From ab007d4d7d12c2990e852242ac5e4d21ba51e327 Mon Sep 17 00:00:00 2001
From: maximevoisincohere
<157384859+maximevoisincohere@users.noreply.github.com>
Date: Mon, 26 Aug 2024 14:53:24 +0200
Subject: [PATCH] Update prompting-command-r.mdx
Signed-off-by: maximevoisincohere <157384859+maximevoisincohere@users.noreply.github.com>
---
.../prompting-command-r.mdx | 32 +++++++++----------
1 file changed, 16 insertions(+), 16 deletions(-)
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 c440197c..d10d3791 100644
--- a/fern/pages/text-generation/prompt-engineering/prompting-command-r.mdx
+++ b/fern/pages/text-generation/prompt-engineering/prompting-command-r.mdx
@@ -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:
-> augmented_gen_prompt_template =
-> """\\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|># Safety Preamble
-> \{SAFETY_PREAMBLE}
# System Preamble
-> ## Basic Rules
-> \{BASIC_RULES}
# User Preamble
-> ## Task and Context
-> \{TASK_CONTEXT}
## Style Guide
+> augmented_gen_prompt_template =
+> """\\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|># Safety Preamble
+> \{SAFETY_PREAMBLE}
# System Preamble
+> ## Basic Rules
+> \{BASIC_RULES}
# User Preamble
+> ## Task and Context
+> \{TASK_CONTEXT}
## Style Guide
> \{STYLE_GUIDE}\<|END_OF_TURN_TOKEN|>\{CHAT_HISTORY}\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{RETRIEVED_SNIPPETS_FOR_RAG or TEXT_TO_SUMMARIZE}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|>\{INSTRUCTIONS}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>"""
@@ -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 =
-"""\\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|># Safety Preamble
-\{SAFETY_PREAMBLE}
# System Preamble
-## Basic Rules
-\{BASIC_RULES}
# User Preamble
-## 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_SINGLE_STEP_TOOL_USE}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>"""
+> singlestep_tool_selection_prompt_template =
+> """\\<|START_OF_TURN_TOKEN|>\<|SYSTEM_TOKEN|># Safety Preamble
+> \{SAFETY_PREAMBLE}
# System Preamble
+> ## Basic Rules
+> \{BASIC_RULES}
# User Preamble
+> ## 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_SINGLE_STEP_TOOL_USE}\<|END_OF_TURN_TOKEN|>\<|START_OF_TURN_TOKEN|>\<|CHATBOT_TOKEN|>"""
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 ## Available Tools section), and the second is that we’ve removed the section with the retrieved snippets or text to summarize.