feat: add field descriptions and validation for agent creation from template#935
feat: add field descriptions and validation for agent creation from template#935hyacinthus merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the agent creation from template functionality by adding comprehensive field descriptions for better API documentation and extends validation to prevent level 1 and level 2 markdown headings in the extra_prompt field.
Key Changes:
- Added Pydantic field descriptions to all fields in
AgentCreationFromTemplatefor improved API documentation - Extended field validation in
AgentUpdateto includeextra_promptfor heading restrictions - Updated tests to verify optional fields (
readonly_wallet_address,weekly_spending_limit,extra_prompt) are correctly passed through
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| intentkit/core/template.py | Added PydanticField descriptions to AgentCreationFromTemplate fields for better API documentation |
| intentkit/models/agent.py | Extended field validator to include extra_prompt for preventing level 1 and level 2 markdown headings |
| tests/core/test_template.py | Added test assertions to verify optional fields are correctly passed through when creating agents from templates |
| CHANGELOG.md | Added version 0.8.41 release notes documenting new features and improvements |
Comments suppressed due to low confidence (1)
intentkit/models/agent.py:830
- This import of module re is redundant, as it was previously imported on line 6.
import re
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| extra_prompt: str | None = PydanticField( | ||
| default=None, | ||
| description="Additional prompt text to be injected into the system prompt", | ||
| ) |
There was a problem hiding this comment.
The extra_prompt field in AgentCreationFromTemplate should have validation to prevent level 1 and level 2 headings (lines starting with "# " or "## "), consistent with the validation applied to extra_prompt in AgentUpdate. Without this validation, users could create agents from templates with invalid extra_prompt content that bypasses the heading restrictions enforced elsewhere in the system.
This PR adds Pydantic field descriptions to AgentCreationFromTemplate and includes extra_prompt validation in AgentUpdate.
Changes