mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
perf: 控制台输出请求响应过程
This commit is contained in:
@@ -31,3 +31,13 @@ class Message(pydantic.BaseModel):
|
||||
tool_calls: typing.Optional[list[ToolCall]] = None
|
||||
|
||||
tool_call_id: typing.Optional[str] = None
|
||||
|
||||
def readable_str(self) -> str:
|
||||
if self.content is not None:
|
||||
return self.content
|
||||
elif self.function_call is not None:
|
||||
return f'{self.function_call.name}({self.function_call.arguments})'
|
||||
elif self.tool_calls is not None:
|
||||
return f'调用工具: {self.tool_calls[0].id}'
|
||||
else:
|
||||
return '未知消息'
|
||||
|
||||
Reference in New Issue
Block a user