ToolInputSchemaValidator
Namespace: Vercel.AI.Util
public static class ToolInputSchemaValidatorValidates a tool call input against the JSON Schema of a tool. Covers the keywords tool schemas use:
type, enum, const, properties, required, additionalProperties, items,
minItems, maxItems, minLength, maxLength, minimum, maximum,
anyOf, oneOf and allOf. Other keywords are ignored.
Inheritance: object
Methods
Section titled “Methods”Validate(JsonElement, JsonElement)
Section titled “Validate(JsonElement, JsonElement)”public static IReadOnlyList<string> Validate(JsonElement schema, JsonElement value)Returns the validation errors of <code class=“paramref”>value</code>, or an empty list when it is valid.
Parameters
| Name | Type | Description |
|---|---|---|
schema |
JsonElement | |
value |
JsonElement |
Returns: IReadOnlyList<string>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product