/** * Observability types for hazo_llm_api. * * Defines the shape of rows in hazo_llm_api_log and the options for usage * summary queries. */ export interface ApiLogRow { id: string; created_at: string; service_type: string; provider: string; model: string | null; success: 0 | 1 | boolean; tokens_input: number | null; tokens_output: number | null; tokens_cached_input: number | null; tokens_total: number | null; cost_usd: number | null; pricing_kind: string | null; pricing_input_per_1m_usd: number | null; pricing_output_per_1m_usd: number | null; pricing_per_image_usd: number | null; latency_ms: number | null; finish_reason: string | null; error_code: string | null; error_message: string | null; prompt_area: string | null; prompt_key: string | null; prompt_id: string | null; session_id: string | null; reference: string | null; attempts_count: number; context_json: string; } export interface UsageSummaryWhere { provider?: string; model?: string; service_type?: string; success?: boolean; session_id?: string; } export type UsageSummaryGroupBy = "provider" | "model" | "service_type" | "session_id" | "reference" | "date"; export interface UsageSummaryOptions { from?: string; to?: string; group_by?: UsageSummaryGroupBy[]; where?: UsageSummaryWhere; limit?: number; } export interface UsageSummaryRow { [group_key: string]: string | number | null; count: number; total_cost_usd: number; total_tokens_input: number; total_tokens_output: number; avg_latency_ms: number; } export interface UsageSummaryResponse { rows: UsageSummaryRow[]; totals: { count: number; total_cost_usd: number; total_tokens_input: number; total_tokens_output: number; }; } /** * Fetch aggregated usage summary. Parameters match UsageSummaryOptions. * Returns { rows: UsageSummaryRow[], totals: {...} }. */ export type FetchSummaryFn = (opts: UsageSummaryOptions) => Promise; /** * Fetch a single call detail row by ID. * Returns null if not found. */ export type FetchDetailFn = (id: string) => Promise; //# sourceMappingURL=types.d.ts.map