UNPKG

ai21

Version:

AI21 TypeScript SDK

32 lines (31 loc) 1.28 kB
import { Chat } from './resources/chat'; import { APIClient } from './APIClient'; import { Headers } from './types'; import { ConversationalRag } from './resources/rag/conversational-rag'; import { Files } from './resources'; import * as Types from './types'; export interface ClientOptions { baseURL?: string | undefined; apiKey?: string | undefined; maxRetries?: number; timeout?: number; via?: string | null; defaultHeaders?: Headers; /** * By default, using this library on the client side is prohibited to prevent exposing your secret API credentials to potential attackers. * Only enable this option by setting it to `true` if you fully understand the risks and have implemented appropriate security measures. */ dangerouslyAllowBrowser?: boolean; } export declare class AI21 extends APIClient { protected options: ClientOptions; private apiKey; private via; constructor({ apiKey, baseURL, timeout, maxRetries, via, ...opts }?: ClientOptions); chat: Chat; conversationalRag: ConversationalRag; files: Files; protected authHeaders(_: Types.FinalRequestOptions): Types.Headers; protected defaultHeaders(opts: Types.FinalRequestOptions): Types.Headers; protected getUserAgent(): string; }