Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we need truncate strategy options for GPT/Completions? #11

Open
mrsteele opened this issue Aug 7, 2023 · 2 comments
Open

Do we need truncate strategy options for GPT/Completions? #11

mrsteele opened this issue Aug 7, 2023 · 2 comments

Comments

@mrsteele
Copy link
Owner

mrsteele commented Aug 7, 2023

Currently the module removes them in pairs. This is because the assumed format is as follows:

  system: You are a bot...
+ user: Hello, how are you?
- assistant: I am good, how about yourself?
+ user: Good. I have a question
- assistant: What is your question?
+ user: Can I have a pony?

You will see that if we had a strict limit above, the context would be well maintained by removing the earliest pair like so:

  system: You are a bot...
+ user: Good. I have a question
- assistant: What is your question?
+ user: Can I have a pony?

But I'm curious if this doesn't fit everyone's use-case. Any feedback would be appreciated if this doesn't work for your intended use of the module.

(I used this cheat sheet to help with colors for anyone else interested)

@mrahmadt
Copy link

mrahmadt commented Sep 5, 2023

I think this is good

I was worried about function messages but after thinking about it, function messages are not worth to be included in the history

Another strategy that could be even better as another option in the library is to use openAI to summarize the conversation

Example if the history reach 2000 token the. Send the history to OpenAI and ask it to summarize the conversation to x words and to keep only the useful information in the history (maybe even to return bullet points of important information in the history)

@mrsteele
Copy link
Owner Author

mrsteele commented Sep 5, 2023

Good thought @mrahmadt . Glad you and I are both thinking about this 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants