mirror of
https://github.com/willchen96/mike.git
synced 2026-06-24 21:38:06 +02:00
feat: add OpenAI model support and harden OSS security defaults
This commit is contained in:
parent
adc2cf2370
commit
bef75b082d
24 changed files with 1301 additions and 364 deletions
|
|
@ -11,11 +11,12 @@ import {
|
|||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { isModelAvailable } from "@/app/lib/modelAvailability";
|
||||
import type { ApiKeyState } from "@/app/lib/mikeApi";
|
||||
|
||||
export interface ModelOption {
|
||||
id: string;
|
||||
label: string;
|
||||
group: "Anthropic" | "Google";
|
||||
group: "Anthropic" | "Google" | "OpenAI";
|
||||
}
|
||||
|
||||
export const MODELS: ModelOption[] = [
|
||||
|
|
@ -23,21 +24,20 @@ export const MODELS: ModelOption[] = [
|
|||
{ id: "claude-sonnet-4-6", label: "Claude Sonnet 4.6", group: "Anthropic" },
|
||||
{ id: "gemini-3.1-pro-preview", label: "Gemini 3.1 Pro", group: "Google" },
|
||||
{ id: "gemini-3-flash-preview", label: "Gemini 3 Flash", group: "Google" },
|
||||
{ id: "gpt-5.5", label: "GPT-5.5", group: "OpenAI" },
|
||||
{ id: "gpt-5.4-mini", label: "GPT-5.4 Mini", group: "OpenAI" },
|
||||
];
|
||||
|
||||
export const DEFAULT_MODEL_ID = "gemini-3-flash-preview";
|
||||
|
||||
export const ALLOWED_MODEL_IDS = new Set(MODELS.map((m) => m.id));
|
||||
|
||||
const GROUP_ORDER: ModelOption["group"][] = ["Anthropic", "Google"];
|
||||
const GROUP_ORDER: ModelOption["group"][] = ["Anthropic", "Google", "OpenAI"];
|
||||
|
||||
interface Props {
|
||||
value: string;
|
||||
onChange: (id: string) => void;
|
||||
apiKeys?: {
|
||||
claudeApiKey: string | null;
|
||||
geminiApiKey: string | null;
|
||||
};
|
||||
apiKeys?: ApiKeyState;
|
||||
}
|
||||
|
||||
export function ModelToggle({ value, onChange, apiKeys }: Props) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue