Closed dazhizun closed 12 months ago
已搞定
请问你找到问题在哪儿了吗?我也遇到了类似的问题,使用第三方接口时返回结果有概率为空
流格式问题,去找个流格式模板套一下
---原始邮件--- 发件人: @.> 发送时间: 2024年6月6日(周四) 下午2:18 收件人: @.>; 抄送: @.>;"State @.>; 主题: Re: [songquanpeng/one-api] 我自己写的第三方接口,使用的是标准的openai接收和返回结构,在oneapi中测试没有问题,但在与fastgpt通讯中一直返回为空,不知道我写的json格式是否有问题还其他什么原因 (Issue #621)
请问你找到问题在哪儿了吗?我也遇到了类似的问题,使用第三方接口时返回结果有概率为空
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>
例行检查
问题描述 我自己写的第三方接口,使用的是标准的openai接收和返回结构,在oneapi中测试没有问题,但在与fastgpt通讯中一直返回为空,不知道我写的json格式是否有问题还其他什么原因
接收结构用的是: curl https://api.openai.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -d '{ "model": "gpt-3.5-turbo", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello!" } ] }'
返回结构用的是: { "id": "chatcmpl-123", "object": "chat.completion", "created": 1677652288, "model": "gpt-3.5-turbo-0613", "choices": [{ "index": 0, "message": { "role": "assistant", "content": "\n\nHello there, how may I assist you today?", }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 9, "completion_tokens": 12, "total_tokens": 21 } }
预期结果 fastgpt有返回结果
相关截图 这是我自己写的接口POST测试图
这是POST自己搭建的ONEAPI渠道测试图
这是渠道测试成功截图
这是fastgpt返回消息为空截图
经测试其他的接口没有问题,但是我写的也是按照标准的openai接口写出来的