880 B
880 B
python环境
本项目的python环境是基于 poetry创建的,如果需要运行 py文件,需要执行poetry run python xxx.py 来执行。 启动脚本:
poetry run uvicorn fastapi_app:app --host 0.0.0.0 --port 8001
测试脚本:
curl --request POST \
--url http://localhost:8001/api/v2/chat/completions \
--header 'authorization: Bearer a21c99620a8ef61d69563afe05ccce89' \
--header 'content-type: application/json' \
--header 'X-Request-ID: 123123123' \
--data '{
"messages": [
{
"role": "user",
"content": "咖啡多少钱一杯"
}
],
"stream": true,
"model": "whatever",
"language": "ja",
"bot_id": "63069654-7750-409d-9a58-a0960d899a20",
"tool_response": true,
"session_id":"xxxxx",
"user_identifier": "及川"
}'
环境变量
环境变量的代码都需要放到 utils/settings.py里管理