@nullplatform/llm-gateway-sdk
Version:
SDK for LLM Gateway plugin development
48 lines • 1.3 kB
TypeScript
import { ILLMRequest, ILLMResponse } from './request.js';
export interface IRequestMetrics {
start_time: Date;
end_time?: Date;
duration_ms?: number;
input_tokens?: number;
output_tokens?: number;
total_tokens?: number;
}
export interface IHTTPRequest {
method: string;
url: string;
headers: Record<string, string>;
body?: any;
}
export interface IHTTPResponse {
status(status: number): void;
json(data: any): void;
}
export interface IRequestContext {
project?: string;
request: ILLMRequest;
response?: ILLMResponse;
adapter?: string;
chunk?: ILLMResponse;
bufferedChunk?: ILLMResponse;
accumulated_response?: ILLMResponse;
finalChunk?: boolean;
httpRequest?: IHTTPRequest;
request_id: string;
user_id?: string;
session_id?: string;
plugin_data: Map<string, any>;
metrics: IRequestMetrics;
error?: Error;
retry_count?: number;
experiment_id?: string;
experiment_variant?: string;
headers: Record<string, string>;
query_params: Record<string, string>;
client_ip?: string;
user_agent?: string;
target_model?: string;
target_model_provider?: string;
available_models?: string[];
metadata: Record<string, any>;
}
//# sourceMappingURL=context.d.ts.map