|
| 1 | +import React from "react" |
| 2 | + |
| 3 | +import { OpenAiServiceTier, providerIdentifiers, type ModelInfo } from "@roo-code/types" |
| 4 | + |
| 5 | +import { TranslationContext } from "../../../i18n/TranslationContext" |
| 6 | +import { ModelInfoView } from "../ModelInfoView" |
| 7 | + |
| 8 | +const modelInfo: ModelInfo = { |
| 9 | + contextWindow: 400_000, |
| 10 | + maxTokens: 128_000, |
| 11 | + supportsImages: true, |
| 12 | + supportsPromptCache: true, |
| 13 | + inputPrice: 2, |
| 14 | + outputPrice: 8, |
| 15 | + cacheReadsPrice: 0.5, |
| 16 | + tiers: [ |
| 17 | + { |
| 18 | + name: OpenAiServiceTier.Flex, |
| 19 | + contextWindow: 400_000, |
| 20 | + inputPrice: 1, |
| 21 | + outputPrice: 4, |
| 22 | + cacheReadsPrice: 0.25, |
| 23 | + }, |
| 24 | + { |
| 25 | + name: OpenAiServiceTier.Priority, |
| 26 | + contextWindow: 400_000, |
| 27 | + inputPrice: 3.5, |
| 28 | + outputPrice: 14, |
| 29 | + cacheReadsPrice: 0.875, |
| 30 | + }, |
| 31 | + ], |
| 32 | +} |
| 33 | + |
| 34 | +const translations: Record<string, string> = { |
| 35 | + "settings:modelInfo.contextWindow": "Context window:", |
| 36 | + "settings:modelInfo.maxOutput": "Max output", |
| 37 | + "settings:modelInfo.supportsImages": "Supports images", |
| 38 | + "settings:modelInfo.noImages": "Does not support images", |
| 39 | + "settings:modelInfo.supportsPromptCache": "Supports prompt caching", |
| 40 | + "settings:modelInfo.noPromptCache": "Does not support prompt caching", |
| 41 | + "settings:serviceTier.pricingTableTitle": "Service tier pricing (per 1M tokens)", |
| 42 | + "settings:serviceTier.columns.tier": "Tier", |
| 43 | + "settings:serviceTier.columns.input": "Input", |
| 44 | + "settings:serviceTier.columns.output": "Output", |
| 45 | + "settings:serviceTier.columns.cacheReads": "Cache reads", |
| 46 | + "settings:serviceTier.standard": "Standard", |
| 47 | + "settings:serviceTier.flex": "Flex", |
| 48 | + "settings:serviceTier.priority": "Priority", |
| 49 | +} |
| 50 | + |
| 51 | +export const ModelInfoViewFixture = () => ( |
| 52 | + <TranslationContext.Provider |
| 53 | + value={{ |
| 54 | + t: (key) => translations[key] ?? key, |
| 55 | + i18n: null as unknown as typeof import("../../../i18n/setup").default, |
| 56 | + }}> |
| 57 | + <div className="w-[480px] bg-vscode-editor-background p-4 text-vscode-foreground"> |
| 58 | + <ModelInfoView |
| 59 | + apiProvider={providerIdentifiers.openaiNative} |
| 60 | + selectedModelId="gpt-5.2" |
| 61 | + modelInfo={modelInfo} |
| 62 | + isDescriptionExpanded={false} |
| 63 | + setIsDescriptionExpanded={() => {}} |
| 64 | + /> |
| 65 | + </div> |
| 66 | + </TranslationContext.Provider> |
| 67 | +) |
0 commit comments