From 97b72c7563de1c65b7ee2d291c8840af31f7f093 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 04:49:48 +0000 Subject: [PATCH 1/2] I've made a commit that refines how I handle your requests, aiming to provide more comprehensive and complete responses. Specifically, I will now aim to: - Provide more detailed answers. - Conduct more thorough research. - Be more cautious about proceeding if I don't have enough information from you. Please note: I wasn't able to test these changes by running the application, as the build process was blocked by missing environment variables. --- lib/agents/researcher.tsx | 2 ++ lib/agents/task-manager.tsx | 1 + lib/agents/writer.tsx | 23 +++++++++++++++++------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lib/agents/researcher.tsx b/lib/agents/researcher.tsx index 6ef6d53b..e13b0ab9 100644 --- a/lib/agents/researcher.tsx +++ b/lib/agents/researcher.tsx @@ -43,6 +43,8 @@ Tool Usage Guide: - "What are some parks in San Francisco?" When you use 'geospatialQueryTool', you don't need to describe how the map will change; simply provide your textual answer based on the query, and trust the map will update appropriately. +Your primary objective is to conduct thorough and comprehensive research to gather all the necessary information to fully answer the user's query. Do not settle for superficial answers. Your research should be deep and wide-ranging, covering all aspects of the user's question. + Always aim to directly address the user's question. If using information from a tool (like web search), cite the source URL. Match the language of your response to the user's language.`; diff --git a/lib/agents/task-manager.tsx b/lib/agents/task-manager.tsx index 1bdd659a..fe6435a0 100644 --- a/lib/agents/task-manager.tsx +++ b/lib/agents/task-manager.tsx @@ -14,6 +14,7 @@ export async function taskManager(messages: CoreMessage[]) { Your decision should be based on a careful assessment of the context and the potential for further information to improve the quality and relevance of your response. For example, if the user asks, "What are the key features of the latest iPhone model?", you may choose to "proceed" as the query is clear and can be answered effectively with web research alone. However, if the user asks, "What's the best smartphone for my needs?", you may opt to "inquire" and present a form asking about their specific requirements, budget, and preferred features to provide a more tailored recommendation. + When in doubt, it is always better to "inquire" for more information than to "proceed" with incomplete information. Make your choice wisely to ensure that you fulfill your mission as a web researcher effectively and deliver the most valuable assistance to the user. `, messages, diff --git a/lib/agents/writer.tsx b/lib/agents/writer.tsx index 67643b35..3dc4efc7 100644 --- a/lib/agents/writer.tsx +++ b/lib/agents/writer.tsx @@ -19,12 +19,23 @@ export async function writer( uiStream.append(answerSection) // Default system prompt, used if dynamicSystemPrompt is not provided - const default_system_prompt = `As a professional writer, your job is to generate a comprehensive and informative, yet concise answer of 400 words or less for the given question based solely on the provided search results (URL and content). You must only use information from the provided search results. Use an unbiased and journalistic tone. Combine search results together into a coherent answer. Do not repeat text. 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 cite the source URL explicitly. Please match the language of the response to the user's language. - Always answer in Markdown format. Links and images must follow the correct format. - Link format: [link text](url) - Image format: ![alt text](url) - `; + const default_system_prompt = `As a professional writer, your primary goal is to provide a comprehensive and informative answer to the user's question, based exclusively on the provided search results (URL and content). + +Your responsibilities include: +- Thoroughly analyze the user's question to understand the core information being sought. +- Carefully review the provided search results, extracting all relevant facts, data, and perspectives. +- Synthesize the information from multiple sources into a coherent, well-structured, and easy-to-understand response. +- Maintain an unbiased and journalistic tone throughout your writing. +- Ensure that your answer directly addresses all parts of the user's question, providing a complete and satisfying response. +- Cite the source URL whenever you quote or reference information from a specific search result. +- If the search results include relevant images, incorporate them into your response using Markdown format. +- Match the language of your response to the user's language. + +Your final output should be a detailed and well-supported answer that fully resolves the user's query, leaving no stone unturned. +Please use Markdown format for your response. +- Link format: [link text](url) +- Image format: ![alt text](url) +`; const systemToUse = dynamicSystemPrompt && dynamicSystemPrompt.trim() !== '' ? dynamicSystemPrompt : default_system_prompt; From 08367c862637ab5c26d988fa09cb7b9dc1529d0f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 05:06:51 +0000 Subject: [PATCH 2/2] I've adjusted my approach to prioritize generating a textual response over including images. Previously, I would sometimes output only images. This change ensures that my primary goal is the textual response, and I will only include images if they are highly relevant and add significant value. Note: I wasn't able to test these changes by running the application, as the build process was blocked by missing environment variables. --- lib/agents/writer.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/agents/writer.tsx b/lib/agents/writer.tsx index 3dc4efc7..86f61b45 100644 --- a/lib/agents/writer.tsx +++ b/lib/agents/writer.tsx @@ -28,10 +28,9 @@ Your responsibilities include: - Maintain an unbiased and journalistic tone throughout your writing. - Ensure that your answer directly addresses all parts of the user's question, providing a complete and satisfying response. - Cite the source URL whenever you quote or reference information from a specific search result. -- If the search results include relevant images, incorporate them into your response using Markdown format. - Match the language of your response to the user's language. -Your final output should be a detailed and well-supported answer that fully resolves the user's query, leaving no stone unturned. +Your final output should be a detailed and well-supported textual answer that fully resolves the user's query. If the search results include images that are highly relevant and add significant value to the textual response, you may include them. However, the text is the most important part of the response. Please use Markdown format for your response. - Link format: [link text](url) - Image format: ![alt text](url)