Amenokal-Labs / legal-ai-assistant

https://legal-ai-assistant.vercel.app
0 stars 1 forks source link

Initialize FastAPI project, and create an endpoint `/ask` to send a question to OpenAI API #12

Closed achab closed 1 year ago

Imad-Allal commented 1 year ago

@achab The API I wrote here takes the text that has been submitted in the ask.html and uses it as input in the openAI API. The generated response is displayed in the response.html.

The problem with this code is that since every new request is a call to the endpoint "ask", every new request is a new call to the function main of the ask.py file => a new conversation => won't remember the previously asked questions

achab commented 1 year ago

Hi @Imad-Allal, actually this is how the API works. You can't have create chats like in ChatGPT using the API.