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 onFinal callback argument when a string is returned from tool call. #961

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

JanMatas
Copy link
Contributor

@JanMatas JanMatas commented Feb 6, 2024

There is an inconsistent behaviour of onFinal callback when different types are returned from experimental_onToolCall.

When experimental_onToolCall callback returns a stream, onFinal gets called with a complete response of the returned stream. However, when experimental_onToolCall returns a string, onFinal callback is called with the tool call instead of the returned string.

This PR makes the behaviour consistent - onFinal is called with the string returned from experimental_onToolCall.

@MaxLeiter MaxLeiter requested a review from lgrammel February 9, 2024 21:36
@lgrammel
Copy link
Collaborator

Looks good. I'll add a test case once it's landed.

@lgrammel lgrammel merged commit 11048cd into vercel:main Feb 20, 2024
8 checks passed
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.

2 participants