GithubHelp home page GithubHelp logo

Comments (4)

dkvdm avatar dkvdm commented on May 18, 2024 1

Pickling is great, and super simple as you can just save/load python data structures, I love it.

from chatgpt-telegram-bot.

AlexHTW avatar AlexHTW commented on May 18, 2024

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.

n3d1117 avatar n3d1117 commented on May 18, 2024

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.

dkvdm avatar dkvdm commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.