Skip to content

GoogleParseContext

Namespace: Vercel.AI.Google

public sealed class GoogleParseContext

Ids and metadata keys used while parsing a Gemini response.

Inheritance: object

View source

GoogleParseContext(string?, Func<string>?, GoogleToolPreparation?, IReadOnlyList<GoogleWarning>?, string?)

Section titled “GoogleParseContext(string?, Func<string>?, GoogleToolPreparation?, IReadOnlyList<GoogleWarning>?, string?)”
public GoogleParseContext(string? provider = null, Func<string>? generateId = null, GoogleToolPreparation? tools = null, IReadOnlyList<GoogleWarning>? warnings = null, string? jsonResponseToolName = null)

Creates a parse context.

Parameters

Name Type Description
provider string
generateId Func<string>
tools GoogleToolPreparation
warnings IReadOnlyList<GoogleWarning>
jsonResponseToolName string

View source

public Func<string> GenerateId { get; set; }

Id factory. The default uses an increasing counter.

Value: Func<string>

View source

public string? JsonResponseToolName { get; }

Name of the internal tool that carries structured output. Its calls become text and ordinary text is omitted.

Value: string

View source

public IReadOnlyList<string> MetadataNames { get; }

Metadata namespaces written onto the result.

Value: IReadOnlyList<string>

View source

public GoogleToolPreparation Tools { get; }

Tool name mapping.

Value: GoogleToolPreparation

View source

public IReadOnlyList<GoogleWarning> Warnings { get; }

Warnings copied onto the result.

Value: IReadOnlyList<GoogleWarning>

View source

public string NextId()

Returns the next synthetic id.

Returns: string

View source

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