UNPKG

@utcp/sdk

Version:

Universal Tool Calling Protocol (UTCP) client library for TypeScript

70 lines (69 loc) 2.19 kB
import { z } from 'zod'; /** * Custom error for when a variable referenced in a provider configuration is not found. */ export declare class UtcpVariableNotFoundError extends Error { variableName: string; constructor(variableName: string); } /** * Represents a source for loading variables, like a .env file. */ export declare const UtcpVariablesConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"dotenv">; env_file_path: z.ZodString; }, "strip", z.ZodTypeAny, { type: "dotenv"; env_file_path: string; }, { type: "dotenv"; env_file_path: string; }>]>; /** * The main configuration schema for the UTCP client. */ export declare const UtcpClientConfigSchema: z.ZodObject<{ /** * A dictionary of variables that can be referenced in provider configurations. */ variables: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>; /** * The file path to a JSON or YAML file containing a list of providers. */ providers_file_path: z.ZodOptional<z.ZodString>; /** * A list of sources from which to load additional variables. */ load_variables_from: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"dotenv">; env_file_path: z.ZodString; }, "strip", z.ZodTypeAny, { type: "dotenv"; env_file_path: string; }, { type: "dotenv"; env_file_path: string; }>]>, "many">>; }, "strip", z.ZodTypeAny, { variables: Record<string, string>; providers_file_path?: string | undefined; load_variables_from?: { type: "dotenv"; env_file_path: string; }[] | undefined; }, { variables?: Record<string, string> | undefined; providers_file_path?: string | undefined; load_variables_from?: { type: "dotenv"; env_file_path: string; }[] | undefined; }>; /** * TypeScript type for the UTCP client configuration. */ export type UtcpClientConfig = z.infer<typeof UtcpClientConfigSchema>; /** * TypeScript type for a variable configuration source. */ export type UtcpVariablesConfig = z.infer<typeof UtcpVariablesConfigSchema>;