From 99f6024026bf8c4180ffc9626521737755178e09 Mon Sep 17 00:00:00 2001 From: camilleislasse Date: Sat, 1 Nov 2025 11:42:05 +0100 Subject: [PATCH] Add Gemini 2.0 Flash Thinking model support - Add Google Gemini 2.0 Flash Thinking as an available model - Free tier available with extended thinking capabilities - Add GOOGLE_API_KEY to .env.example for easy setup - Users can get a free API key at https://aistudio.google.com/apikey --- chat-client/.env.example | 1 + chat-client/ai/providers.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/chat-client/.env.example b/chat-client/.env.example index f4bc1cb..fd8a69a 100644 --- a/chat-client/.env.example +++ b/chat-client/.env.example @@ -1,3 +1,4 @@ # API Keys (Optional - can also be set via UI settings) ANTHROPIC_API_KEY=sk-ant-... OPENAI_API_KEY=sk-... +GOOGLE_API_KEY=AIza... diff --git a/chat-client/ai/providers.ts b/chat-client/ai/providers.ts index 3fd4365..347464e 100644 --- a/chat-client/ai/providers.ts +++ b/chat-client/ai/providers.ts @@ -1,5 +1,6 @@ import { createOpenAI } from "@ai-sdk/openai"; import { createAnthropic } from "@ai-sdk/anthropic"; +import { createGoogleGenerativeAI } from "@ai-sdk/google"; import { customProvider, @@ -43,12 +44,16 @@ const anthropicClient = createAnthropic({ apiKey: getApiKey('ANTHROPIC_API_KEY'), }); +const googleClient = createGoogleGenerativeAI({ + apiKey: getApiKey('GOOGLE_API_KEY'), +}); // const xaiClient = createXai({ // apiKey: getApiKey('XAI_API_KEY'), // }); const languageModels = { + "gemini-2-flash-thinking": googleClient("gemini-2.0-flash-thinking-exp-01-21"), "gpt-5": openaiClient("gpt-5-2025-08-07"), "claude-4-sonnet": anthropicClient('claude-sonnet-4-20250514'), // "qwen-qwq": wrapLanguageModel( @@ -61,6 +66,13 @@ const languageModels = { }; export const modelDetails: Record = { + "gemini-2-flash-thinking": { + provider: "Google", + name: "Gemini 2.0 Flash Thinking", + description: "Google's reasoning model with extended thinking capabilities. Free tier available.", + apiVersion: "gemini-2.0-flash-thinking-exp-01-21", + capabilities: ["Deep Reasoning", "Thinking", "Free", "Agentic"] + }, "gpt-5": { provider: "OpenAI", name: "GPT-5",