Skip to content
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

The first packet returned by streaming from the OpenAPI chat interface is inconsistent with the openai standard. #670

Closed
6 of 7 tasks
zhiluan233 opened this issue Dec 28, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@zhiluan233
Copy link

例行检查

  • 我已确认目前没有类似 issue
  • 我已完整查看过项目 README,以及项目文档
  • 我使用了自己的 key,并确认我的 key 是可正常使用的
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

你的版本

  • 公有云版本
  • 私有部署版本

问题描述

我使用FastGPT的OpenAPI聊天接口时,发现返回流的首包json结果delta内不包含role: "assistant",这直接导致飞书智能伙伴自定义模型的上下文无法使用。

复现步骤

正常用stream=true请求Chat/Completions接口

预期结果

流式传输的首包应当与OpenAI标准的接口一样,包含role: "assistant"

相关截图
问题请求:
image
OpenAI的流式返回结果首包存在role: "assistant"
image
希望修复~

@zhiluan233 zhiluan233 added the bug Something isn't working label Dec 28, 2023
@c121914yu c121914yu changed the title OpenAPI聊天接口流式返回的首包与openai的标准不一致。 The first packet returned by streaming from the OpenAPI chat interface is inconsistent with the openai standard. Dec 28, 2023
@c121914yu
Copy link
Collaborator

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Routine inspection

  • I have confirmed that there is no similar issue currently
  • I have fully reviewed the project README, as well as project documentation
  • I used my own key and confirmed that my key can be used normally
  • I understand and am willing to follow up on this issue, assist in testing and provide feedback
  • I understand and acknowledge the above content, and understand that project maintainers have limited energy. Issues that do not follow the rules may be ignored or closed directly

your version

  • Public cloud version
  • Private deployment version

Problem Description

When I used the OpenAPI chat interface of FastGPT, I found that the delta of the first json result of the return stream did not contain role: "assistant", which directly caused the context of Feishu Smart Partner's custom model to be unusable.

Steps to reproduce

Normally use stream=true to request the Chat/Completions interface

expected outcome

The first packet of streaming should be the same as the OpenAI standard interface, including role: "assistant"

Related screenshots
Question request:
image
The first packet of OpenAI's streaming return result contains role: "assistant"
image
Hope to fix~

@c121914yu c121914yu mentioned this issue Jan 1, 2024
@c121914yu
Copy link
Collaborator

#676 fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants