Recent Releases of liteswarm
liteswarm - 0.6.0
What's Changed
Core Improvements
- Introduced type-safe context validation with generic
AgentContext[ContextParams, AgentOutput] - Added new tool registration system with
@tooland@tool_plaindecorators - Implemented type validation for SwarmStream and Swarm public API
- Added explicit agent switching via
ToolResult.switch_tomethod
Developer Experience
- Unified chat components with new
ChatContextfor simpler state management - Reorganized examples into basics and advanced categories
- Added new examples for structured outputs and agent teams
- Enhanced documentation with type-safe API usage examples
Breaking Changes
- Core API now requires type parameters for context and output validation
- Agent switching requires explicit
ToolResult.switch_tocalls - Chat components use unified
ChatContextinstead of separate managers - Removed experimental SwarmTeam prototype module
Migration Notes
```python
Before - Generic agent context
agent = Agent(id="math", instructions="You are a math assistant.") context = AgentContext(agent=agent, messages=messages)
After - Type-safe context
class MathParams(BaseModel): precision: int
class MathResult(BaseModel): result: int explanation: str
agent = AgentMathParams, MathResult context = AgentContext( agent=agent, messages=messages, params=MathParams(precision=2), )
Before - Implicit agent switching
def switchtoexpert(context: AgentContext) -> Agent: return Agent(id="expert", instructions="You are an expert.")
After - Explicit agent switching
@toolplain def switchtoexpert(domain: str) -> ToolResult: expert = AgentExpertParams, None return ToolResult.switchto( content=f"Switching to {domain} expert", agent=expert, params=ExpertParams(domain=domain), ) ```
Removed
- Experimental SwarmTeam prototype module
- Generic message types in favor of type-safe alternatives
- Swarm team types and exceptions
Contributors
Thanks to: - @mozharovsky and @GlyphyAI
Full Changelog: https://github.com/GlyphyAI/liteswarm/compare/0.5.1...0.6.0
- Python
Published by mozharovsky about 1 year ago
liteswarm - 0.5.1
What's Changed
Improvements
- Added missing common types (LLM, ContextVariables, etc) to global namespace
Bug Fixes
- Resolved mypy type variance issues with generic types
Contributors
Thanks to: - @mozharovsky and @GlyphyAI
Full Changelog: https://github.com/GlyphyAI/liteswarm/compare/0.5.0...0.5.1
- Python
Published by mozharovsky about 1 year ago
liteswarm - 0.5.0
What's Changed
Core Improvements
- Reworked core Swarm API to be fully stateless for better composability
- Added type-safe structured outputs with Pydantic model support
- Implemented new events for managing agent flow (activate, begin, complete, response)
- Added TypeVar type checking trick for Pydantic bound generics
- Introduced parse response method for handling partial/full agent responses
Developer Experience
- Added chat components built on top of Swarm and SwarmTeam
- Simplified field names and event model naming for consistency
- Improved type safety around response formats
- Added new examples showcasing chat and team chat functionality
- Enhanced documentation with stateless architecture examples
Breaking Changes
- Swarm is now fully stateless - state management moved to Chat components
- SwarmTeam redesigned to be stateless with streaming API support
- Event handling requires using new event types
- getresult renamed to getreturn_value for ReturnableAsyncGenerator
Migration Notes
```python
Before - Stateful Swarm
swarm = Swarm() swarm.add_message(Message(role="user", content="Hello")) result = await swarm.execute(agent)
After - Stateless Swarm with Chat
chat = LiteChat() stream = chat.sendmessage("Hello", agent=agent) result = await stream.getreturn_value()
Before - Stateful SwarmTeam
team = SwarmTeam(swarm=swarm, members=members, taskdefinitions=taskdefinitions) session = await team.createsession() result = await session.executeplan(plan)
After - Stateless SwarmTeam with Chat
teamchat = LiteTeamChat(swarm=swarm, members=members, taskdefinitions=taskdefinitions) stream = teamchat.sendmessage("Create a web app") result = await stream.getreturn_value() ```
Removed
- Obsolete MessageStore, ContextManager, EventHandler components
- Redundant unwrap utils and ambiguous messages file
- Deprecated types and components
- Session management from chat components
Contributors
Thanks to: - @mozharovsky and @GlyphyAI
Full Changelog: https://github.com/GlyphyAI/liteswarm/compare/0.4.0...0.5.0
- Python
Published by mozharovsky about 1 year ago
liteswarm - 0.4.0
What's Changed
Core Improvements
- Introduced ReturnableAsyncGenerator for unified event streaming API
- Added RAG strategy configuration type for context optimization control
- Added tool call result field for improved result handling
- Implemented serialization support for agent instructions and LLM tools
Developer Experience
- Refactored event streaming architecture with cleaner separation of concerns
- Embedded completion response into agent response model
- Simplified event types by removing redundant "Swarm" prefix
- Enhanced documentation with up-to-date streaming examples
- Updated event handler to use new streaming API
Breaking Changes
- Removed SwarmStream module in favor of ReturnableAsyncGenerator
- Removed redundant tool call event in favor of result-only events
- Event handling now requires handling event types instead of direct responses
- Streaming API now yields events instead of response chunks
Migration Notes
```python
Before
stream = swarm.stream(agent, prompt="Hello") async for response in stream: print(response.delta.content)
After
stream = swarm.stream(agent, prompt="Hello") async for event in stream: if event.type == "agentresponsechunk": print(event.chunk.completion.delta.content) ```
Contributors
Thanks to: - @mozharovsky and @GlyphyAI
Full Changelog: https://github.com/GlyphyAI/liteswarm/compare/0.3.0...0.4.0
- Python
Published by mozharovsky about 1 year ago
liteswarm - 0.3.0
What's Changed
Core Improvements
- Added async interface to MessageStore for better I/O performance
- Introduced batch operations for message management (addmessages, removemessages)
- Unified ContextManager interface with create/optimize/find methods
- Enhanced usage and cost tracking with proper accumulation
Developer Experience
- Renamed response types to better reflect streaming nature (AgentResponseChunk)
- Updated event types to match new response chunk naming convention
- Improved context management with centralized data access
- Enhanced documentation with updated examples and protocols
Bug Fixes
- Fixed usage statistics accumulation in streaming responses
Breaking Changes
- Renamed
AgentResponsetoAgentResponseChunk - Renamed
CompletionResponsetoCompletionResponseChunk - Updated event types to use new chunk naming
- MessageStore methods now require async/await
Contributors
Thanks to: - @mozharovsky and @GlyphyAI
Full Changelog: https://github.com/GlyphyAI/liteswarm/compare/0.2.0...0.3.0
- Python
Published by mozharovsky about 1 year ago
liteswarm - 0.2.0
What's Changed
Core Improvements
- Added message management system with MessageStore, MessageIndex, and ContextManager
- Introduced event system with ConsoleEventHandler and SwarmEventHandler
- Added SwarmStream wrapper for improved response handling
- Enhanced error handling with retry mechanisms and backoff strategies
Developer Experience
- Added new REPL commands for optimization and search
- Improved type system with stricter checks
- Enhanced message and context management
- Updated examples to use new event system
Bug Fixes
- Fixed context update and retry mechanism issues
- Improved tool call pair filtering
- Enhanced response format handling
- Fixed variable initialization and error logging
Cleanup
- Removed legacy stream handler and summarizer
- Cleaned up unused types and context keys
Contributors
Thanks to: - @mozharovsky and @GlyphyAI
Full Changelog: https://github.com/GlyphyAI/liteswarm/compare/0.1.1...0.2.0
- Python
Published by mozharovsky about 1 year ago
liteswarm - 0.1.1
What's Changed
- Add the py.typed file to make the package PEP 561 compliant, ensuring full support for type checkers like mypy
Contributors
Thanks to: - @mozharovsky and @GlyphyAI
Full Changelog: https://github.com/GlyphyAI/liteswarm/compare/0.1.0...0.1.1
- Python
Published by mozharovsky about 1 year ago
liteswarm - 0.1.0
What's Changed
- Initial release of LiteSwarm framework
- Core agent system with LLM-agnostic design
- Experimental SwarmTeam for multi-agent orchestration
- Structured outputs with OpenAI compatibility
- Comprehensive examples and documentation
Contributors
Thanks to: - @mozharovsky and @GlyphyAI
Full Changelog: https://github.com/GlyphyAI/liteswarm/commits/0.1.0
- Python
Published by mozharovsky about 1 year ago