@@ -62,7 +62,7 @@
|
|||||||
"- `max_tokens`: the maximum number of tokens to generate before stopping. Note that Claude may stop before reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate. Furthermore, this is a *hard* stop, meaning that it may cause Claude to stop generating mid-word or mid-sentence.\n",
|
"- `max_tokens`: the maximum number of tokens to generate before stopping. Note that Claude may stop before reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate. Furthermore, this is a *hard* stop, meaning that it may cause Claude to stop generating mid-word or mid-sentence.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"- `messages`: an array of input messages. Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the messages parameter, and the model then generates the next `Message` in the conversation.\n",
|
"- `messages`: an array of input messages. Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the messages parameter, and the model then generates the next `Message` in the conversation.\n",
|
||||||
" - Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages (they must alternate, if so). The first message must always use the user `role`.\n",
|
" - Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages (they must alternate, if so). The first message must always use the `user` role.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"There are also optional parameters, such as:\n",
|
"There are also optional parameters, such as:\n",
|
||||||
"- `system`: the system prompt - more on this below.\n",
|
"- `system`: the system prompt - more on this below.\n",
|
||||||
|
|||||||
@@ -180,7 +180,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"# System prompt - this is the only field you should chnage\n",
|
"# System prompt - this is the only field you should change\n",
|
||||||
"SYSTEM_PROMPT = \"[Replace this text]\"\n",
|
"SYSTEM_PROMPT = \"[Replace this text]\"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# Prompt\n",
|
"# Prompt\n",
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"However, when we prime Claude to inhabit the role of a cat, Claude's perspective changes, and thus **Claude's response tone, style, content adapts to the new role**. \n",
|
"However, when we prime Claude to inhabit the role of a cat, Claude's perspective changes, and thus **Claude's response tone, style, content adapts to the new role**. \n",
|
||||||
"\n",
|
"\n",
|
||||||
"**Note:** A bonus technique you can use is to **provide Claude context on its intended audience**. Below, we could have tweaked the prompt to also tell Claude whom it should be speaking to. \"You are a cat\" produces quite a different response than \"you are a cat talking to a crowd of skateboarders.\n",
|
"**Note:** A bonus technique you can use is to **provide Claude context on its intended audience**. Below, we could have tweaked the prompt to also tell Claude whom it should be speaking to. \"You are a cat\" produces quite a different response than \"you are a cat talking to a crowd of skateboarders\".\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Here is the prompt without role prompting in the system prompt:"
|
"Here is the prompt without role prompting in the system prompt:"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -320,7 +320,7 @@
|
|||||||
"# Expand on the specific tasks you want Claude to do, as well as any rules that Claude might have to follow.\n",
|
"# Expand on the specific tasks you want Claude to do, as well as any rules that Claude might have to follow.\n",
|
||||||
"# This is also where you can give Claude an \"out\" if it doesn't have an answer or doesn't know.\n",
|
"# This is also where you can give Claude an \"out\" if it doesn't have an answer or doesn't know.\n",
|
||||||
"# It's ideal to show this description and rules to a friend to make sure it is laid out logically and that any ambiguous words are clearly defined.\n",
|
"# It's ideal to show this description and rules to a friend to make sure it is laid out logically and that any ambiguous words are clearly defined.\n",
|
||||||
"TASK_DESCRIPTION = \"\"\"Write a clear, concise answer to this question:\n",
|
"TASK_DESCRIPTION = f\"\"\"Write a clear, concise answer to this question:\n",
|
||||||
"\n",
|
"\n",
|
||||||
"<question>\n",
|
"<question>\n",
|
||||||
"{QUESTION}\n",
|
"{QUESTION}\n",
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"*This lesson teaches our current tool use format. However, we will be updating and improving tool use functionality in the near future, including:*\n",
|
"*This lesson teaches our current tool use format. However, we will be updating and improving tool use functionality in the near future, including:*\n",
|
||||||
"* *A more streamlined format for function definitions and calls*\n",
|
"* *A more streamlined format for function definitions and calls*\n",
|
||||||
"* *More robust error handilgj and edge case coverage*\n",
|
"* *More robust error handling and edge case coverage*\n",
|
||||||
"* *Tighter integration with the rest of our API*\n",
|
"* *Tighter integration with the rest of our API*\n",
|
||||||
"* *Better reliability and performance, especially for more complex tool use tasks*"
|
"* *Better reliability and performance, especially for more complex tool use tasks*"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user