@gaiot/apis
Version:
aiot apis
80 lines (79 loc) • 4.33 kB
TypeScript
import { AxiosInstance } from 'axios';
import { ApiErrorHandler, BaseApi } from '../base';
import { IUploadParam, IUploadTicket, IAecSessionParam as ISessionParam, IAecSession as ISession, ICommentParam, IHistory, MinioConfig, KnowledgeFileMetadata, KnowledgeFileMetadataParams, IMessageParams, IKnowledge, IApplication, IQuestion, ResourceTokenParams, ResourceToken, IAecFile as IFile, IAecFileDataParam as IFileDataParam, IKnowledgeFileParams, IFileParams, IAecPrompt as IPrompt, IAecPromptParam as IPromptParam, IPromptType, IBaseModelInfo } from './model';
export declare class AECPilotApi extends BaseApi {
private axiosInstance;
private getToken;
constructor(axiosInstance: AxiosInstance, getToken: () => string, errorHandler?: ApiErrorHandler);
getSessions(): Promise<ISession[]>;
postSession(params: ISessionParam): Promise<string>;
getSession(id: string): Promise<ISession>;
updateSession(id: string, params: ISessionParam): Promise<string>;
deleteSession(id: string): Promise<ISession>;
getSessionKnowledgeFiles(sessionId: string, params?: {
enabled: number;
}): Promise<KnowledgeFileMetadata[]>;
postSessionKnowledgeFile(sessionId: string, params: KnowledgeFileMetadataParams): Promise<string>;
deleteSessionKnowledgeFiles(sessionId: string, params: {
files: IFileParams[];
}): Promise<any>;
getSessionKnowledgeFile(sessionId: string, fileId: string): Promise<KnowledgeFileMetadata>;
deleteSessionKnowledgeFile(sessionId: string, fileId: string): Promise<string>;
getSessionChatHistory(sessionId: string, params?: {
contextOnly?: boolean;
pageSize?: number;
endTime?: string;
}): Promise<IHistory[]>;
postMessage(applicationId: string, sessionId: string, params: IMessageParams): Promise<null>;
postComments(sessionId: string, params: ICommentParam): Promise<unknown>;
listApplications(): Promise<IApplication[]>;
getApplication(): Promise<string>;
postApplication(applicationId: string): Promise<null>;
getRecommendQues(): Promise<IQuestion[]>;
postRecommendQues(params: IQuestion): Promise<unknown>;
patchRecommendQues(id: string, params: IQuestion): Promise<IQuestion>;
delRecommendQues(id: string): Promise<unknown>;
getUploadTicket(params: IUploadParam): Promise<IUploadTicket>;
uploadMinioFile(minioConfig: MinioConfig, file: File): Promise<string>;
uploadFile(path: string, file: File): Promise<string>;
uploadFiles(path: string, files: File[]): Promise<string[]>;
getKnowledge(docId?: string, name?: string): Promise<IKnowledge[]>;
getKnowledgeIdFileId(id: string, fid: string): Promise<IFile>;
updateKnowledgeIdFileId(id: string, fid: string, params: IKnowledgeFileParams): Promise<IFile>;
getKnowledgeIdFileIdData(id: string, fid: string, did: string): Promise<IFileDataParam[]>;
checkFileReady(sessionId: string, fileId?: string, shouldContinueFunc?: () => boolean, interval?: number, upateFileFn?: any): Promise<KnowledgeFileMetadata | null>;
postChat(params: any, query: {
sessionId: string;
geneQues: boolean;
}): Promise<IHistory>;
postChatV2EventSource(sessionId: string, params: any, signal: AbortSignal, options: {
onopen?: any;
onmessage?: any;
onerror?: any;
onclose?: any;
}): Promise<void>;
postChatV3EventSource(sessionId: string, params: any, signal: AbortSignal, options: {
onopen?: any;
onmessage?: any;
onerror?: any;
onclose?: any;
}): Promise<void>;
getResourceToken(params: ResourceTokenParams): Promise<ResourceToken>;
postUploadTicket(params: IUploadParam): Promise<IUploadTicket>;
postPrompts(params: IPromptParam): Promise<{
id: string;
}>;
listPrompt(params?: {
title?: string;
type?: IPromptType;
}): Promise<IPrompt[]>;
getPrompt(id: string): Promise<IPrompt>;
updatePrompt(id: string, params: IPromptParam): Promise<string>;
deletePrompt(id: string): Promise<string>;
chatSessionIdContext(id: string): Promise<unknown>;
getBaseModelInfo(serviceId: string): Promise<IBaseModelInfo>;
getApplicationId(id: string): Promise<IApplication>;
getAppService(): Promise<any>;
}
export * from './model';
export * from './cosntant';