OperationJson
Namespace: Vercel.AI.Operations
public static class OperationJsonJSON helpers used while normalizing provider options.
Inheritance: object
Methods
Section titled “Methods”Get(JsonElement?, string)
Section titled “Get(JsonElement?, string)”public static JsonElement? Get(JsonElement? element, string name)Reads a property or returns null.
Parameters
| Name | Type | Description |
|---|---|---|
element |
JsonElement? | |
name |
string |
Returns: JsonElement?
Parse(string)
Section titled “Parse(string)”public static JsonElement Parse(string json)Parses a JSON string.
Parameters
| Name | Type | Description |
|---|---|---|
json |
string |
Returns: JsonElement
Serialize<T>(T)
Section titled “Serialize<T>(T)”public static JsonElement Serialize<T>(T value)Serializes a value.
Type parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
value |
T |
Returns: JsonElement
Utf8Length(string)
Section titled “Utf8Length(string)”public static int Utf8Length(string value)UTF-8 size of a string.
Parameters
| Name | Type | Description |
|---|---|---|
value |
string |
Returns: int
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product