diff --git a/CHANGELOG.md b/CHANGELOG.md index ceeb398f..93846311 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## v0.8.41 - 2025-01-29 + +### Features +- **Agent Visibility System**: Added public/private agent visibility controls, allowing agents to be marked as public or private for better access management +- **Jupiter Skill Integration**: New Jupiter skill for Solana DeFi operations including token price queries and swap functionality +- **Enhanced Template Creation**: Improved agent template creation with support for visibility settings and additional field mappings + +### Improvements +- **Prompt Structure**: Refined prompt structure and formatting for better clarity and consistency +- **Template Fields**: Added more comprehensive field support when creating agents from templates + +### Bug Fixes +- **Template Agent Creation**: Fixed field mapping issues in template-based agent creation + +**Full Changelog**: https://github.com/crestalnetwork/intentkit/compare/v0.8.40...v0.8.41 + ## v0.8.40 - 2025-01-31 ### Features diff --git a/intentkit/core/template.py b/intentkit/core/template.py index fae0c1f7..faa5889b 100644 --- a/intentkit/core/template.py +++ b/intentkit/core/template.py @@ -5,6 +5,7 @@ from epyxid import XID from pydantic import BaseModel +from pydantic import Field as PydanticField from sqlalchemy import select from intentkit.models.agent import Agent, AgentCore, AgentTable, AgentVisibility @@ -116,13 +117,30 @@ async def render_agent(agent: Agent) -> Agent: class AgentCreationFromTemplate(BaseModel): """Data structure for creating an agent from a template.""" - template_id: str - name: str | None = None - picture: str | None = None - description: str | None = None - readonly_wallet_address: str | None = None - weekly_spending_limit: float | None = None - extra_prompt: str | None = None + template_id: str = PydanticField( + description="ID of the template to create the agent from" + ) + name: str | None = PydanticField( + default=None, + description="Name of the agent (overrides template name if provided)", + ) + picture: str | None = PydanticField( + default=None, + description="Picture URL for the agent (overrides template picture if provided)", + ) + description: str | None = PydanticField( + default=None, description="Description of the agent" + ) + readonly_wallet_address: str | None = PydanticField( + default=None, description="Read-only wallet address for the agent" + ) + weekly_spending_limit: float | None = PydanticField( + default=None, description="Weekly spending limit for the agent" + ) + extra_prompt: str | None = PydanticField( + default=None, + description="Additional prompt text to be injected into the system prompt", + ) async def create_agent_from_template( diff --git a/intentkit/models/agent.py b/intentkit/models/agent.py index f15ffd2b..013cfe0f 100644 --- a/intentkit/models/agent.py +++ b/intentkit/models/agent.py @@ -813,7 +813,14 @@ class AgentUpdate(AgentUserInput): ), ] - @field_validator("purpose", "personality", "principles", "prompt", "prompt_append") + @field_validator( + "purpose", + "personality", + "principles", + "prompt", + "prompt_append", + "extra_prompt", + ) @classmethod def validate_no_level1_level2_headings(cls, v: str | None) -> str | None: """Validate that the text doesn't contain level 1 or level 2 headings.""" diff --git a/tests/core/test_template.py b/tests/core/test_template.py index 2fad55a7..62987c93 100644 --- a/tests/core/test_template.py +++ b/tests/core/test_template.py @@ -121,6 +121,9 @@ async def test_create_agent_from_template_without_team(): name="Private Agent", picture="private_pic.png", description="Created without team", + readonly_wallet_address="0x1234567890abcdef", + weekly_spending_limit=100.0, + extra_prompt="Additional task instructions", ) # 2. Mock Database @@ -157,6 +160,11 @@ async def mock_refresh(instance): # Verify visibility is set to PRIVATE when team_id is None assert added_agent.visibility == AgentVisibility.PRIVATE + # Verify new optional fields are correctly passed through + assert added_agent.readonly_wallet_address == "0x1234567890abcdef" + assert added_agent.weekly_spending_limit == 100.0 + assert added_agent.extra_prompt == "Additional task instructions" + @pytest.mark.asyncio async def test_create_template_from_agent():