Allow for customizable prompt templates #208
Open
+202
−198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant changes to the prompt creation and orchestration workflow in the codebase. The changes focus on refactoring the prompt creation logic, improving the descriptions for tools, and enhancing the orchestration workflow by introducing new prompt templates and better handling of custom instructions.
Refactoring and Improvements:
Prompt Creation Refactoring:
inputPrompt.js
,messageSummaryPrompt.js
,workflowSummaryPrompt.js
) and updated the import paths accordingly. ([[1]](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-b4dfd7878eec16efd1a0380da0464e07cc47af54ed1dc55b5fc0aefef7644059L21-R21)
,[[2]](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-d54f03d74b8d197391b49044b4557e75108a9f7d4c8800480b843439aedf7ad6L1-L96)
)createPrompts
function to include custom instructions for each type of prompt and return anOrchestratorPrompts
object. ([src/agents/workflows/orchestrator/prompts.tsL1-L94](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-898d517c9ce0d630ebd6fb1a6f31566f2fea89416af8a57a91686c7440875f81L1-L94)
)Enhanced Tool Descriptions:
createFetchMyRecentTweetsAndRepliesTool
to provide better context on its usage. ([src/agents/tools/twitterTools.tsL116-R117](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-230c660f4e65058334d197eecd5d08fa4631f93b723a7648314029959f810c75L116-R117)
)Orchestration Workflow Enhancements:
New Prompt Templates:
createInputPrompt
function to generate input prompts with detailed instructions and memory management rules. ([src/agents/workflows/orchestrator/nodes/inputPrompt.tsR1-R64](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-b2e08db2b9f277c67d3851b990977574059546cf698db5688d8237a7a55d7669R1-R64)
)createMessageSummaryPrompt
function to create detailed message summary prompts that preserve all information conveyed in the messages. ([src/agents/workflows/orchestrator/nodes/messageSummaryPrompt.tsR1-R44](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-7039098758f1907ccdf2759222c92945afeb8af3dd5d6d02e15dd0c23afcdd3fR1-R44)
)createWorkflowSummaryPrompt
function to generate workflow summary prompts that summarize messages in detail without recommending tool usage. ([src/agents/workflows/orchestrator/nodes/workflowSummaryPrompt.tsR1-R35](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-dc9d6e08725c40786fd5ba7e17499fdeb01e6eb1f83549e6a7f573248e1d6d99R1-R35)
)Orchestrator Workflow Updates:
messageSummaryPrompt
andworkflowSummaryPrompt
). ([[1]](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-49cc4f0909411e6de89a20d5a97f81c481546b48973288ba70aeb002b0dd4138L5-R19)
,[[2]](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-8712f0e470d012359def290bb6cb8e4cad477279c8a885cb5b96ca7152bc3ffdL27-R27)
,[[3]](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-b6e31d4ab6330f226a3a8396df55104e1543df617820358ac0a8f4d3a525eff9R17-R24)
)createTwitterPrompts
function, which includes custom instructions specific to the Twitter workflow. ([[1]](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-b50553d9a14cebc922dbd73f76ea0d585fe039df73270d725f01317ad0d668b3L4-R4)
,[[2]](https://github.com/autonomys/autonomys-agents/pull/208/files#diff-b50553d9a14cebc922dbd73f76ea0d585fe039df73270d725f01317ad0d668b3L21-R21)
)These changes collectively improve the modularity, readability, and functionality of the prompt creation and orchestration workflow in the codebase.
Closes #205