call-ai
Version:
Lightweight library for making AI API calls with streaming support
14 lines (13 loc) • 801 B
TypeScript
import { CallAIOptions, Message, StreamResponse, ThenableStreamResponse } from "./types.js";
import { PACKAGE_VERSION } from "./version.js";
declare function callAi(prompt: string | Message[], options?: CallAIOptions): Promise<string> | ThenableStreamResponse;
declare function bufferStreamingResults(generator: AsyncGenerator<string, string, unknown>): Promise<string>;
declare function createBackwardCompatStreamingProxy(promise: Promise<StreamResponse>): ThenableStreamResponse;
declare function prepareRequestParams(prompt: string | Message[], options?: CallAIOptions): {
messages: Message[] | {
role: string;
content: string;
}[];
apiKey: string;
};
export { callAi, bufferStreamingResults, createBackwardCompatStreamingProxy, prepareRequestParams, PACKAGE_VERSION };