Skip to content

An AI-powered search engine with a generative UI

chore: Update researcher prompt and system message

Yoshiki Miuraf1c47a285ccc
diff --git a/lib/agents/researcher.tsx b/lib/agents/researcher.tsx
index 1cd63e59..26a459e1 100644
--- a/lib/agents/researcher.tsx
+++ b/lib/agents/researcher.tsx
@@ -9,7 +9,11 @@ import {
import { getTools } from './tools'
import { getModel, transformToolMessages } from '../utils'
import { AnswerSection } from '@/components/answer-section'
-import { Spinner } from '@/components/ui/spinner'
+
+const SYSTEM_PROMPT = `As a professional search expert, you possess the ability to search for any information on the web.
+For each user query, utilize the search results to their fullest potential to provide additional information and assistance in your response.
+If there are any images relevant to your answer, be sure to include them as well.
+Aim to directly address the user's question, augmenting your response with insights gleaned from the search results.`
export async function researcher(
uiStream: ReturnType<typeof createStreamableUI>,
@@ -39,17 +43,7 @@ export async function researcher(
const result = await streamText({
model: getModel(useSubModel),
maxTokens: 2500,
- system: `As a professional search expert, you possess the ability to search for any information on the web.
- or any information on the web.
- For each user query, utilize the search results to their fullest potential to provide additional information and assistance in your response.
- If there are any images relevant to your answer, be sure to include them as well.
- Aim to directly address the user's question, augmenting your response with insights gleaned from the search results.
- Whenever quoting or referencing information from a specific URL, always explicitly cite the source URL using the [[number]](url) format. Multiple citations can be included as needed, e.g., [[number]](url), [[number]](url).
- The number must always match the order of the search results.
- The retrieve tool can only be used with URLs provided by the user. URLs from search results cannot be used.
- If it is a domain instead of a URL, specify it in the include_domains of the search tool.
- Please match the language of the response to the user's language. Current date and time: ${currentDate}
- `,
+ system: `${SYSTEM_PROMPT} Current date and time: ${currentDate}`,
messages: processedMessages,
tools: getTools({
uiStream,
@@ -128,14 +122,10 @@ export async function ollamaResearcher(
const streamableText = createStreamableValue<string>()
let toolResults: any[] = []
+ const currentDate = new Date().toLocaleString()
const result = await generateText({
model: getModel(),
- system: `As a professional search expert, you possess the ability to search for any information on the web.
- or any information on the web.
- For each user query, utilize the search results to their fullest potential to provide additional information and assistance in your response.
- If there are any images relevant to your answer, be sure to include them as well.
- Aim to directly address the user's question, augmenting your response with insights gleaned from the search results.
- `,
+ system: `${SYSTEM_PROMPT} Current date and time: ${currentDate}`,
messages: messages,
tools: getTools({
uiStream,