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

googleai: incorrect FinishReason when using StreamingFunc #728

Closed
suzmue opened this issue Mar 28, 2024 · 1 comment · Fixed by #734
Closed

googleai: incorrect FinishReason when using StreamingFunc #728

suzmue opened this issue Mar 28, 2024 · 1 comment · Fixed by #734

Comments

@suzmue
Copy link

suzmue commented Mar 28, 2024

When using streaming API, the FinishReason in the response is not correctly set when the reason should be FinishReasonMaxTokens.

This happens because on the last response, the content is empty, which leads it to return early without recording the FinishReason.

if respCandidate.Content == nil {

@tmc
Copy link
Owner

tmc commented Mar 31, 2024

Thanks for the bug report, this should be straightforward to implement.

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 a pull request may close this issue.

2 participants