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

🐛 fix: Support Aliyun deepseek-r1/v3 stream #5751

Closed
wants to merge 4 commits into from

Conversation

sxjeru
Copy link
Contributor

@sxjeru sxjeru commented Feb 5, 2025

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

https://help.aliyun.com/zh/model-studio/developer-reference/deepseek

流输出举例:

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助解决问题。你可以问我"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助解决问题。你可以问我关于科学、技术"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助解决问题。你可以问我关于科学、技术、历史、文化"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助解决问题。你可以问我关于科学、技术、历史、文化、语言等广泛"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助解决问题。你可以问我关于科学、技术、历史、文化、语言等广泛领域的问题,或者"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助解决问题。你可以问我关于科学、技术、历史、文化、语言等广泛领域的问题,或者需要帮助完成某项"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助解决问题。你可以问我关于科学、技术、历史、文化、语言等广泛领域的问题,或者需要帮助完成某项任务。请问有什么"}}]}

data: {"choices":[{"finish_reason":"null","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助解决问题。你可以问我关于科学、技术、历史、文化、语言等广泛领域的问题,或者需要帮助完成某项任务。请问有什么我可以帮你的吗"}}]}

data: {"choices":[{"finish_reason":"stop","message":{"role":"assistant","content":"我是一个人工智能助手,由OpenAI开发。我的设计目的是帮助回答各种问题、提供信息和协助解决问题。你可以问我关于科学、技术、历史、文化、语言等广泛领域的问题,或者需要帮助完成某项任务。请问有什么我可以帮你的吗?"}}]}

📝 补充信息 | Additional Information

Copy link

vercel bot commented Feb 5, 2025

@sxjeru is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @sxjeru

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 96.63866% with 4 lines in your changes missing coverage. Please review.

Project coverage is 92.12%. Comparing base (3499403) to head (71fcc85).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/libs/agent-runtime/utils/streams/qwen.ts 77.77% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #5751     +/-   ##
=========================================
  Coverage   92.11%   92.12%             
=========================================
  Files         648      648             
  Lines       58199    58316    +117     
  Branches     2913     4276   +1363     
=========================================
+ Hits        53612    53725    +113     
- Misses       4587     4591      +4     
Flag Coverage Δ
app 92.12% <96.63%> (+<0.01%) ⬆️
server 98.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sxjeru
Copy link
Contributor Author

sxjeru commented Feb 5, 2025

异常流输出已被 阿里云 统一处理,该 pr 已作废。

@sxjeru sxjeru closed this Feb 5, 2025
@sxjeru sxjeru deleted the patch-3 branch February 5, 2025 13:00
@lobehubbot
Copy link
Member

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


The exception stream output has been processed by Alibaba Cloud, and the pr has been invalidated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants