mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: using base url sent from the frontend
This commit is contained in:
parent
5148255975
commit
30f7c00983
3 changed files with 15 additions and 5 deletions
|
|
@ -30,8 +30,9 @@ export const handleUri = async (uri: vscode.Uri) => {
|
|||
}
|
||||
case "/requesty": {
|
||||
const code = query.get("code")
|
||||
const baseUrl = query.get("baseUrl")
|
||||
if (code) {
|
||||
await visibleProvider.handleRequestyCallback(code)
|
||||
await visibleProvider.handleRequestyCallback(code, baseUrl)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ import type { ClineMessage } from "@roo-code/types"
|
|||
import { readApiMessages, saveApiMessages, saveTaskMessages } from "../task-persistence"
|
||||
import { getNonce } from "./getNonce"
|
||||
import { getUri } from "./getUri"
|
||||
import { REQUESTY_BASE_URL } from "../../shared/utils/requesty"
|
||||
|
||||
/**
|
||||
* https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/default/weather-webview/src/providers/WeatherViewProvider.ts
|
||||
|
|
@ -1456,14 +1457,22 @@ export class ClineProvider
|
|||
|
||||
// Requesty
|
||||
|
||||
async handleRequestyCallback(code: string) {
|
||||
const { apiConfiguration } = await this.getState()
|
||||
async handleRequestyCallback(code: string, baseUrl: string | null) {
|
||||
let { apiConfiguration } = await this.getState()
|
||||
|
||||
const newConfiguration: ProviderSettings = {
|
||||
...apiConfiguration,
|
||||
apiProvider: "requesty",
|
||||
requestyApiKey: code,
|
||||
requestyModelId: requestyDefaultModelId,
|
||||
requestyModelId: apiConfiguration?.requestyModelId || requestyDefaultModelId,
|
||||
}
|
||||
|
||||
// set baseUrl as undefined if we don't provide one
|
||||
// or if it is the default requesty url
|
||||
if (!baseUrl || baseUrl === REQUESTY_BASE_URL) {
|
||||
newConfiguration.requestyBaseUrl = undefined
|
||||
} else {
|
||||
newConfiguration.requestyBaseUrl = baseUrl
|
||||
}
|
||||
|
||||
await this.upsertProviderProfile("Requesty", newConfiguration)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
const REQUESTY_BASE_URL = "https://router.requesty.ai/v1"
|
||||
export const REQUESTY_BASE_URL = "https://router.requesty.ai/v1"
|
||||
|
||||
type URLType = "router" | "app" | "api"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue