|
1 | 1 | import { lambdaClient } from '@/libs/trpc/client';
|
2 | 2 |
|
3 | 3 | class AgentService {
|
4 |
| - async createAgentKnowledgeBase(agentId: string, knowledgeBaseId: string, enabled?: boolean) { |
5 |
| - return await lambdaClient.agent.createAgentKnowledgeBase.mutate({ |
| 4 | + createAgentKnowledgeBase = async ( |
| 5 | + agentId: string, |
| 6 | + knowledgeBaseId: string, |
| 7 | + enabled?: boolean, |
| 8 | + ) => { |
| 9 | + return lambdaClient.agent.createAgentKnowledgeBase.mutate({ |
6 | 10 | agentId,
|
7 | 11 | enabled,
|
8 | 12 | knowledgeBaseId,
|
9 | 13 | });
|
10 |
| - } |
| 14 | + }; |
11 | 15 |
|
12 |
| - async deleteAgentKnowledgeBase(agentId: string, knowledgeBaseId: string) { |
13 |
| - return await lambdaClient.agent.deleteAgentKnowledgeBase.mutate({ agentId, knowledgeBaseId }); |
14 |
| - } |
| 16 | + deleteAgentKnowledgeBase = async (agentId: string, knowledgeBaseId: string) => { |
| 17 | + return lambdaClient.agent.deleteAgentKnowledgeBase.mutate({ agentId, knowledgeBaseId }); |
| 18 | + }; |
15 | 19 |
|
16 |
| - async toggleKnowledgeBase(agentId: string, knowledgeBaseId: string, enabled?: boolean) { |
17 |
| - return await lambdaClient.agent.toggleKnowledgeBase.mutate({ |
| 20 | + toggleKnowledgeBase = async (agentId: string, knowledgeBaseId: string, enabled?: boolean) => { |
| 21 | + return lambdaClient.agent.toggleKnowledgeBase.mutate({ |
18 | 22 | agentId,
|
19 | 23 | enabled,
|
20 | 24 | knowledgeBaseId,
|
21 | 25 | });
|
22 |
| - } |
| 26 | + }; |
23 | 27 |
|
24 |
| - async createAgentFiles(agentId: string, fileIds: string[], enabled?: boolean) { |
25 |
| - return await lambdaClient.agent.createAgentFiles.mutate({ agentId, enabled, fileIds }); |
26 |
| - } |
| 28 | + createAgentFiles = async (agentId: string, fileIds: string[], enabled?: boolean) => { |
| 29 | + return lambdaClient.agent.createAgentFiles.mutate({ agentId, enabled, fileIds }); |
| 30 | + }; |
27 | 31 |
|
28 |
| - async deleteAgentFile(agentId: string, fileId: string) { |
29 |
| - return await lambdaClient.agent.deleteAgentFile.mutate({ agentId, fileId }); |
30 |
| - } |
| 32 | + deleteAgentFile = async (agentId: string, fileId: string) => { |
| 33 | + return lambdaClient.agent.deleteAgentFile.mutate({ agentId, fileId }); |
| 34 | + }; |
31 | 35 |
|
32 |
| - async toggleFile(agentId: string, fileId: string, enabled?: boolean) { |
33 |
| - return await lambdaClient.agent.toggleFile.mutate({ |
| 36 | + toggleFile = async (agentId: string, fileId: string, enabled?: boolean) => { |
| 37 | + return lambdaClient.agent.toggleFile.mutate({ |
34 | 38 | agentId,
|
35 | 39 | enabled,
|
36 | 40 | fileId,
|
37 | 41 | });
|
38 |
| - } |
| 42 | + }; |
39 | 43 |
|
40 |
| - async getFilesAndKnowledgeBases(agentId: string) { |
41 |
| - return await lambdaClient.agent.getKnowledgeBasesAndFiles.query({ agentId }); |
42 |
| - } |
| 44 | + getFilesAndKnowledgeBases = async (agentId: string) => { |
| 45 | + return lambdaClient.agent.getKnowledgeBasesAndFiles.query({ agentId }); |
| 46 | + }; |
43 | 47 | }
|
44 | 48 |
|
45 | 49 | export const agentService = new AgentService();
|
0 commit comments