Commit Graph

1677 Commits

Author SHA1 Message Date
Xiaoyun Zhang 84c7c2430c
[.Net] Add AOT compatible check for AutoGen.Core (#2858)
* add AutoGen.AotCompatibility test

* add aot test

* fix build error

* update ps1 path
2024-06-04 15:01:11 +00:00
Diego Colombo 5f29d6b97d
Refactor hook registration and processing methods (#2853)
* Refactor hook registration and processing methods

- Refactored the `hook_lists` dictionary to use type hints for better readability.
- Updated the `register_hook` method signature to include type hints for the `hook` parameter.
- Added type hints to the `process_last_received_message` method parameters and return value.

This commit refactors the code related to hook registration and processing in the `conversable_agent.py` file. The changes improve code readability and maintainability by using type hints and updating method signatures.

* Refactor hook_lists initialization and add type hints

- Refactored the initialization of `hook_lists` to use a colon instead of an equal sign.
- Added type hints for the parameters and return types of `process_last_received_message` method.

* Refactor hook registration and processing in conversable_agent.py

- Refactored the `hook_lists` dictionary to use a more generic type for the list of hooks.
- Updated the signature check for `process_message_before_send`, `process_all_messages_before_reply`, and `process_last_received_message` hooks to ensure they are callable with the correct signatures.
- Added error handling to raise a ValueError or TypeError if any hook does not have the expected signature.

* Refactor hook processing in conversable_agent.py

- Simplify the code by removing unnecessary type checks and error handling.
- Consolidate the logic for processing hooks in `_process_message_before_send`, `process_all_messages_before_reply`, and `process_last_received_message` methods.

* Refactor register_hook method signature for flexibility

The commit changes the signature of the `register_hook` method in `conversable_agent.py`. The second argument, `hook`, is now of type `Callable` instead of `Callable[[List[Dict]], List[Dict]]`. This change allows for more flexibility when registering hooks.
2024-06-03 22:16:58 +00:00
Zoltan Lux a959deeac6
Use Gemini without API key (#2805)
* google default auth and svc keyfile for Gemini

* [.Net] Release note for 0.0.14 (#2815)

* update release note

* update trigger

* [.Net] Update website for AutoGen.SemanticKernel and AutoGen.Ollama (#2814)
support vertex ai compute region

* [CAP] User supplied threads for agents (#2812)

* First pass:  message loop in main thread

* pypi version bump

* Fix readme

* Better example

* Fixed docs

* pre-commit fixes

* refactoring, minor fixes, update gemini demo ipynb

* add new deps again and reset line endings

* Docstring for the init function. Use private methods

* improve docstring

---------

Co-authored-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com>
Co-authored-by: Rajan <rajan.chari@yahoo.com>
Co-authored-by: Zoltan Lux <z.lux@campus.tu-berlin.de>
2024-06-03 21:00:00 +00:00
Li Jiang 2000d47406
Fix chromadb get_collection ignores custom embedding_function (#2854) 2024-06-03 18:12:03 +00:00
Chi Wang 1e5c03f66a
update guide about roadmap issues (#2846)
* update guide about roadmap issues

* update link
2024-06-03 14:08:18 +00:00
Krishna Shedbalkar de99564a6e
Broken links fix (#2843)
* Update Examples.md

* Update agent_chat.md

* Update agent_chat.md

* Update Optional-Dependencies.md

* Update JSON_mode_example.ipynb

* Update JSON_mode_example.ipynb

* Update JSON_mode_example.ipynb

* Update JSON_mode_example.ipynb

* Update agentchat_agentoptimizer.ipynb

* Update agentchat_nested_chats_chess.ipynb
2024-06-02 18:58:10 +00:00
Diego Colombo 6e8331b754
Add llamaindex agent integration (#2831)
* white spaces

* add llamaindex agent wrapper for autogen

* formatting

* formatting fixes

* add support for llamaindex agents

* fix style

* fix style

* delete file

* re-add file

* fixes pre-commit errors

* feat: Add agentchat_group_chat_with_llamaindex_agents notebook

This commit adds the notebook "agentchat_group_chat_with_llamaindex_agents.ipynb" which demonstrates how to integrate Llamaindex agents into Autogen. The notebook includes code for setting up the API endpoint, creating Llamaindex agents, and setting up a group chat.

* Refactor code

* feat: Add test for LLamaIndexConversableAgent

This commit adds a new test file `test_llamaindex_conversable_agent.py` that contains a test case for the `LLamaIndexConversableAgent` class. The test verifies the functionality of group chat with two MultimodalConversable Agents, limiting the chat by the `max_round` parameter. It also checks if the number of rounds does not exceed the maximum specified rounds.

The purpose of this change is to ensure that the `LLamaIndexConversableAgent` behaves as expected and correctly handles group chats with limited rounds.

Note: This commit includes import statements and setup code necessary for running the test case.

* fix formatting

* feat: Add LlamaIndexAgent job to GitHub Actions workflow

This commit adds a new job called "LlamaIndexAgent" to the GitHub Actions workflow. The job runs on multiple operating systems (ubuntu-latest, macos-latest, windows-2019) and uses Python version 3.11. It sets up the Python environment, installs necessary packages and dependencies for LMM, performs coverage testing using pytest, and uploads the coverage report to Codecov.

The commit also includes changes to the test_llamaindex_conversable_agent.py file. It imports os and sys modules, appends a path to sys.path, and adds skip conditions for tests based on certain conditions.

These changes improve the CI/CD pipeline by adding a new job for LlamaIndexAgent and enhancing test conditions in test_llamaindex_conversable_agent.py.

* fix test yaml

* cleanup tests

* fix test run

* formatting

* add test

* fix yaml

* pr feedback

* add documentation to website

* fixed style

* edit to document page

* newline

* make skip reason easier to see

* compose skip reasons

* fix env variable name

* refactor: Update package installation in contrib workflows

- Replaced specific package installations with more general ones
- Updated the installation of llama-index packages and dependencies
- Added new packages for llama-index and Wikipedia tools

* Update dependencies and add new agents for group chat

- Update dependencies to specific versions
- Add new agent `entertainent_specialist` for discovering entertainment opportunities in a location
- Modify the `test_group_chat_with_llama_index_conversable_agent` function to include the new agent in the group chat

* Update pydantic version requirement in setup.py

- Update pydantic version requirement from "pydantic>=1.10,<3,!=2.6.0" to "pydantic>=1.10,<3"
- Remove comment about issue with pydantic 2.6.0

* Refactor ChatMessage instantiation in _extract_message_and_history()

- Refactored the instantiation of ChatMessage in the _extract_message_and_history() function.
- Added an empty dictionary as additional_kwargs to the ChatMessage constructor.

* Refactor test_llamaindex_conversable_agent.py

- Removed unused import and variable
- Updated OpenAI model to gpt-4
- Reduced max_iterations for location_specialist and entertainment_specialist from 30 to 5
- Changed human_input_mode for user_proxy to "NEVER"
- Added assertion for max_rounds in entertainent_assistant

These changes improve code efficiency and ensure proper functionality.

* Remove entertainment_specialist agent and update user_proxy settings in test_llamaindex_conversable_agent.py

- Remove the creation of entertainent_specialist agent
- Update the max_consecutive_auto_reply setting for user_proxy to 10
- Update the default_auto_reply setting for user_proxy to "Thank you. TERMINATE"

* Refactor installation of LlamaIndex packages and dependencies

- Simplify installation commands for LlamaIndex packages
- Remove specific version numbers from pip install commands

* Update test_llamaindex_conversable_agent.py to include verbose output during pytest.

- Add the -v flag to the pytest command in contrib-openai.yml.
- Print a message when skipping the test due to missing dependencies or key.

* Refactor OpenAI workflow, remove LlamaIndexAgent

This commit removes the LlamaIndexAgent from the OpenAI workflow in order to streamline and simplify the code. The LlamaIndexAgent was no longer necessary and its removal improves overall code organization and maintainability.

* feat: Add test for group chat functionality with LLamaIndexConversableAgent

use mock reactagent in test

* Update Dockerfile for devcontainer

- Updated the Dockerfile for the devcontainer environment.
- Added installation of build-essential, npm, git-lfs, and other packages.
- Upgraded pip and installed pydoc-markdown, pyyaml, and colored libraries.

* Update devcontainer.json with new VS Code extensions and terminal settings

- Updated the list of VS Code extensions in devcontainer.json to include "GitHub.copilot"
- Added a new terminal profile for Linux with the path set to "/bin/bash"
- Set the default Linux terminal profile to "bash"

* removeall

* feat: Add Dockerfiles and devcontainer configurations

This commit adds Dockerfiles and devcontainer configurations for different use cases in the `.devcontainer` directory. The following changes were made:

- Added `Dockerfile` for basic setups (`base`)
- Added `Dockerfile` for advanced features (`full`)
- Added `Dockerfile` for AutoGen project developers (`dev`)
- Added `Dockerfile` for AutoGen project developers using Studio (`studio`)
- Updated existing files with necessary dependencies and configurations
- Modified README.md to provide instructions on customizing Dockerfiles and managing the Docker environment

These changes allow users to easily set up their AutoGen development environment using Docker containers.

* delete

* Add authors.yml file with author information

This commit adds the authors.yml file, which contains information about various authors contributing to the project. Each author entry includes their name, title, URL, and image URL. This file will be used to display author information on the website.

* delete

* Add test cases for agent chat functionality

This commit adds new test cases for the agent chat functionality. The test cases include scenarios such as auto feedback from code execution, function calls, currency calculator, async function calls, group chat finite state machine, cost token tracking, and group chat state flow. These test cases cover different versions of Python (3.10, 3.11, and 3.12) and are skipped if OpenAI is not installed or the Python version does not match.

* delete

* feat: Add LLM configuration documentation

This commit adds documentation for configuring an agent's access to LLMs. It includes information on the `llm_config` argument, `config_list`, and other configuration parameters. The commit also provides examples of filtering the `config_list` based on model names and tags. Additionally, it demonstrates how to add an HTTP client in `llm_config` for proxy usage. Finally, it mentions helper functions for loading a config list from API keys, environment variables, files, or `.env` files.

Closes #1234

* delete

* feat: Add LLM configuration documentation

This commit adds documentation for configuring an agent's access to LLMs. It includes information on the `llm_config` argument, `config_list`, and other configuration parameters. The commit also provides examples of filtering the `config_list` based on model names and tags. Additionally, it demonstrates how to add an HTTP client in `llm_config` for proxy usage. Finally, it mentions helper functions for loading a config list from various sources.

Closes #1234

* delete

* adding back notebooks

* reset

* feat: Add setup.py for package installation

This commit adds a new file, `setup.py`, which is used for installing the package. The `setup.py` file includes information such as the author, description, and dependencies of the package. This allows users to easily install and use the package in their projects.

The `setup.py` file also includes different extra requirements for specific functionalities, such as retrieving chat data or running Jupyter notebooks. These extra requirements are installed when specified during installation.

Overall, this addition improves the usability and installation process of the package.
2024-05-31 20:58:15 +00:00
Chi Wang 341a21787d
fix typo and update news (#2825)
* fix typo and update news

* add link

* update link

* fix metadata

* tag
2024-05-31 03:50:41 +00:00
Wei 752cf88f92
Fix initialization of client in retrieve_docs() function (#2830) 2024-05-30 15:45:09 +00:00
Rajan 47f9052672
[CAP] User supplied threads for agents (#2812)
* First pass:  message loop in main thread

* pypi version bump

* Fix readme

* Better example

* Fixed docs

* pre-commit fixes
2024-05-29 14:10:44 +00:00
Xiaoyun Zhang 7f635b4309
[.Net] Update website for AutoGen.SemanticKernel and AutoGen.Ollama (#2814)
* update sk documents

* add ollama doc
2024-05-28 21:55:40 +00:00
Xiaoyun Zhang f9d3fdaf62
[.Net] Release note for 0.0.14 (#2815)
* update release note

* update trigger
2024-05-28 21:55:30 +00:00
Chi Wang 413a458f75
print next speaker (#2800)
* print next speaker

* fix test error
2024-05-28 13:35:55 +00:00
Mark Ward 73788bdfb7
fix type object 'ConversableAgent' has no attribute 'DEFAULT_summary_prompt' (#2788)
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-05-27 03:49:00 +00:00
Chi Wang 2abdbfbbcf
fix links and tags from databricks notebook (#2795) 2024-05-26 16:31:18 +00:00
Li Jiang c041db6cae
Improve the error messge (#2785) 2024-05-26 08:01:43 +00:00
ikarapanca 7457652520
Update Getting-Started.mdx (#2781)
Add missing os import

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-05-26 02:12:31 +00:00
Chi Wang bbe4b79d7d
Blogpost and news (#2790)
* blog and news

* update

* economist

* news update

* bump version to 0.2.28

* link update

* address comments

* address comments

* add quote

* address comment

* address comment

* fix link

* guidance
2024-05-26 01:27:52 +00:00
TJ 5a2900124b
DBRX (Databricks LLM) example notebook (#2434)
* Resolving test failures locally

* Resolving test failures locally

* Updates to website resources and docs, author

* Adding image

* Fixes to precommit and doc files for lfd

* Fixing ruff exclusion of new notebook

* Updates to support notebook rendering

* Updates to support notebook rendering

* Removing some results to try to fix docs render issue

* pre-commit to standardize formatting

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-25 16:28:46 +00:00
HRUSHIKESH DOKALA c273862ee5
[fix] file logger import (#2773)
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-05-25 05:32:18 +00:00
David Luong 5a5c0f2a11
Remove duplicate project declared in AutoGen.sln (#2789)
* remove duplicate project in AutoGen.sln

* Add EndProject
2024-05-24 20:17:41 +00:00
Audel Rouhi 6604ca511b
PGVector Support for Custom Connection Object (#2566)
* Added fixes and tests for basic auth format

* User can provide their own connection object. Added test for it.

* Updated instructions on how to use. Fully tested all 3 authentication methods successfully.

* Get password from gitlab secrets.

* Hide passwords.

* Update notebook/agentchat_pgvector_RetrieveChat.ipynb

Co-authored-by: Li Jiang <bnujli@gmail.com>

* Hide passwords.

* Added connection_string test. 3 tests total for auth.

* Fixed quotes on db config params. No other changes found.

* Ran notebook

* Ran pre-commits and updated setup to include psycopg[binary] for windows and mac.

* Corrected list extension.

* Separate connection establishment function. Testing pending.

* Fixed pgvectordb auth

* Update agentchat_pgvector_RetrieveChat.ipynb

Added autocommit=True in example

* Rerun notebook

---------

Co-authored-by: Li Jiang <bnujli@gmail.com>
Co-authored-by: Li Jiang <lijiang1@microsoft.com>
2024-05-24 17:58:56 +00:00
jtoy 129887519d
allow serialize_to_str to work with non ascii when dumping via json.dumps (#2714)
Co-authored-by: Jason <jtoy@grids.local>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-05-24 17:51:15 +00:00
HRUSHIKESH DOKALA c0812f9b60
actions version update for the TransformMessages workflow (#2759)
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-05-24 17:44:55 +00:00
David Luong 4fec246342
Introduce AnthropicClient and AnthropicClientAgent (#2769)
* Reference project

Revert "Set up the Agent. Basic Example set up, boilerplate for connector, ran into signing issue."

This reverts commit 0afe04f2

End to end working anthropic agent + unit tests

Set up the Agent. Basic Example set up, boilerplate for connector, ran into signing issue.

* Add pragma warning

* - Remove Message type
- tabbing fix white space in csproj
- Remove redundant inheritance
- Edit Anthropic.Tests' rootnamespace
- Create AutoGen.Anthropic.Samples

* short-cut agent extension method

* Pass system message in the constructor and throw if there's system message in Imessages

---------

Co-authored-by: luongdavid <luongdavid@microsoft.com>
2024-05-24 16:37:16 +00:00
Li Jiang 80b2dba6ab
Add packaging explicitly (#2780) 2024-05-24 14:52:56 +00:00
Aretai-Leah e87a6a424d
Create JSON_mode_example.ipynb (#2554)
* Create JSON_mode_example.ipynb

* updated json example

* added metadata to JSON notebook

* fixed details in wrong metadata

* Update JSON_mode_example.ipynb

removed colab cell

* fixed error

* removed cell output

* whitespace fixed

I think its fixed?

* finally fixed whitespace
2024-05-24 13:12:36 +00:00
Xiaoyun Zhang 702c010d77
[.Net] add ollama-sample and adds more tests (#2776)
* add ollama-sample and adds more tests

* Update AutoGen.Ollama.Sample.csproj
2024-05-24 04:14:29 +00:00
Xiaoyun Zhang 8d55334e4d
[.Net] add AutoGen.SemanticKernel.Sample project (#2774)
* add AutoGen.SemanticKernel.Sample

* revert change
2024-05-24 01:53:22 +00:00
Xiaoyun Zhang edb2f92b0d
[.Net] rename Autogen.Ollama to AutoGen.Ollama and add more test cases to AutoGen.Ollama (#2772)
* update test

* add llava test

* add more tests

* rm Autogen.Ollama

* add AutoGen.ollama

* update

* rename to temp

* remove ollama

* rename

* update

* rename

* rename

* update
2024-05-23 19:15:25 +00:00
Wael Karkoub 4ebfb82186
Ignore Some Messages When Transforming (#2661)
* works

* spelling

* returned old docstring

* add cache fix

* spelling?

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-22 20:22:17 +00:00
pk673 3e11b07d1d
logger fix (#2659)
Co-authored-by: HRUSHIKESH DOKALA <96101829+Hk669@users.noreply.github.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-22 20:04:50 +00:00
Nikolaytv 8b15d44083
added Gemini safety setting and Gemini generation config (#2429)
* added Gemini safety setting and Gemini generation config

* define params_mapping as a constant as a class variable

* fixed formatting issues

---------

Co-authored-by: nikolay tolstov <datatraxer@gmail.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-22 19:58:43 +00:00
Wael Karkoub 2bad145738
Update Deprecation Warning for `CompressibleAgent` and `TransformChatHistory` (#2685)
* improved deprecation warnings

* compressible_agent test fix

* fix retrieve chat history test

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-22 19:58:35 +00:00
Mark Sze 3d8fd5cc91
Added ability to ignore the addition of the select speaker prompt for a group chat (#2726)
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-22 19:55:26 +00:00
jtoy 4b5f5996a2
add warning if duplicate function is registered (#2159)
* add warning if duplicate function is registereed

* check _function_map and llm_config

* check function_map and llm_config

* use register_function and  llm_config

* cleanups

* cleanups

* warning test

* warning test

* more test coverage

* use a fake config

* formatting

* formatting

---------

Co-authored-by: Jason <jtoy@grids.local>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-22 19:53:39 +00:00
Ian b698a98eb0
fix openai compatible changes (#2718)
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-22 19:53:09 +00:00
Rob fb74624376
Add silent option in nested chats and group chat (#2712)
* feat: respect silent request in nested chats and group chat

* fix: address plugin test

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-22 17:39:37 +00:00
Krishna Shedbalkar 918244e98e
[Add] Fix invoking Assistant API (#2751)
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-22 17:38:23 +00:00
Beibin Li 732450d38a
Debug: Gemini client was not logged and causing runtime error (#2749)
* Debug: gemini client was not logged

* Resolve docker issue in LMM test

* Resolve comments

---------

Co-authored-by: HRUSHIKESH DOKALA <96101829+Hk669@users.noreply.github.com>
2024-05-22 17:35:19 +00:00
Eric Zhu eedd94707b
Avoid requests 2.32.0 to fix build (#2761)
* Avoid requests 2.32.0 to fix build

* comment

* quote
2024-05-22 17:17:17 +00:00
Rajan 9f337248e2
[CAP] Refactor: Better Names for classes and methods (#2734)
* Bug fix

* Refactor: Better class names, method names

* pypi version

* pre-commit fixes
2024-05-21 19:46:10 +00:00
Michael e208f7c20a
Update human-in-the-loop.ipynb (#2724) 2024-05-21 17:44:12 +00:00
Xiaoyun Zhang b134506dfa
Update README.md (#2736) 2024-05-21 17:27:24 +00:00
Xiaoyun Zhang 90ca2ca64b
[.Net] Mark Message as obsolete and add ToolCallAggregateMessage type (#2716)
* make Message obsolete

* add ToolCallAggregateMessage

* update message.md

* address comment

* fix tests

* set round to 1 temporarily

* revert change

* fix test

* fix test
2024-05-21 05:48:19 +00:00
Xiaoyun Zhang 3e6f073373
[.Net] fix #2722 (#2723)
* fix bug and add tests

* update
2024-05-21 03:19:07 +00:00
Rajan 31d2d37d88
[CAP] Improved AutoGen Agents support & Pip Install (#2711)
* 1) Removed most framework sleeps 2) refactored connection code

* pre-commit fixes

* pre-commit

* ignore protobuf files in pre-commit checks

* Fix duplicate actor registration

* refactor change

* Nicer printing of Actors

* 1) Report recv_multipart errors 4) Always send 4 parts

* AutoGen generate_reply expects to wait indefinitely for an answer.  CAP can wait a certain amount and give up.   In order to reconcile the two, AutoGenConnector is set to wait indefinitely.

* pre-commit formatting fixes

* pre-commit format changes

* don't check autogenerated proto py files

* Iterating on CAP interface for AutoGen

* User proxy must initiate chat

* autogencap pypi package

* added dependencies

* serialize/deserialize dictionary elements to json when dealing with ReceiveReq

* 1) Removed most framework sleeps 2) refactored connection code

* Nicer printing of Actors

* AutoGen generate_reply expects to wait indefinitely for an answer.  CAP can wait a certain amount and give up.   In order to reconcile the two, AutoGenConnector is set to wait indefinitely.

* pre-commit formatting fixes

* pre-commit format changes

* Iterating on CAP interface for AutoGen

* User proxy must initiate chat

* autogencap pypi package

* added dependencies

* serialize/deserialize dictionary elements to json when dealing with ReceiveReq

* pre-commit check fixes

* fix pre-commit issues

* Better encapsulation of logging

* pre-commit fix

* pip package update
2024-05-19 13:34:39 +00:00
HRUSHIKESH DOKALA 11d9336e3d
gpt40 tokens update (#2717) 2024-05-19 13:32:58 +00:00
Rick 19de99e3f6
Update groupchat.py to remove Optional type hint when they are not checked for None (#2703) 2024-05-17 22:38:17 +00:00
HRUSHIKESH DOKALA d461100bfa
Custom Runtime Logger <> FileLogger (#2596)
* added logger param for custom logger support

* added FileLogger

* bump: spell check

* bump: import error

* added more log functionalites

* bump: builtin logger for FileLogger

* type check and instance level logger

* tests added for the fileLogger

* formatting bump

* updated tests and removed time formatting

* separate module for the filelogger

* update file logger test

* added the FileLogger into the notebook

* bump json decode error

* updated requested changes

* Updated tests with AutoGen agents

* bump file

* bump: logger accessed before intializedsolved

* Updated notebook to guide with a filename

* added thread_id to the FileLogger

* bump type check in tests

* Updated thread_id for each log event

* Updated thread_id for each log event

* Updated with tempfile

* bump: str cleanup

* skipping-windows tests

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-05-16 05:54:05 +00:00