CdC-SI / eak-copilot

The official repository of the EAK-Copilot project as part of the Innovation Fellowship 2024.
https://cdc-si.github.io/eak-copilot/
GNU General Public License v3.0
4 stars 0 forks source link

refactor frontend logic #173

Closed K-Schubert closed 1 month ago

K-Schubert commented 1 month ago

Description

Refactor logic to only make an API call to the backend (may it be RAG or OpenAI) with a query, and returns a streamed message response.

Create a /rag/process route in rag/app/main.py to process RAG requests. Refactor code in src/components/ChatGPT/useChatGPT.ts (chatgpt-minimal) to send the user query as string and return streamed response as string tokens. Renamed src/components/ChatGPT/useChatGPT.ts src/components/ChatGPT/useChatGPT.ts to src/components/RAG/useRAG.ts Updated ChatGPTProps to RAGProps in src/components/RAG/interface.ts.