import { LlmProviderType } from '../../common/constants/llm.constant'; /** `PromptCreateRequest` → POST /api/v1/llm/prompts. * * Per-call LLM tuning knobs (`maxTokens` / `temperature`) are NOT exposed * here — they live on the linked `llm_agent` rule as * `executionParams.llmEval.maxTokens`. The backend has no `temperature` * parameter; `maxTokens` is the only per-completion cap the dashboard can * surface today. */ export interface PromptCreatePayload { name: string; /** User/instruction content (the prompt body). */ content: string; systemPrompt?: string; description?: string; model?: string | null; } /** `PromptUpdateRequest` → PUT /api/v1/llm/prompts/{name} (all optional). */ export interface PromptUpdatePayload { content?: string; systemPrompt?: string; description?: string; model?: string | null; version?: string; } /** * A prompt template row. * * `GET /llm/prompts` (list) returns only `{ id, name, version, description, * variables, model }` — `content` / `systemPrompt` are **not** included. Fetch * the single template (`GET /llm/prompts/{name}`) to read those for editing. */ export interface PromptTemplate { id?: string | number; name: string; version?: string; description?: string; variables?: string[]; model?: string | null; /** Present only on the single-template GET, not the list. */ content?: string; /** Present only on the single-template GET, not the list. */ systemPrompt?: string; } /** `GET /llm/prompts` → `{ templates: PromptTemplate[] }`. */ export interface PromptListResponse { templates: PromptTemplate[]; } /** `POST` / `PUT` → `{ id, name, version }`. */ export interface PromptMutationResponse { id?: string | number; name: string; version?: string; } /** One entry of `GET /llm/prompts/{name}/versions`. The list projection * is intentionally loose — the engine's version rows carry `version` * plus bookkeeping fields; `content` appears on detail reads only. */ export interface LlmPromptVersion { version: number | string; content?: string; systemPrompt?: string; description?: string; createdAt?: string; updatedAt?: string; [key: string]: unknown; } /** `GET /llm/prompts/{name}/versions` response. */ export interface LlmPromptVersionsResult { versions: LlmPromptVersion[]; count?: number; } /** `POST /llm/prompts/{name}/render` body — sample values for the * template's `{{variables}}`; `version` pins a row (default latest). */ export interface LlmPromptRenderPayload { variables: Record; version?: number | string; } /** `POST /llm/prompts/{name}/render` response — `rendered` carries the * substituted text (engine contract field name). */ export interface LlmPromptRenderResponse { rendered: string; name?: string; version?: number | string; } /** Backend-supported provider types (`eaera_cms/llm/`). */ export type { LlmProviderType }; /** * A registered LLM provider. Providers live **in-process** on whichever pod * created them (`ProviderRegistry`) — registrations made via * `POST /api/v1/llm/providers` are lost on pod restart unless env- or * content-backed (see `risk-rules-api-guide.md` §7.C). The `apiKey` is * write-only and never returned on read. */ export interface LlmProvider { name: string; providerType: LlmProviderType; baseUrl?: string; /** Supported model IDs (per-provider). */ models: string[]; /** Provider-specific config (e.g. `{ timeout: 180 }`). */ config?: Record; isEnabled: boolean; /** Health flag — false when the provider cannot be reached. */ isHealthy: boolean; } /** `POST /api/v1/llm/providers` body. `apiKey` is write-only. */ export interface LlmProviderCreatePayload { name: string; providerType: LlmProviderType; baseUrl?: string; /** Write-only — never echoed back by the API. */ apiKey?: string; models?: string[]; config?: Record; isEnabled?: boolean; } /** `PUT /api/v1/llm/providers/{name}` body (all optional). */ export interface LlmProviderUpdatePayload { providerType?: LlmProviderType; baseUrl?: string; /** Write-only. */ apiKey?: string; models?: string[]; config?: Record; isEnabled?: boolean; } /** `GET /api/v1/llm/providers` → `{ providers: LlmProvider[] }`. */ export interface LlmProviderListResponse { providers: LlmProvider[]; } /** `GET /api/v1/llm/providers/{name}/models`. */ export interface LlmProviderModelsResponse { models: string[]; healthy: boolean; } /** One chat message in a completion request. The copilot flow sends * exactly two: `system` = the assist bundle's `rendered_grounding`, * `user` = the operator's intention. */ export interface LlmChatMessage { role: 'system' | 'user' | 'assistant'; content: string; } /** `POST /api/v1/llm/complete` body — OpenAI-shaped chat completion. */ export interface LlmCompletePayload { /** Registered provider name — `'gateway'` routes through the AI * gateway; a personal-agent transport passes its own id. */ provider?: string; model?: string; temperature?: number; max_tokens?: number; messages: LlmChatMessage[]; } /** `POST /api/v1/llm/complete` response — `content` carries the raw * model text (for copilot draft mode: a single RFC 8259 JSON object, * no markdown fence by contract; strip fences defensively anyway). * `usage` is informational only — the FE never forwards usage fields * onto the copilot ledger (422 PEOPLE_COPILOT_USAGE_UNTRUSTED). */ export interface LlmCompleteUsage { promptTokens: number; completionTokens: number; totalTokens: number; } export interface LlmCompleteResponse { content: string; model?: string; provider?: string; finishReason?: string | null; usage?: LlmCompleteUsage | null; } //# sourceMappingURL=llm.type.d.ts.map