import type * as ElevenLabs from "../../../api/index"; export type LiteralKind = "string" | "integer" | "number" | "boolean"; export type SchemaKind = LiteralKind | "object" | "array"; /** @internal The SDK model of any schema the API accepts for a tool param. */ export type SchemaModel = ElevenLabs.LiteralJsonSchemaProperty | ElevenLabs.ObjectJsonSchemaPropertyInput | ElevenLabs.ArrayJsonSchemaPropertyInput; /** @internal */ export interface SchemaState { readonly kind: SchemaKind; /** A loaded literal's `type`, kept as is (the API also allows a list of types). */ readonly literalType?: ElevenLabs.LiteralJsonSchemaPropertyType; readonly description?: string; readonly dynamicVariable?: string; readonly hasConstant: boolean; readonly constantValue?: unknown; readonly systemProvided: boolean; readonly omitted: boolean; readonly optional: boolean; readonly choices?: readonly string[]; readonly allowedFrom?: string; readonly items?: Schema; readonly properties: ReadonlyArray; /** A loaded object's `required`, so its order survives edits. */ readonly loadedRequired?: readonly string[]; readonly anyOf: ReadonlyArray; readonly allOf: ReadonlyArray; /** Loaded fields the builder doesn't model, written back unchanged. */ readonly extra: Readonly>; } /** * A tool param's JSON schema, and where its value comes from. Schemas are values: every method returns a new * schema, so one can be reused across tools and properties. * * @example * Schema.object() * .property("order_id", Schema.string().fromVariable("order_id")) * .property("reason", Schema.string().describe("Why the caller wants a refund").choices(["damaged", "late"])) * .property("note", Schema.string().describe("Anything else the caller said").optional()); */ export declare class Schema { /** @internal */ protected readonly _state: SchemaState; /** @internal */ protected constructor(state: SchemaState); /** A string. */ static string(): LiteralSchema; /** An integer. */ static integer(): LiteralSchema; /** A number. */ static number(): LiteralSchema; /** A boolean. Named `bool` because `boolean` is reserved in Java. */ static bool(): LiteralSchema; /** An object. Add properties with `property()`. */ static object(): ObjectSchema; /** An array whose elements match `items`. */ static array(items: Schema): ArraySchema; /** Loads a schema in API format (snake_case), given as a JSON string or a parsed object. */ static fromJSON(json: string | object): Schema; /** * @internal Loads an SDK model. `optional` is whether its parent leaves it out of `required`. `kind` is given * where the API only allows one kind (e.g. a tool's params object), since an empty schema has no `type`. */ static fromModel(model: SchemaModel, optional?: boolean, kind?: SchemaKind): Schema; /** `"string"`, `"integer"`, `"number"`, `"boolean"`, `"object"` or `"array"`. */ get kind(): SchemaKind; /** Whether the parent leaves this property out of `required`. */ get isOptional(): boolean; /** The LLM provides the value, guided by `text`. On an object or array, documents the container. */ describe(text: string): this; /** The value is read from the dynamic variable `name` when the tool runs. */ fromVariable(name: string): this; /** The value is always `value`, a JSON value matching the schema's type. */ constant(value: unknown): this; /** The param is left out of the request. Only allowed on an optional property. */ omit(): this; /** Leaves this property out of its parent's `required`. Properties are required unless marked optional. */ optional(): this; /** The schema in API format (snake_case keys, sorted). Doesn't validate. */ toJSON(): Record; /** @internal */ get state(): SchemaState; /** @internal The SDK model of this schema. */ toModel(): SchemaModel; /** @internal */ protected _with(changes: Partial): this; } /** A string, integer, number or boolean. */ export declare class LiteralSchema extends Schema { /** @internal */ constructor(state: SchemaState); /** The values the LLM may choose from (`enum`). Strings only. Named `choices` because `enum` is reserved. */ choices(values: string[]): this; /** The value is filled in by the system at runtime. */ systemProvided(): this; /** * Rejects an LLM value that isn't in the list held by the dynamic variable `variable`. The list isn't shown to * the LLM. Needs `describe()`. */ allowedFrom(variable: string): this; } /** An object with named properties. */ export declare class ObjectSchema extends Schema { /** @internal */ constructor(state: SchemaState); /** Adds the property `name`, or replaces it in place if it exists. */ property(name: string, schema: Schema): this; /** Removes the property `name`. */ without(name: string): this; /** Requires at least one of these sets of properties: appends `names` to `required_constraints.any_of`. */ requireAnyOf(names: string[]): this; /** Requires all of these sets of properties: appends `names` to `required_constraints.all_of`. */ requireAllOf(names: string[]): this; /** Property names, in order. */ get propertyNames(): string[]; /** The schema of property `name`, if there is one. */ propertySchema(name: string): Schema | undefined; } /** A list whose elements match one schema. */ export declare class ArraySchema extends Schema { /** @internal */ constructor(state: SchemaState); /** The element schema. */ get items(): Schema | undefined; }