Skip to content

Conversation

neoragex2002
Copy link
Contributor

@neoragex2002 neoragex2002 commented Sep 11, 2025

feat: add GoogleSearch support for Gemini provider

Summary by CodeRabbit

  • New Features

    • Added an internet search toggle for supported Gemini models in Model Settings; several Gemini models now have search disabled by default.
    • Gemini responses now stream richer content (tool-call updates, reasoning chunks, images) and include safety settings for controlled outputs.
    • Added Gemini-specific thinking budget validation with contextual hints and localized messages.
  • Refactor

    • Unified Gemini request/configuration and tool handling for consistent behavior across completions, summaries, and suggestions.

Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Walkthrough

Adds explicit enableSearch: false to several Gemini model entries; introduces a Gemini internet-search toggle and thinkingBudget validation in the ModelConfig dialog; and refactors the Gemini provider to use GenerateContentConfig, streaming generateContentStream, tool integration, and mapped safety settings.

Changes

Cohort / File(s) Summary
Config: Gemini model flags
src/main/presenter/configPresenter/providerModelSettings.ts
Adds enableSearch: false to eight Gemini model entries (explicitly sets previously-undefined flag).
Provider: Gemini refactor to GenerateContentConfig + streaming
src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts
Replaces GenerationConfig usage with GenerateContentConfig; centralizes config construction via getGenerateContentConfig; integrates tools (GoogleSearch when enableSearch, or converted MCP tools); maps safety settings; switches to generateContentStream with rich event streaming and dedicated image-generation stream path; updates message/tool-call formatting.
UI: Model config dialog updates
src/renderer/src/components/settings/ModelConfigDialog.vue
Adds Gemini-only internet search toggle bound to enableSearch, showGeminiSearch computed flag, thinkingBudget defaults and validation, and includes enableSearch in initial ModelConfig usage (ModelConfig type extended accordingly).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as ModelConfigDialog
  participant Presenter as ConfigPresenter
  participant Provider as GeminiProvider
  participant GenAI as Google GenAI API

  rect rgba(230,240,255,0.5)
    User->>UI: Open model settings
    UI->>Presenter: Load model config
    UI-->>User: Show enableSearch (Gemini only)
    User->>UI: Toggle enableSearch / set thinkingBudget
    UI->>Presenter: Save updated config (enableSearch, thinkingBudget)
  end

  rect rgba(240,255,240,0.5)
    User->>Provider: Send messages
    Provider->>Provider: getGenerateContentConfig(messages, modelConfig)
    alt enableSearch = true
      Provider->>Provider: Add GoogleSearch tool
    else enableSearch = false
      Provider->>Provider: Convert MCP tools -> Gemini tools
    end
    Provider->>Provider: Map safety settings -> HarmBlockThreshold/Category
    Provider->>GenAI: generateContentStream(model, contents, config)
    loop Stream
      GenAI-->>Provider: text/reasoning/toolCall/image/usage chunks
      Provider-->>User: Emit chunk events
    end
    GenAI-->>Provider: done
    Provider-->>User: stop
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant Provider as GeminiProvider
  participant GenAI as Google GenAI API

  Note over User,Provider: Image generation path
  User->>Provider: Prompt with image generation intent
  Provider->>Provider: Validate user content for image gen
  Provider->>GenAI: generateContentStream(..., config)
  loop Stream
    GenAI-->>Provider: text chunk / image data
    Provider-->>User: Emit text/imageData events
  end
  Provider-->>User: stop
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • zerob13

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The current PR description is just a one-line title and does not follow the repository's required template; it lacks the problem statement, a detailed solution description, UI/UX notes or screenshots, platform compatibility/testing notes, migration/backwards-compatibility details, and reviewer guidance. The raw changes touch provider logic, model configuration, and the settings UI and therefore require explicit documentation so reviewers can assess behavior, defaults, and safety implications. Because these required sections are missing or empty, the description is insufficient for a proper review and does not meet the template. Please update the PR description to follow the repository template by adding a clear problem statement and a concise solution summary that lists the files and behavioral changes (geminiProvider streaming and tool integration, enableSearch model config, ModelConfigDialog UI and thinkingBudget validation), include UI screenshots or GIFs for the settings change, provide platform compatibility and testing notes, state default behavior and any migration or backwards-compatibility implications, and indicate recommended review focus areas and manual test steps so reviewers can validate the change quickly. Also add relevant labels and suggested reviewers if available.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title succinctly and accurately describes the main change — adding GoogleSearch support for the Gemini provider — and aligns with the changes in provider logic, model configuration, and the UI toggle shown in the changeset. It is concise, uses a conventional "feat:" prefix, and contains no extraneous details or noise, so a reviewer scanning history can quickly understand the primary intent. Therefore the title appropriately summarizes the main change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I twitched my whiskers, flipped a switch,
Search on or off, a tidy stitch.
Streams now hum and tools parade,
Thought budgets set, no steps mislaid.
Hop on—Gemini wakes, unafraid. 🐇✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cc19c7 and 87c3e01.

📒 Files selected for processing (1)
  • src/renderer/src/components/settings/ModelConfigDialog.vue (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/settings/ModelConfigDialog.vue
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (1)

376-383: Bug: comparing enum to string in safety settings filter

threshold is a HarmBlockThreshold enum, but compared to string literals; the condition is never as intended. Compare against enum members and don’t rely on truthiness.

-        // Only add if threshold is defined, category is defined, and threshold is not BLOCK_NONE
-        if (
-          threshold &&
-          category &&
-          threshold !== 'BLOCK_NONE' &&
-          threshold !== 'HARM_BLOCK_THRESHOLD_UNSPECIFIED'
-        ) {
-          safetySettings.push({ category, threshold })
-        }
+        // Only add if category is defined and threshold is not NONE/UNSPECIFIED
+        if (
+          category !== undefined &&
+          threshold !== undefined &&
+          threshold !== null &&
+          threshold !== HarmBlockThreshold.BLOCK_NONE &&
+          threshold !== HarmBlockThreshold.HARM_BLOCK_THRESHOLD_UNSPECIFIED
+        ) {
+          safetySettings.push({ category, threshold })
+        }
🧹 Nitpick comments (6)
src/renderer/src/components/settings/ModelConfigDialog.vue (2)

275-286: Add capability gating for Gemini search toggle

Avoid showing the toggle on unsupported/image models. Gate by model type and functionCall.

-          <div v-if="showGeminiSearch" class="space-y-4">
+          <div v-if="showGeminiSearch" class="space-y-4">

And update the computed below (see next comment).


456-489: Use English for new/changed comments

New comments in this PR are in Chinese. Repo guideline: logs/comments in English. Please convert newly added comments to English (existing legacy comments can be cleaned up separately).

Also applies to: 508-523

src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (4)

298-306: Use a known-available model in provider check()

models/gemini-1.5-flash-8b may not exist in all accounts/regions. Use a static known ID or the first recommended model to reduce false negatives.

-      const result = await this.genAI.models.generateContent({
-        model: 'models/gemini-1.5-flash-8b',
+      const result = await this.genAI.models.generateContent({
+        model: GeminiProvider.GEMINI_MODELS[0].id,
         contents: [{ role: 'user', parts: [{ text: 'Hello' }] }]
       })

943-943: Downgrade verbose logs or guard behind DEBUG

Dumping entire request/response candidates is noisy and may leak context. Wrap with a debug guard.

-    console.log('requestParams', requestParams)
+    if (process.env.LOG_LEVEL === 'DEBUG') console.debug('requestParams', requestParams)
-      console.log('chunk.candidates', JSON.stringify(chunk.candidates, null, 2))
+      if (process.env.LOG_LEVEL === 'DEBUG') {
+        console.debug('chunk.candidates', JSON.stringify(chunk.candidates, null, 2))
+      }

Also applies to: 962-962


512-535: Tool response mapping likely incorrect for Gemini

When handling tool messages (function_response), you’re pushing a text part. Gemini expects a functionResponse part with name + structured response. This can hurt follow-up turns.

Example adjustment inside the tool branch:

  • build parts.push({ functionResponse: { name, response: {...} } })
  • keep user role for functionResponse as you already do elsewhere.

I can propose a concrete patch if you share the exact tool message shape emitted upstream.


964-981: Tool call event ID generation

Using Date.now() risks collisions and makes correlating multiple calls harder. Prefer a monotonic counter or include function name + index.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70e9447 and 0cc19c7.

📒 Files selected for processing (3)
  • src/main/presenter/configPresenter/providerModelSettings.ts (8 hunks)
  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (9 hunks)
  • src/renderer/src/components/settings/ModelConfigDialog.vue (2 hunks)
🧰 Additional context used
📓 Path-based instructions (17)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development-setup.mdc)

**/*.{js,jsx,ts,tsx}: 使用 OxLint 进行代码检查
Log和注释使用英文书写

Files:

  • src/main/presenter/configPresenter/providerModelSettings.ts
  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts
src/{main,renderer}/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/electron-best-practices.mdc)

src/{main,renderer}/**/*.ts: Use context isolation for improved security
Implement proper inter-process communication (IPC) patterns
Optimize application startup time with lazy loading
Implement proper error handling and logging for debugging

Files:

  • src/main/presenter/configPresenter/providerModelSettings.ts
  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts
src/main/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/electron-best-practices.mdc)

Use Electron's built-in APIs for file system and native dialogs

Files:

  • src/main/presenter/configPresenter/providerModelSettings.ts
  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/error-logging.mdc)

**/*.{ts,tsx}: 始终使用 try-catch 处理可能的错误
提供有意义的错误信息
记录详细的错误日志
优雅降级处理
日志应包含时间戳、日志级别、错误代码、错误描述、堆栈跟踪(如适用)、相关上下文信息
日志级别应包括 ERROR、WARN、INFO、DEBUG
不要吞掉错误
提供用户友好的错误信息
实现错误重试机制
避免记录敏感信息
使用结构化日志
设置适当的日志级别

Files:

  • src/main/presenter/configPresenter/providerModelSettings.ts
  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts
src/main/**/*.{ts,js,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

主进程代码放在 src/main

Files:

  • src/main/presenter/configPresenter/providerModelSettings.ts
  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use English for all logs and comments

Files:

  • src/main/presenter/configPresenter/providerModelSettings.ts
  • src/renderer/src/components/settings/ModelConfigDialog.vue
  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Enable and adhere to strict TypeScript typing (avoid implicit any, prefer precise types)

Files:

  • src/main/presenter/configPresenter/providerModelSettings.ts
  • src/renderer/src/components/settings/ModelConfigDialog.vue
  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts
src/renderer/src/**/*

📄 CodeRabbit inference engine (.cursor/rules/i18n.mdc)

src/renderer/src/**/*: All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Use the 'vue-i18n' framework for all internationalization in the renderer
Ensure all user-visible text in the renderer uses the translation system

Files:

  • src/renderer/src/components/settings/ModelConfigDialog.vue
src/renderer/**/*.{vue,ts,js,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

渲染进程代码放在 src/renderer

Files:

  • src/renderer/src/components/settings/ModelConfigDialog.vue
src/renderer/src/**/*.{vue,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/vue-best-practices.mdc)

src/renderer/src/**/*.{vue,ts,tsx,js,jsx}: Use the Composition API for better code organization and reusability
Implement proper state management with Pinia
Utilize Vue Router for navigation and route management
Leverage Vue's built-in reactivity system for efficient data handling

Files:

  • src/renderer/src/components/settings/ModelConfigDialog.vue
src/renderer/src/**/*.vue

📄 CodeRabbit inference engine (.cursor/rules/vue-best-practices.mdc)

Use scoped styles to prevent CSS conflicts between components

Files:

  • src/renderer/src/components/settings/ModelConfigDialog.vue
src/renderer/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

src/renderer/**/*.{ts,tsx,vue}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Use TypeScript for all code; prefer types over interfaces.
Avoid enums; use const objects instead.
Use arrow functions for methods and computed properties.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.

Files:

  • src/renderer/src/components/settings/ModelConfigDialog.vue
src/renderer/**/*.{vue,ts}

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

Implement lazy loading for routes and components.

Files:

  • src/renderer/src/components/settings/ModelConfigDialog.vue
src/renderer/**/*.{ts,vue}

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

src/renderer/**/*.{ts,vue}: Use useFetch and useAsyncData for data fetching.
Implement SEO best practices using Nuxt's useHead and useSeoMeta.

Use Pinia for frontend state management (do not introduce alternative state libraries)

Files:

  • src/renderer/src/components/settings/ModelConfigDialog.vue
src/renderer/{src,shell,floating}/**/*.vue

📄 CodeRabbit inference engine (CLAUDE.md)

src/renderer/{src,shell,floating}/**/*.vue: Use Vue 3 Composition API for all components
All user-facing strings must use i18n keys via vue-i18n (no hard-coded UI strings)
Use Tailwind CSS utilities and ensure styles are scoped in Vue components

Files:

  • src/renderer/src/components/settings/ModelConfigDialog.vue
src/renderer/src/components/**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Organize UI components by feature within src/renderer/src/

Files:

  • src/renderer/src/components/settings/ModelConfigDialog.vue
src/main/presenter/llmProviderPresenter/providers/*.ts

📄 CodeRabbit inference engine (.cursor/rules/llm-agent-loop.mdc)

src/main/presenter/llmProviderPresenter/providers/*.ts: Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Provider implementations must use a coreStream method that yields standardized stream events to decouple the main loop from provider-specific details.
The coreStream method in each Provider must perform a single streaming API request per conversation round and must not contain multi-round tool call loop logic.
Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., prepareFunctionCallPrompt) before making the API call.
When a provider supports native function calling, MCP tools must be converted to the provider's format (e.g., using convertToProviderTools) and included in the API request.
Provider implementations should aggregate and yield usage events as part of the standardized stream.
Provider implementations should yield image data events in the standardized format when applicable.
Provider implementations should yield reasoning events in the standardized format when applicable.
Provider implementations should yield tool call events (tool_call_start, tool_call_chunk, tool_call_end) in the standardized format.
Provider implementations should yield stop events with appropriate stop_reason in the standardized format.
Provider implementations should yield error events in the standardized format...

Files:

  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: neoragex2002
PR: ThinkInAIXYZ/deepchat#550
File: src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts:258-324
Timestamp: 2025-06-21T15:53:34.641Z
Learning: User neoragex2002 prefers concise, brief responses rather than chatty or verbose communication. Avoid lengthy explanations, excessive enthusiasm, or ASCII art in responses.
📚 Learning: 2025-09-06T03:07:23.817Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-06T03:07:23.817Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration entries in src/main/presenter/configPresenter/providers.ts

Applied to files:

  • src/main/presenter/configPresenter/providerModelSettings.ts
🧬 Code graph analysis (1)
src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (2)
src/shared/types/presenters/legacy.presenters.d.ts (1)
  • Tool (108-119)
src/main/presenter/index.ts (1)
  • presenter (223-223)
🔇 Additional comments (2)
src/main/presenter/configPresenter/providerModelSettings.ts (1)

310-312: Explicit Gemini enableSearch defaults added — LGTM

Setting enableSearch: false explicitly is consistent with getProviderSpecificModelConfig and prevents accidental tool attachment. No issues spotted across these blocks.

Also applies to: 334-336, 346-348, 358-360, 385-387, 397-399, 409-411, 421-423

src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (1)

895-905: Google Search tool shape is correct — use camelCase { googleSearch: {} }

Confirmed the @google/genai Node SDK expects { googleSearch: {} }; the current code already uses that shape ({ googleSearch: {} as GoogleSearch }), so no change required.

Comment on lines 867 to 885
// 是否显示Gemini搜索配置
const showGeminiSearch = computed(() => {
const isGemini = props.providerId === 'gemini'
const modelId = props.modelId.toLowerCase()
const supportedSearchModels = [
'gemini-2.5-pro',
'gemini-2.5-flash',
'gemini-2.5-flash-lite',
'gemini-2.5-flash-lite-preview-06-17',
'gemini-2.0-flash',
'gemini-2.0-flash-lite',
'gemini-1.5-pro',
'gemini-1.5-flash'
]
const isSupported =
supportedSearchModels.some((supportedModel) => modelId.includes(supportedModel)) ||
modelId.includes('gemini')
return isGemini && isSupported
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tighten showGeminiSearch conditions (remove broad .includes('gemini'))

Limit to known chat models and require functionCall to reduce UX confusion.

-// 是否显示Gemini搜索配置
-const showGeminiSearch = computed(() => {
-  const isGemini = props.providerId === 'gemini'
-  const modelId = props.modelId.toLowerCase()
-  const supportedSearchModels = [
+// Show Gemini search config only for supported chat models
+const showGeminiSearch = computed(() => {
+  if (props.providerId !== 'gemini') return false
+  const modelId = props.modelId.toLowerCase()
+  const supportedSearchModels = [
     'gemini-2.5-pro',
     'gemini-2.5-flash',
     'gemini-2.5-flash-lite',
     'gemini-2.5-flash-lite-preview-06-17',
-		'gemini-2.0-flash',
-		'gemini-2.0-flash-lite',
-		'gemini-1.5-pro',
+    'gemini-2.0-flash',
+    'gemini-2.0-flash-lite',
+    'gemini-1.5-pro',
     'gemini-1.5-flash'
   ]
-  const isSupported =
-    supportedSearchModels.some((supportedModel) => modelId.includes(supportedModel)) ||
-    modelId.includes('gemini')
-  return isGemini && isSupported
+  const isSupported = supportedSearchModels.some((m) => modelId.includes(m))
+  // Only for chat models that can call tools
+  return (
+    isSupported &&
+    config.value.type === ModelType.Chat &&
+    config.value.functionCall === true
+  )
 })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// 是否显示Gemini搜索配置
const showGeminiSearch = computed(() => {
const isGemini = props.providerId === 'gemini'
const modelId = props.modelId.toLowerCase()
const supportedSearchModels = [
'gemini-2.5-pro',
'gemini-2.5-flash',
'gemini-2.5-flash-lite',
'gemini-2.5-flash-lite-preview-06-17',
'gemini-2.0-flash',
'gemini-2.0-flash-lite',
'gemini-1.5-pro',
'gemini-1.5-flash'
]
const isSupported =
supportedSearchModels.some((supportedModel) => modelId.includes(supportedModel)) ||
modelId.includes('gemini')
return isGemini && isSupported
})
// Show Gemini search config only for supported chat models
const showGeminiSearch = computed(() => {
if (props.providerId !== 'gemini') return false
const modelId = props.modelId.toLowerCase()
const supportedSearchModels = [
'gemini-2.5-pro',
'gemini-2.5-flash',
'gemini-2.5-flash-lite',
'gemini-2.5-flash-lite-preview-06-17',
'gemini-2.0-flash',
'gemini-2.0-flash-lite',
'gemini-1.5-pro',
'gemini-1.5-flash'
]
const isSupported = supportedSearchModels.some((m) => modelId.includes(m))
// Only for chat models that can call tools
return (
isSupported &&
config.value.type === ModelType.Chat &&
config.value.functionCall === true
)
})

@zerob13 zerob13 merged commit 6e8a51e into ThinkInAIXYZ:dev Sep 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants