import { FetchConfig } from '../Fetch/index'; import { Resp, AsyncIterableType } from '../interface'; export declare class BaseClient { protected controller: AbortController; protected qianfanAk?: string; protected qianfanSk?: string; protected qianfanAccessKey?: string; protected qianfanSecretKey?: string; protected qianfanBaseUrl?: string; protected qianfanConsoleApiBaseUrl?: string; protected qianfanV2BaseUrl?: string; protected qianfanLlmApiRetryTimeout?: string; protected qianfanLlmApiRetryBackoffFactor?: string; protected qianfanLlmApiRetryCount?: string; protected qianfanLlmRetryMaxWaitInterval?: string; protected Endpoint?: string; protected headers: { 'Content-Type': string; Accept: string; }; protected fetchInstance: any; protected fetchConfig: FetchConfig; protected enableOauth: boolean; protected version?: string; protected appid?: string; access_token: string; bearer_token: string; expires_in: number; constructor(options?: { QIANFAN_AK?: string; QIANFAN_SK?: string; QIANFAN_ACCESS_KEY?: string; QIANFAN_SECRET_KEY?: string; QIANFAN_BASE_URL?: string; QIANFAN_BEARER_TOKEN?: string; QIANFAN_CONSOLE_API_BASE_URL?: string; QIANFAN_LLM_API_RETRY_TIMEOUT?: string; QIANFAN_LLM_API_RETRY_BACKOFF_FACTOR?: string; QIANFAN_LLM_API_RETRY_COUNT?: string; QIANFAN_LLM_RETRY_MAX_WAIT_INTERVAL?: string; QIANFAN_V2_BASE_URL?: string; ENABLE_OAUTH: boolean; Endpoint?: string; version?: string; appid?: string; }); /** * 使用 AK,SK 生成鉴权签名(Access Token) * @return string 鉴权签名信息(Access Token) */ private getAccessToken; /** * 获取 IAM 路径 (配置proxy情况下) * * @param type 路径类型 * @param model 模型名称 * @returns 返回 IAM 路径 * @throws 当 qianfanBaseUrl 包含 'aip.baidubce.com' 时,抛出错误提示设置 proxy 的 baseUrl * @throws 当 qianfanConsoleApiBaseUrl 未设置时,抛出错误提示未设置 qianfanConsoleApiBaseUrl * @throws 当 Endpoint 未设置且 qianfanConsoleApiBaseUrl 不包含 'qianfan.baidubce.com' 时,抛出错误提示未设置 Endpoint */ private getIAMPath; getAllModels(type: any): Promise; protected sendRequest(type: string, model: string, AKPath: string, requestBody: string, stream?: boolean): Promise; }