This PR implements the ability to customize agent prompts in KaibanJS, allowing developers to tailor the behavior and responses of AI agents to specific use cases or requirements.
Changes
Added support for overriding default prompt templates in the BaseAgent constructor
Updated ReactChampionAgent to utilize custom prompts when provided
Implemented Object.assign() method to merge custom prompts with default templates
Added documentation for the new custom prompts feature
Created example usage in the playground and test environments
How to Use
Developers can now provide custom prompt templates when initializing an agent:
const customPrompts = {
SYSTEM_MESSAGE: ({ agent, task }) => Custom system message for ${agent.name}...,
INITIAL_MESSAGE: ({ agent, task }) => Custom initial message for task: ${task.description}...,
// ... other custom prompts
};
const agent = new Agent({
// ... other agent properties
promptTemplates: customPrompts
});
Testing
Added unit tests for custom prompt integration
Updated e2e tests to include scenarios with custom prompts
Verified custom prompt functionality in the playground environment
Documentation
Updated README with information on how to use custom prompts
Added inline comments explaining the custom prompt override process
Related Issues
Closes #38
Checklist
[x] Code follows the project's coding standards
[x] Comments have been added, particularly in hard-to-understand areas
[x] Changes generate no new warnings
[x] Unit tests pass locally
[x] Any dependent changes have been merged and published in downstream modules
[] Documentation has been updated
Additional Notes
This feature enhances the flexibility of KaibanJS, allowing for more tailored AI agent interactions. It's important to note that while custom prompts offer greater control, they should be used judiciously to maintain consistency across the application.
Custom Agent Prompts
Description
This PR implements the ability to customize agent prompts in KaibanJS, allowing developers to tailor the behavior and responses of AI agents to specific use cases or requirements.
Changes
BaseAgent
constructorReactChampionAgent
to utilize custom prompts when providedObject.assign()
method to merge custom prompts with default templatesHow to Use
Developers can now provide custom prompt templates when initializing an agent:
Testing
Documentation
Related Issues
Closes #38
Checklist
Additional Notes
This feature enhances the flexibility of KaibanJS, allowing for more tailored AI agent interactions. It's important to note that while custom prompts offer greater control, they should be used judiciously to maintain consistency across the application.