UNPKG

anylang

Version:

A translator's kit that uses the free APIs of Google Translate, Yandex, Bing, ChatGPT, and other LLMs

22 lines (21 loc) 656 B
import { z } from 'zod'; import { LLMFetcher } from '..'; export declare const ChatGPTLLMResponseSchema: z.ZodObject<{ choices: z.ZodArray<z.ZodObject<{ message: z.ZodObject<{ content: z.ZodString; }, z.core.$strip>; }, z.core.$strip>>; }, z.core.$strip>; export declare class ChatGPTLLMFetcher implements LLMFetcher { private readonly apiUrl; private readonly config; constructor({ apiKey, model, apiOrigin, }: { apiKey: string; model?: string; apiOrigin?: string; }); getLengthLimit(): number; getRequestsTimeout(): number; fetch(prompt: string): Promise<string>; }