UNPKG

prompt-version-manager

Version:

Centralized prompt management system for Human Behavior AI agents

84 lines 2.6 kB
/** * Type definitions for simplified PVM API */ /** * Response object from model.complete() that enables automatic chaining. */ export interface ModelResponse { /** The actual content returned by the model */ content: string | object; /** Model used for this completion */ model: string; /** Hash of the prompt for tracking */ promptHash: string; /** Unique execution ID */ executionId: string; /** Metadata about the execution */ metadata: { tag: string; provider: string; chainId?: string; tokens: { prompt: number; completion: number; total: number; }; latencyMs: number; structured: boolean; }; /** Raw response from the provider */ rawResponse?: any; /** Signature for automatic chain detection */ _isPvmResponse: true; /** Convert response to string for display */ toString(): string; /** Convert response to prompt string for chaining */ toPrompt(): string; } /** * Options for structured output */ export interface StructuredOutput<T = any> { /** JSON schema for the output */ schema?: object; /** Type/class for validation (provider-specific) */ type?: T; /** Name for the output (used in Claude tool calling) */ name?: string; } /** * Options for model.complete() */ export interface ModelOptions { /** Temperature for randomness (0-2) */ temperature?: number; /** Maximum tokens to generate */ maxTokens?: number; /** System prompt */ systemPrompt?: string; /** Parent execution ID for explicit chaining */ parentExecutionId?: string; /** Additional provider-specific options */ [key: string]: any; } /** * Variables for prompt templates */ export type PromptVariables = any[]; /** * Model interface */ export interface Model { /** * Execute model with automatic tracking and optional structured output * * @param modelName - Model identifier (e.g., "gpt-4", "gemini-2.0-flash", "claude-3.5") * @param prompt - Prompt string or ModelResponse from previous call (for chaining) * @param tag - Tag for tracking this execution * @param jsonOutput - Optional schema/type for structured output * @param options - Additional model options * @returns ModelResponse object that can be used for chaining */ complete(modelName: string, prompt: string | ModelResponse, tag: string, jsonOutput?: StructuredOutput | object, options?: ModelOptions): Promise<ModelResponse>; } //# sourceMappingURL=types.d.ts.map