UNPKG

open-ai-npc

Version:

Testing openAI's API, with a "dungeon master".

25 lines (24 loc) 815 B
import type { ChatCompletionCreateParamsBase } from "openai/resources/chat/completions.mjs"; import OpenAI from "openai"; import type { Express } from "express"; export declare class DefinitionManager { openai: OpenAI; constructor(clientOptions?: { apiKey: string | undefined; organization: string | undefined; project: string | undefined; }); initialized: boolean; getDefinition(word: string, params?: Partial<ChatCompletionCreateParamsBase>, version?: string): Promise<{ definition: any; cached: boolean; model?: undefined; } | { definition: string | null; model: string; cached?: undefined; }>; addWordRoutes(app: Express): void; decodeWord(code: number): string; encodeWord(word: string): number; }