diff options
| author | A.J. Shulman <Shulman.aj@gmail.com> | 2024-09-19 09:53:19 -0400 |
|---|---|---|
| committer | A.J. Shulman <Shulman.aj@gmail.com> | 2024-09-19 09:53:19 -0400 |
| commit | 00b12111c4007ef6ecff645327007a67f6655d8b (patch) | |
| tree | b5ecfd18a7a7e5f2cd97b8307b248882d056c7e0 /src/client/views/nodes/chatbot/agentsystem | |
| parent | ba0520baaa1f84d9fb08d3b2880c68302d28350a (diff) | |
added comments and fixed some styling and error handling
Diffstat (limited to 'src/client/views/nodes/chatbot/agentsystem')
| -rw-r--r-- | src/client/views/nodes/chatbot/agentsystem/prompts.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/client/views/nodes/chatbot/agentsystem/prompts.ts b/src/client/views/nodes/chatbot/agentsystem/prompts.ts index 7000d8634..01c30d444 100644 --- a/src/client/views/nodes/chatbot/agentsystem/prompts.ts +++ b/src/client/views/nodes/chatbot/agentsystem/prompts.ts @@ -22,8 +22,9 @@ export function getReactPrompt(tools: Tool[], summaries: () => string, chatHisto <point>**STRUCTURE**: Always use the correct stage tags (e.g., <stage number="2" role="assistant">) for every response. Use only even-numbered stages for your responses.</point> <point>**STOP after every stage and wait for input. Do not combine multiple stages in one response.**</point> <point>If a tool is needed, select the most appropriate tool based on the query.</point> - <point>**If one tool does not yield satisfactory results or fails twice, try another tool that might work better for the query.**</point> + <point>**If one tool does not yield satisfactory results or fails twice, try another tool that might work better for the query.** This often happens with the rag tool, which may not yeild great results. If this happens, try the search tool.</point> <point>Ensure that **ALL answers follow the answer structure**: grounded text wrapped in <grounded_text> tags with corresponding citations, normal text in <normal_text> tags, and three follow-up questions at the end.</point> + <point>If you use a tool that will do something (i.e. creating a CSV), and want to also use a tool that will provide you with information (i.e. RAG), use the tool that will provide you with information first. Then proceed with the tool that will do something.</point> </critical_points> <thought_structure> @@ -48,8 +49,9 @@ export function getReactPrompt(tools: Tool[], summaries: () => string, chatHisto </action_input_structure> <answer_structure> + ALL answers must follow this structure and everything must be witin the <answer> tag: <answer> - <grounded_text> - All information derived from tools or user documents must be wrapped in these tags with proper citation.</grounded_text> + <grounded_text> - All information derived from tools or user documents must be wrapped in these tags with proper citation. This should not be word for word, but paraphrased from the text.</grounded_text> <normal_text> - Use this tag for text not derived from tools or user documents. It should only be for narrative-like text or extremely common knowledge information.</normal_text> <citations> <citation> - Provide proper citations for each <grounded_text>, referencing the tool or document chunk used. ENSURE THAT THERE IS A CITATION WHOSE INDEX MATCHES FOR EVERY GROUNDED TEXT CITATION INDEX. </citation> @@ -65,6 +67,10 @@ export function getReactPrompt(tools: Tool[], summaries: () => string, chatHisto <step>Ensure that **EVERY** <grounded_text> tag includes a citation index aligned with a citation that you provide that references the source of the information.</step> <step>There should be a one-to-one relationship between <grounded_text> tags and citations.</step> <step>Over-citing is discouraged—only cite the information that is directly relevant to the user's query.</step> + <step>Paraphrase the information in the <grounded_text> tags, but ensure that the meaning is preserved.</step> + <step>Do not include the full text of the chunk in the citation—only the relevant excerpt.</step> + <step>For text chunks, the citation content must reflect the exact subset of the original chunk that is relevant to the grounded_text tag.</step> + <step>Do not use citations from previous interactions. Only use citations from the current action loop.</step> </grounded_text_guidelines> <normal_text_guidelines> @@ -130,7 +136,7 @@ export function getReactPrompt(tools: Tool[], summaries: () => string, chatHisto <stage number="6" role="assistant"> <thought> - With key moments from the World Cup retrieved, I will now use the website scraper tool to gather data on Qatar’s tourism impact during the World Cup. + With key moments from the World Cup retrieved, I will now use the website scraper tool to gather data on Qatar's tourism impact during the World Cup. </thought> <action>websiteInfoScraper</action> </stage> |
