Skip to content

GoogleFinishReason

Namespace: Vercel.AI.Google

public static class GoogleFinishReason

Maps Gemini finish reasons onto the shared finish-reason enum.

Inheritance: object

View source

public static bool IsConfirmedPromptBlock(string? blockReason)

A prompt block is terminal when the reason is present and is not an unspecified placeholder.

Parameters

Name Type Description
blockReason string

Returns: bool

View source

public static FinishReason Map(string? finishReason, bool hasToolCalls)

Maps <code class=“paramref”>finishReason</code>. STOP becomes ToolCalls when the response contains a client tool call.

Parameters

Name Type Description
finishReason string
hasToolCalls bool

Returns: FinishReason

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product