@elizaos/prompts 2.0.0-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,615 @@
1
+ /**
2
+ * Auto-generated prompt templates for elizaOS
3
+ * DO NOT EDIT - Generated from packages/prompts/prompts/*.txt
4
+ *
5
+ * These prompts use Handlebars-style template syntax:
6
+ * - {{variableName}} for simple substitution
7
+ * - {{#each items}}...{{/each}} for iteration
8
+ * - {{#if condition}}...{{/if}} for conditionals
9
+ */
10
+
11
+ export const autonomyContinuousContinueTemplate = `Your job: reflect on context, decide what you want to do next, and act if appropriate.
12
+ - Use available actions/tools when they can advance the goal.
13
+ - Use thinking to think about and plan what you want to do.
14
+ - Do NOT speak out loud. This loop is internal-only.
15
+ - Output structure: ONLY a <thought> plus any actions. No other message text.
16
+ - If you don't need to make a change this round, take no action and output only a <thought>.
17
+ - If you cannot act, explain what is missing inside <thought> and take no action.
18
+ - Keep the response concise, focused on the next action.
19
+
20
+ USER CONTEXT (most recent last):
21
+ {{targetRoomContext}}
22
+
23
+ Your last autonomous note: "{{lastThought}}"
24
+
25
+ Continue from that note. Output <thought> and take action if needed.`;
26
+
27
+ export const AUTONOMY_CONTINUOUS_CONTINUE_TEMPLATE = autonomyContinuousContinueTemplate;
28
+
29
+ export const autonomyContinuousFirstTemplate = `Your job: reflect on context, decide what you want to do next, and act if appropriate.
30
+ - Use available actions/tools when they can advance the goal.
31
+ - Use thinking to think about and plan what you want to do.
32
+ - Do NOT speak out loud. This loop is internal-only.
33
+ - Output structure: ONLY a <thought> plus any actions. No other message text.
34
+ - If you don't need to make a change this round, take no action and output only a <thought>.
35
+ - If you cannot act, explain what is missing inside <thought> and take no action.
36
+ - Keep the response concise, focused on the next action.
37
+
38
+ USER CONTEXT (most recent last):
39
+ {{targetRoomContext}}
40
+
41
+ Think briefly, then output <thought> and take action if needed.`;
42
+
43
+ export const AUTONOMY_CONTINUOUS_FIRST_TEMPLATE = autonomyContinuousFirstTemplate;
44
+
45
+ export const autonomyTaskContinueTemplate = `You are running in AUTONOMOUS TASK MODE.
46
+
47
+ Your job: continue helping the user and make progress toward the task.
48
+ - Use available actions/tools to gather information or execute steps.
49
+ - Use thinking to think about and plan what you want to do.
50
+ - Do NOT speak out loud. This loop is internal-only.
51
+ - Output structure: ONLY a <thought> plus any actions. No other message text.
52
+ - If you don't need to make a change this round, take no action and output only a <thought>.
53
+ - If you cannot act, explain what is missing inside <thought> and take no action.
54
+ - Keep the response concise, focused on the next action.
55
+
56
+ USER CHAT CONTEXT (most recent last):
57
+ {{targetRoomContext}}
58
+
59
+ Your last autonomous note: "{{lastThought}}"
60
+
61
+ Continue the task. Output <thought> and take action now.`;
62
+
63
+ export const AUTONOMY_TASK_CONTINUE_TEMPLATE = autonomyTaskContinueTemplate;
64
+
65
+ export const autonomyTaskFirstTemplate = `You are running in AUTONOMOUS TASK MODE.
66
+
67
+ Your job: continue helping the user and make progress toward the task.
68
+ - Use available actions/tools to gather information or execute steps.
69
+ - If you need UI control, use ComputerUse actions.
70
+ - In MCP mode, selector-based actions require a process scope (pass process=... or prefix selector with "process:<name> >> ...").
71
+ - Prefer safe, incremental steps; if unsure, gather more UI context before acting.
72
+ - Do NOT speak out loud. This loop is internal-only.
73
+ - Output structure: ONLY a <thought> plus any actions. No other message text.
74
+
75
+ USER CHAT CONTEXT (most recent last):
76
+ {{targetRoomContext}}
77
+
78
+ Decide what to do next. Output <thought>, then take the most useful action.`;
79
+
80
+ export const AUTONOMY_TASK_FIRST_TEMPLATE = autonomyTaskFirstTemplate;
81
+
82
+ export const chooseOptionTemplate = `# Task: Choose an option from the available choices.
83
+
84
+ {{providers}}
85
+
86
+ # Available Options:
87
+ {{options}}
88
+
89
+ # Instructions:
90
+ Analyze the options and select the most appropriate one based on the current context.
91
+ Provide your reasoning and the selected option ID.
92
+
93
+ Respond using XML format like this:
94
+ <response>
95
+ <thought>Your reasoning for the selection</thought>
96
+ <selected_id>The ID of the selected option</selected_id>
97
+ </response>
98
+
99
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above.`;
100
+
101
+ export const CHOOSE_OPTION_TEMPLATE = chooseOptionTemplate;
102
+
103
+ export const imageDescriptionTemplate = `<task>Analyze the provided image and generate a comprehensive description with multiple levels of detail.</task>
104
+
105
+ <instructions>
106
+ Carefully examine the image and provide:
107
+ 1. A concise, descriptive title that captures the main subject or scene
108
+ 2. A brief summary description (1-2 sentences) highlighting the key elements
109
+ 3. An extensive, detailed description that covers all visible elements, composition, lighting, colors, mood, and any other relevant details
110
+
111
+ Be objective and descriptive. Focus on what you can actually see in the image rather than making assumptions about context or meaning.
112
+ </instructions>
113
+
114
+ <output>
115
+ Do NOT include any thinking, reasoning, or <think> sections in your response.
116
+ Go directly to the XML response format without any preamble or explanation.
117
+
118
+ Respond using XML format like this:
119
+ <response>
120
+ <title>A concise, descriptive title for the image</title>
121
+ <description>A brief 1-2 sentence summary of the key elements in the image</description>
122
+ <text>An extensive, detailed description covering all visible elements, composition, lighting, colors, mood, setting, objects, people, activities, and any other relevant details you can observe in the image</text>
123
+ </response>
124
+
125
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.
126
+ </output>`;
127
+
128
+ export const IMAGE_DESCRIPTION_TEMPLATE = imageDescriptionTemplate;
129
+
130
+ export const imageGenerationTemplate = `# Task: Generate an image prompt for {{agentName}}.
131
+
132
+ {{providers}}
133
+
134
+ # Instructions:
135
+ Based on the conversation, create a detailed prompt for image generation.
136
+ The prompt should be specific, descriptive, and suitable for AI image generation.
137
+
138
+ # Recent conversation:
139
+ {{recentMessages}}
140
+
141
+ Respond using XML format like this:
142
+ <response>
143
+ <thought>Your reasoning for the image prompt</thought>
144
+ <prompt>Detailed image generation prompt</prompt>
145
+ </response>
146
+
147
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above.`;
148
+
149
+ export const IMAGE_GENERATION_TEMPLATE = imageGenerationTemplate;
150
+
151
+ export const messageHandlerTemplate = `<task>Generate dialog and actions for the character {{agentName}}.</task>
152
+
153
+ <providers>
154
+ {{providers}}
155
+ </providers>
156
+
157
+ <instructions>
158
+ Write a thought and plan for {{agentName}} and decide what actions to take. Also include the providers that {{agentName}} will use to have the right context for responding and acting, if any.
159
+
160
+ IMPORTANT ACTION ORDERING RULES:
161
+ - Actions are executed in the ORDER you list them - the order MATTERS!
162
+ - REPLY should come FIRST to acknowledge the user's request before executing other actions
163
+ - Common patterns:
164
+ - For requests requiring tool use: REPLY,CALL_MCP_TOOL (acknowledge first, then gather info)
165
+ - For task execution: REPLY,SEND_MESSAGE or REPLY,EVM_SWAP_TOKENS (acknowledge first, then do the task)
166
+ - For multi-step operations: REPLY,ACTION1,ACTION2 (acknowledge first, then complete all steps)
167
+ - REPLY is used to acknowledge and inform the user about what you're going to do
168
+ - Follow-up actions execute the actual tasks after acknowledgment
169
+ - Use IGNORE only when you should not respond at all
170
+ - If you use IGNORE, do not include any other actions. IGNORE should be used alone when you should not respond or take any actions.
171
+
172
+ IMPORTANT ACTION PARAMETERS:
173
+ - Some actions accept input parameters that you should extract from the conversation
174
+ - When an action has parameters listed in its description, include a <params> block for that action
175
+ - Extract parameter values from the user's message and conversation context
176
+ - Required parameters MUST be provided; optional parameters can be omitted if not mentioned
177
+ - If you cannot determine a required parameter value, ask the user for clarification in your <text>
178
+
179
+ EXAMPLE (action parameters):
180
+ User message: "Send a message to @dev_guru on telegram saying Hello!"
181
+ Actions: REPLY,SEND_MESSAGE
182
+ Params:
183
+ <params>
184
+ <SEND_MESSAGE>
185
+ <targetType>user</targetType>
186
+ <source>telegram</source>
187
+ <target>dev_guru</target>
188
+ <text>Hello!</text>
189
+ </SEND_MESSAGE>
190
+ </params>
191
+
192
+ IMPORTANT PROVIDER SELECTION RULES:
193
+ - Only include providers if they are needed to respond accurately.
194
+ - If the message mentions images, photos, pictures, attachments, or visual content, OR if you see "(Attachments:" in the conversation, you MUST include "ATTACHMENTS" in your providers list
195
+ - If the message asks about or references specific people, include "ENTITIES" in your providers list
196
+ - If the message asks about relationships or connections between people, include "RELATIONSHIPS" in your providers list
197
+ - If the message asks about facts or specific information, include "FACTS" in your providers list
198
+ - If the message asks about the environment or world context, include "WORLD" in your providers list
199
+ - If no additional context is needed, you may leave the providers list empty.
200
+
201
+ IMPORTANT CODE BLOCK FORMATTING RULES:
202
+ - If {{agentName}} includes code examples, snippets, or multi-line code in the response, ALWAYS wrap the code with \`\`\` fenced code blocks (specify the language if known, e.g., \`\`\`python).
203
+ - ONLY use fenced code blocks for actual code. Do NOT wrap non-code text, instructions, or single words in fenced code blocks.
204
+ - If including inline code (short single words or function names), use single backticks (\`) as appropriate.
205
+ - This ensures the user sees clearly formatted and copyable code when relevant.
206
+
207
+ First, think about what you want to do next and plan your actions. Then, write the next message and include the actions you plan to take.
208
+ </instructions>
209
+
210
+ <keys>
211
+ "thought" should be a short description of what the agent is thinking about and planning.
212
+ "actions" should be a comma-separated list of the actions {{agentName}} plans to take based on the thought, IN THE ORDER THEY SHOULD BE EXECUTED (if none, use IGNORE, if simply responding with text, use REPLY)
213
+ "providers" should be a comma-separated list of the providers that {{agentName}} will use to have the right context for responding and acting (NEVER use "IGNORE" as a provider - use specific provider names like ATTACHMENTS, ENTITIES, FACTS, KNOWLEDGE, etc.)
214
+ "text" should be the text of the next message for {{agentName}} which they will send to the conversation.
215
+ "params" (optional) should contain action parameters when actions require input. Format as nested XML with action name as wrapper.
216
+ </keys>
217
+
218
+ <output>
219
+ Do NOT include any thinking, reasoning, or <think> sections in your response.
220
+ Go directly to the XML response format without any preamble or explanation.
221
+
222
+ Respond using XML format like this:
223
+ <response>
224
+ <thought>Your thought here</thought>
225
+ <actions>ACTION1,ACTION2</actions>
226
+ <providers>PROVIDER1,PROVIDER2</providers>
227
+ <text>Your response text here</text>
228
+ <params>
229
+ <ACTION1>
230
+ <paramName1>value1</paramName1>
231
+ <paramName2>value2</paramName2>
232
+ </ACTION1>
233
+ <ACTION2>
234
+ <paramName1>value1</paramName1>
235
+ </ACTION2>
236
+ </params>
237
+ </response>
238
+
239
+ The <params> block is optional - only include when actions require input parameters.
240
+ If an action has no parameters or you're only using REPLY/IGNORE, omit <params> entirely.
241
+
242
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.
243
+ </output>`;
244
+
245
+ export const MESSAGE_HANDLER_TEMPLATE = messageHandlerTemplate;
246
+
247
+ export const multiStepDecisionTemplate = `<task>
248
+ Determine the next step the assistant should take in this conversation to help the user reach their goal.
249
+ </task>
250
+
251
+ {{recentMessages}}
252
+
253
+ # Multi-Step Workflow
254
+
255
+ In each step, decide:
256
+
257
+ 1. **Which providers (if any)** should be called to gather necessary data.
258
+ 2. **Which action (if any)** should be executed after providers return.
259
+ 3. Decide whether the task is complete. If so, set \`isFinish: true\`. Do not select the \`REPLY\` action; replies are handled separately after task completion.
260
+
261
+ You can select **multiple providers** and at most **one action** per step.
262
+
263
+ If the task is fully resolved and no further steps are needed, mark the step as \`isFinish: true\`.
264
+
265
+ ---
266
+
267
+ {{actionsWithDescriptions}}
268
+
269
+ {{providersWithDescriptions}}
270
+
271
+ These are the actions or data provider calls that have already been used in this run. Use this to avoid redundancy and guide your next move.
272
+
273
+ {{actionResults}}
274
+
275
+ <keys>
276
+ "thought" Clearly explain your reasoning for the selected providers and/or action, and how this step contributes to resolving the user's request.
277
+ "action" Name of the action to execute after providers return (can be empty if no action is needed).
278
+ "providers" List of provider names to call in this step (can be empty if none are needed).
279
+ "isFinish" Set to true only if the task is fully complete.
280
+ </keys>
281
+
282
+ ⚠️ IMPORTANT: Do **not** mark the task as \`isFinish: true\` immediately after calling an action. Wait for the action to complete before deciding the task is finished.
283
+
284
+ <output>
285
+ <response>
286
+ <thought>Your thought here</thought>
287
+ <action>ACTION</action>
288
+ <providers>PROVIDER1,PROVIDER2</providers>
289
+ <isFinish>true | false</isFinish>
290
+ </response>
291
+ </output>`;
292
+
293
+ export const MULTI_STEP_DECISION_TEMPLATE = multiStepDecisionTemplate;
294
+
295
+ export const multiStepSummaryTemplate = `<task>
296
+ Summarize what the assistant has done so far and provide a final response to the user based on the completed steps.
297
+ </task>
298
+
299
+ # Context Information
300
+ {{bio}}
301
+
302
+ ---
303
+
304
+ {{system}}
305
+
306
+ ---
307
+
308
+ {{messageDirections}}
309
+
310
+ # Conversation Summary
311
+ Below is the user's original request and conversation so far:
312
+ {{recentMessages}}
313
+
314
+ # Execution Trace
315
+ Here are the actions taken by the assistant to fulfill the request:
316
+ {{actionResults}}
317
+
318
+ # Assistant's Last Reasoning Step
319
+ {{recentMessage}}
320
+
321
+ # Instructions
322
+
323
+ - Review the execution trace and last reasoning step carefully
324
+
325
+ - Your final output MUST be in this XML format:
326
+ <output>
327
+ <response>
328
+ <thought>Your thought here</thought>
329
+ <text>Your final message to the user</text>
330
+ </response>
331
+ </output>`;
332
+
333
+ export const MULTI_STEP_SUMMARY_TEMPLATE = multiStepSummaryTemplate;
334
+
335
+ export const optionExtractionTemplate = `# Task: Extract selected task and option from user message
336
+
337
+ # Available Tasks:
338
+ {{tasks}}
339
+
340
+ # Recent Messages:
341
+ {{recentMessages}}
342
+
343
+ # Instructions:
344
+ 1. Review the user's message and identify which task and option they are selecting
345
+ 2. Match against the available tasks and their options, including ABORT
346
+ 3. Return the task ID (shortened UUID) and selected option name exactly as listed above
347
+ 4. If no clear selection is made, return null for both fields
348
+
349
+ Do NOT include any thinking, reasoning, or <think> sections in your response.
350
+ Go directly to the XML response format without any preamble or explanation.
351
+
352
+ Return in XML format:
353
+ <response>
354
+ <taskId>string_or_null</taskId>
355
+ <selectedOption>OPTION_NAME_or_null</selectedOption>
356
+ </response>
357
+
358
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.`;
359
+
360
+ export const OPTION_EXTRACTION_TEMPLATE = optionExtractionTemplate;
361
+
362
+ export const postCreationTemplate = `# Task: Create a post in the voice and style and perspective of {{agentName}} @{{xUserName}}.
363
+
364
+ Example task outputs:
365
+ 1. A post about the importance of AI in our lives
366
+ <response>
367
+ <thought>I am thinking about writing a post about the importance of AI in our lives</thought>
368
+ <post>AI is changing the world and it is important to understand how it works</post>
369
+ <imagePrompt>A futuristic cityscape with flying cars and people using AI to do things</imagePrompt>
370
+ </response>
371
+
372
+ 2. A post about dogs
373
+ <response>
374
+ <thought>I am thinking about writing a post about dogs</thought>
375
+ <post>Dogs are man's best friend and they are loyal and loving</post>
376
+ <imagePrompt>A dog playing with a ball in a park</imagePrompt>
377
+ </response>
378
+
379
+ 3. A post about finding a new job
380
+ <response>
381
+ <thought>Getting a job is hard, I bet there's a good post in that</thought>
382
+ <post>Just keep going!</post>
383
+ <imagePrompt>A person looking at a computer screen with a job search website</imagePrompt>
384
+ </response>
385
+
386
+ {{providers}}
387
+
388
+ Write a 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.
389
+ Your response should be 1, 2, or 3 sentences (choose the length at random).
390
+ Your response should not contain any questions. Brief, concise statements only. The total character count MUST be less than 280. No emojis. Use \\n\\n (double spaces) between statements if there are multiple statements in your response.
391
+
392
+ Your output should be formatted in XML like this:
393
+ <response>
394
+ <thought>Your thought here</thought>
395
+ <post>Your post text here</post>
396
+ <imagePrompt>Optional image prompt here</imagePrompt>
397
+ </response>
398
+
399
+ The "post" field should be the post you want to send. Do not including any thinking or internal reflection in the "post" field.
400
+ The "imagePrompt" field is optional and should be a prompt for an image that is relevant to the post. It should be a single sentence that captures the essence of the post. ONLY USE THIS FIELD if it makes sense that the post would benefit from an image.
401
+ The "thought" field should be a short description of what the agent is thinking about before responding, including a brief justification for the response. Includate an explanation how the post is relevant to the topic but unique and different than other posts.
402
+
403
+ Do NOT include any thinking, reasoning, or <think> sections in your response.
404
+ Go directly to the XML response format without any preamble or explanation.
405
+
406
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.`;
407
+
408
+ export const POST_CREATION_TEMPLATE = postCreationTemplate;
409
+
410
+ export const reflectionEvaluatorTemplate = `# Task: Generate Agent Reflection, Extract Facts and Relationships
411
+
412
+ {{providers}}
413
+
414
+ # Examples:
415
+ {{evaluationExamples}}
416
+
417
+ # Entities in Room
418
+ {{entitiesInRoom}}
419
+
420
+ # Existing Relationships
421
+ {{existingRelationships}}
422
+
423
+ # Current Context:
424
+ Agent Name: {{agentName}}
425
+ Room Type: {{roomType}}
426
+ Message Sender: {{senderName}} (ID: {{senderId}})
427
+
428
+ {{recentMessages}}
429
+
430
+ # Known Facts:
431
+ {{knownFacts}}
432
+
433
+ # Instructions:
434
+ 1. Generate a self-reflective thought on the conversation about your performance and interaction quality.
435
+ 2. Extract new facts from the conversation.
436
+ 3. Identify and describe relationships between entities.
437
+ - The sourceEntityId is the UUID of the entity initiating the interaction.
438
+ - The targetEntityId is the UUID of the entity being interacted with.
439
+ - Relationships are one-direction, so a friendship would be two entity relationships where each entity is both the source and the target of the other.
440
+
441
+ Do NOT include any thinking, reasoning, or <think> sections in your response.
442
+ Go directly to the XML response format without any preamble or explanation.
443
+
444
+ Generate a response in the following format:
445
+ <response>
446
+ <thought>a self-reflective thought on the conversation</thought>
447
+ <facts>
448
+ <fact>
449
+ <claim>factual statement</claim>
450
+ <type>fact|opinion|status</type>
451
+ <in_bio>false</in_bio>
452
+ <already_known>false</already_known>
453
+ </fact>
454
+ <!-- Add more facts as needed -->
455
+ </facts>
456
+ <relationships>
457
+ <relationship>
458
+ <sourceEntityId>entity_initiating_interaction</sourceEntityId>
459
+ <targetEntityId>entity_being_interacted_with</targetEntityId>
460
+ <tags>group_interaction,voice_interaction,dm_interaction,additional_tag1,additional_tag2</tags>
461
+ </relationship>
462
+ <!-- Add more relationships as needed -->
463
+ </relationships>
464
+ </response>
465
+
466
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.`;
467
+
468
+ export const REFLECTION_EVALUATOR_TEMPLATE = reflectionEvaluatorTemplate;
469
+
470
+ export const reflectionTemplate = `# Task: Reflect on recent agent behavior and interactions.
471
+
472
+ {{providers}}
473
+
474
+ # Recent Interactions:
475
+ {{recentInteractions}}
476
+
477
+ # Instructions:
478
+ Analyze the agent's recent behavior and interactions. Consider:
479
+ 1. Was the communication clear and helpful?
480
+ 2. Were responses appropriate for the context?
481
+ 3. Were any mistakes made?
482
+ 4. What could be improved?
483
+
484
+ Respond using XML format like this:
485
+ <response>
486
+ <thought>Your detailed analysis</thought>
487
+ <quality_score>Score 0-100 for overall quality</quality_score>
488
+ <strengths>What went well</strengths>
489
+ <improvements>What could be improved</improvements>
490
+ <learnings>Key takeaways for future interactions</learnings>
491
+ </response>
492
+
493
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above.`;
494
+
495
+ export const REFLECTION_TEMPLATE = reflectionTemplate;
496
+
497
+ export const replyTemplate = `# Task: Generate dialog for the character {{agentName}}.
498
+
499
+ {{providers}}
500
+
501
+ # Instructions: Write the next message for {{agentName}}.
502
+ "thought" should be a short description of what the agent is thinking about and planning.
503
+ "text" should be the next message for {{agentName}} which they will send to the conversation.
504
+
505
+ IMPORTANT CODE BLOCK FORMATTING RULES:
506
+ - If {{agentName}} includes code examples, snippets, or multi-line code in the response, ALWAYS wrap the code with \`\`\` fenced code blocks (specify the language if known, e.g., \`\`\`python).
507
+ - ONLY use fenced code blocks for actual code. Do NOT wrap non-code text, instructions, or single words in fenced code blocks.
508
+ - If including inline code (short single words or function names), use single backticks (\`) as appropriate.
509
+ - This ensures the user sees clearly formatted and copyable code when relevant.
510
+
511
+ Do NOT include any thinking, reasoning, or <think> sections in your response.
512
+ Go directly to the XML response format without any preamble or explanation.
513
+
514
+ Respond using XML format like this:
515
+ <response>
516
+ <thought>Your thought here</thought>
517
+ <text>Your message here</text>
518
+ </response>
519
+
520
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.`;
521
+
522
+ export const REPLY_TEMPLATE = replyTemplate;
523
+
524
+ export const shouldRespondTemplate = `<task>Decide on behalf of {{agentName}} whether they should respond to the message, ignore it or stop the conversation.</task>
525
+
526
+ <providers>
527
+ {{providers}}
528
+ </providers>
529
+
530
+ <instructions>Decide if {{agentName}} should respond to or interact with the conversation.
531
+
532
+ IMPORTANT RULES FOR RESPONDING:
533
+ - If YOUR name ({{agentName}}) is directly mentioned → RESPOND
534
+ - If someone uses a DIFFERENT name (not {{agentName}}) → IGNORE (they're talking to someone else)
535
+ - If you're actively participating in a conversation and the message continues that thread → RESPOND
536
+ - If someone tells you to stop or be quiet → STOP
537
+ - Otherwise → IGNORE
538
+
539
+ The key distinction is:
540
+ - "Talking TO {{agentName}}" (your name mentioned, replies to you, continuing your conversation) → RESPOND
541
+ - "Talking ABOUT {{agentName}}" or to someone else → IGNORE
542
+ </instructions>
543
+
544
+ <output>
545
+ Do NOT include any thinking, reasoning, or <think> sections in your response.
546
+ Go directly to the XML response format without any preamble or explanation.
547
+
548
+ Respond using XML format like this:
549
+ <response>
550
+ <name>{{agentName}}</name>
551
+ <reasoning>Your reasoning here</reasoning>
552
+ <action>RESPOND | IGNORE | STOP</action>
553
+ </response>
554
+
555
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.
556
+ </output>`;
557
+
558
+ export const SHOULD_RESPOND_TEMPLATE = shouldRespondTemplate;
559
+
560
+ export const updateEntityTemplate = `# Task: Update entity information.
561
+
562
+ {{providers}}
563
+
564
+ # Current Entity Information:
565
+ {{entityInfo}}
566
+
567
+ # Instructions:
568
+ Based on the request, determine what information about the entity should be updated.
569
+ Only update fields that the user has explicitly requested to change.
570
+
571
+ Respond using XML format like this:
572
+ <response>
573
+ <thought>Your reasoning for the entity update</thought>
574
+ <entity_id>The entity ID to update</entity_id>
575
+ <updates>
576
+ <field>
577
+ <name>field_name</name>
578
+ <value>new_value</value>
579
+ </field>
580
+ </updates>
581
+ </response>
582
+
583
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above.`;
584
+
585
+ export const UPDATE_ENTITY_TEMPLATE = updateEntityTemplate;
586
+
587
+ export const updateSettingsTemplate = `# Task: Update settings based on the request.
588
+
589
+ {{providers}}
590
+
591
+ # Current Settings:
592
+ {{settings}}
593
+
594
+ # Instructions:
595
+ Based on the request, determine which settings to update.
596
+ Only update settings that the user has explicitly requested.
597
+
598
+ Respond using XML format like this:
599
+ <response>
600
+ <thought>Your reasoning for the settings changes</thought>
601
+ <updates>
602
+ <update>
603
+ <key>setting_key</key>
604
+ <value>new_value</value>
605
+ </update>
606
+ </updates>
607
+ </response>
608
+
609
+ IMPORTANT: Your response must ONLY contain the <response></response> XML block above.`;
610
+
611
+ export const UPDATE_SETTINGS_TEMPLATE = updateSettingsTemplate;
612
+
613
+ export const booleanFooter = "Respond with only a YES or a NO.";
614
+
615
+ export const BOOLEAN_FOOTER = booleanFooter;
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@elizaos/prompts",
3
+ "private": false,
4
+ "version": "2.0.0-alpha",
5
+ "description": "Shared prompt templates for elizaOS across TypeScript, Python, and Rust",
6
+ "type": "module",
7
+ "main": "./dist/typescript/index.ts",
8
+ "types": "./dist/typescript/index.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/typescript/index.ts",
12
+ "import": "./dist/typescript/index.ts"
13
+ },
14
+ "./python": "./dist/python/prompts.py",
15
+ "./rust": "./dist/rust/prompts.rs"
16
+ },
17
+ "scripts": {
18
+ "build": "node scripts/generate.js && node scripts/generate-plugin-action-spec.js && node scripts/generate-action-docs.js",
19
+ "build:typescript": "node scripts/generate.js --target typescript",
20
+ "build:python": "node scripts/generate.js --target python",
21
+ "build:rust": "node scripts/generate.js --target rust",
22
+ "build:action-docs": "node scripts/generate-action-docs.js",
23
+ "build:plugin-action-spec": "node scripts/generate-plugin-action-spec.js",
24
+ "check:secrets": "node scripts/check-secrets.js",
25
+ "clean": "rm -rf dist",
26
+ "lint": "bunx @biomejs/biome check --write --unsafe .",
27
+ "lint:check": "bunx @biomejs/biome check .",
28
+ "typecheck": "echo 'No TypeScript source files to check'"
29
+ },
30
+ "files": [
31
+ "prompts/",
32
+ "dist/",
33
+ "scripts/"
34
+ ],
35
+ "keywords": [
36
+ "elizaos",
37
+ "prompts",
38
+ "templates",
39
+ "ai",
40
+ "llm"
41
+ ],
42
+ "license": "MIT",
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "gitHead": "97cb016b794d01bc07a552427734d2e98a1d674a"
47
+ }
@@ -0,0 +1,15 @@
1
+ Your job: reflect on context, decide what you want to do next, and act if appropriate.
2
+ - Use available actions/tools when they can advance the goal.
3
+ - Use thinking to think about and plan what you want to do.
4
+ - Do NOT speak out loud. This loop is internal-only.
5
+ - Output structure: ONLY a <thought> plus any actions. No other message text.
6
+ - If you don't need to make a change this round, take no action and output only a <thought>.
7
+ - If you cannot act, explain what is missing inside <thought> and take no action.
8
+ - Keep the response concise, focused on the next action.
9
+
10
+ USER CONTEXT (most recent last):
11
+ {{targetRoomContext}}
12
+
13
+ Your last autonomous note: "{{lastThought}}"
14
+
15
+ Continue from that note. Output <thought> and take action if needed.