Code Monkey home page Code Monkey logo

Comments (10)

npiv avatar npiv commented on July 26, 2024 1

Also, does chatgpt not store the collection on its server somehow? Intuitively, I would have thought we just have to provide the session and a new prompt, and it has all the previous prompts and answers for that session saved. Is this not the case?

No. That's now how it works. Every time you send it a message its completely stateless. Thats just the nature of the large language model. So we provide context ourselves. This is also how openAI does it, each time you add to a conversation on their website it sends the whole thread to the language model.

So if you want to send everything across for context use -S, if not don't.

If you want to check how big your current conversation has gotten, and everything in it, just use -S with -t and no query. It will show you the whole convo, how many tokens, and an estimated cost.

from chatblade.

fritzrehde avatar fritzrehde commented on July 26, 2024 1

The only information I have on -e is:

-e, --extract                   extract content from response if possible (either json or code block)

I don't see how this help line explains how it fixes the issues I had. And even if you say it does, then maybe you should change this line from the help menu.

from chatblade.

fritzrehde avatar fritzrehde commented on July 26, 2024

I also just got the error

openai error: This model's maximum context length is 4097 tokens. However, your messages resulted in 4108 tokens. Please reduce the length of the messages.

Is this because openai is always sending back all the previous messages? This seems quite limiting, as I can't continue to have a conversation forever, as I will end up with this error anyways at some point.

from chatblade.

npiv avatar npiv commented on July 26, 2024

Hi @fritzrehde,

With regards to the 2nd question, that is your choice. If you use sessions then yes it will send everything back to openAI. Thats how the chats work on the website as well. It is the only way the GPT model has a notion of context. The newer model gpt-4 has a larger max context but is also more pricey.

If however you don't care about the context, then don't use the sessions ofc.

The first question I will have a look at, and provide a fix today/tomorrow

from chatblade.

fritzrehde avatar fritzrehde commented on July 26, 2024

Does the interactive session work differently to using a session throughout multiple chatblade instances? Is there also a "limit" with the session in the interactive mode?

from chatblade.

fritzrehde avatar fritzrehde commented on July 26, 2024

Also, does chatgpt not store the collection on its server somehow? Intuitively, I would have thought we just have to provide the session and a new prompt, and it has all the previous prompts and answers for that session saved. Is this not the case?

from chatblade.

fritzrehde avatar fritzrehde commented on July 26, 2024

Actually, this thought just occured to me: Maybe I am getting the openai error because the payload sent to me is too large. I had naively assumed that the payload I was sending to the chatgpt (i.e. all the queries and responses of the specified session) would be sent to the api. If the former is the case, then just fixing that chatblade doesn't send back all previous responses as well might fix this?

from chatblade.

npiv avatar npiv commented on July 26, 2024

With regards to first question I think -e actually does what you want

from chatblade.

fritzrehde avatar fritzrehde commented on July 26, 2024

You're right though, it does fix my issue. I would, however, be curious to understand why it fixes it.

from chatblade.

fritzrehde avatar fritzrehde commented on July 26, 2024

Actually,

chatblade \
	--session "$SESSION_NAME" \
	--stream \
	--extract \
	--raw \
	--no-format \
	--only \
	"$query"

now has a different, maybe related, bug: Now it shows the response stream, but once the stream is done, the first part of the response is no longer visible.

from chatblade.

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.