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 754b3e4 commit efa1b95
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,23 @@ This iterative process continues for as many steps as the model deems necessary.
> <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="magenta-text">## Available Tools</span></b>
> <b><span class="magenta-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="dark-pink-text">\{INSTRUCTIONS_FOR_MULTI_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><span class="dark-red-text">\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_1}</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="dark-red-text">\{TOOL_RESULTS_FROM_STEP_1}</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><span class="dark-red-text">\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_2}</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="dark-red-text">\{TOOL_RESULTS_FROM_STEP_2}</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><span class="dark-red-text">\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_3}</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="dark-red-text">\{TOOL_RESULTS_FROM_STEP_3}</span><span class="brown-text">\<|END_OF_TURN_TOKEN|></span>...etc...<span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|CHATBOT_TOKEN|></span><span class="dark-red-text">\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_i-1}</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="dark-red-text">\{TOOL_RESULTS_FROM_STEP_i-1}</span></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>
> <b><span class="magenta-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="dark-pink-text">\{INSTRUCTIONS_FOR_MULTI_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><span class="dark-red-text">\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_1}</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="dark-red-text">\{TOOL_RESULTS_FROM_STEP_1}</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><span class="dark-red-text">\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_2}</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="dark-red-text">\{TOOL_RESULTS_FROM_STEP_2}</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><span class="dark-red-text">\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_3}</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="dark-red-text">\{TOOL_RESULTS_FROM_STEP_3}</span><span class="brown-text">\<|END_OF_TURN_TOKEN|></span>...etc...<span class="brown-text">\<|START_OF_TURN_TOKEN|></span><span class="dark-orange-text">\<|CHATBOT_TOKEN|></span><span class="dark-red-text">\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_i-1}</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="dark-red-text">\{TOOL_RESULTS_FROM_STEP_i-1}</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>

## Detailed Prompt Templates

Now that we have a high-level understanding of prompt templates, let's dive into the detailed prompts for each task.

### Augmented Generation: RAG with Command R/R+

Retrieval Augmented Generation (RAG) involves two main steps:
- Retrieval: retrieve the relevant snippets
- Augmented Generation: generate a response based on these snippets.

Below is a detailed look at the fully rendered prompt for Augmented Generation. You can achieve the same result using the Hugging Face Tokenizer’s **apply_grounded_generation_template()** function.

The chat history in this example, is the simplest it can be: the user question only.




Expand Down

0 comments on commit efa1b95

Please sign in to comment.