NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

[Feature Request] Support streamWithThink for other models

Open RYQ-22 opened this issue 10 months ago • 14 comments

🥰 Feature Description

Currently, only the deepseek-reasoner model supports streamWithThink. However, when we use a third-party DeepSeek API through the OpenAI interface, streamWithThink is disabled.

Image

Image

🧐 Proposed Solution

I have a naive idea but I'm not sure if it‘ll work: detect <think> in stream for all models and turn on "think" mode automatically.

📝 Additional Information

No response

RYQ-22 avatar Feb 02 '25 18:02 RYQ-22

Image 能否也支持一下谷歌模型的思考过程?谢谢!

ninirobot avatar Feb 03 '25 07:02 ninirobot

Bot detected the issue body's language is not English, translate it automatically.


! [Image] (https://github.com/user-attachments/aSSETS/E037AB30-5F53-410d-b74b-a537ca019612)) Can you also support the thinking process of Google model? Thanks!

Issues-translate-bot avatar Feb 03 '25 07:02 Issues-translate-bot

related: https://github.com/ChatGPTNextWeb/NextChat/pull/6141

jackalcooper avatar Feb 04 '25 09:02 jackalcooper

Bot detected the issue body's language is not English, translate it automatically.


related: https://github.com/ChatGPTNextWeb/NextChat/pull/6141

Issues-translate-bot avatar Feb 04 '25 09:02 Issues-translate-bot

在 https://github.com/ChatGPTNextWeb/NextChat/pull/6186 修复了格式

jackalcooper avatar Feb 08 '25 09:02 jackalcooper

Bot detected the issue body's language is not English, translate it automatically.


Fixed format at https://github.com/ChatGPTNextWeb/NextChat/pull/6186

Issues-translate-bot avatar Feb 08 '25 09:02 Issues-translate-bot

#6186 修复了格式

可以做成一个通用的方案吗?现在看起来只对SiliconFlow生效。

xzcxzcyy avatar Feb 08 '25 17:02 xzcxzcyy

Bot detected the issue body's language is not English, translate it automatically.


Fixed format in #6186

Can it be made into a general solution? Now it looks like it only works for SiliconFlow.

Issues-translate-bot avatar Feb 08 '25 17:02 Issues-translate-bot

#6186 修复了格式

可以做成一个通用的方案吗?现在看起来只对SiliconFlow生效。

因为只有openai原版api带有的的规范变成通用的自定义endpoint才比较合适,现在这个field是deepseek 特有的,所以不太好一口气全改(比如有些模型输出有可能是<think>)。现在的代码本身是通用的,每个模型实现自己的parseSSE函数。

jackalcooper avatar Feb 08 '25 21:02 jackalcooper

Bot detected the issue body's language is not English, translate it automatically.


Fixed format in #6186

Can it be made into a general solution? Now it looks like it only works for SiliconFlow.

Because it is more appropriate to only the specifications included in the original openai API become general custom endpoints, this field is now unique to deepseek, so it is not easy to modify them all in one go (for example, some model output may be ). The code now is general in itself, and each model implements its own parseSSE function.

Issues-translate-bot avatar Feb 08 '25 21:02 Issues-translate-bot

#6186 修复了格式

可以做成一个通用的方案吗?现在看起来只对SiliconFlow生效。

因为只有openai原版api带有的的规范变成通用的自定义endpoint才比较合适,现在这个field是deepseek 特有的,所以不太好一口气全改(比如有些模型输出有可能是<think>)。现在的代码本身是通用的,每个模型实现自己的parseSSE函数。

ENABLE_MCP这个环境变量的实现会统一这部分推理输出嘛?后续是否有计划会实现?

Crpto999 avatar Mar 16 '25 15:03 Crpto999

Bot detected the issue body's language is not English, translate it automatically.


Fixed format in #6186

Can it be made into a general solution? Now it looks like it only works for SiliconFlow.

Because it is more appropriate to only if the specifications included in the original openai API become general custom endpoints, this field is now unique to deepseek, so it is not easy to modify them all in one go (for example, some model output may be <think>). The code now is general in itself, and each model implements its own parseSSE function.

Will the implementation of the environment variable ENABLE_MCP unify this part of the inference output? Are there any plans to come true?

Issues-translate-bot avatar Mar 16 '25 15:03 Issues-translate-bot

#6186 修复了格式

可以做成一个通用的方案吗?现在看起来只对SiliconFlow生效。

因为只有openai原版api带有的的规范变成通用的自定义endpoint才比较合适,现在这个field是deepseek 特有的,所以不太好一口气全改(比如有些模型输出有可能是<think>)。现在的代码本身是通用的,每个模型实现自己的parseSSE函数。

ENABLE_MCP这个环境变量的实现会统一这部分推理输出嘛?后续是否有计划会实现?

我现在在我的fork实现成渲染两个markdown,生成引用还是太麻烦了

jackalcooper avatar Mar 16 '25 18:03 jackalcooper

Bot detected the issue body's language is not English, translate it automatically.


Fixed format in #6186

Can it be made into a general solution? Now it looks like it only works for SiliconFlow.

Because it is more appropriate to only become a general custom endpoint for the specifications included in the openai original API, this field is unique to deepseek, so it is not easy to modify it in one go (for example, some model output may be <think>). The code now is general in itself, and each model implements its own parseSSE function.

Will the implementation of the environment variable ENABLE_MCP unify this part of the inference output? Are there any plans to come true?

I'm now implementing two markdowns in my fork, generating references is still too troublesome

Issues-translate-bot avatar Mar 16 '25 18:03 Issues-translate-bot