Commit Graph

563 Commits

Author SHA1 Message Date
Audel Rouhi 1b8d65df0a
2447 fix pgvector tests and notebook (#2455)
* Re-added missing notebook

* Test installing postgres

* Error handle the connection.

* Fixed import.

* Fixed import.

* Fixed creation of collection without client.

* PGVector portion working. OpenAI untested.

* Fixed prints.

* Added output.

* Fixed pre-commits.

* Run pgvector notebook

* Improve efficiency of get_collection

* Fix delete_collection

* Fixed issues with pytests and validated functions.

* Validated pytests.

* Fixed pre-commits

* Separated extra_requires to allow more logic. Retrieve_chat base dependencies included on pgvector and qdrant.

* Fixed extra newline.

* Added username and password fields.

* URL Encode the connection string parameters to support symbols like %

* Fixed pre-commits.

* Added pgvector service

* pgvector doesn't have health intervals.

* Switched to colon based key values.

* Run on Ubuntu only. Linux is only option with container service support.

* Using default credentials instead.

* Fix postgres setup

* Fix postgres setup

* Don't skip tests on win and mac

* Fix command error

* Try apt install postgresql

* Assert table does not exist when deleted.

* Raise value error on a empty list or None value provided for IDs

* pre-commit

* Add install pgvector

* Add install pgvector

* Reorg test files, create a separate job for test pgvector

* Fix format

* Fix env format

* Simplify job name, enable test_retrieve_config

* Fix test_retrieve_config

* Corrected behavior for get_docs_by_ids with no ids returning all docs.

* Corrected behavior for get_docs_by_ids with no ids returning all docs.

* Fixed pre-commits.

* Added return values for all functions.

* Validated distance search is implemented correctly.

* Validated all pytests

* Removed print.

* Added default clause.

* Make ids optional

* Fix test, make it more robust

* Bump version of openai for the vector_store support

* Added support for choosing the sentence transformer model.

* Added error handling for model name entered.

* Updated model info.

* Added model_name db_config param.

* pre-commit fixes and last link fix.

* Use secrets password.

* fix: link fixed

* updated tests

* Updated config_list.

* pre-commit fix.

* Added chat_result to all output.
Unable to re-run notebooks.

* Pre-commit fix detected this requirement.

* Fix python 3.8 and 3.9 not supported for macos

* Fix python 3.8 and 3.9 not supported for macos

* Fix format

* Reran notebook with MetaLlama3Instruct7BQ4_k_M

* added gpt model.

* Reran notebook

---------

Co-authored-by: Li Jiang <bnujli@gmail.com>
Co-authored-by: Hk669 <hrushi669@gmail.com>
2024-04-28 13:43:02 +00:00
William W Wang fbcc56c90e
AutoGen cache using Azure Cosmos DB (#2327)
* Create cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Create test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cache.py

* Update cache_factory.py

* Update test_cache.py

* Update test_cache.py

* Update cache.py

* Update llm-caching.md

* Update cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update build.yml

* Update build.yml

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update autogen/cache/cache_factory.py

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

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update .github/workflows/build.yml

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

* Update cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cache_factory.py

* Update cache.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cache.py

* Update cache_factory.py

* Update test_cache.py

* Update test_cache.py

* Update cache.py

* Update cache.py

* Update test_cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cache_factory.py

* Update cache_factory.py

* Update cache_factory.py

* Update cache_factory.py

* Update build.yml

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update test_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update build.yml

* Update build.yml

* Update build.yml

* Update build.yml

* Update cache_factory.py

* Update cache.py

* Update cosmos_db_cache.py

* Update cache.py

* Update build.yml

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update cache.py

* Update cache.py

* Update cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-26 15:23:18 +00:00
asandez1 31fe75ad0e
Add support for HTML, CSS and Javascript in LocalCommandLineCodeExecutor with Mapping executor/saver #2303 (#2464)
* Add support for HTML, CSS and Javascript in LocalCommandLineCodeExecutor

* init branch

* init branch

* feat: test code execution added

* fix: test update

* fix: test

* fix: policy test

* feat: default policy

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-04-24 01:21:24 +00:00
Eduardo Salinas ebde196d6b
feat: add event logging api and more tracing (#2478)
* feat: add event logging api and more tracing

* code fmt shenanigans

* fixup

* Update test_agent_logging.py

* Update test_agent_logging.py

* Update test_agent_logging.py

* Update sqlite_logger.py

* Update test_agent_logging.py

* Update sqlite_logger.py

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-23 22:27:47 +00:00
Ian a41182a93f
Support openai assistant v2 API (#2466)
* adapted to openai assistant v2 api

* fix comments

* format code

* fix ci

* Update autogen/agentchat/contrib/gpt_assistant_agent.py

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

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-04-23 17:26:06 +00:00
Wael Karkoub 7f1a810630
Adds Message History to a `ConversableAgent` (#2437)
* updates docstr +  fix spelling

* fix docstr

* maybe a lfs fix?

* Revert "maybe a lfs fix?"

This reverts commit 2ea2dade26.

* revert

* rename arg to chat_messages

* minor fix
2024-04-22 21:44:43 +00:00
Audel Rouhi ded2d612c3
[Re-Opened] Support for PGVector Database in Autogen (#2439)
* PGVector Contrib Initial Commit - KnucklesTeam:autogen:pgvector_contrib fork

* Update website/docs/ecosystem/pgvector.md

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

* Updated qdrant installation instructions.

* Fixed openai version.

* Added dependencies to install for qdrant and pgvector in contrib tests.

* Added dependencies to install for qdrant and pgvector in contrib tests.

* Cleaned up dependencies.

* Removed flaml out of setup.py. Used only for notebook example.

* Added PGVector notebook link

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-18 20:00:03 +00:00
Chi Wang 6636689cb9
speed up notebook in CI and fix CI failures (#2427)
* speed up notebook in CI

* improve notebook

* comment about filter

* bug fix for summary

* bump version to 0.2.26

* restrict openai version

* news update

* add tags in example
2024-04-18 16:43:34 +00:00
saberuster 442c10bd7b
support openai 'sk-proj-' apikey format (#2426)
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-18 15:58:37 +00:00
Chi Wang d307818dd9
improve test speed (#2406)
* improve test speed

* speed up test

* speed up test
2024-04-17 20:10:18 +00:00
Beibin Li 0aaf30a8da
Merge "Gemini" feature into the main branch (#2360)
* Start Gemini integration: works ok with Text now

* Gemini notebook lint

* try catch "import" for Gemini

* Debug: id issue for chat completion in Gemini

* Add RAG example

* Update docs for RAG

* Fix missing pydash

* Remove temp folder

* Fix test error in runs/7206014032/job/19630042864

* Fix tqdm warning

* Fix notebook output

* Gemini's vision model is supported now

* Install instructions for the Gemini branch

* Catch and retry when see Interval Server Error 500

* Allow gemini to take more flexible messages
i.e., it can take messages where "user" is not the last role.

* Use int time for Gemini client

* Handle other exceptions in gemini call

* rename to "create" function for gemini

* GeminiClient compatible with ModelClient now

* Lint

* Update instructions in Gemini notebook

* Lint

* Remove empty blocks from Gemini notebook

* Add gemini into example page

* self.create instead of call

* Add py and Py into python execution

* Remove error code from merging

* Remove pydash dependency for gemini

* Add cloud-gemini doc

* Remove temp file

* cache import update

* Add test case for summary with mm input

* Lint: warnings instead of print

* Add test cases for gemini

* Gemini test config

* Disable default model for gemini

* Typo fix in gemini workflow

* Correct grammar in example notebook

* Raise if "model" is not provided in create(...)

* Move TODOs into a roadmap

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

Co-authored-by: Davor Runje <davor@airt.ai>

* Gemini test config update

* Update setup.py

Co-authored-by: Davor Runje <davor@airt.ai>

* Update test/oai/test_gemini.py

Co-authored-by: Davor Runje <davor@airt.ai>

* Update test/oai/test_gemini.py

Co-authored-by: Davor Runje <davor@airt.ai>

* Remove python 3.8 from gemini
No google's generativeai for Windows with Python 3.8

* Update import error handling for gemini

* Count tokens and cost for gemini

---------

Co-authored-by: Li Jiang <bnujli@gmail.com>
Co-authored-by: Davor Runje <davor@airt.ai>
2024-04-17 00:24:07 +00:00
Shaokun Zhang 0c5aed0489
add AgentOptimizer test in CI (#2380)
* add test

* fix test

* fix

---------

Co-authored-by: AnonymousRepoSub <“shaokunzhang529@outlook.com” >
2024-04-16 05:07:58 +00:00
Chi Wang fbe8476726
fix local test failures (#2386)
* fix local test failures

* set skip
2024-04-15 12:34:26 +00:00
HRUSHIKESH DOKALA 59daf78d9f
Made the cost info easier to read (#2356)
* gather_usage_summary has been updated

* updated cost info to 'usage_including_cached_inference' and 'usage_excluding_cached_inference'

* fix: pre-commit formatting for cost_info

* improved cost explanation and doc

* improved cost info doc

* include - exclude

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-15 01:18:50 +00:00
giorgossideris 90883904c5
Standardize printing of MessageTransforms (#2308)
* Standardize printing of MessageTransforms

* Fix pre-commit black failure

* Add test for transform_messages printing

* Return str instead of printing

* Rename to_print_stats to verbose

* Cleanup

* t i# This is a combination of 3 commits.

Update requirements

* Remove lazy-fixture

* Avoid calling apply_transform in two code paths

* Format

* Replace stats with logs

* Handle no content messages in TokenLimiter get_logs()

* Move tests from test_transform_messages to test_transforms

---------

Co-authored-by: Wael Karkoub <wael.karkoub96@gmail.com>
2024-04-14 00:48:24 +00:00
Josh Trim d473dee664
Add "py" as lang in conversable agent (#1062) (#2144)
* Add "py" as lang in conversable agent (#1062)

* Add conditions to allow for python executable variants (#1062)

* reverted import (#1062)

* Parameterized tests, moved Python variants to a constant (#1062)

* Moved Python variants to a constant (#1062)

* Update autogen/code_utils.py (#1062)

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

* Update autogen/coding/local_commandline_code_executor.py (#1062)

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

* Added PYTHON_VARIANTS as imported constant (#1062)

* ran pre-commit-check  (#1062)

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-04-12 15:14:51 +00:00
Wael Karkoub 78cb908f95
adds fix (#2364) 2024-04-12 05:03:32 +00:00
Shaokun Zhang 9069eb926a
support llm_config in AgentOptimizer (#2299)
* support llm_config in agentoptimizer

* fix doc

* restore seed timeout

---------

Co-authored-by: “skzhang1” <“shaokunzhang529@gmail.com”>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-11 13:46:42 +00:00
Li Jiang adb8fd849c
Add a vectordb module (#2263)
* Added vectordb base and chromadb

* Remove timer and unused functions

* Added filter by distance

* Added test utils

* Fix format

* Fix type hint of dict

* Rename test

* Add test chromadb

* Fix test no chromadb

* Add coverage

* Don't skip test vectordb utils

* Add types

* Fix tests

* Fix docs build error

* Add types to base

* Update base

* Update utils

* Update chromadb

* Add get_docs_by_ids

* Improve docstring

* Add get all docs

* Move chroma_results_to_query_results to utils

* Improve type hints

* Update logger

* Update init, add embedding func

* Improve docstring of vectordb, add two attributes

* Improve test workflow
2024-04-10 17:43:08 +00:00
Li Jiang 5a96dc2c29
Add source to the answer for default prompt (#2289)
* Add source to the answer for default prompt

* Fix qdrant

* Fix tests

* Update docstring

* Fix check files

* Fix qdrant test error
2024-04-10 00:45:26 +00:00
Chi Wang 23ef8ecae0
Use assistant tag to filter config (#2316)
* Use assistant tag to  filter config

* bump version to 0.2.23
2024-04-08 08:07:50 +00:00
Davor Runje 0c0f953df3
Fix types in tool tests (#2285)
* fixed types related to function calling

* polishing

* fixed types in tests
2024-04-05 15:51:49 +00:00
Chi Wang ebd0210fa1
bump version to 0.2.22 (#2256)
* bump version to 0.2.22

* doc update

* link update

* consider the failure case
2024-04-05 13:41:14 +00:00
Li Jiang 6b1376b04d
Add bs4 and overlap (#2271)
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-05 05:21:32 +00:00
Li Jiang 42b27b9a9d
Add isort (#2265)
* Add isort

* Apply isort on py files

* Fix circular import

* Fix format for notebooks

* Fix format

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-05 02:26:06 +00:00
Eric Zhu 4d688a51ad
remove subdirectory .gitattributes files and add relevant files to lfs (#2270)
Co-authored-by: Yiran Wu <32823396+kevin666aa@users.noreply.github.com>
2024-04-04 18:46:35 +00:00
cheng-tan e83301ed18
fix logging cost flaky test (#2277) 2024-04-04 14:36:46 +00:00
Mark Sze 89f3cfd1ad
Recommit from my repo - Enhanced speaker name selection during agent name matching. (#2267) 2024-04-03 22:57:41 +00:00
Jack Gerrits 0644a2bc0c
Add in memory cache class (#2266)
* Add in memory cache class

* formatting
2024-04-03 22:18:40 +00:00
Beibin Li 1674c3cbbb
Fix Vision Capability Test for MacOS (#2260)
* Update mm test: create dummy image in case file corrput

* Update vision capability test for MacOS

* Lint

* Upload image for testing
2024-04-02 23:12:45 +00:00
Beibin Li c030225eb6
Update mm test: create dummy image in case file corrput (#2258) 2024-04-02 17:31:09 +00:00
Jack Gerrits c3193f847b
Allow custom name for functions module (#2241)
* Allow custom name for functions module

* update tests

* reorder
2024-04-02 06:21:31 +00:00
Mark Sze 32fbfa233b
Re-commit code from #2182 to Microsoft branch (#2233) 2024-04-01 13:49:13 +00:00
Mark Sze 3f63db32b9
Added ability to specify 'role' field for select speaker messages for Group Chats (Replaces PR #2167) (#2199)
* Re-commit of code from PR (#2167) addressing #1861, due to wrong basing

* Update website/docs/topics/non-openai-models/best-tips-for-nonopenai-models.md

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

* Removed unnecessary notebook images

* Update conversation-patterns.ipynb

Updated to include note about being applicable when auto.

* Updated to include checks that the role is not blank/None. Added tests.

* Changed try-except to use pytest

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-31 22:54:17 +00:00
Jack Gerrits 7b5fd51e2e
Support string based UDFs (#2195) 2024-03-30 15:15:39 +00:00
Wael Karkoub 7a685b52d8
Fix `generate_init_message` for Multimodal Messages (#2124)
* multimodal carryover

* adds mm carryover tests

* more tests + cleanup code

* check content instead

* beibin suggestion

* cleanup

* fix async

* use deepcopy

* handle carryover method

* remove content copy

* sonichi suggestions

---------

Co-authored-by: Beibin Li <BeibinLi@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-30 02:10:24 +00:00
Wael Karkoub 8cb5c14c82
Transform Messages Capability (#1923)
* wip

* Adds docstrings

* fixed spellings

* wip

* fixed errors

* better class names

* adds tests

* added tests to workflow

* improved token counting

* improved notebook

* improved token counting in test

* improved docstrings

* fix inconsistencies

* changed by mistake

* fixed docstring

* fixed details

* improves tests + adds openai contrib test

* fix spelling oai contrib test

* clearer docstrings

* remove repeated docstr

* improved notebook

* adds metadata to notebook

* Improve outline and description (#2125)

* better dir structure

* clip max tokens to allowed tokens

* more accurate comments/docstrs

* add deperecation warning

* fix front matter desc

* add deperecation warning notebook

* undo local notebook settings changes

* format notebook

* format workflow

---------

Co-authored-by: gagb <gagb@users.noreply.github.com>
2024-03-28 16:16:17 +00:00
Davor Runje 21a7eb3115
Fix iostream on new thread (#2181)
* fixed get_stream in new thread by introducing a global default

* fixed get_stream in new thread by introducing a global default

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-28 14:26:01 +00:00
Chi Wang e6237d44a1
simplify getting-started; update news (#2175)
* simplify getting-started; update news

* bug fix
2024-03-28 03:43:01 +00:00
Jack Gerrits 5ef2dfc104
Implement User Defined Functions for Local CLI Executor (#2102)
* Implement user defined functions feature for local cli exec, add docs

* add tests, update docs

* fixes

* fix test

* add pandas test dep

* install test

* provide template as func

* formatting

* undo change

* address comments

* add test deps

* formatting

* test only in 1 env

* formatting

* remove test for local only

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-27 23:45:17 +00:00
Jack Gerrits 95c0118568
Mark cache as a protocol and update type hints to reflect (#2168)
* Mark cache as a protocl and update type hints to reflect

* int

* undo init change
2024-03-27 22:15:24 +00:00
Davor Runje 78aa0eb220
Introducing IOStream protocol and adding support for websockets (#1551)
* Introducing IOStream

* bug fixing

* polishing

* refactoring

* refactoring

* refactoring

* wip: async tests

* websockets added

* wip

* merge with main

* notebook added

* FastAPI example added

* wip

* merge

* getter/setter to iostream added

* website/blog/2024-03-03-AutoGen-Update/img/dalle_gpt4v.png: convert to Git LFS

* website/blog/2024-03-03-AutoGen-Update/img/gaia.png: convert to Git LFS

* website/blog/2024-03-03-AutoGen-Update/img/teach.png: convert to Git LFS

* add SSL support

* wip

* wip

* exception handling added to on_connect()

* refactoring: default iostream is being set in a context manager

* test fix

* polishing

* polishing

* polishing

* fixed bug with new thread

* polishing

* a bit of refactoring and docs added

* notebook added to docs

* type checking added to CI

* CI fix

* CI fix

* CI fix

* polishing

* obsolete todo comment removed

* fixed precommit error

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-26 22:39:55 +00:00
Shaokun Zhang 72994ea127
Integrate AgentOptimizer (#1767)
* draft agent optimizer

* refactor

* remove

* change openai config interface

* notebook

* update blog

* add test

* clean up

* redir

* update

* update interface

* change model name

* move to contrib

* Update autogen/agentchat/contrib/agent_optimizer.py

Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>

---------

Co-authored-by: “skzhang1” <“shaokunzhang529@gmail.com”>
Co-authored-by: Beibin Li <BeibinLi@users.noreply.github.com>
Co-authored-by: Jieyu Zhang <jieyuz2@cs.washington.edu>
Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
2024-03-26 20:31:02 +00:00
Wael Karkoub 66d96dd887
Parse Any HTML-esh Style Tags (#2046)
* tried implementing my own regex

* improves tests

* finally works

* removes prints

* fixed test

* adds start and end

* delete unused imports

* refactored to use new tool

* significantly improved algo

* tag content -> tag attr

* fix tests + adds new field

* return full match

* return remove start and end

* update docstrings

* update docstrings

* update docstrings

---------

Co-authored-by: Beibin Li <BeibinLi@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-26 18:46:44 +00:00
Qingyun Wu a1322d2475
context to kwargs (#2064)
* context to kwargs

* add tag

* add test

* text to kwargs

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-26 16:31:55 +00:00
Beibin Li 2f109f5f94
Add vision capability (#2025)
* Add vision capability

* Configurate: description_prompt

* Print warning instead of raising issues for type

* Skip vision capability test if dependencies not installed

* Append "vision" to agent's system message when enabled VisionCapability

* GPT-4V notebook update with ConversableAgent

* Clean GPT-4V notebook

* Add vision capability test to workflow

* Lint import

* Update system message for vision capability

* Add a `custom_caption_func` to VisionCapability

* Add custom function example for vision capability

* Skip test Vision capability custom func

* GPT-4V notebook metadata to website

* Remove redundant files

* The custom caption function takes more inputs now

* Add a more complex example of custom caption func

* Remove trailing space

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-24 19:46:55 +00:00
Wael Karkoub 331818300d
Silences Pip Install Messages in Code Executors (#2105)
* fix

* adds tests

* check if windows

* adds windows shells

* modifies exit code

* fix powershell

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-21 20:08:50 +00:00
Jack Gerrits e35db7ef5f
Encapsulate colored into a module (#2057)
* Encapsulate colored into a module

* lint fix

* add missing file

* undo change

* conform with original colored func

* change import strategy

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-19 18:09:43 +00:00
Chi Wang 6b47a966dd
fix test_human_input (#2063)
* fix test_human_input

* shorten tests

* terminate chat early

* limit max turns

* limit max_rounds

* check skip_openai
2024-03-19 06:44:39 +00:00
Davor Runje b1839c3845
Update pre-commit (#2067)
* update pre-commit

* update pre-commit.ci

* lint fix
2024-03-19 02:55:37 +00:00
Abhay Mathur 3a3d4cc2ee
code_utils.py powershell command bugfix in MacOS (#1963)
* macos bugfix

* logs permissionerror warning only if lang is powershell command

* condensed the if statements down

* Update code_utils.py

* fixed formatting

* handled powershell_command = None case

* bugfix

* raising exceptions instead of logging warnings

* code formatting fixed

* removed return sh statement

* fixed code formatting

* update get_powershell_command

* Update code_utils.py

fixed code format

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-18 13:05:19 +00:00
Chi Wang cc836de13d
adjust order of side bars (#2040)
* adjust order of side bars

* doc improvement

* limit max turns

* improve tests

* improve doc

* improve docstr
2024-03-17 22:57:54 +00:00
Eric Zhu 2cefff9206
Request for longer response to make cache test more robust. (#2043)
* Request for longer response to make cache test more robust.

* 1000 words --> 100 words
2024-03-17 22:49:40 +00:00
cheng-tan 00972a6013
bug fix: fix agent_logging test (#2036)
* fix test

* Update test/agentchat/test_agent_logging.py

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-17 01:27:00 +00:00
Ian 36c4d6aa3e
Separate openai assistant related config items from llm_config (#2037)
* add assistant config

* add test

* change notebook to use assistant config

* use assistant config in testing

* code refinement

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-16 17:21:59 +00:00
Qingyun Wu 8844f86525
Allow different senders in nested chat (#2028)
* allow sender in nested chat

* description

* update example list

* doc format

* meta data

* add test
2024-03-15 22:26:45 +00:00
Wael Karkoub c5536ee92b
[Feature] Adds Image Generation Capability 2.0 (#1907)
* adds image generation capability

* add todo

* readded cache

* wip

* fix content str bugs

* removed todo: delete imshow

* wip

* fix circular imports

* add notebook

* improve prompt

* improved text analyzer + notebook

* notebook update

* improve notebook

* smaller notebook size

* made changes to the wrong branch :(

* resolve comments + 1

* adds doc strings

* adds cache doc string

* adds doc string to add_to_agent

* adds doc string to ImageGeneration

* instructions are not configurable

* removed unnecessary imports

* changed doc string location

* more doc strings

* improves testability

* adds tests

* adds cache test

* added test to github workflow

* compatible llm config format

* configurable reply function position

* skip_openai + better comments

* fix test

* fix test?

* please fix test?

* last fix test?

* remove type hint

* skip cache test

* adds mock api key

* dalle-2 test

* fix dalle config

* use apu key function

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-15 22:11:53 +00:00
Yiran Wu f78985d359
StateFlow Blog (#1826)
* init PR

* update

* update code check

* update

* update

* update

* update

* update

* Test the ability to have agents a,u,t,o,g,e,n speak in turn.

* update

* update

* update

* Evidence that groupchat not terminating because of the TERMINATE substring.

* Raising NoEligibleSpeakerException allows graceful exit before max turns

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* udpate to comments

* update

* Update website/blog/2024-02-29-StateFlow/index.mdx

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

* update links

* remove unnecessary changes

* Update website/blog/2024-02-29-StateFlow/index.mdx

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

* Update website/blog/2024-02-29-StateFlow/index.mdx

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

* remove test for custom notebook

* update

* update

---------

Co-authored-by: Joshua Kim <Joshua@spectdata.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Joshua Kim <joshkyh@users.noreply.github.com>
2024-03-14 15:46:28 +00:00
Davor Runje bf08856389
Fix type and default value of the code_execution_config parameter in UserProxyAgent (#1996)
* fix type and default value of the code_execution_config of UserProxAgent

* fix type and default value of the code_execution_config of UserProxAgent

* set default value of llm_config in UserProxyAgent to None

* fixed tests

* revert llm_config to False

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-13 22:57:43 +00:00
Jack Gerrits d583c8088e
Update local cli executor to use same filename strategy as docker (#1981)
* consistent file saving across cli executors

* test fixes

* feedback

* make path

* formatting

* run timeout test on windows

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-12 21:57:32 +00:00
Jack Gerrits b1c44deb0c
Remove system message from code executors (#1933)
* Remove system message functionality from code executors

* remove from protocol

* fix tests, pre-commit

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-12 19:04:43 +00:00
Chi Wang 523581825b
improve validation of llm_config (#1946)
* improve validation of llm_config

* fixed test_register_for_llm_without_LLM

* docstr about llm_config=None

* Make None a sentinel

* pop tools

---------

Co-authored-by: Davor Runje <davor@airt.ai>
2024-03-11 22:36:00 +00:00
Qingyun Wu c75655a340
Supporting callable message (#1852)
* add message field

* send

* message func doc str

* test dict message

* retiring soon

* generate_init_message docstr

* remove todo

* update notebook

* CompressibleAgent

* update notebook

* add test

* retrieve agent

* update test

* summary_method args

* summary

* carryover

* dict message

* update nested doc

* generate_init_message

* fix typo

* update docs for mathchat

* Fix missing message

* Add docstrings

* model

* notebook

* default naming

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: kevin666aa <yrwu000627@gmail.com>
Co-authored-by: Li Jiang <bnujli@gmail.com>
Co-authored-by: Li Jiang <lijiang1@microsoft.com>
2024-03-09 20:27:46 +00:00
Wael Karkoub 29b9c80c40
General Enhancements in agentchat 2.0 (#1906)
* work in progress

* wip

* groupchat type hints

* clean up

* formatting

* formatting

* clean up

* address comments

* better comment

* updates docstring a_send

* resolve comments

* agent.py back to original format

* resolve more comments

* rename carryover type exception

* revert next_agent changes + keeping UndefinedNextagent

* fixed ciruclar dependencies?

* fix cache tests

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-09 15:15:19 +00:00
cheng-tan 811fd6926d
Fix threading issue for logging (#1901)
* fix mypy errors for logging

* cleanup

* formatting

* fix threading issue in logging

* remove kwarg

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-08 00:08:22 +00:00
Jack Gerrits e9219fefc0
Implement docker based command line code executor (#1856)
* implement docker based command line code executor

* undo import

* test skips

* format

* fix type issue

* skip docker tests

* fix paths

* add docs

* Update __init__.py

* class name

* precommit

* undo twoagent change

* use relative to directly

* Update, fixes, etc.

* update doc

* Update docstring

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-07 18:11:52 +00:00
Yiran Wu c37227bd04
Allow user to pass in a customized speaker selection method (#1791)
* init PR

* update

* update code check

* update

* update

* update

* update

* Test the ability to have agents a,u,t,o,g,e,n speak in turn.

* update

* update

* update

* Evidence that groupchat not terminating because of the TERMINATE substring.

* Raising NoEligibleSpeakerException allows graceful exit before max turns

* update

* To confirm with author that custom function is meant to override graph constraints

* Confirmed the expected test behaviour with author

* Update autogen/agentchat/groupchat.py

* update

* update

---------

Co-authored-by: Joshua Kim <Joshua@spectdata.com>
Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>
2024-03-07 02:28:22 +00:00
Jack Gerrits 685164f83a
Executor timeout should preserve kernel state (#1885) 2024-03-06 18:24:33 +00:00
Jack Gerrits d9078210e7
Change name from LocalCommandlineCodeExecutor to LocalCommandLineCodeExecutor (#1873)
* Change name from LocalCommandlineCodeExecutor to LocalCommandLineCodeExecutor

* formatting

* name

* name

* CommandLineCodeResult rename too

* formatting
2024-03-06 15:41:19 +00:00
Chi Wang cd3b5c6bbd
add doc about effects for capabilities (#1842)
* add doc about effects for capabilities

* remove unnecessary imports

* improve doc

* test

* test location

* polish

* improve import of colored

* termcolor

* termcolor

* use pull request for openai test
2024-03-03 23:15:52 +00:00
Grigorij Dudnik f2e42326e1
Fix for bugs appeared when using function calls with clear history functionality (#1531)
* resolved errors happening when using function calling and clear history

* checking in nr_of_messages_to_preserve were provided

* code formatting

* test added, dict signature improved

* test added, dict signature improved

* test added, dict signature improved

* test added, dict signature improved

* test added, dict signature improved

* test added, dict signature improved

* test added, dict signature improved

* test added, dict signature improved

* Test updated

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

* test improved

* test improved

* comment about preserving additional message added

* commentary about clear history called in tool response improved

* created test for clear hisotry called from tool response

* code formatting

* added 'USER INTERRUPTED' as internal content of tool response

* added separate vatiable 'nr_messages_to_preserve_internal'

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-02 18:03:52 +00:00
Eric Zhu fcf14ee9e9
Remove default trigger value for register_nested_chats (#1833)
* remove default trigger value for register_nested_chats

* update notebook and test
2024-03-01 21:50:58 +00:00
Jack Gerrits 76ef0789c0
Implement docker based jupyter executor (#1794)
* Implement docker based jupyter client

* formatting

* skip docker tests when asked

* feedback

* add log

* update build

* formatting

* structural changes

* update setup.py

* update tests

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-29 14:54:11 +00:00
Gunnar Kudrjavets b8ceb866e6
Add shebang functionality to tests (#1784)
Tests that contain `if __name__ == "__main__":` now have a shebang line
and execute permission.
2024-02-29 01:11:08 +00:00
Beibin Li 5b0c919d7d
Debug: Resolve the DALLE Agent's self.client error. (#1798)
* Change defualt model for `lmm`

* Try to use PIL image for LMM's _oai_messages

* Update test cases and llava

* Remove redundant files

* Update the imports for lmm tests

* Test case fix

* Docstring update

* LMM notebook lint

* Typo correction for img_utils and its test

* Fix self.client bug for Dalle Agent
The self.client member variable is reserved for OpenAI's LLM-compatible
client, which requires usage summary support.
So, we rename self.client to self._dalle_client to resolve this issue
2024-02-29 00:58:19 +00:00
Rohit Singh Rathaur dc89147310
hook-list are updated to accept a sender argument (#1799)
* hook-list are updated to accept a sender argument

* Update the hook function Signature & add assertions for Sender
2024-02-28 06:34:21 +00:00
Shaokun Zhang b8727893f7
Support functions removing in ConversableAgent (#1786)
* fix

* update

* reformat

---------

Co-authored-by: “skzhang1” <“shaokunzhang529@gmail.com”>
2024-02-27 18:42:56 +00:00
Qingyun Wu c6f6707f4d
Adding `register_nested_chats` to make nested chat easier (#1753)
* add util

* add notebook

* SoM notebook

* doc

* update notebook

* SoM

* optiguide

* rename

* add implementation

* update notebook

* update notebook

* update notebook

* summary method

* initiate_chats enhancements

* callable summary_method

* summary method

* summary method default

* docstr

* add timeout to slient pip install test

* consolidate_chat_info

* a_initiate_chat

* AssertionError tests

* AssertionError test

* update tests

* update test

* remove redudant file

* kwargs

* update notebook

* update notebook

* nested

* update SoM

* update notebook

* max_turns

* add notebook

* updatenotebook

* add notebooks

* update notebook and test

* add links to the example page

* annotations

* documentation

* default values

* Expanded details about the purpose of each cell

* update default value

* default value for reply_func_from_nested_chats

* default reply func name

* update notebook

* update optiGuide

* upload fig

* optiGuide notebook

* doc

* update notebook

* update notebook

* notebook format

* update optiguide notebook

* raise value error

* update notebook

* Improve language

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: signalprime <15487280+signalprime@users.noreply.github.com>
Co-authored-by: gagb <gagb@users.noreply.github.com>
2024-02-27 04:36:18 +00:00
Joshua Kim d797d267e4
Blog regarding finite-state machine (#1622)
* Initialization of fsm blog

* Pre-commit pass

* Pinyin name correction

* Updated title

* Updated title

* Added summary of notebook and note about DAG

* Update index.mdx

* Update website/blog/2024-02-11-FSM-GroupChat/index.mdx

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

* Update website/blog/2024-02-11-FSM-GroupChat/index.mdx

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

* Removed outdated filename and followed SoM notebook format

* Pre-commit pass

* Update notebook link

* Corrected link to rendered notebook

* Removed agentchat_hierarchy_flow_using_select_speaker and modified agentchat_groupchat_finite_state_machine

* Add notebook/agentchat_groupchat_finite_state_machine.ipynb to paths

---------

Co-authored-by: freedeaths <register917@gmail.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-26 18:10:00 +00:00
Chi Wang 8ec1c3e0b3
process message before send (#1783)
* process message before send

* rename
2024-02-25 15:57:27 +00:00
afourney 477598afff
Groupchat send introductions (#961)
* Allow the GroupChatManager to send introductions.

* Fixed function name.

* Added test cases for sending introductions.

* Trying to sort out why remote pytest is failing.

* Fixed broken plugin behavior.

* Update autogen/agentchat/groupchat.py

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

* Updated as per Chi's suggestions.

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-02-24 16:50:46 +00:00
Ian fb2b412c4a
Handle azure_deployment Parameter Issue in GPTAssistantAgent to Maintain Compatibility with OpenAIWrapper (#1721)
* support getting model from both llm config and config list

* address comments

* address commentsd

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-24 03:56:39 +00:00
Jack Gerrits fbc2f6e911
Use jupyer-kernel-gateway for ipython executor (#1748)
* checkpoint async based

* Implement jupyter client and use jupyer gateway

* update deps

* address comments

* add missing parenthesis

* Update build.yml

* CI fixes

* change requirement name

* debug

* print stderr

* dont seek

* show token

* mitigaton for windows bug

* use hex token to avoid - in token

* formatting

* put back in place original while the windows bug exists

* lint

* Update autogen/coding/jupyter_code_executor.py

* Update jupyter_code_executor.py

* Update test_embedded_ipython_code_executor.py

* Update setup.py

* Update build.yml

* fix nameerror

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-02-23 19:09:59 +00:00
Abhay Mathur a646df2d02
Updating code_utils.py to solve issue #1747 (#1758)
* Update code_utils.py

Updated the powershell command to pwsh

* Update code_utils.py

added a split to handle powershell in the first condition as well

* Update local_commandline_code_executor.py

added "pwsh" as a command option in lang variable

* Update autogen/coding/local_commandline_code_executor.py

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

* Update code_utils.py

* Update code_utils.py

fixed formatting

* Update code_utils.py

defined a function to detect whether 'powershell' or 'pwsh' works and accordingly use the one that works

* Update code_utils.py

fixed formatting

* Update and rename test_code.py to test_code_utils.py

added a unit test for get_powershell_command function in code_utils.py

* Update test_code_utils.py

fixed formatting

* Update test_code_utils.py

fixed formatting

* Update autogen/code_utils.py

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

* solved issue #1747

* updated unit test

* fixed formatting

* fixed formatting

* fixed formatting

* fixed a bug

* removed extra return None and removed redundant comments

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-23 03:41:33 +00:00
Linxin Song 07520aa354
[AutoBuild] fix test error (#1750)
* try to fix blog

* modify blog

* fix test error in #717; fix blog typo in installation; update blogs with output examples.

* pre-commit

* pre-commit

* Update website/blog/2023-11-26-Agent-AutoBuild/index.mdx

Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu>

* add future work

* fix grammar

* update agent_builder

* solve #941; add detailed debug info; support json string config

* pre-commit

* solve #954

* pre-commit

* [new feature] build group chat agents from library.

* pre-commit

* add authors' info in notebook; add a new notebook for build_from_library; reduce prompt effort

* update test and example for build_from_library

* pre-commit

* add notebook; update docs

* change notebook name

* change description for notebook and doc

* remove default value for default_llm_config

* add embedding similarity agent selection

* pre-commit

* update test

* add dependency installation in github workflow

* update test

* pre-commit

* update notebook

* support directly json as library; support customize embedding model

* update test

* pre-commit

* update github test workflow

* Update autobuild_agent_library.ipynb

* add agent description

* refine prompt; update notebook

* pre-commit

* update test example

* update test

* update test

* update test

* change `config_path` to `config_path_or_env`; update test

* pre-commit

* update test

* update test

* update test: add config_file_location

* change `config_path_or_env` to `config_file_or_env`

* update test

* solve noqa

* fix import error for conftest

* fix test error

* pre-commit

* * update error message in `_create_agent`.
* replace `gpt-4-1106-preview` to `gpt-4` in test file.

* add comment on local server creation; modify notebook; update contrib-openai.yml for test; add autobuild option in setup.py; add autotest model name statement

* move import huggingface_hub to _create_agent

* pre-commit

* add uncover comment in the endpoint creation code block

* recover contrib-openai.yml for merge

* remove TERMINATE assertion for sys msg

* remove TERMINATE assertion

---------

Co-authored-by: Jieyu Zhang <jieyuz2@cs.washington.edu>
Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu>
2024-02-21 22:01:30 +00:00
Rohit Singh Rathaur 3c2c251f3f
Allow None for sender field in `CoversableAgent.generate_reply` (#1725)
* Allow None for sender field

* Apply formatting fixes

* Add test for ConversableAgent generate_reply with message is provided and sender is None

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-21 19:42:18 +00:00
Aristo a4ab4cc9ae
Async version of multiple sequential chat (#1724)
* async_initiate_chats init commit

* Fix a_get_human_input bug

* Add agentchat_multi_task_async_chats.ipynb with concurrent exampls.

* Addess the comments, Update unit test

* Add agentchat_multi_task_async_chats.ipynb to Examples.md

* Fix type for Python 3.8

---------

Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>
2024-02-21 19:33:33 +00:00
dkirsche a34e4cc515
Refactor transform_messages (#1631)
* refactored code to simplify

* optimize function. Instead of iterating over each character, guess at size and then iterate by token.

* adding tests

* Add missing tests

* minor test fix

* simplified token truncation by using tiktoken to encode and decode

* updated truncated notification message

* Fix llm_config spec to use os.environ

* Add test case and fix bug in loop

---------

Co-authored-by: gagb <gagb@users.noreply.github.com>
2024-02-20 22:53:05 +00:00
Abhay Mathur 2750391f84
Updated code_utils.py & local_commandline_code_executor.py (powershell to pwsh) (#1710)
* Update code_utils.py

Updated the powershell command to pwsh

* Update code_utils.py

added a split to handle powershell in the first condition as well

* Update local_commandline_code_executor.py

added "pwsh" as a command option in lang variable

* Update autogen/coding/local_commandline_code_executor.py

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

* Update code_utils.py

* Update code_utils.py

fixed formatting

* Update code_utils.py

defined a function to detect whether 'powershell' or 'pwsh' works and accordingly use the one that works

* Update code_utils.py

fixed formatting

* Update and rename test_code.py to test_code_utils.py

added a unit test for get_powershell_command function in code_utils.py

* Update test_code_utils.py

fixed formatting

* Update test_code_utils.py

fixed formatting

* Update autogen/code_utils.py

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

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-19 17:32:13 +00:00
Aaron e50d5a1747
Command line code sanitation (#1627)
* UPDATE - add commandline sanitation class, update local_commandline_code_executor.py and renamed test for code_utils.py

* FIX - precommit run

* UPDATE - moved sanitation function to LocalCommandlineCodeExecutor, moved testo to test_commandline_code_executor.py

* UPDATE - added docstring notice to sanitize_code

* Update autogen/coding/local_commandline_code_executor.py

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

* FIX - regular expression

* FIX - function invocation in tests

* UPDATE - pre-commit run

* FIX - pre-commit run -_-

---------

Co-authored-by: Ward <award40@LAMU0CLP74YXVX6.uhc.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-02-18 16:41:36 +00:00
Li Jiang 5aee9114ae
Fix issue 1440 by applying new function registration decorator (#1661)
* Reproduce #1440

* Updated code with latest APIs

* Reran notebook

* Fix usage of cache
2024-02-18 15:47:19 +00:00
Beibin Li 9de374a495
Use PIL Image internally for the Multimodal Agent (#1124)
* Change defualt model for `lmm`

* Try to use PIL image for LMM's _oai_messages

* Update test cases and llava

* Remove redundant files

* Update the imports for lmm tests

* Test case fix

* Docstring update

* LMM notebook lint

* Typo correction for img_utils and its test

* Update test_llava.py

debug, reformat

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Shaokun Zhang <shaokunzhang529@gmail.com>
Co-authored-by: Shaokun Zhang <shaokun.zhang@psu.edu>
2024-02-18 15:08:55 +00:00
Chi Wang 9708058dae
use str for hook key (#1711)
* use str for hook key

* bump version to 0.2.15

* remove github

* disable assertion
2024-02-17 18:00:23 +00:00
Qingyun Wu a00df55306
Allow limiting the maximum number of turns in `initiate_chat` and `initiate_chats` (#1703)
* max_turns

* add notebook

* simplify code

* groupchat _prepare_chat

* doc

* add doc

* Update autogen/agentchat/conversable_agent.py

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-17 17:02:12 +00:00
Mats Finsås 7ceee5dadc
Update Azure OpenAI API to 2024-02-15-preview (#1692)
On April 2, 2024 the following API preview releases will be retired and will stop accepting API requests:

2023-03-15-preview
2023-06-01-preview
2023-07-01-preview
2023-08-01-preview

To avoid service disruptions, update to use the latest version 2024-02-15-preview.

https://review.learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation
2024-02-15 18:57:17 +00:00
cheng-tan 5ca69da8e5
bug fix: logging test may fail if some config fails (#1695) 2024-02-15 18:51:38 +00:00
Wael Karkoub a52f52a1b5
Feature: Get Nested Agents in a `GroupChat` (#1636)
* implements features

* fix docstring

* adds test

* resolve some comments

* remove unused group chat manager from test

* list implementation

* better naming

* resolve comments

* adds one more test

* checks case when agent doesnt exist

* clean up

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-15 18:33:59 +00:00
Ian b270a2e467
support azure assistant api (#1616)
* support azure assistant api

* try to add azure testing

* improve testing

* fix testing

* fix code

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-15 05:29:08 +00:00
Chi Wang cff9ca9a11
do model check properly (#1686)
* do model check properly

* bug in logging test

* set llm_config
2024-02-15 04:51:22 +00:00
Gunnar Kudrjavets d677b47c44
Validate llm_config passed to ConversableAgent (issue #1522) (#1654)
* Validate llm_config passed to ConversableAgent

Based on #1522, this commit implements the additional validation checks in
`ConversableAgent.`

Add the following validation and `raise ValueError` if:

 - The `llm_config` is `None`.
 - The `llm_config` is valid, but `config_list` is missing or lacks elements.
 - The `config_list` is valid, but no `model` is specified.

The rest of the changes are code churn to adjust or add the test cases.

* Validate llm_config passed to ConversableAgent

Based on #1522, this commit implements the additional validation checks in
`ConversableAgent.`

Add the following validation and `raise ValueError` if:

 - The `llm_config` is `None` (validated in `ConversableAgent`).
 - The `llm_config` has no `model` specified and `config_list` is empty
   (validated in `OpenAIWrapper`).
 - The `config_list` has at least one entry, but not all the entries have
   the `model` is specified (validated in `OpenAIWrapper`).

The rest of the changes are code churn to adjust or add the test cases.

* Validate llm_config passed to ConversableAgent

Based on #1522, this commit implements the additional validation checks in
`ConversableAgent.`

Add the following validation and `raise ValueError` if:

 - The `llm_config` is `None` (validated in `ConversableAgent`).
 - The `llm_config` has no `model` specified and `config_list` is empty
   (validated in `OpenAIWrapper`).
 - The `config_list` has at least one entry, but not all the entries have
   the `model` is specified (validated in `OpenAIWrapper`).

The rest of the changes are code churn to adjust or add the test cases.

* Validate llm_config passed to ConversableAgent

Based on #1522, this commit implements the additional validation checks in
`ConversableAgent.`

Add the following validation and `raise ValueError` if:

 - The `llm_config` is `None` (validated in `ConversableAgent`).
 - The `llm_config` has no `model` specified and `config_list` is empty
   (validated in `OpenAIWrapper`).
 - The `config_list` has at least one entry, but not all the entries have
   the `model` is specified (validated in `OpenAIWrapper`).

The rest of the changes are code churn to adjust or add the test cases.

* Validate llm_config passed to ConversableAgent

Based on #1522, this commit implements the additional validation checks in
`ConversableAgent.`

Add the following validation and `raise ValueError` if:

 - The `llm_config` is `None` (validated in `ConversableAgent`).
 - The `llm_config` has no `model` specified and `config_list` is empty
   (validated in `OpenAIWrapper`).
 - The `config_list` has at least one entry, but not all the entries have
   the `model` is specified (validated in `OpenAIWrapper`).

The rest of the changes are code churn to adjust or add the test cases.

* Fix the test_web_surfer issue

For anyone reading this: you need to `pip install markdownify` for the
`import WebSurferAgent` to succeed. That is needed to run the
`test_web_surfer.py` locally.

Test logic needs `llm_config` that is not `None` and that is not
`False`.

Let us pray that this works as part of GitHub actions ...

* One more fix for llm_config validation contract
2024-02-15 00:54:31 +00:00