Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:fix ChatZhipuAI tool call bug #26693

Merged
merged 1 commit into from
Sep 20, 2024
Merged

Conversation

stein1988
Copy link
Contributor

  • PR title: "community:fix ChatZhipuAI tool call bug"

  • Description: ZhipuAI api response as follows:
    {'id': '20240920132549e379a9152a6a4d7c', 'created': 1726809949, 'model': 'glm-4-flash', 'choices': [{'index': 0, 'finish_reason': 'tool_calls', 'delta': {'role': 'assistant', 'tool_calls': [{'id': 'call_20240920132549e379a9152a6a4d7c', 'index': 0, 'type': 'function', 'function': {'name': 'get_datetime_offline', 'arguments': '{}'}}]}}]}
    so, tool_calls = dct.get("tool_call", None) in _convert_delta_to_message_chunk should be "tool_calls"

response as follows:
{'id': '20240920132549e379a9152a6a4d7c', 'created': 1726809949, 'model': 'glm-4-flash', 'choices': [{'index': 0, 'finish_reason': 'tool_calls', 'delta': {'role': 'assistant', 'tool_calls': [{'id': 'call_20240920132549e379a9152a6a4d7c', 'index': 0, 'type': 'function', 'function': {'name': 'get_datetime_offline', 'arguments': '{}'}}]}}]}
Copy link

vercel bot commented Sep 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 6:03am

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. community Related to langchain-community 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Sep 20, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Sep 20, 2024
@ccurme ccurme enabled auto-merge (squash) September 20, 2024 13:04
@ccurme ccurme merged commit 9159492 into langchain-ai:master Sep 20, 2024
30 checks passed
Sheepsta300 pushed a commit to Sheepsta300/langchain that referenced this pull request Oct 1, 2024
- [ ] **PR title**: "community:fix ChatZhipuAI tool call bug"

- [ ] **Description:** ZhipuAI api response as follows:
{'id': '20240920132549e379a9152a6a4d7c', 'created': 1726809949, 'model':
'glm-4-flash', 'choices': [{'index': 0, 'finish_reason': 'tool_calls',
'delta': {'role': 'assistant', 'tool_calls': [{'id':
'call_20240920132549e379a9152a6a4d7c', 'index': 0, 'type': 'function',
'function': {'name': 'get_datetime_offline', 'arguments': '{}'}}]}}]}
so, tool_calls = dct.get("tool_call", None) in
_convert_delta_to_message_chunk should be "tool_calls"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community lgtm PR looks good. Use to confirm that a PR is ready for merging. size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants