Giter Club home page Giter Club logo

Comments (4)

xqdoo00o avatar xqdoo00o commented on June 19, 2024

右下角

from chatgpt-web.

Raytow avatar Raytow commented on June 19, 2024

from chatgpt-web.

xqdoo00o avatar xqdoo00o commented on June 19, 2024

自动的话,怎么确定要不要清呢,等我重设计好对话选项UI再看看

from chatgpt-web.

WhiteMagic2014 avatar WhiteMagic2014 commented on June 19, 2024

自动的话,怎么确定要不要清呢,等我重设计好对话选项UI再看看

这个我是这样解决的,比如我使用的model 是 3.5turbo,max token 4096个,每次调用 chat接口设定的 最大token长度是 500(加上本次的prompt) 估成600吧,4096/600 = 6.8 左右, 那么我按每次最大来算 极限存储 6次对话。这个次数随着模型max token,设置的单次长度 变化,估一个大概也可以
然后用一个队列来存储对话, 队列达到6以后 第一次对话记录出队列,为了防止特殊情况,当返回context_length_exceeded 的时候(token长度超了) 第一个对话出队列,同时再次请求一次。
https://github.com/WhiteMagic2014/WMagicBotR/blob/master/src/main/java/com/whitemagic2014/service/impl/ChatPGTServiceImpl.java
这个是我说的逻辑的java实现

from chatgpt-web.

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.