import { AxiosInstance } from 'axios'; import { AccessToken, AICheckResult, Balance, Batch, BatchRequest, BatchStatus, BatchStatuses, Chat, ChatCompletion, ChatCompletionChunk, DeletedFile, Embeddings, Image, Model, Models, Tokens, UploadedFile, UploadedFiles, WithXHeaders } from './interfaces'; import { Settings } from './settings'; import { EventEmitter } from 'events'; export interface GigaChatClientConfig { /** Адрес относительно которого выполняются запросы */ baseUrl?: string; /** Адрес для запроса токена доступа OAuth 2.0 */ authUrl?: string; /** Авторизационные данные */ credentials?: string; /** Версия API, к которой предоставляется доступ */ scope?: string; /** JWE токен */ accessToken?: string; /** Название модели, от которой нужно получить ответ */ model?: string; /** Параметр цензуры */ profanityCheck?: boolean; /** Имя пользователя */ user?: string; /** Пароль */ password?: string; /** Таймаут в секундах */ timeout?: number; /** Детализация запросов в консоли */ verbose?: boolean; /** Флаги, включающие особенные фичи */ flags?: string[]; /** HTTPS Agent, который прокидывается в Axios клиент */ httpsAgent?: any; /** Включает работу библиотеку в браузере */ dangerouslyAllowBrowser?: boolean; } export interface DetectedImage { uuid?: string; postfix?: string; } export interface DetectedVideo { uuid?: string; cover_uuid?: string; postfix?: string; } export declare function detectImage(message: string): DetectedImage | null; export declare function detectVideo(message: string): DetectedVideo | null; export declare class GigaChat { _client: AxiosInstance; _authClient: AxiosInstance; _settings: Settings; protected _accessToken?: AccessToken; constructor(config: GigaChatClientConfig); protected get token(): string | undefined; protected get useAuth(): boolean; protected checkValidityToken(): boolean; protected resetToken(): void; protected parseChat(payload: Chat | Record | string): Chat; private _getAxiosConfig; private _getAuthAxiosConfig; updateToken(): Promise; private _decorator; tokensCount(input: string[], model?: string): Promise; aiCheck(input: string, model: string): Promise; balance(): Promise; embeddings(texts: string[], model?: string): Promise; embeddingsBatch(payload: BatchRequest[]): Promise; getModels(): Promise; getModel(model: string): Promise; getImage(fileId: string): Promise; uploadFile(file: File, purpose?: 'general' | 'assistant'): Promise; getFile(file: string): Promise; getFiles(): Promise; deleteFile(file: string): Promise; chat(payload: Chat | Record | string): Promise; chatsBatch(payload: BatchRequest[]): Promise; getBatch(fileId: string): Promise & WithXHeaders>; getBatches(): Promise; getBatchStatus(batchId: string): Promise; stream_readable(payload: Chat | Record | string, abortSignal?: AbortSignal): Promise; stream(payload: Chat | Record | string, abortSignal?: AbortSignal): AsyncIterable; private _buildAccessToken; } export default GigaChat; //# sourceMappingURL=index.d.ts.map