This commit is contained in:
Dennis Bartlett 2025-02-28 14:06:00 -08:00
parent 9232d752b2
commit dfeb57d3af
4 changed files with 10 additions and 6 deletions

View file

@ -2,7 +2,13 @@ import { Anthropic } from "@anthropic-ai/sdk"
import OpenAI from "openai"
import { withRetry } from "../retry"
import { calculateApiCostOpenAI } from "../../utils/cost"
import { ApiHandlerOptions, ModelInfo, openAiModelInfoSaneDefaults, requestyDefaultModelId, requestyDefaultModelInfo } from "../../shared/api"
import {
ApiHandlerOptions,
ModelInfo,
openAiModelInfoSaneDefaults,
requestyDefaultModelId,
requestyDefaultModelInfo,
} from "../../shared/api"
import { ApiHandler } from "../index"
import { convertToOpenAiMessages } from "../transform/openai-format"
import { ApiStream } from "../transform/stream"

View file

@ -542,7 +542,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
telemetryService.updateTelemetryState(isOptedIn)
})
// post last cached models in case the call to endpoint fails
this.readDynamicProviderModels(GlobalFileNames.requestyModels).then((requestyModels) => {
if (requestyModels) {
@ -552,7 +551,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
})
}
})
// gui relies on model info to be up-to-date to provide the most accurate pricing, so we need to fetch the latest details on launch.
// we do this for all users since many users switch between api providers and if they were to switch back to openrouter it would be showing outdated model info if we hadn't retrieved the latest at this point
// (see normalizeApiConfiguration > openrouter)
@ -569,7 +568,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
}
}
})
break
case "newTask":
// Code that should run in response to the hello message command

View file

@ -905,4 +905,3 @@ export const xaiModels = {
description: "X AI's Grok Beta model (legacy) with 131K context window",
},
} as const satisfies Record<string, ModelInfo>

View file

@ -18,7 +18,7 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
customInstructions,
setCustomInstructions,
openRouterModels,
requestyModels,
requestyModels,
telemetrySetting,
setTelemetrySetting,
} = useExtensionState()