Replies: 2 comments 8 replies
-
|
还有 GLM-Zero-Preview |
Beta Was this translation helpful? Give feedback.
-
|
以DeepSeek R1为例,推理模型会带来更多参数的启用和禁用,比如temperature、top_p、presence_penalty、frequency_penalty、logprobs、top_logprobs参数无效(似乎其他推理模型对temperature的敏感性和一般模型也有差异),同时新增控思维链的长度的参数(reasoning_effort)。o1也有类似需求(参考 #5063 #5407) 鉴于以思考过程、联网搜索为代表的模型特殊能力(特性)发展,建议在实现思考过程展示时同时实现对模型(特殊)参数用户友好型配置(以及顺路把配置绑定到模型,增强灵活性)的支持。 更进一步的,由于不同提供商的模型以及同一提供商的不同类型模型(推理/非推理)模型对temperature等参数的敏感性不同(比如OpenAI的模型temperature虽然支持到0-2,但一般超过1就容易胡言乱语;deepseek官方temperature指引通用对话1.3,创意性任务1.5),建议将temperature绑定到模型。 当然这会导致助手默认设置和绑定到模型的参数冲突,所以建议参考 #2726 提供以temperature为基础参数的输出风格模式设置,将助手设置和不同风格下适合不同模型的temperature等参数统一起来。在助手设置侧,只需要设置该助手适合的输出风格,在模型的风格设置中绑定个性化temperature等配置。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
背景
OpenAI O1、DeepSeek R1、Gemini Thinking 模型都开始内置 CoT,本 RFC 将研究如何将思考过程做用户体验友好的展示
设计思路
在之前的实现中,我们通过 model runtime 定义了一套自行封装的请求规范,因此针对
reason_content的流式解析的处理会比较简单,通过 chunk 解析,将有 reasoning_content 的 chunk 解析成{type:'reasoning', data: reasoning_content }的格式即可。示例的测试用例:
lobe-chat/src/libs/agent-runtime/utils/streams/openai.test.ts
Lines 725 to 754 in bf2d848
然后对应在 fetchSSE 层对应加一个 smoothing 处理逻辑,往外抛: https://github.com/lobehub/lobe-chat/pull/5558/files#diff-9b2bf237e44d83c03957c853eb46aa4b0124858d612b6b3a21bc52a67c4f6934
最后在 chat store 层接住这个 type 的 chunk ,并且存到 reasoning json 字段中。
效果:
目前支持 Reasoning 的模型有:
<think>标签中,虽然可以解决但是不如 DeepSeek 优雅Beta Was this translation helpful? Give feedback.
All reactions