* Fix openai client token usage (#4769)
* Include actual_usage in add_usage function
* Make sure result is assigned
* remove method
---------
Co-authored-by: Jack Gerrits <jack@jackgerrits.com>
* Make register_factory a user facing API
* fix docstring
* Update python/packages/autogen-core/src/autogen_core/_agent_runtime.py
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* formatting
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* 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
* 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
* 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.
* Add MagenticOne API
* Add CodeExecutorAgent to MagenticOne for enhanced task execution
* Refactor MagenticOne class to inherit from MagenticOneGroupChat and streamline initialization
* Enhance MagenticOne class documentation with detailed usage examples and initialization instructions
* Refactor MagenticOne module structure and update import paths
* Remove unused imports
* Add documentation for MagenticOne module and remove redundant initialization comments
* Enhance MagenticOne class with human-in-the-loop mode and update examples
* Update MagenticOne class documentation with safety precautions and architecture details
* Run poe format
* Add blog post reference to MagenticOne class documentation
* change default of websurfer use_ocr to false because of refusals
* Refactor MagenticOne class to use ChatCompletionClient instead of OpenAIChatCompletionClient
* Add client capability validation to MagenticOne initialization
* Poe format
* Refactor imports in MagenticOne class for clarity and organization
* Add stacklevel parameter to warning in client capability validation
* Update README to recommend using Magentic-One API for improved integration
* Add create_args property to OpenAIChatCompletionClient for better access to initialization arguments
* Enhance client capability validation in MagenticOne to ensure compatibility with OpenAI GPT-4o model
* Refactor client capability validation in MagenticOne for improved clarity
* Update magentic_one.py
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* Remove create_args property from OpenAIChatCompletionClient and update validation logic in MagenticOne to directly access _create_args
* Refactor documentation in MagenticOne for improved readability and consistency
* Refactor client capability validation in MagenticOne to remove unnecessary model check for GPT-4o
* Add MagenticOne CLI (#4788)
* Add MagenticOne CLI script for task execution with OpenAI GPT-4o integration
* Fix argument parsing in MagenticOne CLI to require a single task input
* Add docstring to main function in MagenticOne CLI for improved usage clarity
* Fix example usage in docstring of MagenticOne CLI for correct argument order
* Refactor argument parsing in MagenticOne CLI for improved clarity and consistency
* Add type hints to run_task function in MagenticOne CLI
* Add type hint for main function in MagenticOne CLI
* Remove type ignore from main function call in MagenticOne CLI
---------
Co-authored-by: Hussein Mozannar <hmozannar@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* Enhance MagenticOneGroupChat documentation with architecture overview and citation reference
* Fix formatting in MagenticOneGroupChat documentation and add citation reference
* 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>
* add chainlit sample
* readme updates
* put team inside run to avoid problems
* simplify example and add readme
* inform user team is reset
---------
Co-authored-by: Hussein Mozannar <hmozannar@microsoft.com>
* moves AgentId into Agent
* Renames AgentRuntime to AgentMessenger (more accurate name)
* Remove IAgentRuntime Interface
* changes constructor of Agent to take IAgentWorker instead of IAgentRuntime
* fix finicky websurfer test
* add close method
* update default to not download or debug
* enable closing agents in team_manager
---------
Co-authored-by: Victor Dibia <victor.dibia@gmail.com>
* 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>
* fix message instance check error
* general refactor, enable 3rd party gallery
* format fixes
* update detail view
* improve detail view and test sync capabilities
* minor tweaks, version bump
* version bump
* update uv.lock
* update lockfile
* update uv.lock
* update uv lock
* pin uv version
* uv version
* revert
* revert
* minor side bar and drag drop layout fixes
* revert version numbering.
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* refactor renaming agent base
* 1st draft
* 1st draft
* format
* rename the tsts
* move IagentWorker
* 1st draft
* format
* gen-proto
* run gen-proto-samples
* format
* merge problem format
* v1 progress on drag_drop
* add v1 for node deletions
* major refactor, add sidebar to teams and session playground
* format updates
* formatting updates
* update formatting
* formatting and other checks
* add mangentic one deps
* general refactor, fix new team creation bug etc...
* minor bugfix
* update uv lock
---------
Co-authored-by: Ryan Sweet <rysweet@microsoft.com>
* Use official cloud event proto schema
* format
* fix bug in cloud event attribute creation
---------
Co-authored-by: Kosta Petan <kostapetan@gmail.com>
Co-authored-by: Ryan Sweet <rysweet@microsoft.com>
* Update user guide
* Fix typos
* Move the file to correct dir
* update notebook, add runnable code to catch bugs, improve text on inner messages
* update icons in tutorial
* Reduce references to future concepts
---------
Co-authored-by: Victor Dibia <victor.dibia@gmail.com>
1. convert dataclass types to pydantic basemodel
2. add save_state and load_state for ChatAgent
3. state types for AgentChat
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* Move LLMUsageTracker to a cookbook
* rename, add to index
* fmt and remove test
* Update python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/llm-usage-logger.ipynb
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix missing quotation marks in notebook
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Core API example showing multiple agents concurrently (#4427)
* Apply feedback
* Add different topics for closure agent example
* Address feedback
* Mypy fix
* Modify import path based on refactoring
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* initial addition
* working without multimodal messages
* show images
* remove temp changes
* ui type websurfer
* fix issue with image width, enable text truncation, enable viewing images full screen
---------
Co-authored-by: Victor Dibia <victor.dibia@gmail.com>
* fix import issue related to agentchat update #4245
* update uv lock file
* fix db auto_upgrade logic issue.
* im prove msg rendering issue
* Support termination condition combination. Closes#4325
* fix db instantiation bug
* update yarn.lock, closes#4260#4262
* remove deps for now with vulnerabilities found by dependabot #4262
* update db tests
* add ability to load sessions from db ..
* format updates, add format checks to ags
* format check fixes
* linting and ruff check fixes
* make tests for ags non-parrallel to avoid db race conditions.
* format updates
* fix concurrency issue
* minor ui tweaks, move run start to websocket
* lint fixes
* update uv.lock
* Update python/packages/autogen-studio/autogenstudio/datamodel/types.py
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* Update python/packages/autogen-studio/autogenstudio/teammanager.py
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* reuse user proxy from agentchat
* ui tweaks
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Hussein Mozannar <hmozannar@microsoft.com>
* add protobuf serialization test
* proto file regeneration
---------
Co-authored-by: Ryan Sweet <rysweet@microsoft.com>
Co-authored-by: Mohammad Mazraeh <Mazraeh.Mohammad@Gmail.com>
* initial addition of a user proxy agent in agentchat, related to #3614
* fix typing/mypy errors
* format fixes
* format and pyright checks
* update, add support for returning handoff message, add tests
---------
Co-authored-by: Ryan Sweet <rysweet@microsoft.com>
Co-authored-by: Hussein Mozannar <hmozannar@microsoft.com>
* Update README.md
Add more information about using Azure OpenAI services
* Update README.md
Adjust the formatting to improve readability of the steps, making them easier to follow.
---------
Co-authored-by: Hussein Mozannar <hmozannar@microsoft.com>
* task: added warning when none is called in intervention handler
* add leading underscore to indicate private to _warn_if_none method in intervention.py
* address comment of returning Any for result in intervention.py
* Update intervention.py to remove redundant name change
* Format and lint
---------
Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
Co-authored-by: Jack Gerrits <jack@jackgerrits.com>
* Swarm Tutorial
* Include 2 swarm example, add svgs
* Include latest Swarm changes & Eric changes
* Update docs to remove UserProxyAgent
* Include latest Console changes
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* Console to return last processed (#4277)
* Preserve input generator type
* Add tests
* format
---------
Co-authored-by: Jack Gerrits <jack@jackgerrits.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* add subscription response
* fix send subscription response
* add register agent type response
* adding a test
* working on shaping up a test
* appsettins update for backend
* another appsettings
* fixup aspire hosting
* enable AGENT_HOST var from aspire
* add SendMessageAsync
* remove broken test
* test compiles and runs but is not (yet) correct
* subscriptions grain wireup.
* temp assert true.
* remove DI for SubscriptionGrain
* add xlang python code
* add subscription response
* rebond
* Update to .NET 9.0
* Fix Backend project SDK
* Package updates
* get RegisterAgentTypeRequest working
* fix exceptions
* add error handling for requests
* whoops
* send cloud event message type
* processing cloudevents
* trying tosend proto data - doesn't work
* trying to pack proto_data
* fix (#4238)
* pack the Message from agents_events
* format - not sure why these?
* format
* cleanup, error handling, xlang sample publishes messages that can be heard by .NET and vice versa
* format
* sdk version
* sdk vers
* net8
* back to net8
* remove netstandard2
* fix used
* remove unused
* more cleanup
* remove unneeded package
* I'm terrible at writing tests
* deserialize the cloud events and sent them as events
* comment
* cleanup
* await
* Delete dotnet/samples/Hello/Backend/Backend.csproj
unneeded change
* whoops
* merge main python back into here
* revert back to local
* revert some of the helloAgents changes.
* [.NET] Add happy path test for in-memory agent && Simplify HelloAgent example && some clean-up in extension APIs (#4227)
* add happy path test
* remove unnecessary namespace
* fix build error
* Update AgentBaseTests.cs
* revert changes
---------
* fix busted merge from main
* addressing review comments
* make internal
* case sensitive rename step 1
* case sensitive rename step 2
* remove!
---------
Co-authored-by: Peter Chang <petchang@microsoft.com>
Co-authored-by: Reuben Bond <reuben.bond@gmail.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com>
* task can be ChatMessage; add group chat state validation step, and address swarm state valiation; change handling of start and reset to RPC to capture any error.
* Update tutorial note
* add ui streaming to distributed group chat example
Signed-off-by: Mohammad Mazraeh <mazraeh.mohammad@gmail.com>
* fix pyright error after updating dependencies
Signed-off-by: Mohammad Mazraeh <mazraeh.mohammad@gmail.com>
---------
Signed-off-by: Mohammad Mazraeh <mazraeh.mohammad@gmail.com>
* add react-flow
* update tutorial, some ui improvement for agent thread layout
* v1 for interactive viz for agent state
* add Ui visualization of message based transitions
* minor updates
* fix node edges, support visualization of self loops
* improve edges and layout, add support for selector group chat prompt
* minor ui tweaks
* ui and layout updates
* ugrade dependencies to fix dependabot scan errors
* persist sidebar, enable contentbar title mechanism #4191
* add support for user proxy agent, support human in put mode. #4011
* add UI support for human input mode via a userproxy agent #4011
* version update
* fix db initialization bug
* support for human input mode in UI, fix backend api route minor bugs
* update pyproject toml and uv lock
* readme update, support full screen mode for agent visualiation
* update uv.lock
When the tool expects complex inputs that require nested models, pydantic will generate a JSON Schema that will include references to other schemas using the `$ref` keyword (cf https://json-schema.org/understanding-json-schema/structuring#dollarref).
But the `$ref` keyword is not supported by OpenAI.
This fix:
1. Resolves the references and inlines the corresponding schemas.
2. Removes the then useless root `$defs` field of the JSON schema to save tokens.
Co-authored-by: Jean-Marc Le Roux <contact@jmlx.io>
Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>