UNPKG

open-ai-npc

Version:

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

23 lines (22 loc) 765 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; } | { definition: string | null; cached?: undefined; }>; addWordRoutes(app: Express): void; decodeWord(code: number): string; encodeWord(word: string): number; }