Skip to content

Get raw finish reason from provider #5307

Closed
@egoist

Description

@egoist

Feature Description

when using google gemini, ai sdk would treat IMAGE_SAFETY and some other reasons as unknown finish reason in streamText

data: {"candidates": [{"finishReason": "IMAGE_SAFETY","index": 0}],"usageMetadata": {"promptTokenCount": 8,"totalTokenCount": 8,"promptTokensDetails": [{"modality": "TEXT","tokenCount": 8}]},"modelVersion": "gemini-2.0-flash-exp"}

Use Cases

need the underlying finish reason to display warnings to user properly

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions