Skip to content

V4Json

Namespace: Vercel.AI.Gateway

public static class V4Json

Serializes call options and parses results in the Language Model V4 JSON shape the Gateway expects.

Inheritance: object

View source

public static string CallOptions(LanguageModelCallOptions options)

Serializes <code class=“paramref”>options</code> as a V4 call body.

Parameters

Name Type Description
options LanguageModelCallOptions

Returns: string

View source

public static LanguageModelGenerateResult ParseGenerate(JsonElement root)

Parses a V4 generate result.

Parameters

Name Type Description
root JsonElement

Returns: LanguageModelGenerateResult

View source

public static LanguageModelStreamPart? ParseStreamPart(string json)

Parses one SSE JSON object into a stream part.

Parameters

Name Type Description
json string

Returns: LanguageModelStreamPart

View source

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