We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While using the LLM using OpenAI, we encountered the Bad request error.
const capiClient = new OpenAI({ baseURL: "https://api.githubcopilot.com/", apiKey: tokenForUser, headers: { "Copilot-Integration-Id": "copilot-chat" }, }); console.log("capiclient request"); const response = await capiClient.chat.completions.create({ stream: false, model: "gpt-4o", messages: [{ role: "user", content: "What is GitHub Copilot"}] });
Error Message
Once we replace the module function with fetch and hardcoded the Copilot-Integration-Id, it start working.
fetch
Copilot-Integration-Id
const copilotResponse = await fetch( "https://api.githubcopilot.com/chat/completions", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${tokenForUser}`, "Copilot-Integration-Id": "vscode-chat", }, body: JSON.stringify({ messages: [{ role: "user", content: "What is GitHub Copilot"}], max_tokens: 50, temperature: 0.5 }), } );
The text was updated successfully, but these errors were encountered:
No branches or pull requests
While using the LLM using OpenAI, we encountered the Bad request error.
Code Used
Error Message
Work-around
Once we replace the module function with
fetch
and hardcoded theCopilot-Integration-Id
, it start working.The text was updated successfully, but these errors were encountered: