Initial commit

This commit is contained in:
2025-04-01 08:37:41 +02:00
commit 39c1b6ff0a
59 changed files with 14076 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
/**
* 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;
}