mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-07 14:26:03 +00:00
perf: minor fixes
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -98,7 +98,6 @@ class ProviderAPIRequester(metaclass=abc.ABCMeta):
|
||||
"""
|
||||
pass
|
||||
|
||||
@abc.abstractmethod
|
||||
async def invoke_llm_stream(
|
||||
self,
|
||||
query: core_entities.Query,
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user