From 3ddcf87c4200ed22083c93bc54d3e143731840b2 Mon Sep 17 00:00:00 2001 From: Lukapetro Date: Thu, 12 Dec 2024 15:32:12 +0100 Subject: [PATCH] Add templates documentation to the project --- docs/docs/core/characterfile.md | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/docs/docs/core/characterfile.md b/docs/docs/core/characterfile.md index e25fe58348c..8662a548710 100644 --- a/docs/docs/core/characterfile.md +++ b/docs/docs/core/characterfile.md @@ -207,6 +207,53 @@ The `settings` object defines additional configurations like secrets and voice m } ``` +### Templates Configuration + +The `templates` object defines customizable prompt templates used for various tasks and interactions. Below is the list of available templates: + +- `goalsTemplate` +- `factsTemplate` +- `messageHandlerTemplate` +- `shouldRespondTemplate` +- `continueMessageHandlerTemplate` +- `evaluationTemplate` +- `twitterSearchTemplate` +- `twitterPostTemplate` +- `twitterMessageHandlerTemplate` +- `twitterShouldRespondTemplate` +- `telegramMessageHandlerTemplate` +- `telegramShouldRespondTemplate` +- `discordVoiceHandlerTemplate` +- `discordShouldRespondTemplate` +- `discordMessageHandlerTemplate` + +### Example: Twitter Post Template + +Here’s an example of a `twitterPostTemplate`: + +```js +templates: { + twitterPostTemplate: ` +# Areas of Expertise +{{knowledge}} + +# About {{agentName}} (@{{twitterUserName}}): +{{bio}} +{{lore}} +{{topics}} + +{{providers}} + +{{characterPostExamples}} + +{{postDirections}} + +# Task: Generate a post in the voice and style and perspective of {{agentName}} @{{twitterUserName}}. +Write a 1-3 sentence post that is {{adjective}} about {{topic}} (without mentioning {{topic}} directly), from the perspective of {{agentName}}. Do not add commentary or acknowledge this request, just write the post. +Your response should not contain any questions. Brief, concise statements only. The total character count MUST be less than {{maxTweetLength}}. No emojis. Use \\n\\n (double spaces) between statements.`, +} +``` + --- ## Example: Complete Character File