mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import apiClient from '../client';
|
|
import endpoints from '../endpoints';
|
|
|
|
const conversationService = {
|
|
answer: (data: any, signal: AbortSignal): Promise<any> =>
|
|
apiClient.post(endpoints.CONVERSATION.ANSWER, data, {}, signal),
|
|
answerStream: (data: any, signal: AbortSignal): Promise<any> =>
|
|
apiClient.post(endpoints.CONVERSATION.ANSWER_STREAMING, data, {}, signal),
|
|
search: (data: any): Promise<any> =>
|
|
apiClient.post(endpoints.CONVERSATION.SEARCH, data),
|
|
feedback: (data: any): Promise<any> =>
|
|
apiClient.post(endpoints.CONVERSATION.FEEDBACK, data),
|
|
getConversation: (id: string): Promise<any> =>
|
|
apiClient.get(endpoints.CONVERSATION.CONVERSATION(id)),
|
|
getConversations: (): Promise<any> =>
|
|
apiClient.get(endpoints.CONVERSATION.CONVERSATIONS),
|
|
shareConversation: (isPromptable: boolean, data: any): Promise<any> =>
|
|
apiClient.post(
|
|
endpoints.CONVERSATION.SHARE_CONVERSATION(isPromptable),
|
|
data,
|
|
),
|
|
getSharedConversation: (identifier: string): Promise<any> =>
|
|
apiClient.get(endpoints.CONVERSATION.SHARED_CONVERSATION(identifier)),
|
|
delete: (id: string, data: any): Promise<any> =>
|
|
apiClient.post(endpoints.CONVERSATION.DELETE(id), data),
|
|
deleteAll: (): Promise<any> =>
|
|
apiClient.get(endpoints.CONVERSATION.DELETE_ALL),
|
|
update: (data: any): Promise<any> =>
|
|
apiClient.post(endpoints.CONVERSATION.UPDATE, data),
|
|
};
|
|
|
|
export default conversationService;
|