TypeSafeClient
HTTP client for TypeSafe System One and model discovery.
Constructors
Layers
Provides a client from explicit options.
Signature
declare function layer(options: Options): Layer<TypeSafeClient, never, HttpClient>layerConfig
Added in v4.0.0
Source
Provides a client from configuration, defaulting to TYPESAFE_API_KEY.
Signature
declare function layerConfig(options?: { readonly apiKey?: Config<Redacted<string> | undefined>; readonly apiUrl?: Config<string>; readonly transformClient?: (client: HttpClient) => HttpClient;}): Layer<TypeSafeClient, ConfigError, HttpClient>Options
Services
Low-level TypeSafe operations.
Signature
interface Service { readonly client: HttpClient; readonly listModels: () => Effect<{ readonly models: readonly Array<{ readonly description?: string; readonly name: string; readonly release_date?: string; }>; }, AiError>; readonly systemOne: (request: { readonly model: string; readonly questions: { [key: string]: { readonly criteria: { [key: string]: string; }; readonly instructions: string; readonly type: "choice"; } | { readonly criteria: readonly Array<string>; readonly instructions: string; readonly type: "score"; } | { readonly criteria?: { readonly false: string; readonly true: string; }; readonly instructions: string; readonly type: "noul"; }; }; readonly state: Json; }) => Effect<{ readonly answers: { [key: string]: { readonly choice: string; readonly confidence: number; readonly probabilities: { [key: string]: number; }; readonly type: "choice"; } | { readonly confidence: number; readonly legend?: { [key: string]: string; }; readonly probabilities: { [key: string]: number; }; readonly score: number; readonly type: "score"; } | { readonly noul: number; readonly type: "noul"; }; }; readonly model: string; readonly usage?: { readonly input_tokens?: number; readonly output_tokens?: number; }; }, AiError>;}TypeSafeClient
Added in v4.0.0
Source
TypeSafe client service.
Signature
declare class TypeSafeClient extends Shape<"@effect/ai-typesafe/TypeSafeClient", Service, this> { constructor(_: never);}