mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
30 lines
763 B
TypeScript
30 lines
763 B
TypeScript
"use client";
|
|
|
|
import { useState } from "react";
|
|
import { useLocalStorage } from "usehooks-ts";
|
|
|
|
export function SelectLLMProvider() {
|
|
const [llmProvider, setLLMProvider] = useLocalStorage<string | null>(
|
|
"llmProvider",
|
|
"openai",
|
|
);
|
|
// const [llmProvider, setLLMProvider] = useState<string | null>("openai");
|
|
|
|
return (
|
|
<div className="flex gap-2">
|
|
<button
|
|
onClick={() => setLLMProvider("openai")}
|
|
className={`${llmProvider === "openai" ? "bg-blue-500" : "bg-gray-200"}`}
|
|
>
|
|
OpenAI
|
|
</button>
|
|
<button
|
|
onClick={() => setLLMProvider("anthropic")}
|
|
className={`${llmProvider === "anthropic" ? "bg-blue-500" : "bg-gray-200"}`}
|
|
>
|
|
Anthropic
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|