Skip to content

Commit a897bf6

Browse files
committed
nes: fix: use custom url & api key only if set; otherwise, use proxy
1 parent 4bd311c commit a897bf6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/extension/xtab/node/xtabProvider.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import { RequestType } from '@vscode/copilot-api';
67
import { Raw } from '@vscode/prompt-tsx';
78
import { ChatCompletionContentPartKind } from '@vscode/prompt-tsx/dist/base/output/rawTypes';
89
import { FetchStreamSource } from '../../../platform/chat/common/chatMLFetcher';
@@ -1068,7 +1069,7 @@ export class XtabProvider implements IStatelessNextEditProvider {
10681069
const endpoint = this.instaService.createInstance(ChatEndpoint, {
10691070
id: modelName,
10701071
name: 'nes.nextCursorPosition',
1071-
urlOrRequestMetadata: url,
1072+
urlOrRequestMetadata: url ? url : { type: RequestType.ProxyChatCompletions },
10721073
model_picker_enabled: false,
10731074
is_chat_default: false,
10741075
is_chat_fallback: false,
@@ -1095,9 +1096,9 @@ export class XtabProvider implements IStatelessNextEditProvider {
10951096
debugName: 'nes.nextCursorPosition',
10961097
finishedCb: undefined,
10971098
location: ChatLocation.Other,
1098-
requestOptions: {
1099+
requestOptions: secretKey ? {
10991100
secretKey,
1100-
}
1101+
} : undefined,
11011102
},
11021103
CancellationToken.None
11031104
);

0 commit comments

Comments
 (0)