Skip to content

An AI-powered search engine with a generative UI

feat: add support for o3-mini model

Yoshiki Miurad0d6d7d138f4
diff --git a/lib/schema/search.tsx b/lib/schema/search.tsx
index 51b84bf2..6e775baf 100644
--- a/lib/schema/search.tsx
+++ b/lib/schema/search.tsx
@@ -3,9 +3,9 @@ import { z } from 'zod'
export const searchSchema = z.object({
query: z.string().describe('The query to search for'),
- max_results: z.coerce
+ max_results: z
.number()
- .describe('The maximum number of results to return'),
+ .describe('The maximum number of results to return. default is 20'),
search_depth: z
.string()
.describe(
@@ -13,13 +13,11 @@ export const searchSchema = z.object({
),
include_domains: z
.array(z.string())
- .optional()
.describe(
'A list of domains to specifically include in the search results. Default is None, which includes all domains.'
),
exclude_domains: z
.array(z.string())
- .optional()
.describe(
"A list of domains to specifically exclude from the search results. Default is None, which doesn't exclude any domains."
)
diff --git a/lib/streaming/create-tool-calling-stream.ts b/lib/streaming/create-tool-calling-stream.ts
index a7411e52..558c09ed 100644
--- a/lib/streaming/create-tool-calling-stream.ts
+++ b/lib/streaming/create-tool-calling-stream.ts
@@ -6,6 +6,7 @@ import {
streamText
} from 'ai'
import { getMaxAllowedTokens, truncateMessages } from '../utils/context-window'
+import { isReasoningModel } from '../utils/registry'
import { handleStreamFinish } from './handle-stream-finish'
import { BaseStreamConfig } from './types'
@@ -35,7 +36,8 @@ export function createToolCallingStreamResponse(config: BaseStreamConfig) {
originalMessages: messages,
model,
chatId,
- dataStream
+ dataStream,
+ skipRelatedQuestions: isReasoningModel(model)
})
}
})
diff --git a/lib/types/models.ts b/lib/types/models.ts
index 63e90063..871ab690 100644
--- a/lib/types/models.ts
+++ b/lib/types/models.ts
@@ -66,6 +66,12 @@ export const models: Model[] = [
provider: 'Ollama',
providerId: 'ollama'
},
+ {
+ id: 'o3-mini',
+ name: 'o3-mini',
+ provider: 'OpenAI',
+ providerId: 'openai'
+ },
{
id: 'gpt-4o',
name: 'GPT-4o',
diff --git a/lib/utils/registry.ts b/lib/utils/registry.ts
index 431bec48..3cbf7188 100644
--- a/lib/utils/registry.ts
+++ b/lib/utils/registry.ts
@@ -142,5 +142,9 @@ export function isReasoningModel(model: string): boolean {
if (typeof model !== 'string') {
return false
}
- return model.includes('deepseek-r1') || model.includes('deepseek-reasoner')
+ return (
+ model.includes('deepseek-r1') ||
+ model.includes('deepseek-reasoner') ||
+ model.includes('o3-mini')
+ )
}