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(adapters/openai): safely parse non-string tool return value for Function calling #50

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

charlypoly
Copy link
Contributor

@charlypoly charlypoly commented Jan 16, 2025

A tool returning a non-string value triggers an error in the OpenAI API because "content" (of the `"type": "tool") is an array.

--
Fixes the https://github.com/inngest/agentkit-render-tutorial demo

@charlypoly charlypoly self-assigned this Jan 16, 2025
Copy link

changeset-bot bot commented Jan 16, 2025

🦋 Changeset detected

Latest commit: 7036865

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@inngest/agent-kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@charlypoly charlypoly changed the title fix(adapters/openai): safely parse non-strong tool return value for Function calling fix(adapters/openai): safely parse non-string tool return value for Function calling Jan 16, 2025
@charlypoly charlypoly merged commit d40a5c3 into main Jan 16, 2025
3 checks passed
@charlypoly charlypoly deleted the fix/openai-function-calling-request-parser branch January 16, 2025 17:00
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.

3 participants