From 716158a7dade0f1079230bc5f6e9c807c0b5d419 Mon Sep 17 00:00:00 2001 From: shlroland Date: Tue, 3 Jun 2025 17:34:35 +0800 Subject: [PATCH] fix: update baseURL to include current environment uriScheme --- src/api/providers/nutstore.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/providers/nutstore.ts b/src/api/providers/nutstore.ts index c09f39bfde8..c52b00f1c98 100644 --- a/src/api/providers/nutstore.ts +++ b/src/api/providers/nutstore.ts @@ -8,18 +8,20 @@ import { withRetry } from "../retry" import { createOpenRouterStream } from "../transform/openrouter-stream" import { ApiStream, ApiStreamUsageChunk } from "../transform/stream" import { OpenRouterErrorResponse } from "./types" +import * as vscode from "vscode" export class NutstoreHandler implements ApiHandler { private options: ApiHandlerOptions private client: OpenAI lastGenerationId?: string private host: string = "https://ai-assistant.jianguoyun.net.cn" + private uriScheme: string = vscode.env.uriScheme // private host: string = "http://localhost.eo2suite.cn:9000" constructor(options: ApiHandlerOptions) { this.options = options this.client = new OpenAI({ - baseURL: `${this.host}/cline/llm-router`, + baseURL: `${this.host}/cline-${this.uriScheme}/llm-router`, apiKey: "", // put AccessToken in header for verification defaultHeaders: { "HTTP-Referer": "https://cline.bot", // Optional, for including your app on openrouter.ai rankings.