openai-cookbook
openai-cookbook copied to clipboard
nextjs-with-flask-server persistence
The app example nextjs-with-flask-server seems to work fine. It populates the index and answer the questions. But after a refresh, it asks to upload the source files again, although they are already vectorized on Pinecone. Is this really the behavior expected?
I hacked client/src/components/FileQandAArea.tsx to get round this for now. Commented out the if (props.files.length === 0) { block. Works fine after that with existing data from before.
I hacked client/src/components/FileQandAArea.tsx to get round this for now. Commented out the
if (props.files.length === 0) {block. Works fine after that with existing data from before.
Thanks. I did the same change and I also hard-coded the session-id for the function create_app on server/app.py It worked better because it seemed that it was trying to look on a wrong pinecone namespace attacched to the session. But still, it does not reply as well, as it needed something from the file. From the code and doc it was not clear to me if it needed to use the file name or content to send to the API.
Im gonna try hardcoding the sessions ID, seemed for me when commenting out that line it stopped playing nice.
Side note have you tested uploading multiple files, seems that if i upload more than one file with the second being larger it breaks.
yes, in my case it was multiple
Im gonna try hardcoding the sessions ID, seemed for me when commenting out that line it stopped playing nice.
Side note have you tested uploading multiple files, seems that if i upload more than one file with the second being larger it breaks.
That was it. Fixing the session ID actually solves the problem, but it gets quite buggy with multiple files.
In my case, merely hardcoding the "session_id" is insufficient. It's possible that I am using a different version, but I also need to persist the "file_text_dict" variable. Otherwise, attempting to access the vector without the accompanying text would result in no text being sent to ChatGPT.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.