Skip to content

Conversation

ksrpraneeth
Copy link
Contributor

#326
[https://drive.google.com/file/d/1Hrl2tHw_NfJNRfuuimOctbOh2Co_CjCo/view?usp=sharing](Video Preview)

ksrpraneeth and others added 13 commits July 30, 2025 11:13
- Add conditional message reordering for mixed content (text + images)
- Preserve original order for pure tool responses to maintain references
- Ensure OpenAI's required message sequence is maintained

Fixes evalstate#314
- Added test_openai_tool_validation_fix.py with 3 test scenarios:
  1. Parallel tool calls with mixed content ordering
  2. OpenAI validation error prevention
  3. Single mixed content tool validation
- Added mixed_content_server.py MCP server to reproduce issue scenario
- Moved tests to multimodal directory (appropriate for text+image content)
- Updated fastagent.config.yaml files accordingly

Tests validate the fix for OpenAI API validation errors that occurred
during parallel tool calls when one tool returns mixed content.
Implement dynamic agents that can be created at runtime by other agents,
enabling adaptive team composition and specialized task delegation.

Key Features:
- Create specialized agents on-the-fly during execution
- Each agent has its own context, memory, tools, and prompt
- Parallel execution for efficient team coordination
- Lifecycle management (create, communicate, terminate)
- MCP server and tool access control
- Console display with agent tree visualization
- Usage tracking and performance monitoring

Use Cases:
- Project management with specialized development teams
- Code review teams with different expertise areas
- Content creation with writers, editors, and reviewers
- Data analysis with collectors, processors, and visualizers
- Organize imports alphabetically and group properly
- Remove unused imports (typing.Any, TextContent, PromptMessageMultipart, etc.)
- Fix import formatting across all example files
- Ensure compliance with project code style guidelines
model: Optional[str] = None


class DynamicAgentInfo(BaseModel):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already use the AgentCard (from the A2A framework) to describe Agents and Tools for Router/Orchestrator. Would it be possible to standardize on this type? And we have serialization routines for this (I think... check the router/orchestrator)

content=[TextContent(type="text", text=formatted)]
)

elif name == f"{DYNAMIC_AGENT_TOOL_PREFIX}_list":
Copy link
Owner

@evalstate evalstate Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a think whether this would be best injected as part of the instructions/early messages? Rather than in a Tool Call. The text that describes the available agents doesn't need to be hidden behind a tool call. (Would consider this)

content=[TextContent(type="text", text=response)]
)

elif name == f"{DYNAMIC_AGENT_TOOL_PREFIX}_broadcast":
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If were super-super MCP minded, we would set up a Resource Subscription for this. (This will add work for little benefit).

evalstate and others added 4 commits August 5, 2025 16:24
- Update dynamic_agent_manager.py to import from fast_agent.agents.agent_types
- Update test_dynamic_agent_manager.py to import from fast_agent.agents.agent_types
- All 19 dynamic agent tests now pass successfully
- Resolves import errors caused by package restructuring in main branch
Addresses feedback to use existing AgentCard type instead of custom DynamicAgentInfo.

Changes:
- Replace DynamicAgentInfo class with create_dynamic_agent_card() function
- Use AgentCard from a2a.types for consistency with router/orchestrator
- Convert server access, status, and usage info into AgentSkill objects
- Update list_agents() method to return List[AgentCard] instead of List[DynamicAgentInfo]
- Update all tests to work with new AgentCard structure
- Maintain all original functionality while using standardized types

Benefits:
- Consistency with existing codebase architecture
- Access to existing serialization routines (model_dump_json)
- Better integration with router/orchestrator components
- Future-proof compatibility with A2A framework

All 20 tests pass successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants