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

Gemini的流式返回存在问题 #1408

Open
5 tasks done
manjieqi opened this issue May 4, 2024 · 2 comments
Open
5 tasks done

Gemini的流式返回存在问题 #1408

manjieqi opened this issue May 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@manjieqi
Copy link
Contributor

manjieqi commented May 4, 2024

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,尤其是常见问题部分
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述
Gemini仅返回几个字,因为它们把"finish_reason":"stop"作为回答停止的信号
如果openai的返回格式是标准的,那Gemini的流式还需要改一下

Gemini的回答,可以看见每一个部分都有stop
Snipaste_2024-05-04_13-13-19

GPT的回答,仅最后的一个部分有stop
Snipaste_2024-05-04_13-14-14

@manjieqi manjieqi added the bug Something isn't working label May 4, 2024
@RexWzh
Copy link

RexWzh commented May 14, 2024

+1 似乎是最新版引入的问题,我之前使用是正常的

data: {"id":"","object":"chat.completion.chunk","created":0,"model":"gemini","choices":[{"index":0,"delta":{"content":"我是 Gemini,一个由 Google 开发的多模态 AI 模型。作为一个大型语言"},"finish_reason":"stop"}]}

data: {"id":"","object":"chat.completion.chunk","created":0,"model":"gemini","choices":[{"index":0,"delta":{"content":"模型,我接受了大量文本数据的训练,能够理解和生成人类语言、回答问题并提供信息。我不断学习和完善,致力于提供全面"},"finish_reason":"stop"}]}

data: {"id":"","object":"chat.completion.chunk","created":0,"model":"gemini","choices":[{"index":0,"delta":{"content":"且有帮助的响应。"},"finish_reason":"stop"}]}

data: [DONE]

@SLF-Heisenberg
Copy link

我也遇到了 同样的问题 每一次的 调用结果 都是 "finish_reason": "stop" 但是 只有 最后一个包分发完毕的 才是 "stop"
image

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

3 participants