3626 Commits

Author SHA1 Message Date
Afzal Pawaskar
446da624ac
Fix missing tools in logs (#6532)
Fix for LLMCallEvent failing to log "tools" passed to
BaseOpenAIChatCompletionClient in
autogen_ext.models.openai._openai_client.BaseOpenAIChatCompletionClient

This bug creates problems inspecting why a certain tool was selected/not
selected by the LLM as the list of tools available to the LLM is not
present in the logs

## Why are these changes needed?

Added "tools" to the LLMCallEvent to log tools available to the LLM as
these were being missed causing difficulties during debugging LLM tool
calls.

## Related issue number

[<!-- For example: "Closes #1234"
-->](https://github.com/microsoft/autogen/issues/6531)

## 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.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-05-15 17:12:19 -07:00
Chester Hu
9d297318b5
Add Llama API OAI compatible endpoint support (#6442)
## Why are these changes needed?

To add the latest support for using Llama API offerings with AutoGen


## 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.
- [ ] I've made sure all auto checks have passed.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-05-15 16:57:27 -07:00
ChrisBlaa
1eb7f93366
add tool_call_summary_msg_format_fct and test (#6460)
## 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

- [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.

---------

Co-authored-by: Chris Wieczorek <Chris.Wieczorek@iav.de>
Co-authored-by: EeS <chiyoung.song@motov.co.kr>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Mehrsa Golestaneh <mehrsa.golestaneh@gmail.com>
Co-authored-by: Mehrsa Golestaneh <mgolestaneh@microsoft.com>
Co-authored-by: Zhenyu <81767213+Dormiveglia-elf@users.noreply.github.com>
2025-05-14 10:02:34 -07:00
Miroslav Pokrovskii
aa22b622d0
feat: add qwen3 support (#6528)
## Why are these changes needed?

Add ollama qwen 3 support
2025-05-14 09:52:13 -07:00
Eric Zhu
cc2693b409
Update website 0.5.7 (#6527) 2025-05-13 21:39:33 -07:00
Jay Prakash Thakur
87cf4f07dd
Simplify Azure Ai Search Tool (#6511)
## Why are these changes needed?

Simplified the azure ai search tool and fixed bugs in the code


## Related issue number

"Closes #6430 " 

## 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.

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
python-v0.5.7
2025-05-13 13:42:11 -07:00
EeS
978cbd2e89
FIX/mistral could not recive name field (#6503)
## Why are these changes needed?
FIX/mistral could not recive name field, so add model transformer for
mistral

## Related issue number
Closes #6147

## 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>
2025-05-12 19:32:14 -07:00
Eric Zhu
177211b5b4
Update version 0.5.7 (#6518) 2025-05-12 17:19:32 -07:00
Peter Jausovec
867194a907
fixes the issues where exceptions from MCP server tools aren't serial… (#6482)
…ized properly

## Why are these changes needed?
The exceptions thrown by MCP server tools weren't being serialized
properly - the user would see `[{}, {}, ... {}]` instead of an actual
error/exception message.

## Related issue number

Fixes #6481 

## 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.

---------

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Co-authored-by: Victor Dibia <victordibia@microsoft.com>
Co-authored-by: Victor Dibia <victor.dibia@gmail.com>
2025-05-12 15:01:08 -07:00
peterychang
9118f9b998
Add ability to register Agent instances (#6131)
<!-- 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?

Nice to have functionality

## Related issue number

Closes #6060 

## 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.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-05-12 15:34:48 +00:00
EeS
c26d894c34
fix/mcp_session_auto_close_when_Mcpworkbench_deleted (#6497)
<!-- 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?
As-is: Deleting `McpWorkbench` does not close the `McpSession`.  
To-be: Deleting `McpWorkbench` now properly closes the `McpSession`.

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

<!-- For example: "Closes #1234" -->

## 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.
2025-05-12 13:31:01 +00:00
Victor Dibia
6427c07f5c
Fix AnthropicBedrockChatCompletionClient import error (#6489)
<!-- Thank you for your contribution! Please review
https://microsoft.github.io/autogen/docs/Contribute before opening a
pull request. -->

Some fixes with the AnthropicBedrockChatCompletionClient 

- Ensure `AnthropicBedrockChatCompletionClient` exported and can be
imported.
- Update the BedrockInfo keys serialization - client argument can be
string (similar to api key in this ) but exported config should be
Secret
- Replace `AnthropicBedrock` with `AsyncAnthropicBedrock` : client
should be async to work with the ag stack and the BaseAnthropicClient it
inherits from
- Improve `AnthropicBedrockChatCompletionClient` docstring to use the
correct client arguments rather than serialized dict format.

Expect

```python
from autogen_ext.models.anthropic import AnthropicBedrockChatCompletionClient, BedrockInfo
from autogen_core.models import UserMessage, ModelInfo


async def main():
    anthropic_client = AnthropicBedrockChatCompletionClient(
        model="anthropic.claude-3-5-sonnet-20240620-v1:0",
        temperature=0.1,
        model_info=ModelInfo(vision=False, function_calling=True,
                             json_output=False, family="unknown", structured_output=True),
        bedrock_info=BedrockInfo(
            aws_access_key="<aws_access_key>",
            aws_secret_key="<aws_secret_key>",
            aws_session_token="<aws_session_token>",
            aws_region="<aws_region>",
        ),
    )
    # type: ignore
    result = await anthropic_client.create([UserMessage(content="What is the capital of France?", source="user")])
    print(result)

await main()
```

<!-- 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?

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

<!-- For example: "Closes #1234" -->

Closes #6483 

## 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.
- [ ] I've made sure all auto checks have passed.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-05-10 09:12:02 -07:00
peterychang
3db7a29403
improve Otel tracing (#6499)
<!-- 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?

Will the changes made in
https://github.com/microsoft/autogen/pull/5853/files and this PR need to
be ported to the worker_runtime as well?
Resolves https://github.com/microsoft/autogen/issues/5894

## Related issue number

https://github.com/microsoft/autogen/issues/5894

## 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.
- [ ] I've made sure all auto checks have passed.
2025-05-09 16:24:30 -04:00
AndreaTang123
356ec34b9c
Fix header icons focus and hover style for better accessibility (#6409)
## Why are these changes needed?

This PR improves keyboard accessibility by ensuring that header
links/icons have visual feedback (underline and color change) on both
hover and keyboard focus states. Also adds smooth scaling animation.

## Related issue number

Related issue: #6090 

## 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.
- [☑️] I've made sure all auto checks have passed.

Co-authored-by: peterychang <49209570+peterychang@users.noreply.github.com>
2025-05-09 15:07:23 -04:00
Victor Dibia
1ab24417b8
Add gpt 4o search (#6492)
<!-- Thank you for your contribution! Please review
https://microsoft.github.io/autogen/docs/Contribute before opening a
pull request. -->

Add gpt 4o search models to list of default models

```python
"gpt-4o-mini-search-preview-2025-03-11": {
        "vision": False,
        "function_calling": True,
        "json_output": True,
        "family": ModelFamily.GPT_4O,
        "structured_output": True,
        "multiple_system_messages": True,
    },
"gpt-4o-search-preview-2025-03-11": {
        "vision": False,
        "function_calling": True,
        "json_output": True,
        "family": ModelFamily.GPT_4O,
        "structured_output": True,
        "multiple_system_messages": True,
    },
```

<!-- 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?

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

<!-- For example: "Closes #1234" -->

Closes #6491

## 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.
- [ ] I've made sure all auto checks have passed.
2025-05-08 18:01:38 -07:00
Victor Dibia
7cc7165573
Update docs.yml (#6493)
Bump python version, pin nr-utils

<!-- Thank you for your contribution! Please review
https://microsoft.github.io/autogen/docs/Contribute before opening a
pull request. -->

Fix docs build CI bug.
- pydocmkardown depends on pydocspec 
-[ pydocspec was updated May
6](https://pypi.org/project/docspec-python/#history) (two days ago), and
includes a problematic dependency (`nr.utils` which is specified as
[nr-utils](61d3e38c55/docspec-python/pyproject.toml (L14C5-L14C23)).
This caused imports to fail.
- current fix is fixing the pydocspec version.
- Also using the opportunity to update the python version 3.8 -> 3.9 for
the docs build 0.2

<!-- 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?

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

<!-- For example: "Closes #1234" -->

## 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.
- [ ] I've made sure all auto checks have passed.
2025-05-08 16:54:57 -07:00
long
b17793ec6b
Fix: Move the createTeam function (#6487)
## Related issue number

Closes #6486
2025-05-08 16:24:56 +00:00
Emmanuel Ferdman
eba05aed37
Fix Gitty prompt message (#6473) 2025-05-07 04:11:19 +00:00
DavidYu00
bacfa98aa6
Sample for integrating Core API with chainlit (#6422)
## Why are these changes needed?

This pull request adds new samples that integrates the Autogen Core API
with Chainlit. It closely follows the structure of the
Agentchat+Chainlit sample and provides examples for using a single agent
and multiple agents in a groupchat.
## Related issue number


Closes: #5345

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-05-06 14:19:31 -07:00
Abhijeetsingh Meena
2864fbfc2c
Add model_context to SelectorGroupChat for enhanced speaker selection (#6330)
## Why are these changes needed?
This PR enhances the `SelectorGroupChat` class by introducing a new
`model_context` parameter to support more context-aware speaker
selection.

### Changes
- Added a `model_context: ChatCompletionContext | None` parameter to
`SelectorGroupChat`.
- Defaulted to `UnboundedChatCompletionContext` when None is provided
like `AssistantAgent`.
- Updated `_select_speaker` to prepend context messages from
`model_context` to the main thread history.
- Refactored history construction into a helper method
`construct_message_history`.

## Related issue number
Closes [Issue #6301](https://github.com/org/repo/issues/6301), enabling
the group chat manager to utilize `model_context` for richer, more
informed speaker selection decisions.

## 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.

---------

Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-05-06 12:30:18 -07:00
Eric Zhu
085ff3dd7d
Update website 0.5.6 (#6454) 2025-05-02 15:57:04 -07:00
EeS
880a225cb2
FIX/McpWorkbench_errors_properties_and_grace_shutdown (#6444)
## 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 #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.
python-v0.5.6
2025-05-02 15:23:54 -07:00
EeS
6fc4f53212
FIX: MultiModalMessage in gemini with openai sdk error occured (#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 #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>
2025-05-01 09:27:31 -07:00
Zhenyu
7c29704525
fix: ensure streaming chunks are immediately flushed to console (#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 #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.
2025-05-01 13:38:47 +00:00
Mehrsa Golestaneh
2792359ef0
Adding readme with link to a repo containing a comprehensive multiagent postgreSQL data management example (#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>
2025-05-01 04:50:46 +00:00
EeS
c7757de59e
FIX: GraphFlow serialize/deserialize and adding test (#6434)
## 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 #1234" -->
Closes #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.
2025-04-30 11:25:20 -07:00
Eric Zhu
8efa1f10a9
update autogen version 0.5.6 (#6433) 2025-04-29 16:18:36 -07:00
EeS
b0c13a476b
test_docker_commandline_code_executor.py : 161.66s -> 108.07 (#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](a3cf70bcf8)
[reuse executor at some tests
140s->120s](ca15938afa)
[Remove unnecessary start of docker
120s->110s](61247611e0)

## Related issue number

<!-- For example: "Closes #1234" -->
Part of #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>
2025-04-29 14:18:51 -07:00
abhinav-aegis
bfdf816f21
Aegis graph docs (#6417)
Documentation for Graph based workflow. I kept this separate from pull
request #6333 so that you can just merge in the code without the
documentation changes if needed.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-04-28 22:31:19 -07:00
abhinav-aegis
9f8e892d27
Added Graph Based Execution functionality to Autogen (#6333)
Closes #4623 

### Add Directed Graph-based Group Chat Execution Engine
(`DiGraphGroupChat`)

This PR introduces a new graph-based execution framework for Autogen
agent teams, located under `autogen_agentchat/teams/_group_chat/_graph`.

**Key Features:**

- **`DiGraphGroupChat`**: A new group chat implementation that executes
agents based on a user-defined directed graph (DAG or cyclic with exit
conditions).
- **`AGGraphBuilder`**: A fluent builder API to programmatically
construct graphs.
- **`MessageFilterAgent`**: A wrapper to restrict what messages an agent
sees before invocation, supporting per-source and per-position
filtering.

**Capabilities:**

- Supports sequential, parallel, conditional, and cyclic workflows.
- Enables fine-grained control over both execution order and message
context.
- Compatible with existing Autogen agents and runtime interfaces.

**Tests:**

- Located in `autogen_agentchat/tests/test_group_chat_graph.py`
- Includes unit and integration tests covering:
  - Graph validation
  - Execution paths
  - Conditional routing
  - Loops with exit conditions
  - Message filtering

Let me know if anything needs refactoring or if you'd like the
components split further.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Leonardo Pinheiro <leosantospinheiro@gmail.com>
2025-04-29 02:06:27 +00:00
LuluZhuu
fcbac2d078
Fix: Reduce multiple H1s to H2s in Distributed Agent Runtime page (#6412)
## Why are these changes needed?

This PR fixes the issue of multiple `<h1>` headers in the Distributed
Agent Runtime documentation page. The page has more than one `<h1>`
which violates semantic HTML structure. This fix downgrades the inner
section headings (e.g., "Cross-Language Runtimes", "Next Steps") to
`<h2>`.

## Related issue number

Related issue: [#6090](https://github.com/microsoft/autogen/issues/6090)

## 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.

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-04-28 23:22:20 +00:00
long
0e9744c4a2
Fix: Icons are not aligned vertically. (#6369)
<!-- 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?

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

Closes #6366


## 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.
- [ ] I've made sure all auto checks have passed.

Co-authored-by: Victor Dibia <victordibia@microsoft.com>
2025-04-28 22:52:56 +00:00
Abdo Talema
881cd6a75c
Bing grounding citations (#6370)
Adding support for Bing grounding citations to the AzureAIAgent.

<!-- 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?

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

<!-- For example: "Closes #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.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Dheeraj Bandaru <BandaruDheeraj@users.noreply.github.com>
2025-04-28 13:09:13 -07:00
Mars Wang
998840f7e0
docs: Clarify missing dependencies in documentation (fix #6076) (#6406)
It clarifies the missing dependencies of all README.md in
python/samples/

- Added explicit mention of required dependencies
- Improved instructions for initial setup

<!-- 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?
According to issue #6076, several dependencies were missing from the
requirements.txt and not mentioned in the README.md instructions.
This change adds the missing installation instructions to ensure that
users can run the demo smoothly.


## Related issue number
Closes #6076 
<!-- For example: "Closes #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.

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-04-28 12:47:14 -07:00
Victor Dibia
18d24005e1
Add missing dependency to tracing docs (#6421)
## Why are these changes needed?

Add missing dependency to tracing docs

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

<!-- For example: "Closes #1234" -->

Closes #6419

## 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.
- [ ] I've made sure all auto checks have passed.
2025-04-28 12:31:19 -07:00
Harini N
a91006cdc2
Adding bedrock chat completion for anthropic models (#6170)
## Why are these changes needed?

Anthropic models are supported by AWS bedrock. ChatCompletionClient can
be created for anthropic bedrock models using this changes. This enables
the user to do the following
- Add any anthropic models and version from AWS bedrock
- Can use ChatCompletionClient for bedrock anthropic models

## Related issue number
Closes #5226

---------

Co-authored-by: harini.narasimhan <harini.narasimhan@eagleview.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-04-28 11:56:46 -07:00
EeS
99d853a9cb
FIX: resolving_workbench_and_tools_conflict_at_desirialize_assistant_agent (#6407)
## Why are these changes needed?
Starting from AutoGen v0.5.5, tools are internally managed through
`StaticWorkbench`.
However, both tools and workbench were being serialized and
deserialized, which caused conflicts during deserialization:
	•	When both are restored, the constructor raises:
```
ValueError: Tools cannot be used with a workbench.
```

The changes address this issue by:
1.	Removing tools from serialization/deserialization:
• tools are now considered internal state of `StaticWorkbench`, and are
no longer serialized.
• Only workbench is serialized, ensuring consistency and avoiding
duplication.
2.	Ensuring logical integrity:
• Since tools are not used directly after initialization, persisting
them separately serves no functional purpose.
• This avoids scenarios where both are populated, violating constructor
constraints.

Summary:

This change prevents tools/workbench conflicts by fully delegating tool
management to `StaticWorkbench` and avoiding unnecessary persistence of
tools themselves.


<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

Closes #6405 

## 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>
2025-04-28 11:37:09 -07:00
EeS
516a211954
[FIX] DockerCommandLineCodeExecutor multi event loop aware (#6402)
## Why are these changes needed?
*Problem*

Previously, in `DockerCommandLineCodeExecutor`, cancellation tasks were
added directly to `self._cancellation_tasks` using
`asyncio.create_task()`:
```python
self._cancellation_tasks.append(asyncio.create_task(self._kill_running_command(command)))
```
This caused issues when cancellation tasks were created from multiple
event loops, leading to loop mismatch errors during executor shutdown.

*Solution*
This PR fixes the issue by introducing a dedicated internal event loop
for managing cancellation tasks.
Cancellation tasks are now scheduled in a fixed event loop using
`asyncio.run_coroutine_threadsafe()`:
```python
                    future: ConcurrentFuture[None] = asyncio.run_coroutine_threadsafe(
                        self._kill_running_command(command), self._loop
                    )
                    self._cancellation_futures.append(future)
```

*Additional Changes*
- Added detailed logging for easier debugging.
- Ensured clean shutdown of the internal event loop and associated
thread.


*Note*
This change ensures that all cancellation tasks are handled consistently
in a single loop, preventing cross-loop conflicts and improving executor
stability in multi-threaded environments.

## Related issue number

<!-- For example: "Closes #1234" -->
Closes #6395 

## 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>
2025-04-28 10:30:19 -07:00
Eric Zhu
63c791d342
Add more mcp workbench examples to MCP API doc (#6403) 2025-04-25 17:45:24 -07:00
Eric Zhu
4eb256d44a
Update website for v0.5.5 (#6401) 2025-04-25 16:43:23 -07:00
Eric Zhu
653bcc5876
Document custom message types in teams API docs (#6400)
Addresses: #6365
python-v0.5.5
2025-04-25 16:32:47 -07:00
Eric Zhu
7811b1ce83
[doc] Clarify selector prompt for SelectorGroupChat (#6399)
Resolves #6383
2025-04-25 16:17:48 -07:00
Eric Zhu
7bdd7f6162
Add functional termination condition (#6398)
Use an expression for termination condition check. This works well
especially with structured messages.
2025-04-25 15:57:36 -07:00
Minh Đăng
519a04d5fc
Update: implement return_value_as_string for McpToolAdapter (#6380)
## Why are these changes needed?
- Add return_value_as_string for formating result from MCP tool

## Related issue number
- Opened Issue on #6368 

## 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.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-04-25 15:41:02 -07:00
Eric Zhu
70784eaeda
Update version to 0.5.5 (#6397) 2025-04-25 14:22:03 -07:00
amith-ajith
91a7188d9d
Add example using autogen-core and FastAPI for handoff multi-agent design pattern with streaming and UI (#6391)
## Why are these changes needed?

This PR adds an example which demonstrates how to build a streaming chat
API with multi-turn conversation history and a simple web UI for handoff
multi-agent design pattern.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-04-24 18:35:36 -07:00
Eric Zhu
d96aaebc8d
Update agent documentation (#6394)
* Replace on_messages and on_messages_stream with run and run_stream to
unify interface documentation with teams
* Remove magentic-one-cli from homepage as it has not been maintained
and improved for a while.
2025-04-24 18:29:39 -07:00
Eric Zhu
bab0dfd1e7
AssistantAgent to support Workbench (#6393)
Finishing up the work on workbench.

```python
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import StdioServerParams, McpWorkbench

async def main() -> None:
    params = StdioServerParams(
        command="uvx",
        args=["mcp-server-fetch"],
        read_timeout_seconds=60,
    )

    # You can also use `start()` and `stop()` to manage the session.
    async with McpWorkbench(server_params=params) as workbench:
        model_client = OpenAIChatCompletionClient(model="gpt-4.1-nano")
        assistant = AssistantAgent(
            name="Assistant",
            model_client=model_client,
            workbench=workbench,
            reflect_on_tool_use=True,
        )
        await Console(assistant.run_stream(task="Go to https://github.com/microsoft/autogen and tell me what you see."))
    
asyncio.run(main())
```
2025-04-24 16:19:36 -07:00
EeS
0c9fd64d6e
TEST: skip when macos+uv and adding uv venv tests (#6387)
## Why are these changes needed?

> The pytest tests test_local_executor_with_custom_venv and
test_local_executor_with_custom_venv_in_local_relative_path located in
packages/autogen-ext/tests/code_executors/test_commandline_code_executor.py
fail when run on macOS (aarch64) using a Python interpreter managed by
uv (following the project's recommended development setup).
> 
> The failure occurs during the creation of a nested virtual environment
using Python's standard venv.EnvBuilder. Specifically, the attempt to
run ensurepip inside the newly created venv fails immediately with a
SIGABRT signal. The root cause appears to be a dynamic library loading
error (dyld error) where the Python executable inside the newly created
venv cannot find its required libpythonX.Y.dylib shared library.

So, when MacOS + uv case, skipping that test.
And, adding uv-venv case

## Related issue number

Closes #6341

## 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>
2025-04-24 14:34:38 -07:00
Eric Zhu
cbd8745f2b
Add guide for workbench and mcp & bug fixes for create_mcp_server_session (#6392)
Add user guide for workbench and mcp

*Also fixed a bug in create_mcp_server_session that included "type" in
the parameters Resolves: #6392
2025-04-24 14:19:09 -07:00