@@ -15,19 +15,26 @@ const API_VERSION = "2025-04-01"
1515
1616export const copilotBaseUrl = ( state : State ) =>
1717 `https://api.${ state . accountType } .githubcopilot.com`
18- export const copilotHeaders = ( state : State ) => ( {
19- Authorization : `Bearer ${ state . copilotToken } ` ,
20- "content-type" : standardHeaders ( ) [ "content-type" ] ,
21- "copilot-integration-id" : "vscode-chat" ,
22- "editor-version" : `vscode/${ state . vsCodeVersion } ` ,
23- "editor-plugin-version" : EDITOR_PLUGIN_VERSION ,
24- "user-agent" : USER_AGENT ,
25- "openai-intent" : "conversation-panel" ,
26- "x-github-api-version" : API_VERSION ,
27- "x-request-id" : randomUUID ( ) ,
28- "x-vscode-user-agent-library-version" : "electron-fetch" ,
29- "copilot-vision-request" : state . visionEnabled ? "true" : "false" ,
30- } )
18+ export const copilotHeaders = ( state : State ) => {
19+ const headers : Record < string , string > = {
20+ Authorization : `Bearer ${ state . copilotToken } ` ,
21+ "content-type" : standardHeaders ( ) [ "content-type" ] ,
22+ "copilot-integration-id" : "vscode-chat" ,
23+ "editor-version" : `vscode/${ state . vsCodeVersion } ` ,
24+ "editor-plugin-version" : EDITOR_PLUGIN_VERSION ,
25+ "user-agent" : USER_AGENT ,
26+ "openai-intent" : "conversation-panel" ,
27+ "x-github-api-version" : API_VERSION ,
28+ "x-request-id" : randomUUID ( ) ,
29+ "x-vscode-user-agent-library-version" : "electron-fetch" ,
30+ }
31+
32+ if ( state . visionEnabled ) {
33+ headers [ "copilot-vision-request" ] = "true"
34+ }
35+
36+ return headers
37+ }
3138
3239export const GITHUB_API_BASE_URL = "https://api.github.com"
3340export const githubHeaders = ( state : State ) => ( {
0 commit comments