refactor: improve the get microagents API (#9958)

Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
This commit is contained in:
Hiep Le
2025-07-31 11:33:02 +07:00
committed by GitHub
parent c2e860fe92
commit 10ae481b91
8 changed files with 1145 additions and 1332 deletions

View File

@@ -1,3 +1,4 @@
from datetime import datetime
from enum import Enum
from pydantic import BaseModel, Field
@@ -34,3 +35,25 @@ class MicroagentMetadata(BaseModel):
mcp_tools: MCPConfig | None = (
None # optional, for microagents that provide additional MCP tools
)
class MicroagentResponse(BaseModel):
"""Response model for microagents endpoint.
Note: This model only includes basic metadata that can be determined
without parsing microagent content. Use the separate content API
to get detailed microagent information.
"""
name: str
path: str
created_at: datetime
class MicroagentContentResponse(BaseModel):
"""Response model for individual microagent content endpoint."""
content: str
path: str
triggers: list[str] = []
git_provider: str | None = None