import { O as OpenRouterClient, S as SendOptions } from '../index-DMpnd7bA.js'; import { C as ChatCompletionResponse, S as StreamChunk, M as ModelsListResponse } from '../api-DL1ztBmF.js'; import { M as ModelCatalog } from '../ModelCatalog-BcfW6bZr.js'; import { M as ModelSelector } from '../ModelSelector-DRt9Wz6J.js'; import { P as PricingCalculator, C as CostTracker } from '../CostTracker-_TwTsEdz.js'; import 'eventemitter3'; import '../routing-C4EW-wyV.js'; import '../pricing-BUJAtUlg.js'; import '../logger-DUq4P1BF.js'; /** * NestJS Injectable Service * Usage: * * @Module({ * providers: [ * { * provide: OpenRouterService, * useFactory: () => { * const client = new OpenRouterClient({ apiKey: 'your-key' }); * return new OpenRouterService(client); * } * } * ] * }) */ declare class OpenRouterService { private readonly client; constructor(client: OpenRouterClient); sendMessage(message: string | any[], options?: SendOptions): Promise; streamMessage(message: string | any[], options?: SendOptions): AsyncIterable; listModels(): Promise; getModelCatalog(): ModelCatalog; getPricingCalculator(): PricingCalculator; getCostTracker(): CostTracker; getModelSelector(): ModelSelector; destroy(): void; } /** * NestJS Controller example * * @Controller('openrouter') * export class OpenRouterController { * constructor(private readonly openrouterService: OpenRouterService) {} * * @Post('chat') * async chat(@Body() body: ChatDto) { * return this.openrouterService.sendMessage(body.message, body.options); * } * * @Post('chat/stream') * async stream(@Body() body: ChatDto, @Res() res: Response) { * res.setHeader('Content-Type', 'text/event-stream'); * * for await (const chunk of this.openrouterService.streamMessage(body.message, body.options)) { * res.write(`data: ${JSON.stringify(chunk)}\n\n`); * } * * res.end(); * } * } */ /** * Factory function for NestJS integration */ declare function createNestJSService(client: OpenRouterClient): OpenRouterService; export { OpenRouterService, createNestJSService };