Skip to content

An AI-powered search engine with a generative UI

Update cloud speed models to Gemini 3.1 series (#779)

Yoshiki Miura79e1264279e9
diff --git a/config/models/cloud.json b/config/models/cloud.json
index 0035de86..acaf2046 100644
--- a/config/models/cloud.json
+++ b/config/models/cloud.json
@@ -4,30 +4,24 @@
"byMode": {
"quick": {
"speed": {
- "id": "gemini-3-flash-preview",
- "name": "Gemini 3 Flash Preview",
+ "id": "gemini-3.1-flash-lite-preview",
+ "name": "Gemini 3.1 Flash Lite Preview",
"provider": "Google",
"providerId": "google"
},
"quality": {
- "id": "gemini-3-pro",
- "name": "Gemini 3 Pro",
+ "id": "gemini-3.1-pro-preview",
+ "name": "Gemini 3.1 Pro Preview",
"provider": "Google",
"providerId": "google"
}
},
"adaptive": {
"speed": {
- "id": "gpt-5-mini",
- "name": "GPT-5 mini",
- "provider": "OpenAI",
- "providerId": "openai",
- "providerOptions": {
- "openai": {
- "reasoningEffort": "medium",
- "reasoningSummary": "auto"
- }
- }
+ "id": "gemini-3-flash-preview",
+ "name": "Gemini 3 Flash Preview",
+ "provider": "Google",
+ "providerId": "google"
},
"quality": {
"id": "gpt-5.2",
diff --git a/lib/agents/prompts/search-mode-prompts.ts b/lib/agents/prompts/search-mode-prompts.ts
index b08861a4..fbe9eaf1 100644
--- a/lib/agents/prompts/search-mode-prompts.ts
+++ b/lib/agents/prompts/search-mode-prompts.ts
@@ -141,11 +141,13 @@ End with a synthesizing conclusion that ties the main points together into a cle
`
}
-export function getAdaptiveModePrompt(): string {
+export function getAdaptiveModePrompt({
+ enableTodo = false
+}: { enableTodo?: boolean } = {}): string {
return `
Instructions:
-You are a helpful AI assistant with access to real-time web search, content retrieval, task management, and the ability to ask clarifying questions.
+You are a helpful AI assistant with access to real-time web search, content retrieval,${enableTodo ? ' task management,' : ''} and the ability to ask clarifying questions.
**EFFICIENCY GUIDELINES:**
- **Target: Complete research within ~20 tool calls when possible**
@@ -270,7 +272,9 @@ IMPORTANT: Citations must appear INLINE within your response text, not separatel
Example: "The company reported record revenue. [1](#toolu_abc123) Analysts predict continued growth. [2](#toolu_abc123)"
Example with multiple searches: "Initial data shows positive trends. [1](#toolu_abc123) Recent updates indicate acceleration. [1](#toolu_def456)"
-TASK MANAGEMENT (todoWrite tool):
+${
+ enableTodo
+ ? `TASK MANAGEMENT (todoWrite tool):
**When to use todoWrite:**
- Queries with 3-4 distinct aspects: SHOULD use todoWrite
- **Queries with 5+ steps/aspects: STRONGLY RECOMMENDED to use todoWrite**
@@ -301,7 +305,9 @@ Example task patterns:
- "Research [topic] from multiple sources"
- "Compare different perspectives on [topic]"
- "Fetch detailed content from top sources"
-- "Synthesize findings into comprehensive answer"
+- "Synthesize findings into comprehensive answer"`
+ : ''
+}
OUTPUT FORMAT (MANDATORY):
- You MUST always format responses as Markdown.
@@ -338,4 +344,3 @@ Conclude with a brief synthesis that ties together the main insights into a clea
// Export static prompts for backward compatibility
export const QUICK_MODE_PROMPT = getQuickModePrompt()
-export const ADAPTIVE_MODE_PROMPT = getAdaptiveModePrompt()
diff --git a/lib/agents/researcher.ts b/lib/agents/researcher.ts
index 36daf36d..b40e4adf 100644
--- a/lib/agents/researcher.ts
+++ b/lib/agents/researcher.ts
@@ -18,7 +18,7 @@ import { getModel } from '../utils/registry'
import { isTracingEnabled } from '../utils/telemetry'
import {
- ADAPTIVE_MODE_PROMPT,
+ getAdaptiveModePrompt,
QUICK_MODE_PROMPT
} from './prompts/search-mode-prompts'
@@ -112,11 +112,14 @@ export function createResearcher({
case 'adaptive':
default:
- systemPrompt = ADAPTIVE_MODE_PROMPT
- activeToolsList = ['search', 'fetch']
- // Only enable todo tools for quality model type
- if (writer && 'todoWrite' in todoTools && modelType === 'quality') {
- activeToolsList.push('todoWrite')
+ {
+ const enableTodo =
+ writer && 'todoWrite' in todoTools && modelType === 'quality'
+ systemPrompt = getAdaptiveModePrompt({ enableTodo: !!enableTodo })
+ activeToolsList = ['search', 'fetch']
+ if (enableTodo) {
+ activeToolsList.push('todoWrite')
+ }
}
console.log(
`[Researcher] Adaptive mode: maxSteps=50, modelType=${modelType}, tools=[${activeToolsList.join(', ')}]`