-
Notifications
You must be signed in to change notification settings - Fork 7.8k
add tool_call_summary_msg_format_fct and test #6460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ft#6429) ## Why are these changes needed? Current autogen-ext's test is too slow. So, I will search slow test case and makes more fast. [init docker executor function to module 180s->140s](microsoft@a3cf70b) [reuse executor at some tests 140s->120s](microsoft@ca15938) [Remove unnecessary start of docker 120s->110s](microsoft@6124761) ## Related issue number <!-- For example: "Closes microsoft#1234" --> Part of microsoft#6376 ## Checks - [ ] I've included any doc changes needed for <https://microsoft.github.io/autogen/>. See <https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to build and test documentation locally. - [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR. - [x] I've made sure all auto checks have passed. --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
## Why are these changes needed? ❗ Before Previously, GraphFlow.__init__() modified the inner_chats and termination_condition for internal execution logic (e.g., constructing _StopAgent or composing OrTerminationCondition). However, these modified values were also used during dump_component(), meaning the serialized config no longer matched the original inputs. As a result: 1. dump_component() → load_component() → dump_component() produced non-idempotent configs. 2. Internal-only constructs like _StopAgent were mistakenly serialized, even though they should only exist in runtime. ⸻ ✅ After This patch changes the behavior to: • Store original inner_chats and termination_condition as-is at initialization. • During to_config(), serialize only the original unmodified versions. • Avoid serializing _StopAgent or other dynamically built agents. • Ensure deserialization (from_config) produces a logically equivalent object without additional nesting or duplication. This ensures that: • GraphFlow.dump_component() → load_component() round-trip produces consistent, minimal configs. • Internal execution logic and serialized component structure are properly separated. <!-- Please give a short summary of the change and the problem this solves. --> ## Related issue number <!-- For example: "Closes microsoft#1234" --> Closes microsoft#6431 ## Checks - [ ] I've included any doc changes needed for <https://microsoft.github.io/autogen/>. See <https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to build and test documentation locally. - [x] I've added tests (if relevant) corresponding to the changes introduced in this PR. - [x] I've made sure all auto checks have passed.
…nt postgreSQL data management example (microsoft#6443) ## Why are these changes needed? Requesting to add a new example folder under Python samples so that AutoGen(0.4+) users can easily find this comprehensive example of using agents and Groupchats to build a multi-agent data management system for Azure postgreSQL. Readme contains link to a repo with comprehensive multiagent postgreSQL data management example ## Related issue number N/A ## Checks N/A (only a readme file) - [ ] I've included any doc changes needed for <https://microsoft.github.io/autogen/>. See <https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to build and test documentation locally. - [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR. - [ ] I've made sure all auto checks have passed. Co-authored-by: Mehrsa Golestaneh <mgolestaneh@microsoft.com> Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
…osoft#6424) Added `flush=True` to the `aprint` call when handling `ModelClientStreamingChunkEvent` message to ensure each chunk is immediately displayed as it arrives. <!-- Thank you for your contribution! Please review https://microsoft.github.io/autogen/docs/Contribute before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? When handling `ModelClientStreamingChunkEvent` message, streaming chunks weren't guaranteed to be displayed immediately, as Python's stdout might buffer output without an explicit flush instruction. This could cause visual delays between when `chunk_event` objects are added to the message queue and when users actually see the content rendered in the console. <!-- Please give a short summary of the change and the problem this solves. --> ## Related issue number None <!-- For example: "Closes microsoft#1234" --> ## Checks - [x] I've included any doc changes needed for <https://microsoft.github.io/autogen/>. See <https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to build and test documentation locally. - [x] I've added tests (if relevant) corresponding to the changes introduced in this PR. - [x] I've made sure all auto checks have passed.
…rosoft#6440) ## Why are these changes needed? Multimodal message fill context with other routine. However current `_set_empty_to_whitespace` is fill with context. So, error occured. And, I checked `multimodal_user_transformer_funcs` and I found it, in this routine, context must not be empty. Now remove the `_set_empty_to_whitespace` when multimodal message, <!-- Please give a short summary of the change and the problem this solves. --> ## Related issue number Closes microsoft#6439 ## Checks - [ ] I've included any doc changes needed for <https://microsoft.github.io/autogen/>. See <https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to build and test documentation locally. - [x] I've added tests (if relevant) corresponding to the changes introduced in this PR. - [x] I've made sure all auto checks have passed. Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
## Why are these changes needed?
Our McpWorkbench required properties however mongodb-lens's some tools
do not has it. I will fix it from when properties is None, -> {}
Our McpWorkbench now does not have stop routine with without async with
McpWorkbench(params) as workbench: and lazy init. So, I will adding def
__del__: pass just insert that, It could show error.
## Related issue number
Closes microsoft#6425
## Checks
- [ ] I've included any doc changes needed for
<https://microsoft.github.io/autogen/>. See
<https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to
build and test documentation locally.
- [x] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [x] I've made sure all auto checks have passed.
@microsoft-github-policy-service agree |
python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py
Outdated
Show resolved
Hide resolved
python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py
Outdated
Show resolved
Hide resolved
python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py
Outdated
Show resolved
Hide resolved
|
@ekzhu nice, thank you. I'll take care 👌 |
|
@ekzhu Any chance to get a review or another reviewer assigned here? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6460 +/- ##
=======================================
Coverage 79.52% 79.52%
=======================================
Files 225 225
Lines 16641 16644 +3
=======================================
+ Hits 13233 13236 +3
Misses 3408 3408
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks @ChrisBlaa. I think this is a useful feature for quick prototyping. Though for properly formatting each tool call result, another option is to override the |
Why are these changes needed?
This change introduces support for dynamic formatting of tool call summary messages by allowing a user-defined
tool_call_summary_format_fct. Instead of relying solely on a static string template, this function enables runtime generation of summary messages based on the specific tool call and its result. This provides greater flexibility and cleaner integration without introducing any breaking changes.My Use Case / Problem
In my use case, I needed concise summaries for successful tool calls and detailed messages for failures. The existing static summary string didn't allow conditional formatting, which led to overly verbose success messages or inconsistent failure outputs. This change allows customizing summaries per result type, solving that limitation cleanly.
Related issue number
Closes #6426
Checks