diff --git a/pkg/platform/sources/webchat.yaml b/pkg/platform/sources/webchat.yaml index 0b1d4c29..748dfc8c 100644 --- a/pkg/platform/sources/webchat.yaml +++ b/pkg/platform/sources/webchat.yaml @@ -10,17 +10,7 @@ metadata: zh_Hans: "用于流水线调试的网页聊天适配器" icon: "" spec: - config: - - name: enable-stream-reply - label: - en_US: Enable Stream Reply Mode - zh_Hans: 启用电报流式回复模式 - description: - en_US: If enabled, the bot will use the stream of telegram reply mode - zh_Hans: 如果启用,将使用电报流式方式来回复内容 - type: boolean - required: true - default: false + config: [] execution: python: path: "webchat.py" diff --git a/pkg/provider/entities.py b/pkg/provider/entities.py index ff1e4526..9dcaffcd 100644 --- a/pkg/provider/entities.py +++ b/pkg/provider/entities.py @@ -148,8 +148,6 @@ class MessageChunk(pydantic.BaseModel): tool_call_id: typing.Optional[str] = None - # tool_calls: typing.Optional[list[ToolCallChunk]] = None - is_final: bool = False def readable_str(self) -> str: diff --git a/pkg/provider/modelmgr/requester.py b/pkg/provider/modelmgr/requester.py index d28783b9..6352b6c5 100644 --- a/pkg/provider/modelmgr/requester.py +++ b/pkg/provider/modelmgr/requester.py @@ -98,7 +98,6 @@ class ProviderAPIRequester(metaclass=abc.ABCMeta): """ pass - @abc.abstractmethod async def invoke_llm_stream( self, query: core_entities.Query, diff --git a/pkg/provider/runners/localagent.py b/pkg/provider/runners/localagent.py index 3ff0ce9d..dc8be15f 100644 --- a/pkg/provider/runners/localagent.py +++ b/pkg/provider/runners/localagent.py @@ -116,7 +116,6 @@ class LocalAgentRunner(runner.RequestRunner): query.use_llm_model, req_messages, query.use_funcs, - stream=is_stream, extra_args=query.use_llm_model.model_entity.extra_args, ): assert isinstance(msg, llm_entities.MessageChunk) @@ -178,10 +177,8 @@ class LocalAgentRunner(runner.RequestRunner): query.use_llm_model, req_messages, query.use_funcs, - stream=is_stream, extra_args=query.use_llm_model.model_entity.extra_args, ): - assert isinstance(msg, llm_entities.MessageChunk) yield msg if msg.tool_calls: for tool_call in msg.tool_calls: diff --git a/templates/metadata/pipeline/trigger.yaml b/templates/metadata/pipeline/trigger.yaml index 165e488e..08a2714b 100644 --- a/templates/metadata/pipeline/trigger.yaml +++ b/templates/metadata/pipeline/trigger.yaml @@ -134,8 +134,11 @@ stages: default: true - name: remove_think label: - en_US: remove think - zh_Hans: 删除深度思考消息 + en_US: Remove CoT + zh_Hans: 删除思维链 + description: + en_US: If enabled, LangBot will remove the LLM thought content in response + zh_Hans: 如果启用,将自动删除大模型回复中的模型思考内容 type: boolean required: true default: true diff --git a/web/src/app/home/pipelines/components/debug-dialog/DebugDialog.tsx b/web/src/app/home/pipelines/components/debug-dialog/DebugDialog.tsx index c45a7085..833c98d8 100644 --- a/web/src/app/home/pipelines/components/debug-dialog/DebugDialog.tsx +++ b/web/src/app/home/pipelines/components/debug-dialog/DebugDialog.tsx @@ -190,7 +190,7 @@ export default function DebugDialog({ const botMessage: Message = { id: -1, role: 'assistant', - content: '生成中...', + content: 'Generating...', timestamp: new Date().toISOString(), message_chain: [{ type: 'Plain', text: '' }], }; @@ -216,6 +216,7 @@ export default function DebugDialog({ selectedPipelineId, (data) => { // 处理流式响应数据 + console.log('data', data); if (data.message) { // 更新完整内容 fullContent = data.message.content; @@ -231,8 +232,11 @@ export default function DebugDialog({ typingInterval = setInterval(() => { if (currentPos < targetContent.length) { - displayContent = targetContent.substring(0, currentPos + 1); - currentPos++; + displayContent = targetContent.substring( + 0, + currentPos + 10, + ); + currentPos += 10; // 更新bot消息 setMessages((prevMessages) => { @@ -255,7 +259,7 @@ export default function DebugDialog({ } else { clearInterval(typingInterval); } - }, 30); // 调整这个值可以改变打字速度 + }, 1); // 调整这个值可以改变打字速度 } }, () => {