37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
/**
|
|
* OpenRouter LLM Provider
|
|
* Handles communication with OpenRouter API for LLM interactions
|
|
*/
|
|
import { LlmProvider, LlmConfig, ActionRequest, ActionResponse, NarrativeRequest, NarrativeResponse } from '../interfaces/llm';
|
|
export declare class OpenRouterProvider implements LlmProvider {
|
|
private apiKey;
|
|
private model;
|
|
private client;
|
|
private temperature;
|
|
private maxTokens;
|
|
/**
|
|
* Initialize the OpenRouter provider with configuration
|
|
*/
|
|
initialize(config: LlmConfig): Promise<void>;
|
|
/**
|
|
* Translate player input into a structured action for the game engine
|
|
*/
|
|
translateAction(request: ActionRequest): Promise<ActionResponse>;
|
|
/**
|
|
* Generate narrative prose based on game events
|
|
*/
|
|
generateNarrative(request: NarrativeRequest): Promise<NarrativeResponse>;
|
|
/**
|
|
* Build the system and user prompts for action translation
|
|
*/
|
|
private buildActionPrompt;
|
|
/**
|
|
* Build the system and user prompts for narrative generation
|
|
*/
|
|
private buildNarrativePrompt;
|
|
/**
|
|
* Validate and normalize the action response
|
|
*/
|
|
private validateActionResponse;
|
|
}
|