diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index e76ff6a..62fd618 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -40,27 +40,27 @@ export interface CompletionRequest { } export interface CompletionResponse { - /** UUID for the request — use for tracing / support */ - request_id: string; + /** Request ID for tracing */ + id: string; /** Overall status of the response */ status: 'approved' | 'warning' | 'pending_review' | 'rejected'; - /** The LLM output, or null if rejected/failed */ - output: unknown | null; - /** Model confidence score 0–1 */ + /** Model confidence score 0–10 */ confidence: number; /** Ollama model that produced the output */ - model_used: string; - /** Prompt template version used */ - prompt_version: string; - /** Token usage */ - token_count: { input: number; output: number }; + model: string; + /** Task type that was processed */ + task_type: string; /** End-to-end latency in milliseconds */ latency_ms: number; - /** Validation details (present when return_validation_details=true or status != 'approved') */ + /** Token usage */ + tokens: { in: number; out: number }; + /** The LLM output text */ + output: string; + /** Validation details (present when return_validation_details=true) */ validation?: { passed: boolean; - ban_hits: unknown[]; - warnings: string[]; + score: number; + validators: Record; }; } @@ -100,7 +100,7 @@ export class LLMGatewayClient { }) { this.baseUrl = config.baseUrl ?? process.env['LLM_GATEWAY_URL'] - ?? 'http://localhost:3100'; + ?? 'https://llm-gateway.context-x.org'; this.caller = config.caller; this.timeout = config.timeout ?? 30_000; } @@ -240,10 +240,10 @@ export function createNOGnetClient(baseUrl?: string): LLMGatewayClient { } /** - * ShieldX — LLM prompt injection defense (internal meta-use) + * ShieldX — LLM prompt injection defense */ export function createShieldXClient(baseUrl?: string): LLMGatewayClient { - return new LLMGatewayClient({ caller: 'internal', baseUrl, timeout: 10_000 }); + return new LLMGatewayClient({ caller: 'shieldx', baseUrl, timeout: 10_000 }); } /**