Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2220,18 +2220,17 @@ export class ClineProvider implements vscode.WebviewViewProvider {

if (response.data) {
const rawModels: Record<string, any> = response.data

for (const [modelId, model] of Object.entries(rawModels)) {
models[modelId] = {
maxTokens: model.maxTokens ? parseInt(model.maxTokens) : undefined,
contextWindow: model.contextWindow ? parseInt(model.contextWindow) : 0,
supportsImages: model.supportsImages ?? false,
supportsPromptCache: model.supportsPromptCaching ?? false,
supportsComputerUse: model.supportsComputerUse ?? false,
inputPrice: model.inputTokenPrice ? parseFloat(model.inputTokenPrice) : undefined,
outputPrice: model.outputTokenPrice ? parseFloat(model.outputTokenPrice) : undefined,
cacheWritesPrice: model.cacheWritePrice ? parseFloat(model.cacheWritePrice) : undefined,
cacheReadsPrice: model.cacheReadPrice ? parseFloat(model.cacheReadPrice) : undefined,
maxTokens: model?.maxTokens ? parseInt(model.maxTokens) : undefined,
contextWindow: model?.contextWindow ? parseInt(model.contextWindow) : 0,
supportsImages: model?.supportsImages ?? false,
supportsPromptCache: model?.supportsPromptCaching ?? false,
supportsComputerUse: model?.supportsComputerUse ?? false,
inputPrice: model?.inputTokenPrice ? parseFloat(model.inputTokenPrice) : undefined,
outputPrice: model?.outputTokenPrice ? parseFloat(model.outputTokenPrice) : undefined,
cacheWritesPrice: model?.cacheWritePrice ? parseFloat(model.cacheWritePrice) : undefined,
cacheReadsPrice: model?.cacheReadPrice ? parseFloat(model.cacheReadPrice) : undefined,
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion webview-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"build-storybook": "storybook build"
},
"dependencies": {
"@radix-ui/react-alert-dialog": "^1.1.6",
"@radix-ui/react-collapsible": "^1.1.3",
"@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-dropdown-menu": "^2.1.5",
Expand All @@ -23,7 +24,7 @@
"@radix-ui/react-progress": "^1.1.2",
"@radix-ui/react-separator": "^1.1.2",
"@radix-ui/react-slider": "^1.2.3",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-tooltip": "^1.1.8",
"@tailwindcss/vite": "^4.0.0",
"@vscode/webview-ui-toolkit": "^1.4.0",
Expand Down
17 changes: 6 additions & 11 deletions webview-ui/src/components/settings/ApiConfigManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ApiConfigMeta } from "../../../../src/shared/ExtensionMessage"
import { Dropdown } from "vscrui"
import type { DropdownOption } from "vscrui"
import { Dialog, DialogContent, DialogTitle } from "../ui/dialog"
import { Button, Input } from "../ui"

interface ApiConfigManagerProps {
currentApiConfigName?: string
Expand Down Expand Up @@ -299,10 +300,7 @@ const ApiConfigManager = ({
aria-labelledby="new-profile-title">
<DialogContent className="p-4 max-w-sm">
<DialogTitle>New Configuration Profile</DialogTitle>
<button className="absolute right-4 top-4" aria-label="Close dialog" onClick={resetCreateState}>
<span className="codicon codicon-close" />
</button>
<VSCodeTextField
<Input
ref={newProfileInputRef}
value={newProfileName}
onInput={(e: unknown) => {
Expand All @@ -327,15 +325,12 @@ const ApiConfigManager = ({
</p>
)}
<div className="flex justify-end gap-2 mt-4">
<VSCodeButton appearance="secondary" onClick={resetCreateState}>
<Button variant="secondary" onClick={resetCreateState}>
Cancel
</VSCodeButton>
<VSCodeButton
appearance="primary"
disabled={!newProfileName.trim()}
onClick={handleNewProfileSave}>
</Button>
<Button variant="default" disabled={!newProfileName.trim()} onClick={handleNewProfileSave}>
Create Profile
</VSCodeButton>
</Button>
</div>
</DialogContent>
</Dialog>
Expand Down
Loading
Loading