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

Reduce the length of message #11

Closed
knight42 opened this issue Mar 29, 2023 · 2 comments
Closed

Reduce the length of message #11

knight42 opened this issue Mar 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@knight42
Copy link
Owner

I encountered an error today:

Error: create completion: error, This model's maximum context length is 4097 tokens. However, your messages resulted in 5515 tokens. Please reduce the length of the messages.

I can think of 2 options to solve it:

  1. truncate the message to maxium length
  2. prune the object, like only send the status field and related events
@knight42 knight42 added the bug Something isn't working label Mar 29, 2023
@pacoxu
Copy link

pacoxu commented Mar 30, 2023

There are some defaulting filed that can be omitted, such as terminationGracePeriodSeconds. We may need to check the yaml.

  • for pods, ss I know the kubectl-apply annotation is very big.
  • for nodes, the status.image is large but useless.

@knight42
Copy link
Owner Author

@pacoxu Hi, I have filed #12 to remove node.status.image, metadata.{labels,annotations} from the object before submiting it to gpt api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants