deep-chat
Version:
Customizable chat component for AI APIs
25 lines • 1.5 kB
TypeScript
import { Messages } from '../../views/chat/messages/messages';
import { Response as ResponseI } from '../../types/response';
import { RequestDetails } from '../../types/interceptors';
import { ErrorResp } from '../../types/errorInternal';
import { ServiceIO } from '../../services/serviceIO';
import { GenericObject } from '../../types/object';
import { Connect } from '../../types/connect';
import { DeepChat } from '../../deepChat';
export type FetchFunc = (body: any) => Promise<Response>;
export type InterceptorResult = RequestDetails & {
error?: string;
};
type InterceptorResultP = Promise<InterceptorResult>;
export declare class RequestUtils {
static readonly CONTENT_TYPE = "Content-Type";
static tempRemoveContentHeader(connectSettings: Connect | undefined, request: (stringifyBody?: boolean) => Promise<unknown>, stringifyBody: boolean): Promise<unknown>;
static displayError(messages: Messages, err: ErrorResp, defMessage?: string): void;
static fetch(io: ServiceIO, headers: GenericObject<string> | undefined, stringifyBody: boolean, body: any): Promise<Response>;
static processResponseByType(response: Response): Promise<any> | Response;
static processRequestInterceptor(deepChat: DeepChat, requestDetails: RequestDetails): InterceptorResultP;
static validateResponseFormat(response: ResponseI): boolean;
static onInterceptorError(messages: Messages, error: string, onFinish?: () => void): void;
}
export {};
//# sourceMappingURL=requestUtils.d.ts.map