Comments (4)
Pickling is great, and super simple as you can just save/load python data structures, I love it.
from chatgpt-telegram-bot.
There is currently no context or session comparable to the browser chat available for the API. Every request has to include the history (that's why the token usage grows).
Histories would have to be saved locally. However I have mixed feelings about storing the conversations of my users.
Anyway, if @n3d1117 is a fan of the idea I think the implementation can be very straightforward by adding it to the UsageTracker, as a field to the usage_logs .json files "current_conversation". Similarly #71 can be included in an additional field "saved_conversations". I am happy to do it, if @n3d1117 thinks it's worthwhile. But we have to discuss if it's feasable leaving it in JSONs and also in memory, as the usage numbers currently are. But that could be easily changed to I/O from the JSONs, but that might slow the bot down. Probably should be moved to a database if the amount of data we want to store is larger than the few usage numbers right now.
As an addition to this feature I want to suggest a command /opt_out that prevents saving the current conversations of the user.
from chatgpt-telegram-bot.
Thanks for the suggestion @dkvdm. I like the idea of keeping track of the conversations between deployments.
@AlexHTW good thinking. Not a big fan of adding a whole database though. For what it's worth, I just noticed python-telegram-bot
offers a few persistence solutions out of the box: https://github.com/python-telegram-bot/python-telegram-bot/wiki/Making-your-bot-persistent
Maybe the built-in PicklePersistence could be useful here, for storing data in binary format instead of plain json. Haven't tested it but I feel like it could be used to store usage data as well!
from chatgpt-telegram-bot.
A full look under the hood on how the webapp deals with sessions: https://github.com/terminalcommandnewsletter/everything-chatgpt
from chatgpt-telegram-bot.
Related Issues (20)
- When contacting the bot, an error occurs HOT 1
- bot unstart HOT 1
- how i can use plugins? HOT 3
- Enabling and using plugins HOT 16
- Can't change model from 3.5 to 4 HOT 1
- Contributions to this Repo HOT 1
- deepl plugin returns text in unicode escape sequence HOT 4
- Exception while handling an update: getattr():
- Deployment issues with fly.io
- Оооид
- Duck Duck Go Rate Limit HOT 1
- Update docker image in docker hub HOT 1
- Separate /image commands for Dall-E 2 and Dall-E 3
- audo ---> text HOT 1
- DDG HOT 3
- Everything worked and abruptly stopped working HOT 1
- Bugs in the operation of plugins: auto_tts, ddg_ddg_search, and ddg_images_earch (403, HttpError).
- stop or new dialog
- Add support for gpt-4-turbo-2024-04-09 HOT 1
- am i the only one facing this? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-telegram-bot.