/** * Transport-agnostic interface for LLM providers. * * Ported from PSYCHE src/llm/backend.py. Credentials are baked into the * underlying SDK client at backend construction time (see registry.ts), * so these method signatures deliberately do not accept api_key / api_base. * * @task T1388 (T1386-W2) * @epic T1386 */ import type { z } from 'zod'; /** Normalized tool call from any provider. */ export interface ToolCallResult { id: string; name: string; input: Record; thoughtSignature?: string | null; } /** Normalized completion result returned by provider backends. */ export interface CompletionResult { content: unknown; inputTokens: number; outputTokens: number; cacheCreationInputTokens: number; cacheReadInputTokens: number; finishReason: string; toolCalls: ToolCallResult[]; thinkingContent: string | null; thinkingBlocks: Array>; reasoningDetails: Array>; rawResponse?: unknown; } /** A single chunk in a streaming response from a backend. */ export interface StreamChunk { content: string; isDone: boolean; finishReason?: string | null; outputTokens?: number | null; } /** Factory function for creating a default CompletionResult. */ export declare function makeCompletionResult(partial: Partial & Pick): CompletionResult; /** Common parameters for complete() and stream() calls. */ export interface BackendCallParams { model: string; messages: Array>; maxTokens: number; temperature?: number | null; stop?: string[] | null; tools?: Array> | null; toolChoice?: string | Record | null; responseFormat?: (new (...args: unknown[]) => unknown) | Record | null; thinkingBudgetTokens?: number | null; thinkingEffort?: string | null; maxOutputTokens?: number | null; extraParams?: Record | null; } /** * Transport-agnostic interface for LLM providers. * * Implementations: AnthropicBackend, OpenAIBackend, GeminiBackend. */ export interface ProviderBackend { complete(params: BackendCallParams): Promise; stream(params: BackendCallParams): AsyncGenerator; } export type { z }; //# sourceMappingURL=backend.d.ts.map