<!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds support for free OpenRouter models and a new “Free (OpenRouter)” auto option that fails over across free models for reliability. Improves setup flow and UI with provider cards, a “Free” price badge, and an OpenRouter setup prompt in chat. - **New Features** - Added OpenRouter free models: Qwen3 Coder (free), DeepSeek v3 (free), DeepSeek v3.1 (free), marked with dollarSigns=0 and a “Free” badge. - New auto model: “Free (OpenRouter)” that uses a fallback client to cycle through free models with smart retry on transient errors. - New SetupProviderCard component and updated SetupBanner with dedicated Google and OpenRouter setup cards. - Chat shows an OpenRouter setup prompt when “Free (OpenRouter)” is selected and OpenRouter isn’t configured. - New PriceBadge component in ModelPicker to display “Free” or price tier. - E2E: added setup flow test and option to show the setup screen in tests. - Model updates: added DeepSeek v3.1, updated Kimi K2 to kimi-k2-0905, migrated providers to LanguageModelV2. <!-- End of auto-generated description by cubic. -->
21 lines
570 B
TypeScript
21 lines
570 B
TypeScript
import React from "react";
|
|
|
|
export function PriceBadge({
|
|
dollarSigns,
|
|
}: {
|
|
dollarSigns: number | undefined;
|
|
}) {
|
|
if (dollarSigns === undefined || dollarSigns === null) return null;
|
|
|
|
const label = dollarSigns === 0 ? "Free" : "$".repeat(dollarSigns);
|
|
|
|
const className =
|
|
dollarSigns === 0
|
|
? "text-[10px] text-primary border border-primary px-1.5 py-0.5 rounded-full font-medium"
|
|
: "text-[10px] bg-primary/10 text-primary px-1.5 py-0.5 rounded-full font-medium";
|
|
|
|
return <span className={className}>{label}</span>;
|
|
}
|
|
|
|
export default PriceBadge;
|