Commit Graph

563 Commits

Author SHA1 Message Date
Umer Mansoor 0c5cbd8b2b
Fix failing GitGuardian check (#3228) 2024-07-26 22:10:33 +00:00
wenngong f048776685
avoid scan tool false alarm (#3218)
Co-authored-by: gongwn1 <gongwn1@lenovo.com>
2024-07-26 16:38:09 +00:00
Fabian Valle f9295c4c39
+mdb atlas vectordb [clean_final] (#3000)
* +mdb atlas

* Update test/agentchat/contrib/vectordb/test_mongodb.py

Co-authored-by: HRUSHIKESH DOKALA <96101829+Hk669@users.noreply.github.com>

* update test_mongodb.py; we dont need to do the assert .collection_name vs .name

* Try fix mongodb service

* Try fix mongodb service

* Update username and password

* Update autogen/agentchat/contrib/vectordb/mongodb.py

* closer --- but im not super thrilled about the solution...

* PYTHON-4506 Expanded tests and simplified vector search pipelines

* Update mongodb.py

* Update mongodb.py - Casey

* search_index_magic

index_name change; keeping track of lucene indexes is tricky

* Fix format

* Fix tests

* hacking trying to figure this out

* Streamline checks for indexes in construction and restructure tests

* Add tests for score_threshold, embedding inclusion, and multiple query tests

* refactored create_collection to meet base object requirements

* lint

* change the localhost port to 27017

* add test to check that no embedding is there unless explicitly provided

* Update logger

* Add test get docs with ids=None

* Rename and update notebook

* have index management include waiting behaviors

* Adds further optional waits or users and tests. Cleans up upsert.

* ensure the embedding size for multiple embedding inputs is equal to dimensions

* fix up tests and add configuration to ensure documents and indexes are READY for querying

* fix import failure

* adjust typing for 3.9

* fix up the notebook output

* changed language to communicate time taken on first init_chat call

* replace environment variable usage

---------

Co-authored-by: Fabian Valle <fabian.valle-simmons@mongodb.com>
Co-authored-by: HRUSHIKESH DOKALA <96101829+Hk669@users.noreply.github.com>
Co-authored-by: Li Jiang <bnujli@gmail.com>
Co-authored-by: Casey Clements <casey.clements@mongodb.com>
Co-authored-by: Jib <jib.adegunloye@mongodb.com>
Co-authored-by: Jib <Jibzade@gmail.com>
Co-authored-by: Cozypet <yanhan860711@gmail.com>
2024-07-25 23:11:19 +00:00
Zoltan Lux a5e5be73b5
Enhance vertexai integration (#3086)
* switch to officially supported Vertex AI message sending + safety setting converion for vertexai

* add system instructions

* switch to officially supported Vertex AI message sending + safety setting converion for vertexai

* fix bug in safety settings conversion

* add missing system instructions

* add safety settings to send message

* add support for credentials objects

* add type checkingchange project_id to project arg

* add more tests

* fix mock creation in test

* extend docstring

* fix errors with gemini message format in chats

* add option for vertexai response validation setting & improve docstring

* readding empty message handling

* add more tests

* extend and improve gemini vertexai jupyter notebook

* rename project arg to project_id and GOOGLE_API_KEY env var to GOOGLE_GEMINI_API_KEY

* adjust docstring formatting
2024-07-23 16:37:48 +00:00
Yiran Wu c19f44f626
update (#3175)
Co-authored-by: HRUSHIKESH DOKALA <96101829+Hk669@users.noreply.github.com>
2024-07-21 21:07:13 +00:00
Manojkumar Kotakonda 1fdeca4205
Added anthropic bedrock (#3103)
* Added anthropic bedrock

* Code format and fixed import

* Added tests for anthropic bedrock

* tests update

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: HRUSHIKESH DOKALA <96101829+Hk669@users.noreply.github.com>
2024-07-19 19:43:09 +00:00
Li Jiang 744fcbe299
Fix websurfer test error (#3138)
* Fix assertion error

* Update triggers
2024-07-15 15:37:15 +00:00
Anush 5b1dc3bf63
feat: Qdrant support for the VectorDB interface (#3035)
* feat: Qdrant support

* chore: pre-defined vector db

* Fix issues

---------

Co-authored-by: Li Jiang <bnujli@gmail.com>
2024-07-15 13:19:58 +00:00
Shaun 0a82b3eb76
fix: support openai service account apikey format (#3078) 2024-07-05 16:59:58 +00:00
HRUSHIKESH DOKALA b4a3f263b0
Cohere Client (#3004)
* initial setup for cohere client

* client update

* changes: ClintType added to the utils

* Revert "changes: ClintType added to the utils"

This reverts commit 80d6155228.

* Message conversion to Cohere, Parameter handling, cost calculation, streaming, tool calling

* Changed Groq references.

* minor fix

* tests added

* ref fix

* added in the workflows

* Fixed bug on non-streaming text generation

* fix: formatting

* Support Cohere rule for last message not USER when tool_results exist

* Added Cohere to documentation

* fixed client.py merge, removed unnecessary comments in groq.py, updated Cohere documentation, added Groq documentation

* log: ignored params

* update: custom exception added

---------

Co-authored-by: Mark Sze <mark@sze.family>
Co-authored-by: Mark Sze <66362098+marklysze@users.noreply.github.com>
2024-07-03 14:33:03 +00:00
Mark Sze 23c1dec206
Groq Client (#3003)
* Groq Client Class - main class and setup, except tests

* Change pricing per K, added tests

* Streaming support, including with tool calling

* Used Groq retries instead of loop, thanks Gal-Gilor!

* Fixed bug when using logging.

---------

Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>
2024-06-28 05:58:42 +00:00
Mark Sze b1ec3ae545
Together AI Client (#2919)
* First pass together.ai client class

* Config handling, models and cost

* Added tests, moved param management to create function

* Tests, parameter, validation, logging updates

* Added use of client_utils PR 2949

* Updated to return OAI response

* Notebook example

* Improved function calling, updated tests, updated notebook with Chess example

* Tidied up together client class, better parameter handling, simpler exception capture, warning for no cost, reuse in tests, cleaner tests

* Update of documentation notebook, replacement of old version

* Fix of messages parameter for hide_tools function call

* Update autogen/oai/together.py

Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>

* Update together.py to fix text

---------

Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>
Co-authored-by: Yiran Wu <32823396+yiranwu0@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-06-21 17:14:44 +00:00
Mark Sze 27e3690378
Mistral Client (#2892)
* Initial commit of Mistral client class

* Updated to manage final system message for reflection_with_llm

* Add Mistral support to client class

* Add Mistral support across the board (based on Gemini changes)

* Test file for Mistral client

* Updated handling of config, added notebook for documentation

* Added support for additional API parameters

* Remove unneeded code, updated exception raising

* Updated handling of keywords, including type checks, defaults, warnings. Updated notebook example to remove logging warnings.

* Added class description.

* Updated tests to support new config handling.

* Moved parameter parsing to create function, minimised init, added parameter tests

* Refined parameter validation

* Correct spacing

* Fixed string concat in parameter validation

* Corrected upper/lower bound warning

* Use client_tools, tidy up Mistral create, better handle tool call response, tidy tests

* Update of documentation notebook, replacement of old version

* Update to handle multiple tool_call recommendations in a message

* Updated tests to accommodate multiple tool_calls as well as content in message

* Update autogen/oai/mistral.py comment

Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>

* cleanup, rewrite mock

* update

---------

Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>
Co-authored-by: kevin666aa <yrwu000627@gmail.com>
2024-06-21 05:42:16 +00:00
NanthagopalEswaran ded8e1b280
Fix #2845 - LocalCommandLineCodeExecutor is not working with virtual environments (#2926)
* Used absolute path of virtual environment bin path in local command executors

* Checked if the expected venv is used or not

* Added code comments for documentation

* fix: format issue - shutil lib

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Li Jiang <bnujli@gmail.com>
2024-06-19 13:39:23 +00:00
HRUSHIKESH DOKALA 32fa709e13
Anthropic Client (#2931)
* intial setup for the anthropic client with cost config

* update: other methods added

* fix: formatting

* fix: config unused

* update: changes made in the client

* update: test added to the workflow

* update: added tests to the anthropic client

* fix: errors in workflows and client

* fix

* fix: anthropic tools type

* update: notebook anthropic

* Nonetype fixed

* fix-tests config

* update: tests and client issues

* logger support

* remove sys path

* updated the functioning of the client

* update: type hints and stream

* skip tests- importerror

* fix: anthropic client and tests

* none fix

* Alternating roles, parameter keywords, cost on response,

* update: anthropic notebook

* update: notebook with more details

* devcontainer

* update: added validate_params from the client_utils

* fix: formatting

* fix: minor comment

---------

Co-authored-by: Mark Sze <mark@sze.family>
2024-06-19 06:15:12 +00:00
Mark Sze 064214f62b
should_hide_tools function added to client_utils (#2966) 2024-06-19 05:22:15 +00:00
Mark Sze 8dd3a8a8f9
Client class utilities (#2949)
* Addition of client utilities, initially for parameter validation

* Corrected test

* update: type checks and few tests

* fix: docs, tests

---------

Co-authored-by: Hk669 <hrushi669@gmail.com>
2024-06-18 04:01:15 +00:00
Zoltan Lux 10b8fa548b
Fix missing messages in Gemini history (#2906)
* fix missing message in history

* fix message handling

* add list of Parts to Content object

* add test for gemini message conversion function

* add test for gemini message conversion

* add message to asserts

* add safety setting support for vertexai

* remove vertexai safety settings
2024-06-14 18:13:19 +00:00
Qingyun Wu 6d4cf406f9
Filter models with tags instead of model name (#2912)
* identify model with tags instead of model name

* models

* model to tag

* add more model name

* format

* Update test/agentchat/test_function_call.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update test/agentchat/test_function_call.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update test/agentchat/test_tool_calls.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update test/agentchat/test_tool_calls.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* remove uncessary tags

* use gpt-4 as tag

* model to tag

* add tag for teachable agent test

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: AutoGen-Hub <flaml20201204@gmail.com>
2024-06-14 15:58:17 +00:00
LeoLjl c54e8a5db1
[Autobuild] improve robustness and reduce cost (#2907)
* Update Autobuild.

* merge main into autobuild

* update test for new autobuild

* update author info

* fix pre-commit

* Update autobuild notebook

* Update autobuild_agent_library.ipynb

* Update autobuild_agent_library.ipynb

* Fix pre-commit failures.

---------

Co-authored-by: Linxin Song <rm.social.song1@gmail.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-06-14 14:14:08 +00:00
Yiran Wu 39f688778e
Allow passing in custom pricing in config_list (#2902)
* update

* update

* TODO comment removed

* update

---------

Co-authored-by: Yiran Wu <32823396+kevin666aa@users.noreply.github.com>
Co-authored-by: Davor Runje <davor@airt.ai>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-06-13 20:10:47 +00:00
Davor Runje a0787aced3
pre-commit version update and a few spelling fixes (#2913) 2024-06-12 06:26:22 +00:00
Davor Runje 53a59ddac6
CRLF changed to LF (#2915) 2024-06-12 06:25:18 +00:00
Audel Rouhi bf7e4d619c
Bugfix: PGVector/RAG - Calculate the Vector Size based on Model Dimensions (#2865)
* Calculate the dimension size based off model chosen.

* Added example docstring.

* Validated working notebook with sentence models of different dimensions.

* Validated removal of model_name working.

* Second example uses conn object.

* embedding_function no longer directly references .encode

* Fixed pre-commit issue.

* Use try/except to raise error when shape is not found in embedding function.

* Re-ran notebook.

* Update autogen/agentchat/contrib/vectordb/pgvectordb.py

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

* Update autogen/agentchat/contrib/vectordb/pgvectordb.py

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

* Added .encode

* Removed example comment.

* Fix overwrite doesn't work with existing collection when custom embedding function has different dimension from default one

---------

Co-authored-by: Li Jiang <bnujli@gmail.com>
2024-06-11 12:16:56 +00:00
Chi Wang 2d6c8c012b
version update (#2908)
* version update

* version update
2024-06-10 18:23:51 +00:00
Braelyn Boynton 85ad929f34
AgentOps Runtime Logging Implementation (#2682)
* add agentops req

* track conversable agents with agentops

* track tool usage

* track message sending

* remove record from parent

* remove record

* simple example

* notebook example

* remove spacing change

* optional dependency

* documentation

* remove extra import

* optional import

* record if agentops

* if agentops

* wrap function auto name

* install agentops before notebook test

* documentation fixes

* notebook metadata

* notebook metadata

* pre-commit hook changes

* doc link fixes

* git lfs

* autogen tag

* bump agentops version

* log tool events

* notebook fixes

* docs

* formatting

* Updated ecosystem manual

* Update notebook for clarity

* cleaned up notebook

* updated precommit recommendations

* Fixed links to screenshots and examples

* removed unused files

* changed notebook hyperlink

* update docusaurus link path

* reverted setup.py

* change setup again

* undo changes

* revert conversable agent

* removed file not in branch

* Updated notebook to look nicer

* change letter

* revert setup

* revert setup again

* change ref link

* change reflink

* remove optional dependency

* removed duplicated section

* Addressed clarity commetns from howard

* minor updates to wording

* formatting and pr fixes

* added info markdown cell

* better docs

* notebook

* observability docs

* pre-commit fixes

* example images in notebook

* example images in docs

* example images in docs

* delete agentops ong

* doc updates

* docs updates

* docs updates

* use agent as extra_kwarg

* add logging tests

* pass function properly

* create table

* dummy function name

* log chat completion source name

* safe serialize

* test fixes

* formatting

* type checks

---------

Co-authored-by: reibs <areibman@gmail.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Howard Gil <howardbgil@gmail.com>
Co-authored-by: Alex Reibman <meta.alex.r@gmail.com>
2024-06-07 06:01:03 +00:00
aswny 75f0808b5a
allow function to remove termination string in groupchat (#2804)
* allow function to remove termination string in groupchat

* improve docstring

Co-authored-by: Joshua Kim <joshkyh@users.noreply.github.com>

* improve docstring

Co-authored-by: Joshua Kim <joshkyh@users.noreply.github.com>

* improve test case description

Co-authored-by: Joshua Kim <joshkyh@users.noreply.github.com>

---------

Co-authored-by: Joshua Kim <joshkyh@users.noreply.github.com>
2024-06-06 21:55:55 +00:00
Wael Karkoub 8564bd4c48
[Refactor] Transforms Utils (#2863)
* wip

* tests + docstrings

* improves tests

* fix import
2024-06-06 21:49:22 +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
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 413a458f75
print next speaker (#2800)
* print next speaker

* fix test error
2024-05-28 13:35:55 +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
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
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
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
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
James Woffinden-Luey dad9c66104
Agenteval integration (#2672)
* first pass at offline agent eval integration

* Integrating AgentEval for offline scenarios

* removing old changes

* fixing notebook, updating docs

* fixing subcriteria bug

* updating class comment

* cleaning up agent constructors

* moving AgentEval agents to separate folder and adding a brief README

* fixing build breaks

* fixing formatting break

* fixing comments

* consolidating files in the agenteval folder under contrib and cleaning up imports

* fixing import ordering

* adding basic agenteval tests and fixing criteria parsing bug

* first try at adding openai agenteval tests to build process

* adding non-openai agenteval tests to build process

* updating test settings

* updating openai test

* Update test/agentchat/contrib/agent_eval/test_agent_eval.py

Co-authored-by: Wael Karkoub <wael.karkoub96@gmail.com>

* Update .github/workflows/contrib-openai.yml

Co-authored-by: Wael Karkoub <wael.karkoub96@gmail.com>

* test commit

* updating typing and converting to pydantic objects

* fixing test file

---------

Co-authored-by: Beibin Li <BeibinLi@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Wael Karkoub <wael.karkoub96@gmail.com>
2024-05-14 07:14:37 +00:00
MarianoMolina 4b747d731a
Add role to reflection with llm (#2527)
* Added 'role' as a summary_args and to the reflection_with_llm flow to be able to pass the role for the summarizing prompt

* Added 'role' as a summary_args and to the reflection_with_llm flow to be able to pass the role for the summarizing prompt, minor docstring adjustments

* Added test for summary prompt role assignment

* Fixed docstrings and mocked llm-config in the test

* Update autogen/agentchat/conversable_agent.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* ran pre-commit

* ran pre-commit2

* fixed old arg name

* Delete dasdaasd

No idea what this file was about

* Fixed incorrect merge update on test_groupchat

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-14 06:46:01 +00:00
R. Singh 60c665871a
Feature: Add ability to use a separate python environment in local executor (#2615)
* Add ability to use virtual environments in local executor

* Copy environment variables from parent environment

* Fix mypy errors and formatting

* Account for venv on Windows

* Use a virtual environment context object instead of path

* Add utility method to create a virtual environment

* Remove assertion using `_venv_path`

* Add tests for `create_virtual_env`

* Modify test code and add output assertion

* Modify test code and assertion

* Execute activation script before actual command on windows

* Add docs for using a virtual env
2024-05-11 06:25:20 +00:00
Mark Sze a86c474339
Resuming a GroupChat (#2627)
* Initial resume

* Cleaned up resume function

* Further updating resuming group chat

* Added async resume_chat and documentation

* Added test cases, refined group chat function parameters

* compiled documentation

* Added tests to main

* Removed mdx file.

* Revert "Merge remote-tracking branch 'origin/main' into groupchatresume"

This reverts commit 8f709308f0, reversing
changes made to 8bfcb2bff1.

* Refactored resume to remove initiate_chat

* fix git history

* fix history

* Added clean-up of objects, _groupchat references, and messages_to_string updated

* Added termination-based resumption in notebook, added test cases and improved robustness on resuming messages parameter

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-05-10 22:56:25 +00:00
Wael Karkoub 372ac1e794
Text Compression Transform (#2225)
* adds implementation

* handles optional import

* cleanup

* updates github workflows

* skip test if dependencies not installed

* skip test if dependencies not installed

* use cpu

* skip openai

* unskip openai

* adds protocol

* better docstr

* minor fixes

* updates optional dependencies docs

* wip

* update docstrings

* wip

* adds back llmlingua requirement

* finalized protocol

* improve docstr

* guide complete

* improve docstr

* fix FAQ

* added cache support

* improve cache key

* cache key fix + faq fix

* improve docs

* improve guide

* args -> params

* spelling
2024-05-06 14:16:49 +00:00
Abdur Rahman Nawaz 4711d7bb9c
Fix for http client (#2579)
* Fix for http client

* fixed constructor to only ignore the http_client while copying

* fixed comment formating

* removed check for http_client and added error message with docs

* fix formatting

* fix formatting

* added test for http-fix

* changed title and content of docs

* changed test func name
2024-05-04 14:12:36 +00:00
asandez1 5fdaf1a8c0
Docker multilanguage executor saver with policy (#2522)
* feat: update executor saver policy

* feat: languages

* feat: add test _cmd

* fix: try catch

* fix: log

* fix: test docker mock

* fix: invalid path test

* fix: invalid path message

* fix: invalid path message

* fix: is_docker test

* fix: delete old test

* fix: cmd lang
2024-05-01 21:14:09 +00:00
Mark Sze 5b6ae324e2
Re-query speaker name when multiple speaker names returned during Group Chat speaker selection (#2304)
* Added requery_on_multiple_speaker_names to GroupChat and updated _finalize_speaker to requery on multiple speaker names (if enabled)

* Removed unnecessary comments

* Update to current main

* Tweak error message.

* Comment clarity

* Expanded description of Group Chat requery_on_multiple_speaker_names

* Reworked to two-way nested chat for speaker selection with default of 2 retries.

* Adding validation of new GroupChat attributes

* Updates as per @ekzhu's suggestions

* Update groupchat

- Added select_speaker_auto_multiple_template and select_speaker_auto_none_template
- Added max_attempts comment
- Re-instated support for role_for_select_speaker_messages
-

* Update conversable_agent.py

Added ability to force override role for a message to support select speaker prompt.

* Update test_groupchat.py

Updated existing select_speaker test functions as underlying approach has changed, added necessary tests for new functionality.

* Removed block for manual selection in select_speaker function.

* Catered for no-selection during manual selection mode

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-30 04:16:08 +00:00
giorgossideris 11a43421e3
Min tokens in token limiter (#2400)
* Add minimum token threshold in MessageHistoryLimiter

* Update transforms tests for the threshold

* Move min_threshold_tokens from Message to Token Limiter

* Optimize _check_tokens_threshold

Co-authored-by: Wael Karkoub <wael.karkoub96@gmail.com>

* Apply requested changes (renaming, phrasing, validations)

* Fix format

* Fix _check_tokens_threshold logic

* Update docs and notebook

* Improve phrasing

* Add min_tokens example in notebook

* Add min_tokens example in website docs

* Add min_tokens example in notebook

* Update website docs to be in sync with get_logs change

---------

Co-authored-by: Wael Karkoub <wael.karkoub96@gmail.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-29 02:11:16 +00:00
Wael Karkoub a9171211c7
Streamline Testing with `pytest-cov` and `pytest` Defaults (#2490)
* done

* update docs

* try fix

* update workflows

* undo minor fix

* resolve comments

* adds back pytest-asyncio

* minor fix

* add branch coverage

* restore pip install e.

* test with coverage

* fix mypy

* fix coverage + docker + windows combo

* fix bash command

* formatter

* formatter

* one last fix

* I lied, last fix

* fix

* fix retrieve chat test

* fix windows paths

* change cache seed

* down grade openai version

* fix openai mypy

* better error type

* fix image gen cache test

* fix

* experimenting

* fix lmm

* skip cosmos test

* remove cosmos db

* unused imports

* handle more cosmosdb skips

* fix flaky test
2024-04-29 00:27:34 +00:00