Skip to content

feat(autogen): upgrade to v0.7.5, fix all examples, and add 4 new examples#25

Open
martimfasantos wants to merge 1 commit intomainfrom
task/update-autogen-not-ag2
Open

feat(autogen): upgrade to v0.7.5, fix all examples, and add 4 new examples#25
martimfasantos wants to merge 1 commit intomainfrom
task/update-autogen-not-ag2

Conversation

@martimfasantos
Copy link
Copy Markdown
Owner

Summary

  • Upgrade AutoGen from v0.7.2 to v0.7.5 and rewrite all 8 existing examples to follow repo conventions, fix bugs, and add 4 new examples covering GraphFlow, termination conditions, state management, and custom agents — bringing the total to 12 hands-on examples
  • All examples follow repo conventions (zero-padded filenames, dashed-border docstrings, section headers, settings-based config)
  • Includes verified OUTPUTS.md with captured output and feature highlight annotations for all 12 examples

Examples

# File Feature
00 00_hello_world.py Basic AssistantAgent, streaming output with Console
01 01_tools.py FunctionTool, tool schema generation, tool call execution
02 02_streaming_and_metrics.py Streaming responses, token usage statistics
03 03_structured_outputs.py Pydantic model responses, chain-of-thought reasoning
04 04_human_in_the_loop.py HandoffTermination, pausing and resuming with user input
05 05_multi_agent_teams.py RoundRobin, Selector, MagenticOne, Swarm team presets
06 06_agents_as_tool.py AgentTool, TeamTool, disabling parallel tool calls
07 07_memory.py ListMemory, user preferences, memory-aware tool usage
08 08_graph_flow.py DiGraphBuilder, sequential/parallel/conditional workflows
09 09_termination_conditions.py MaxMessage, TextMention, Timeout, OR/AND combinators
10 10_state_management.py save_state/load_state for agents and teams, checkpointing
11 11_custom_agents.py Subclassing BaseChatAgent (CountDownAgent, EchoAgent)

Changes to Existing Files

File Change
0007 examples Renamed from 0_7_ to zero-padded 00_07_, added convention-compliant docstrings with verified docs URLs, added await model_client.close(), wrapped in async def main()
02_streaming_and_metrics.py Fixed bug: renamed tool function from sum to add_numbers to avoid shadowing Python builtin (caused infinite recursion)
04_human_in_the_loop.py Rewrote to use HandoffTermination pattern instead of input() calls (violates "No Interactive Input" rule)
07_memory.py Removed access to private _model_context attribute
pyproject.toml Cleaned up from 40+ pinned dependencies to 5 clean >= specifiers
.env.example Fixed default model from gpt-4o to gpt-4o-mini to match settings.py
README.md Complete rewrite with features list, 12-example table, uv setup instructions
autogen-project/ Deleted unused subdirectory (leftover from earlier experiments)

Configuration

  • All examples use OpenAI (gpt-4o-mini) via settings.py
  • Dependencies: autogen-agentchat>=0.7.5, autogen-core>=0.7.5, autogen-ext[openai]>=0.7.5, pydantic>=2.10, pydantic-settings>=2.10
  • Managed with uv package manager

Testing

All 12 examples ran successfully with exit code 0 and produced feature-showcasing output (see OUTPUTS.md for full details).

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.

1 participant