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 function example code #538

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akimthedream
Copy link

@akimthedream akimthedream commented Oct 17, 2024

I used the example code for function calling in one of my projects yesterday. It worked fine as long as there was only one item in message["tool_calls"], but when multiple items were returned, the client responded with a 400 error for the second_response. After reviewing the official function calling documentation, I found that the message containing tool_calls is expected to appear only once, not for each item individually. This small change resolves the issue.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant