p4u-client-ai
Version:
Empower Your Apps with AI: Access Multiple Models, Automate Tasks, Create AI Agents Easily
41 lines (40 loc) • 3.15 kB
TypeScript
import { AxiosResponse } from 'axios';
import type { IRequest, IInsert, IDelete, IAgent, IInsertAgent, IUpdateAgent, IAgentQueryRequest, IQueryResponse, IAgentRag, IGetAgentRagResponse, IDeleteAgentRagReturn, IAddKnowledgeRequest, IAddKnowledgeBatchRequest, ISearchKnowledgeRequest, IAgentKnowledge, ISearchKnowledgeResult, IExcludeKnowledgeRequest, ISearchKnowledgeByMetadataRequest } from './interfaces/index.js';
export type { IRequest, IInsert, IDelete, IAgent, IInsertAgent, IUpdateAgent, IAgentQueryRequest, IQueryResponse, IAgentRag, IGetAgentRagResponse, IDeleteAgentRagReturn, IAddKnowledgeRequest, IAddKnowledgeBatchRequest, ISearchKnowledgeRequest, IAgentKnowledge, ISearchKnowledgeResult, IExcludeKnowledgeRequest, ISearchKnowledgeByMetadataRequest, } from './interfaces/index.js';
export { GPTModelsEnum } from './enums/gptModels.enum.js';
export { AudioModelsEnum } from './enums/audioModels.enum.js';
export { ImageModelsEnum } from './enums/imageModels.enum.js';
export { VideoModelsEnum } from './enums/videoModels.enum.js';
export default class AIClient {
private headers;
private apiUrl;
private debugUrl;
constructor();
login(userName: string, password: string): Promise<void>;
private makeRequest;
pingPong(): Promise<AxiosResponse<any>>;
listTasks(): Promise<AxiosResponse<any>>;
runTask(request: IRequest): Promise<AxiosResponse<any>>;
deleteTask(request: IDelete): Promise<AxiosResponse<any>>;
createTask(request: IInsert): Promise<AxiosResponse<any>>;
setLocalUrl(url: string): void;
listAgents(): Promise<AxiosResponse<IAgent[]>>;
getAgent(id: string): Promise<AxiosResponse<IAgent>>;
createAgent(request: IInsertAgent): Promise<AxiosResponse<IAgent>>;
updateAgent(request: IUpdateAgent): Promise<AxiosResponse<IAgent>>;
deleteAgent(id: string): Promise<AxiosResponse<IAgent>>;
queryAgent(body: IAgentQueryRequest): Promise<AxiosResponse<IQueryResponse>>;
getAllAgentRag(query?: Record<string, any>): Promise<AxiosResponse<IGetAgentRagResponse>>;
getAgentRag(id: string): Promise<AxiosResponse<IAgentRag>>;
createAgentRag(data: IAgentRag): Promise<AxiosResponse<IAgentRag>>;
deleteAgentRag(id: string): Promise<AxiosResponse<IDeleteAgentRagReturn>>;
addKnowledge(data: IAddKnowledgeRequest): Promise<AxiosResponse<IAgentKnowledge[]>>;
addKnowledgeBatch(data: IAddKnowledgeBatchRequest): Promise<AxiosResponse<IAgentKnowledge[]>>;
addKnowledgeFromFile(agentRagId: string, file: Blob, metadata?: Record<string, any>): Promise<AxiosResponse<IAgentKnowledge[]>>;
searchKnowledge(data: ISearchKnowledgeRequest): Promise<AxiosResponse<ISearchKnowledgeResult>>;
getKnowledgeById(id: string): Promise<AxiosResponse<IAgentKnowledge>>;
getKnowledgeStatistics(agentRagId: string): Promise<AxiosResponse<any>>;
getKnowledgeByAgentRagId(agentRagId: string): Promise<AxiosResponse<IAgentKnowledge[]>>;
excludeKnowledge(data: IExcludeKnowledgeRequest): Promise<AxiosResponse<IDeleteAgentRagReturn>>;
searchKnowledgeByMetadata(data: ISearchKnowledgeByMetadataRequest): Promise<AxiosResponse<IAgentKnowledge[]>>;
}