feature: 增加 OpenAI 兼容模型适配器#61
Merged
Merged
Conversation
Contributor
raychen911
commented
May 12, 2026
- 新增 openai_adapter 目录,按模型拆分 DeepSeek 与 Hunyuan 的特殊适配逻辑
- 保持 OpenAIModel 主流程兼容,避免将特定模型逻辑继续堆叠在主实现中
- 适配 DeepSeek v4 的 thinking、response_format、reasoning_content 与 token usage 处理
- 为 hy3-preview 增加 ToolPrompt 文本工具调用解析与流式输出过滤
- 修复 ToolPrompt 流式解析多个工具调用时只保留最后一个的问题
- 优化 thinking 示例,仅在 hy3-preview 下启用 add_tools_to_prompt,并区分展示思考、工具调用和最终回复
- 更新示例 prompt,避免模型在工具返回前编造结果或过度展开推理
- 新增 openai_adapter 目录,按模型拆分 DeepSeek 与 Hunyuan 的特殊适配逻辑 - 保持 OpenAIModel 主流程兼容,避免将特定模型逻辑继续堆叠在主实现中 - 适配 DeepSeek v4 的 thinking、response_format、reasoning_content 与 token usage 处理 - 为 hy3-preview 增加 ToolPrompt 文本工具调用解析与流式输出过滤 - 修复 ToolPrompt 流式解析多个工具调用时只保留最后一个的问题 - 优化 thinking 示例,仅在 hy3-preview 下启用 add_tools_to_prompt,并区分展示思考、工具调用和最终回复 - 更新示例 prompt,避免模型在工具返回前编造结果或过度展开推理
af72422 to
516d132
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.