Skip to content

OperationJson

Namespace: Vercel.AI.Operations

public static class OperationJson

JSON helpers used while normalizing provider options.

Inheritance: object

View source

public static JsonElement? Get(JsonElement? element, string name)

Reads a property or returns null.

Parameters

Name Type Description
element JsonElement?
name string

Returns: JsonElement?

View source

public static JsonElement Parse(string json)

Parses a JSON string.

Parameters

Name Type Description
json string

Returns: JsonElement

View source

public static JsonElement Serialize<T>(T value)

Serializes a value.

Type parameters

Name Description
T

Parameters

Name Type Description
value T

Returns: JsonElement

View source

public static int Utf8Length(string value)

UTF-8 size of a string.

Parameters

Name Type Description
value string

Returns: int

View source

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