diff --git a/src/lib/prompts/webSearch.ts b/src/lib/prompts/webSearch.ts index 387525a..49c4fa6 100644 --- a/src/lib/prompts/webSearch.ts +++ b/src/lib/prompts/webSearch.ts @@ -6,11 +6,13 @@ export const webSearchRetrieverPrompt = ` - Only add additional information or change the meaning of the question if it is necessary for clarity or relevance to the conversation - Condense the question to its essence and remove any unnecessary details - Ensure the question is grammatically correct and free of spelling errors -- If it is a simple writing task or a greeting (unless the greeting contains a question after it) like Hi, Hello, How are you, etc. than a question then you need to return \`not_needed\` as the response in the XML block +- If it is a simple writing task or a greeting (unless the greeting contains a question after it) like Hi, Hello, How are you, etc. instead of a question then you need to return \`not_needed\` as the response in the XML block - If the user includes URLs or a PDF in their question, return the URLs or PDF links inside the XML block and the question inside the XML block - If the user wants to you to summarize the webpage or the PDF, return summarize inside the XML block in place of a question and the URLs to summarize in the XML block - If you are a thinking or reasoning AI, do not use and or and tags in your thinking. Those tags should only be used in the final output - If applicable, use the provided date to ensure the rephrased question is relevant to the current date and time + - This includes but is not limited to things like sports scores, standings, weather, current events, etc. +- If the user requests limiting to a specific website, include that in the rephrased question with the format \`'site:example.com'\`, be sure to include the quotes. Only do this if the limiting is explicitly mentioned in the question # Data - The history is contained in the tag after the below @@ -22,99 +24,135 @@ export const webSearchRetrieverPrompt = ` There are several examples attached for your reference inside the below examples XML block -## Example 1 input - -Who won the last F1 race?\nAyrton Senna won the Monaco Grand Prix. It was a tight race with lots of overtakes. Alain Prost was in the lead for most of the race until the last lap when Senna overtook them. - - -What were the highlights of the race? - + + + + Who won the last F1 race?\nAyrton Senna won the Monaco Grand Prix. It was a tight race with lots of overtakes. + + + What were the highlights of the race? + + + + + F1 Monaco Grand Prix highlights + + + -## Example 1 output - -F1 Monaco Grand Prix highlights - + + + + + + What is the capital of France + + + + + Capital of France + + + -## Example 2 input - - - -What is the capital of France - + + + + + + Hi, how are you? + + + + + not_needed + + + -## Example 2 output - -Capital of France - + + + + What is the capital of New York?\nThe capital of New York is Albany.\nWhat year was the capital established?\nThe capital of New York was established in 1797. + + + What is the weather like there? Use weather.com + + + + + Weather in Albany, New York {date} 'site:weather.com' + + + -## Example 3 input - - - -Hi, how are you? - + + + + + + Can you tell me what is X from https://example.com + + + + + Can you tell me what is X + + + https://example.com + + + -## Example 3 output - -not_needed - + + + + + + Summarize the content from https://example.com + + + + + summarize + + + https://example.com + + + -## Example 4 input - - - -Can you tell me what is X from https://example.com - - -## Example 4 output - -Can you tell me what is X - - - -https://example.com - - -## Example 5 input - - - -Summarize the content from https://example.com - - -## Example 5 output - -summarize - - - -https://example.com - - -## Example 6 input - - - -Get the current F1 constructor standings and return the results in a table - - -## Example 6 output - -{date} F1 constructor standings - - -## Example 7 input - - - -What are the top 10 restaurants in New York? Show the results in a table and include a short description of each restaurant - - -## Example 7 output - -Top 10 restaurants in New York on {date} - + + + + + + Get the current F1 constructor standings and return the results in a table + + + + ## Example 6 output + + {date} F1 constructor standings + + + + + + + + + What are the top 10 restaurants in New York? Show the results in a table and include a short description of each restaurant. Only include results from yelp.com + + + + ## Example 7 output + + Top 10 restaurants in New York on {date} 'site:yelp.com' + + + Everything below is the part of the actual conversation diff --git a/src/lib/search/index.ts b/src/lib/search/index.ts index 36bc60e..868371b 100644 --- a/src/lib/search/index.ts +++ b/src/lib/search/index.ts @@ -64,6 +64,6 @@ export const searchHandlers: Record = { rerankThreshold: 0.3, searchWeb: true, summarizer: false, - additionalSearchCriteria: 'site:reddit.com', + additionalSearchCriteria: '\'site:reddit.com\'', }), };