enhancement: reusable api client setup + replaced in settings, conversation

This commit is contained in:
Siddhant Rai
2024-07-24 21:33:36 +05:30
parent 56a16b862a
commit 7c6532f145
15 changed files with 522 additions and 432 deletions

View File

@@ -0,0 +1,23 @@
const endpoints = {
USER: {
API_KEYS: '/api/get_api_keys',
CREATE_API_KEY: '/api/create_api_key',
DELETE_API_KEY: '/api/delete_api_key',
PROMPTS: '/api/get_prompts',
CREATE_PROMPT: '/api/create_prompt',
DELETE_PROMPT: '/api/delete_prompt',
UPDATE_PROMPT: '/api/update_prompt',
SINGLE_PROMPT: (id: string) => `/api/get_single_prompt?id=${id}`,
DELETE_PATH: (docPath: string) => `/api/delete_old?path=${docPath}`,
},
CONVERSATION: {
ANSWER: '/api/answer',
ANSWER_STREAMING: '/stream',
SEARCH: '/api/search',
FEEDBACK: '/api/feedback',
SHARED_CONVERSATION: (identifier: string) =>
`/api/shared_conversation/${identifier}`,
},
};
export default endpoints;