There are two methods for installing the required packages:
append the following packages to the requirements.txt
:
uvicorn~=0.23.2
fastapi~=0.99.1
pydantic~=1.10.12
setuptools~=68.0.0
Then, run:
pip install -r requirements.txt
Execute the following command:
pip install "fastapi[all]"
To run the API, execute:
python run_api.py
To test if your API setup is working correctly, use the following curl request:
curl --location 'http://127.0.0.1:8000/chat' \
--header 'Content-Type: application/json' \
--data '{
"human_say": "my pain always pain, so I cannot sleep well",
"conversation_history": [
"Ted Lasso: Hey, good morning! How are you? <END_OF_TURN>",
"User: hi, how are you? why calling? <END_OF_TURN>",
"Ted Lasso: Hi there! I'\''m Ted Lasso from Sleep Haven. I'\''m calling to see if you'\''re looking to achieve better sleep by purchasing a premium mattress. How have you been sleeping lately? <END_OF_TURN>"
]
}'
If everything is set up correctly, you should receive an appropriate response from your API.