Closed lin-z-z closed 5 months ago
2024-01-08 07:53:34,275 [INFO] - Chat 接口 URI: /v1/chat/completions
2024-01-08 07:53:34,275 [INFO] - 绘图接口 URI: /v1/images/generations
chat/completions
打扰了大佬,写错url了,我测试画图接口没问题,但是测试chat接口会出现这个报错, 请求如下: curl http://10.0.8.8:50011/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer fk-***" \ -d '{ "model": "gpt-3.5-turbo", "prompt": "say this is a test", "max_tokens": 7, "temperature": 0 }' 报错日志如下:
2024-01-08 08:36:06,836 [ERROR] - Exception on /v1/chat/completions [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1455, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 869, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 176, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 867, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 852, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/app/main.py", line 1478, in chat_completions
upstream_response = send_text_prompt_and_get_response(messages, api_key, stream, model)
File "/app/main.py", line 529, in send_text_prompt_and_get_response
for message in messages:
TypeError: 'NoneType' object is not iterable
10.0.8.8 - - [08/Jan/2024:08:36:06 +0000] "POST /v1/chat/completions HTTP/1.1" 500 265 "-" "curl/7.29.0"
请求格式有问题,请求体具体格式见openai官方的api说明
请求格式有问题,请求体具体格式见openai官方的api说明
额,我在官网看到的请求格式就是这样的,是因为不同的模型有差别么
/v1/chat/completions
看这个接口的文档
/v1/chat/completions
看这个接口的文档
可以了,谢谢大佬耐心的解答
想问一下。画图是不是需要自己账号支持gpt4
想问一下。画图是不是需要自己账号支持gpt4
是的,确保自己开通了plus
大佬,我的config的配置如下: { "log_level": "DEBUG", "need_log_to_file": "true", "process_workers": 2, "process_threads": 2, "pandora_base_url": "http://10.0.8.8:8181", "pandora_api_prefix": "tokensTool01", "backend_container_url": "http://10.0.8.8:50011", "backend_container_api_prefix": "", "key_for_gpts_info": "fk-", "gpt_4_s_new_name": "gpt-4-s", "gpt_4_mobile_new_name": "gpt-4-mobile,dall-e-3", "gpt_3_5_new_name": "gpt-3.5-turbo", "need_delete_conversation_after_response": "false", "use_oaiusercontent_url": "false", "use_pandora_file_server": "true", "custom_arkose_url": "false", "arkose_urls": "", "dalle_prompt_prefix": "请严格根据我的以下要求完成绘图任务,如果我没有发出指定的绘画指令,则绘制出我发出的文字对应的图片:", "bot_mode": { "enabled": "true", "enabled_markdown_image_output": "true", "enabled_plain_image_url_output": "false", "enabled_bing_reference_output": "false", "enabled_plugin_output": "false" } } 我使用curl命令如下: curl http://10.0.8.8:50011/v1/images/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer fk-" \ -d '{ "model": "gpt-4-s", "prompt": "A cute baby sea otter" }' 我在测试过程中,命令行调用结果如下:
日志如下:
初始启动日志如下:
我想请问下这配置中是否有什么错误么,无论我把model修改为其他的,返回的都是{"message":"Welcome to Inker's World"}