Skip to content

googleai: incorrect FinishReason when using StreamingFunc #728

@suzmue

Description

@suzmue

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 {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions