Skip to content

Commit

Permalink
Update prompting-command-r.mdx
Browse files Browse the repository at this point in the history
Signed-off-by: maximevoisincohere <[email protected]>
  • Loading branch information
maximevoisincohere authored Aug 26, 2024
1 parent c749c77 commit ab007d4
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ Summarization is very similar to augmented generation: the model takes in some d
This way, RAG and Summarization follow a similar prompt template. It is the Augmented Generation prompt template and here’s what it looks like at a high level:


> <b>augmented_gen_prompt_template = </b>
> <b>"""<span class="dark-blue-text">\<BOS_TOKEN></span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|SYSTEM_TOKEN|></span><span class="red-text"># Safety Preamble</span> </b>
> <b><span class="red-text">\{SAFETY_PREAMBLE}</span><br /><br /><span class="dark-green-text"># System Preamble</span> </b>
> <b><span class="green-text">## Basic Rules</span> </b>
> <b><span class="green-text">\{BASIC_RULES}</span><br /><br /><span class="dark-purple-text"># User Preamble</span> </b>
> <b><span class="purple-text">## Task and Context</span> </b>
> <b><span class="purple-text">\{TASK_CONTEXT}</span><br /><br /><span class="dark-sangria-text">## Style Guide</span> </b>
> <b>augmented_gen_prompt_template =</b>
> <b>"""<span class="dark-blue-text">\<BOS_TOKEN></span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|SYSTEM_TOKEN|></span><span class="red-text"># Safety Preamble</span></b>
> <b><span class="red-text">\{SAFETY_PREAMBLE}</span><br /><br /><span class="dark-green-text"># System Preamble</span></b>
> <b><span class="green-text">## Basic Rules</span></b>
> <b><span class="green-text">\{BASIC_RULES}</span><br /><br /><span class="dark-purple-text"># User Preamble</span></b>
> <b><span class="purple-text">## Task and Context</span></b>
> <b><span class="purple-text">\{TASK_CONTEXT}</span><br /><br /><span class="dark-sangria-text">## Style Guide</span></b>
> <b><span class="dark-sangria-text">\{STYLE_GUIDE}</span><span class="brown-text">\<|END_OF_TURN_TOKEN|></span><span class="orange-text">\{CHAT_HISTORY}</span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|SYSTEM_TOKEN|></span><span class="orange-text">\{RETRIEVED_SNIPPETS_FOR_RAG or TEXT_TO_SUMMARIZE}</span><span class="brown-text">\<|END_OF_TURN_TOKEN|></span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|SYSTEM_TOKEN|></span><span class="pink-text">\{INSTRUCTIONS}</span><span class="brown-text">\<|END_OF_TURN_TOKEN|></span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|CHATBOT_TOKEN|></span>"""</b>

Expand All @@ -62,15 +62,15 @@ You can learn more about single step tool use [in our documentation](https://doc

#### A) Tool Selection Prompt Template

singlestep_tool_selection_prompt_template =
"""<span class="dark-blue-text">\<BOS_TOKEN></span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|SYSTEM_TOKEN|></span><span class="red-text"># Safety Preamble</span>
<span class="red-text">\{SAFETY_PREAMBLE}</span><br /><br /><span class="dark-green-text"># System Preamble</span>
<span class="green-text">## Basic Rules</span>
<span class="green-text">\{BASIC_RULES}</span><br /><br /><span class="dark-purple-text"># User Preamble</span>
<span class="purple-text">## Task and Context</span>
<span class="purple-text">\{TASK_CONTEXT}</span><br /><br /><span class="dark-sangria-text">## Style Guide</span>
<span class="dark-sangria-text">\{STYLE_GUIDE}</span><br /><br /><span class="light-yellow-text">## Available Tools</span>
<span class="light-yellow-text">\{TOOLS}</span><span class="brown-text">\<|END_OF_TURN_TOKEN|></span><span class="orange-text">\{CHAT_HISTORY}</span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|SYSTEM_TOKEN|></span><span class="light-pink-text">\{INSTRUCTIONS_FOR_SINGLE_STEP_TOOL_USE}</span><span class="brown-text">\<|END_OF_TURN_TOKEN|></span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|CHATBOT_TOKEN|></span>"""
> <b>singlestep_tool_selection_prompt_template = </b>
> <b>"""<span class="dark-blue-text">\<BOS_TOKEN></span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|SYSTEM_TOKEN|></span><span class="red-text"># Safety Preamble</span> </b>
> <b><span class="red-text">\{SAFETY_PREAMBLE}</span><br /><br /><span class="dark-green-text"># System Preamble</span> </b>
> <b><span class="green-text">## Basic Rules</span> </b>
> <b><span class="green-text">\{BASIC_RULES}</span><br /><br /><span class="dark-purple-text"># User Preamble</span> </b>
> <b><span class="purple-text">## Task and Context</span> </b>
> <b><span class="purple-text">\{TASK_CONTEXT}</span><br /><br /><span class="dark-sangria-text">## Style Guide</span> </b>
> <b><span class="dark-sangria-text">\{STYLE_GUIDE}</span><br /><br /><span class="light-yellow-text">## Available Tools</span> </b>
> <b><span class="light-yellow-text">\{TOOLS}</span><span class="brown-text">\<|END_OF_TURN_TOKEN|></span><span class="orange-text">\{CHAT_HISTORY}</span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|SYSTEM_TOKEN|></span><span class="light-pink-text">\{INSTRUCTIONS_FOR_SINGLE_STEP_TOOL_USE}</span><span class="brown-text">\<|END_OF_TURN_TOKEN|></span><span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|CHATBOT_TOKEN|></span>"""</b>

The prompt template for Tool Selection is similar to the Augmented Generation prompt template. There are, however, two spots that differ which are highlighted. The first is that we have added the tool definitions which come after the style guide (you can see that there’s now an <span class="pink-text">## Available Tools</span> section), and the second is that we’ve removed the section with the retrieved snippets or text to summarize.
Expand Down

0 comments on commit ab007d4

Please sign in to comment.