(state: State, vision: boolean = false)
| 18 | "https://api.githubcopilot.com" |
| 19 | : `https://api.${state.accountType}.githubcopilot.com` |
| 20 | export const copilotHeaders = (state: State, vision: boolean = false) => { |
| 21 | const headers: Record<string, string> = { |
| 22 | Authorization: `Bearer ${state.copilotToken}`, |
| 23 | "content-type": standardHeaders()["content-type"], |
| 24 | "copilot-integration-id": "vscode-chat", |
| 25 | "editor-version": `vscode/${state.vsCodeVersion}`, |
| 26 | "editor-plugin-version": EDITOR_PLUGIN_VERSION, |
| 27 | "user-agent": USER_AGENT, |
| 28 | "openai-intent": "conversation-panel", |
| 29 | "x-github-api-version": API_VERSION, |
| 30 | "x-request-id": randomUUID(), |
| 31 | "x-vscode-user-agent-library-version": "electron-fetch", |
| 32 | } |
| 33 | |
| 34 | if (vision) headers["copilot-vision-request"] = "true" |
| 35 | |
| 36 | return headers |
| 37 | } |
| 38 | |
| 39 | export const GITHUB_API_BASE_URL = "https://api.github.com" |
| 40 | export const githubHeaders = (state: State) => ({ |
no test coverage detected
searching dependent graphs…