mirror of
https://github.com/HanaokaYuzu/Gemini-API.git
synced 2026-04-12 12:23:03 -06:00
Persist Conversation History #9
Labels
No labels
advanced
advanced
bug
dependencies
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
model
pull-request
question
unreproducible
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mirrors/Gemini-API#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @winxalex on GitHub (Feb 28, 2024).
I've done web api fast api/uvcorn, and have dictionary that keep ChatSession by cid. This way I can call web api with cid and continue chat session. But if I restart server I can't restore the chat session. If I create new ChatSession with cid (i've written down on paper for test),
This will start new session on same cid (I can see that is browser), all previous history will be erased. Please advice is it possible to have similar functionality as in browser, so I can later continue with the session. Don't know if would work if I serialised pickle the chat session and unpickle later. I think also SNlM0e or access token should be restored and kept for the session
@HanaokaYuzu commented on GitHub (Feb 28, 2024):
To retrieve conversation history, you must provide all 3 values of
cid,ridandrcid. They are stored inChatSession.metadataand will be automatically updated every time afterChatSession.send_message()is called.Try the following code instead: