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

Token exceeded from 128000 #57

Open
agn-7 opened this issue Mar 7, 2024 · 1 comment
Open

Token exceeded from 128000 #57

agn-7 opened this issue Mar 7, 2024 · 1 comment

Comments

@agn-7
Copy link

agn-7 commented Mar 7, 2024

I wanted to test this extension on my local, however, I encountered the following error!

I also test with the different current pages like google, bing, github, etc.

Error:
This model's maximum context length is 128000 tokens. However, your messages resulted in 133758 tokens. Please reduce the length of the messages.

2024-03-06_18-24

@agn-7
Copy link
Author

agn-7 commented Mar 11, 2024

I also checked the inspect->console and I saw the following error as well:

Refused to set unsafe header "User-Agent"

Then I came up with the issue via the following code changes:

  // const openai = new OpenAIApi(
  //   new Configuration({
  //     apiKey: key,
  //   })
  // );

  // This hardcodes insertion of 'User-Agent'
  let config = new Configuration({ apiKey: key,});
  delete config.baseOptions.headers['User-Agent'];
  const openai = new OpenAIApi(config);

But still, the maximum token issue exists from openai API response with status 400!

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

1 participant