-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api接收的数据与chat2db发送的不一致 #7
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
chat2db发送的格式为:
,{"messages":[{"role":"user","content":"### Please follow the below table properties and SQL inputConvert natural language into SQL queries. \n#\n### MYSQL SQL tables, with their properties:\n#\n# ["CREATE TABLE
user
) ENGINE=InnoDB AUTO_INCREMENT=11075 DEFAULT CHARSET=utf8"]\n#\n#\n### SQL input: username"}],"stream":true,"model":"sqlcoder-7b"}而项目的解析
json_post_raw = await request.json()
print(json_post_raw)
json_post = json.dumps(json_post_raw)
json_post_list = json.loads(json_post)
question = json_post_list.get('prompt')
prompt = prompt_template.format(
user_question=question.replace("#","")
)
取prompt怎么能取到?
报错如下:
File "/root/miniconda3/envs/chat2dbsqlcoder/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
return await dependant.call(**values)
File "/home/tiancom/chat2db-sqlcoder-deploy/api.py", line 33, in create_item
user_question=question.replace("#","")
The text was updated successfully, but these errors were encountered: