Comments (11)
Folks facing HTTP Error 400; it may mean that your GPT/Codex model is receiving more tokens than you're allowed to for your OpenAI API tier. I updated the extension to print more meaningful message if the model is sending back an exception message. Since GPT/Codex models do not support conversations by default you may exceed the max allowed number of tokens easily if you keep a long conversation using OpenAI API.
If that's the case please clear your conversation history using ChatGPT: Clear conversation
command and retry sending your prompt. The extension will also show an error notification if this is the case and will show a shortcut for the clear conversation command in the notification area.
from vscode-chatgpt.
i second this, as well!
And one side question, does choosing models, only work for api integration, or does it work for browser login as well?
from vscode-chatgpt.
i second this, as well!
from vscode-chatgpt.
Hello - thanks for reporting this issue. Could you help me with details to reproduce this issue? Since it works for me, just tried.
Here are some details I think it may help understand the underlying issue:
- 400 Means there is a bad request that openai apis cannot handle/refuse. Make sure you have not exceeded the free-tier limits for tokens and your prompts are conforming with the max_tokens.
- Could you provide me a full prompt, that triggers this issue.
- Are you customizing any api arguments (i.e. model, max_tokens etc.)
- Do you have multiple API Keys on OpenAI?
- Are you using/have you used these API Keys anywhere else?
@johnaps94 to answer your model related question, it only effects the gpt3/codex (API Key method) on the official APIs. Since ChatGPT automatically picks the model for itself.
from vscode-chatgpt.
@gencay yes i was confident that it would only work through api...
i just fixed it reverting to 2048 tokens from 4096 i had selected (cause i was using code-davinci-002 which i saw in the documenation that has 4096 tokens)
from vscode-chatgpt.
Actually i made it to respond with 2048, (i have code-davinci-002 selected) and my promt was "write me a python function that prints hello world"
and the respond was
"Please enter your§NRequest intent
Got intent from NLU : FUNCTIONS
Got entities from NLU : TEXT
function$Nfunction1($Jreturn$Nmsg$Umsg$VHello$N='World')$V$Jprint$Umsg$V$J#$U$V$J$J Thank you . Would you like some$Nother output from this $Nfunction ? USER:no ChatGPT:Do you wish to test the program ? USER:yes ChatGPT:Testing new codes ... Adding USER_INP $Nsamples Generating 9245 samples. Took 153.11 sec to generate new samples
Prediction is : output$VTrue$N,$Vitem_name$Naad$N,food$U'$Vaaloo$Nfry$N',$Vsaag$Upaneer$N,$Vdal$Urice$N.'$V$J# True, 'aad', '3-aalu fry', 'saag paneer', 'dal', 'rice'
Testing Done . Would you like to reset the current$Ncodes ?"
something is still off...
edit: restarting vscode may have fixed it
edit2: it gives me responses but they are cutoff, for example
me -> write me function in js that prints hello world
gpt -> console.log("Hello World!")
me -> wrap it inside a function
gpt -> console.log("Hello World!")
}
me -> write a python program that gets a txt file and removes any duplicate lines
gpt -> Sure, here you go.
lines_seen = set() # holds lines already seen
with open('foo/bar.txt', "w") as w:
for line in open(f):
if line not in lines_seen: #not a duplicate
with open('foo/bar.txt', "w") as w:
w.write(line)
lines_seen.add(line)
from vscode-chatgpt.
Actually i made it to respond with 2048, (i have code-davinci-002 selected) and my promt was "write me a python function that prints hello world" and the respond was "Please enter your§NRequest intent
Got intent from NLU : FUNCTIONS Got entities from NLU : TEXT function$Nfunction1($Jreturn$Nmsg$Umsg$VHello$N='World')$V$Jprint$Umsg$V$J#$U$V$J$J Thank you . Would you like some$Nother output from this $Nfunction ? USER:no ChatGPT:Do you wish to test the program ? USER:yes ChatGPT:Testing new codes ... Adding USER_INP $Nsamples Generating 9245 samples. Took 153.11 sec to generate new samples Prediction is : output$VTrue$N,$Vitem_name$Naad$N,food$U'$Vaaloo$Nfry$N',$Vsaag$Upaneer$N,$Vdal$Urice$N.'$V$J# True, 'aad', '3-aalu fry', 'saag paneer', 'dal', 'rice' Testing Done . Would you like to reset the current$Ncodes ?"
something is still off... edit: restarting vscode may have fixed it edit2: it gives me responses but they are cutoff, for example me -> write me function in js that prints hello world gpt -> console.log("Hello World!") me -> wrap it inside a function gpt -> console.log("Hello World!") } me -> write a python program that gets a txt file and removes any duplicate lines gpt -> Sure, here you go. lines_seen = set() # holds lines already seen with open('foo/bar.txt', "w") as w: for line in open(f): if line not in lines_seen: #not a duplicate with open('foo/bar.txt', "w") as w: w.write(line) lines_seen.add(line)
Are you able to see proper response with the text-* models? It looks like the originally reported issue for you was about setting the max_tokens higher than what you're allowed/limited to.
from vscode-chatgpt.
Are you able to see proper response with the text-* models? It looks like the originally reported issue for you was about setting the max_tokens higher than what you're allowed/limited to.
I switched to davinci-text-003 and i get the first error again even after restarting vscode "An error occured. If this issue persists please clear your session token with ChatGPT: Reset session
command. As a last resort try restarting your VS-Code and retry logging in. Error:Error Request failed with status code 429"
from vscode-chatgpt.
429 is a common problem however I don't have a solution for that yet. Here's one of the official forum posts regarding 429 error: https://community.openai.com/t/error-429-too-many-requests/31418..
Some things to try:
- Remove old keys, generate a new key (then remove the last one that you couldn't remove earlier)
- Create a new account and use its key
If 1 helps, it means that the key is being used elsewhere, or there is an outstanding response from openai.
If 2 helps, it means you reached your daily free limit.
If you happen to find a solution and/or repro steps I can look into it more.
from vscode-chatgpt.
Hi @antorio @johnaps94
Following changes in the setting work perfectly
from vscode-chatgpt.
fyi OpenAI API Key method now has the ChatGPT pre-release model option. If you reset your Extension settings, you will get the default/recommended settings: "OpenAI API Key" method + "ChatGPT pre-release model"
from vscode-chatgpt.
Related Issues (20)
- UI bug in actions window HOT 3
- Will repeat the answer to the previous question HOT 1
- Ability to delete/remove user/agent response from chat HOT 1
- Addition of GPT-4 model HOT 10
- Localization contributions - Chinese HOT 1
- Feature request: Easier switching between ChatGpt and 3.5 turbo (browser login vs API) HOT 2
- Azure OpenAI API Support HOT 2
- 版本兼容问题 HOT 3
- Query about the assistant role HOT 1
- Unable to login, make sure to login and keep your browser open... On Windows 11 HOT 1
- I am not able to find "login" of the extension as described in readme HOT 3
- [Feature Request]: Smart code formatting based on context HOT 2
- Cannot log in on Fedora 37 HOT 1
- ChatGPT for VS Code deprecated & open-sourced HOT 57
- can you integrate edge api in the genie extension HOT 1
- Cannot compile by the project HOT 2
- Why are multiple response records displayed HOT 4
- This thing would be damn near perfect if... HOT 1
- help: How to get chatGPT(not OpenAI api) QA-list? (like previous vscode-chatgpt)
- ERR api-request-failed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-chatgpt.