open-ai-npc
Version:
Testing openAI's API, with a "dungeon master".
23 lines (22 loc) • 764 B
TypeScript
import type { ChatCompletionCreateParamsBase } from "openai/resources/chat/completions.mjs";
import OpenAI from "openai";
import type { Express } from "express";
export declare class TranslateManager {
openai: OpenAI;
constructor(clientOptions?: {
apiKey: string | undefined;
organization: string | undefined;
project: string | undefined;
});
initialized: boolean;
getTranslation(sentence: string, lang: string, params?: Partial<ChatCompletionCreateParamsBase>, version?: string): Promise<{
translation: any;
cached: boolean;
model?: undefined;
} | {
translation: string | null;
model: string;
cached?: undefined;
}>;
addTranslateRoutes(app: Express): void;
}