export type DecisionJSON = null | boolean | number | string | DecisionJSON[] | { [key: string]: DecisionJSON; }; export type DecisionDescription = string | DecisionJSON[] | { [key: string]: DecisionJSON; }; export type DecisionQuestion = { type: "choice"; instructions: DecisionDescription; criteria: Record; } | { type: "score"; instructions: DecisionDescription; criteria: DecisionDescription[]; } | { type: "boolean" | "bool" | "noul" | "predicate"; instructions: DecisionDescription; criteria?: { true?: DecisionDescription; false?: DecisionDescription; }; } /** TypeSafe only (Jev 1.14): one bounding box around what the instructions name, in an image of the request. */ | { type: "box"; instructions: DecisionDescription; }; export type DecisionAPI = "system-one" | "cloudflare" | "openai-decisions" | "vercel-evaluate" | "llama-cpp" | "llama-system-one" | "anthropic" | "google"; export interface DecisionTarget { provider: string; api?: DecisionAPI; model?: string; endpoint?: string; allowLocal?: boolean; allowGenerated?: boolean; providerOptions?: Record; temperature?: number; } export interface DecisionProfiles { version: 1; defaultProfile?: string; profiles: Record; } export interface DecisionRequest extends Partial { profile?: string; state: DecisionDescription; questions: Record; /** `ref` places the image for TypeSafe (which requires it): wherever that text appears in the state, instructions or criteria. */ images?: { type?: "image"; data: string; mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif"; ref?: string; }[]; } export type DecisionImageSupport = "supported" | "unsupported" | "model-dependent"; export interface DecisionProvider { provider: string; api: DecisionAPI | ""; defaultModel: string; endpoint: string; credentialEnv: string; imageSupport: DecisionImageSupport; generated: boolean; } export interface DecisionResolution { target: DecisionTarget & { api: DecisionAPI; model: string; endpoint: string; allowLocal: boolean; allowGenerated: boolean; }; credential: { env: string; resolved: false; }; imageSupport: DecisionImageSupport; generated: boolean; profile?: string; } export type DecisionAnswer = { type: "boolean"; probability: number; } | { type: "choice"; choice: string; probabilities?: Record; confidence?: number; } | { type: "score"; score: number; probabilities?: Record; confidence?: number; legend?: Record; } | { type: "box"; box: { top: number; bottom: number; left: number; right: number; }; confidence?: number; } | { type: "refusal"; [field: string]: unknown; }; export interface DecisionResult { status: "ok" | "error"; provider: string; api: DecisionAPI; model: string; answers: Record; usage: { input_tokens: number | null; output_tokens: number | null; }; provenance?: { kind: "native" | "generated" | "token-logprobs"; [field: string]: unknown; }; raw?: DecisionJSON; rawJson?: string; rawText?: string; rawComplete?: boolean; httpStatus?: number; error?: { code: number; message: string; } | null; budget: { exhausted: boolean; reason: string; }; } export interface DecisionModel { /** Pi registry handle; not a native preset or a verified live model. */ model: { provider: string; id: string; }; name: string; api: string; target?: DecisionTarget; supported: boolean; imageSupport: DecisionImageSupport; generated: boolean; logits: boolean; credentials: { configured: boolean; verified: false; }; } //# sourceMappingURL=decision-types.d.ts.map