From efa1b95151bf4b02f1de2e8ef8670277f82cb9a5 Mon Sep 17 00:00:00 2001 From: maximevoisincohere <157384859+maximevoisincohere@users.noreply.github.com> Date: Mon, 26 Aug 2024 22:51:03 +0200 Subject: [PATCH] Update prompting-command-r.mdx Signed-off-by: maximevoisincohere <157384859+maximevoisincohere@users.noreply.github.com> --- .../prompt-engineering/prompting-command-r.mdx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fern/pages/text-generation/prompt-engineering/prompting-command-r.mdx b/fern/pages/text-generation/prompt-engineering/prompting-command-r.mdx index 7d5b67e2..183f27b0 100644 --- a/fern/pages/text-generation/prompt-engineering/prompting-command-r.mdx +++ b/fern/pages/text-generation/prompt-engineering/prompting-command-r.mdx @@ -155,11 +155,23 @@ This iterative process continues for as many steps as the model deems necessary. > ## Task and Context > \{TASK_CONTEXT}

## Style Guide
> \{STYLE_GUIDE}

## Available Tools
-> \{TOOLS}\<|END_OF_TURN_TOKEN|>\{CHAT_HISTORY}\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{INSTRUCTIONS_FOR_MULTI_STEP_TOOL_USE}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_1}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{TOOL_RESULTS_FROM_STEP_1}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_2}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{TOOL_RESULTS_FROM_STEP_2}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_3}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{TOOL_RESULTS_FROM_STEP_3}\<|END_OF_TURN_TOKEN|>...etc...\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_i-1}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{TOOL_RESULTS_FROM_STEP_i-1}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>""" +> \{TOOLS}\<|END_OF_TURN_TOKEN|>\{CHAT_HISTORY}\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{INSTRUCTIONS_FOR_MULTI_STEP_TOOL_USE}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_1}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{TOOL_RESULTS_FROM_STEP_1}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_2}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{TOOL_RESULTS_FROM_STEP_2}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_3}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{TOOL_RESULTS_FROM_STEP_3}\<|END_OF_TURN_TOKEN|>...etc...\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>\{PLAN_AND_SUGGESTED_TOOL_CALLS_FOR_STEP_i-1}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{TOOL_RESULTS_FROM_STEP_i-1}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>""" ## 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. +