@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
50 lines (41 loc) • 1.43 kB
text/typescript
import { lambdaClient } from '@/libs/trpc/client';
class AgentService {
createAgentKnowledgeBase = async (
agentId: string,
knowledgeBaseId: string,
enabled?: boolean,
) => {
return lambdaClient.agent.createAgentKnowledgeBase.mutate({
agentId,
enabled,
knowledgeBaseId,
});
};
deleteAgentKnowledgeBase = async (agentId: string, knowledgeBaseId: string) => {
return lambdaClient.agent.deleteAgentKnowledgeBase.mutate({ agentId, knowledgeBaseId });
};
toggleKnowledgeBase = async (agentId: string, knowledgeBaseId: string, enabled?: boolean) => {
return lambdaClient.agent.toggleKnowledgeBase.mutate({
agentId,
enabled,
knowledgeBaseId,
});
};
createAgentFiles = async (agentId: string, fileIds: string[], enabled?: boolean) => {
return lambdaClient.agent.createAgentFiles.mutate({ agentId, enabled, fileIds });
};
deleteAgentFile = async (agentId: string, fileId: string) => {
return lambdaClient.agent.deleteAgentFile.mutate({ agentId, fileId });
};
toggleFile = async (agentId: string, fileId: string, enabled?: boolean) => {
return lambdaClient.agent.toggleFile.mutate({
agentId,
enabled,
fileId,
});
};
getFilesAndKnowledgeBases = async (agentId: string) => {
return lambdaClient.agent.getKnowledgeBasesAndFiles.query({ agentId });
};
}
export const agentService = new AgentService();