Skip to content

Commit

Permalink
fix: zhipu tool calling, this PR fixes the bug described in issue #5496
Browse files Browse the repository at this point in the history
… (#5469)

Co-authored-by: vccler <[email protected]>
Co-authored-by: -LAN- <[email protected]>
  • Loading branch information
3 people authored and XiaoLey committed Jun 22, 2024
1 parent 5c2b4d4 commit 3c4075b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/core/model_runtime/model_providers/zhipuai/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
PromptMessageRole,
PromptMessageTool,
SystemPromptMessage,
ToolPromptMessage,
UserPromptMessage,
)
from core.model_runtime.errors.validate import CredentialsValidateFailedError
Expand Down Expand Up @@ -463,6 +464,8 @@ def _convert_one_message_to_text(self, message: PromptMessage) -> str:
message_text = f"{ai_prompt} {content}"
elif isinstance(message, SystemPromptMessage):
message_text = content
elif isinstance(message, ToolPromptMessage):
message_text = content
else:
raise ValueError(f"Got unknown type {message}")

Expand Down

0 comments on commit 3c4075b

Please sign in to comment.