Commit Graph

164 Commits

Author SHA1 Message Date
Eric Zhu 225eb9d0b2
feat: introduce ModelClientStreamingChunkEvent for streaming model output and update handling in agents and console (#5208)
Resolves #3983

* introduce `model_client_stream` parameter in `AssistantAgent` to
enable token-level streaming output.
* introduce `ModelClientStreamingChunkEvent` as a type of `AgentEvent`
to pass the streaming chunks to the application via `run_stream` and
`on_messages_stream`. Although this will not affect the inner messages
list in the final `Response` or `TaskResult`.
* handle this new message type in `Console`.
2025-01-29 02:49:02 +00:00
Eric Zhu b29d0bda2f
update versions to 0.4.4 and m1 cli to 0.2.3 (#5229) 2025-01-28 17:59:14 +00:00
Victor Dibia 67029853ec
make AssistantAgent and Handoff use BaseTool (#5193)
<!-- 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?

Make AssistantAgent and Handoff use BaseTool.  
This ensures that they can be made declarative/serialized

<!-- 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://microsoft.github.io/autogen/docs/Contribute#documentation 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-01-25 12:04:05 -08:00
Victor Dibia 979d8ab4f1
Make AgentChat Team Config Serializable (#5071)
* initial pass on making group chats declarative

* update group chat tests

* update impl to include participant serialization for all teams

* v1 making soc declarative

* update memory test

* update chatagent and team base classes

* update serialization doc notebook

* fomating updates
2025-01-24 07:08:22 +00:00
Fernando Bellido Pazos a585091406
Closes #5059 (#5156)
Update _magentic_one_orchestrator.py

In a Magentic Group Settting, if one of the Assitant Agents uses a tool it gives the following error, note this is under a FALSE reflect_on_tool variable.

Making it true, wont happen, though more tokens will be consumed and it will have a worst output and the philosophy of a tool as an answer is not followed...
2025-01-23 02:04:35 -08:00
Victor Dibia 5e9b24c3d9
Make Memory and Team an ABC (#5149)
* make memory and team an ABC

* update memory test

* update tests
2025-01-22 15:51:34 -08:00
Jack Gerrits 226b37d07b
Make ChatAgent an ABC (#5129) 2025-01-21 20:08:53 -05:00
Leon De Andrade d9fd39a297
Add sources field to TextMentionTermination (#5106) 2025-01-19 23:21:29 -08:00
Eric Zhu 9b1260dd3e
docs: update AssistantAgent documentation with a new figure, attention and warning notes (#5099)
* docs: update AssistantAgent documentation with attention and warning notes

* update

---------

Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
2025-01-17 23:49:02 +00:00
Eric Zhu 8643ff6e40
Pass context between AssistantAgent for handoffs (#5084)
* Pass context between AssistantAgent for handoffs

* Add parallel tool call test

---------

Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
2025-01-17 23:39:57 +00:00
Leonardo Pinheiro a1fdbd9692
Use caching to run tests and report coverage (#5086)
* use caching to run tests and report coverage

* fix test step dep name

* try to fix cov fname

* add working dir to mv step

* update artifact download

* fmt

* reduce concurrency on ext test

---------

Co-authored-by: Leonardo Pinheiro <lpinheiro@microsoft.com>
2025-01-17 14:32:18 +00:00
Victor Dibia c2a43e84a2
Declarative BaseChat Agents (#5055)
* v1, make assistant agent declarative

* make head tail context declarative

* update and formatting

* update assistant, format updates

* make websurfer declarative

* update formatting

* move declarative docs to advanced section

* remove tools until implemented

* minor updates to termination conditions

* update docs
2025-01-16 22:29:40 -08:00
afourney 2e1a9c737a
Retry multiple times when M1 selects an invalid agent. Make agent sel… (#5079)
Retry multiple times when M1 selects an invalid agent. Make agent selection deterministic when the team is a singleton (corner case).
2025-01-16 20:29:50 +00:00
Jack Gerrits 1a3ac626eb
Update version to 0.4.3 pre-emptively (#5066)
* Update version to 0.4.3

* lock

* update lock

* lock
2025-01-15 19:11:32 -05:00
Jacob Alber ae98c9d764
feat: Change async input strategy (#5060) 2025-01-15 10:12:47 -05:00
Victor Dibia abbdbb2f87
Memory Interface in AgentChat (#4438)
* initial base memroy impl

* update, add example with chromadb

* include mimetype consideration

* add transform method

* update to address feedback, will update after 4681 is merged

* update memory impl,

* remove chroma db, typing fixes

* format, add test

* update uv lock

* update docs

* format updates

* update notebook

* add memoryqueryevent message, yield message for observability.

* minor fixes, make score optional/none

* Update python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>

* update tests to improve cov

* refactor, move memory to core.

* format fixxes

* format updates

* format updates

* fix azure notebook import, other fixes

* update notebook, support str query in Memory protocol

* update test

* update cells

* add specific extensible return types to memory query and update_context

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-01-14 07:06:13 +00:00
Victor Dibia d883e3dfb0
Make termination condition config declarative (#4984)
* make termination condition declarative

* make all term conditions declarative

* make And/OrTermination top level objects in base

* add basic tests

* add tutorial notebook

* update tests and formatting

* update tests

* update declarative config with updated api.
2025-01-13 19:30:30 -08:00
Jack Gerrits 91ec611338
Update version to 0.4.1 (#5029)
* Update version to 0.4.1

* lock

* dest dir

* remove website changes
2025-01-13 21:22:03 +00:00
Jack Gerrits 466848ac65
fix: fix user input in m1 (#4995)
* Add lock for input and output management in m1

* Use event to signal it is time to prompt for input

* undo stop change

* undo changes

* Update python/packages/magentic-one-cli/src/magentic_one_cli/_m1.py

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>

* reduce exported surface area

* fix

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Hussein Mozannar <hmozannar@microsoft.com>
2025-01-13 15:28:08 +00:00
Eric Zhu 23c9b78c25
Disable output usage stat summary in Console as the stats is often inaccurate. (#5021)
* Disable output stats in Console as the stats is often inaccurate.

* format
2025-01-13 07:09:05 +00:00
Jack Gerrits c2721ff65b
Update all versions to 0.4.0 (#4941)
* Update all versions to 0.4.0

* update redirect

* install with upgrade for agentchat
2025-01-09 15:29:54 -05:00
Jack Gerrits ecdf18d3f6
Make package readmes slightly less empty (#4961)
* Make package readmes slightly less empty

* Update python/packages/autogen-ext/README.md

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-01-09 10:44:13 -08:00
Jack Gerrits 02ad98bcb3
Console async printing and optional stats (#4956)
* async printing

* Make stats output option
2025-01-09 16:02:15 +00:00
Eric Zhu 30cbbf7cad
Add pip install for magentic one and studio to homepage; update doc link (#4946)
* Add pip install for magentic one and studio to homepage; update doc link

* Update links
2025-01-08 10:52:33 -08:00
Jack Gerrits 973c8b6330
Remove deprecated items for release (#4927) 2025-01-08 08:56:08 -05:00
Roy Belio 00b06ab2e1
fix(magentic-one): Enhance error handling in orchestrate_step to manage invalid ledger formats (#4845)
* fix(magentic-one): Enhance error handling in orchestrate_step to manage invalid ledger formats

* formatting

---------

Co-authored-by: Roy Belio <robelio@microsoft.com>
Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
Co-authored-by: Jack Gerrits <jack@jackgerrits.com>
2025-01-08 02:18:42 +00:00
peterychang 71a3b238e7
Activate deactivate agents (#4800)
* Instantiate and call activate/deactivate on agents

* autoformatting

* remove activate. Rename deactivate to close

* remove unneeded import

* create close fn in runtime

* change runtime close behavior

* uv.lock

---------

Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
2025-01-07 21:37:02 +00:00
Jack Gerrits d4b406b78c
refactor!: Reduce dependencies of core, remove image from URL (#4919)
* Reduce dependencies of core

* Update lock

* add package to test deps

* Update lock

* aio console dep

* Update lock
2025-01-07 18:30:04 +00:00
WcW a1d782d3ec
Fix: Correct cancellation token usage in UserProxyAgent docstring (#4874)
Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
2025-01-02 11:46:01 -05:00
Sachin Joglekar ecdade3d3e
Add coverage task & integrate with poe check (#4847)
* Add coverage task & integrate with poe check

* Adding workflow

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-01-02 09:49:18 -05:00
Jack Gerrits fb1094d9c3
Update to dev13 (#4862) 2024-12-30 17:12:51 -05:00
Jack Gerrits cb1633b501
feat!: Add support for model family specification (#4856)
* Add support for model family specification

* spelling mistake

* lint, etc

* fixes
2024-12-30 15:09:21 -05:00
Eric Zhu 5ee2190e00
Replace Tuple[type[ChatMessage], ...] with Sequence[type[ChatMessage]] (#4857) 2024-12-30 11:30:31 -08:00
Eric Zhu a20ec102d3
AgentChat tutorial update to include model context usage and langchain tool (#4843)
* Doc update to include model context usage

* add langchain tools

* update langchain tool wrapper api doc

* updat

* update

* format

* add langchain experimental dev dep

* type

* Fix type

* Fix some types in langchain adapter

* type ignores
2024-12-30 09:09:33 -08:00
Leon De Andrade 23dbb6a632
Add missing model context attribute (#4848)
* Add missing model context attribute

* fix type

* Add test

* imports

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-12-28 22:50:54 -08:00
Eric Zhu d933b9ab5f
dev12 (#4839)
* dev12
2024-12-27 11:49:12 -08:00
Eric Zhu b9bd8b0c64
human-in-the-loop section for agentchat tutorial (#4832)
* human-in-the-loop section for agentchat tutorial
2024-12-27 10:20:52 -08:00
Jack Gerrits fadff4aece
Fix definition of workspace package, remove uv pin (#4830)
* Fix definition of workspace package, remove uv pin

* add  --all-packages

* pin docs uv versions for older project structure

* try old version to verify CI

* Use workflow target

* change syntax

* change check

* try with var in matrix

* add all packages to workspace

* remove project table
2024-12-27 13:11:42 -05:00
Eric Zhu edad1b6065
Emphasis on_messages is for new messages only; remove unused file. (#4819)
* Emphasis on_messages is for new messages only

* update

* update uv

* update uv action

* try pin uv version

* pin all uv versions to 0.5.11

* revert uv lock file and remove unwanted file.
2024-12-27 08:34:21 -05:00
Eric Zhu 150a54c4f5
Refine types in agentchat (#4802)
* Refine types in agentchat

* importg

* fix mypy
2024-12-23 16:10:46 -08:00
Sachin Joglekar 8e116fd86d
Fix pydantic warnings when saving state (#4801) 2024-12-23 15:17:40 -08:00
gagb b15551c961
Improve magentic one doc string (#4781)
* Enhance MagenticOneGroupChat documentation with architecture overview and citation reference

* Fix formatting in MagenticOneGroupChat documentation and add citation reference
2024-12-21 14:18:28 -08:00
Aditya Kurniawan c989181da2
use model context for assistant agent, refactor model context (#4681)
* Decouple model_context from AssistantAgent

* add UnboundedBufferedChatCompletionContext to mimic pervious model_context behaviour on AssistantAgent

* moving unbounded buffered chat to a different file

* fix model_context assertions in test_group_chat

* Refactor model context, introduce states

* fixes

* update

---------

Co-authored-by: aditya.kurniawan <aditya.kurniawan@core42.ai>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Victor Dibia <victordibia@microsoft.com>
2024-12-19 22:27:41 -08:00
jspv a271708a97
Tool call result summary message (#4755)
* Adding ToolCallResultSummaryMessage

* Support for ToolCallResultSummaryMessage

* Added ToolCallSummaryMessage

* ruff format

* Add ToolCallSummaryMessage to ChatMessage

* typing and tests for ToolCallSummaryMessage

* PR Feedback

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Hussein Mozannar <hmozannar@microsoft.com>
2024-12-19 21:23:18 -08:00
Eric Zhu e902e94b14
Define AgentEvent, rename tool call messages to events. (#4750)
* Define AgentEvent, rename tool call messages to events.

* update doc

* Use AgentEvent | ChatMessage to replace AgentMessage

* Update docs

* update deprecation notice

* remove unused

* fix doc

* format
2024-12-18 14:09:19 -08:00
Eric Zhu 44b27ad81a
Make it clear the on_messages method is stateful. (#4751) 2024-12-17 23:50:25 -08:00
Arun Brahma 7c0bbf674f
feat: add support for list of messages as team task input and update Society of Mind Agent (#4500)
* feat: add support for list of messages as team task input
* Update society of mind agent to use the list input task
---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ryan Sweet <rysweet@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-12-14 21:48:17 -08:00
gagb 34b997769e
Add module level docstrings (#4652)
* Improve init docs

* Add docstring for messages

* Add docstring for agents

* Add docstring for teams

* Add doc string for conditions

* Add docs for ui

* Update module docstring in __init__.py

* Clarify BaseChatAgent description in __init__.py

* Fix formatting
2024-12-11 11:06:14 -08:00
Eric Zhu 6c1f638960
dev11 release (#4642)
* dev11 release
2024-12-10 08:28:48 -08:00
Jack Gerrits 7e7265ddd0
Update version for dev10 (#4630)
* Update version for dev10

* fix notebook
2024-12-09 19:33:21 -08:00