* function calling upgraded: async/sync mixing works now for all combinations and register_function added to simplify registration of functions without decorators
* polishing
* fixing tests
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* Added a GroupChatRepresentative class that uses group chat as an inner-monologue.
* Renamed GroupChatRepresentative to SocietyOfMindAgent
* Added tests for the society of mind agent.
* Don't force message attribution -- the defaults are correct.
* Add names to external messages.
* Added some comments to document code, per request.
* Added some comments to document code, per request.
* Added a Notebook example, and the ability to use a prompt as the response_preparer.
* Protect inner chat with try-catch
* Fixed typo.
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* functionality of manual history cleaning by admin added
* formatting improved
* formatting improved 2
* formatting improved 3
* test function added
* test code formatting
* test code formatting 2
* more advanced logging. Now user can see nr of messages to preserve as confirmation
* test_invalid_allow_repeat_speaker uncommented
* warning when providing recepient agent and nr messages to preserve added, changed variables names
* code formatting
* code formatting
* code formatting
* added 'enable_clear_history' variable to GroupChat
* 'enable_clear_history' added, better descripted
* clearing groupchat history added
* clearing groupchat history added
* two ifs merged into one, formatting improved
* two ifs merged into one, formatting improved
* two ifs merged into one, formatting improved
* formatting
* formatting
---------
Co-authored-by: Davor Runje <davor@airt.ai>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* Change last_n_messages to default to 'auto'
* Added last_n_messages validation, as per Eric's comment.
---------
Co-authored-by: Davor Runje <davor@airt.ai>
* Initial commit of WebSurfer. Adds the browser_utils, and related tests. WebSurfer will be added in a subsequent commit.
* Added the web surfer agent, and related tests.
* Added a notebook to show how WebSurferAgent works.
* Fixed a typo.
* Updated test_web_surfer for compatibility with #1110.
* Updated skip_oai logic.
* Fixed code formatting.
* More pre-commit fixes.
* Added block to contrib-openai.yml
* Added block to contrib-openai.yml
* Added hook for BING_API_KEY
* Temporarily commented out other tests, per request.
* Fixed indentation (maybe?)
* Restoring contrib-openai.yml
* implement redis cache mode, if redis_url is set in the llm_config then
it will try to use this. also adds a test to validate both the existing
and the redis cache behavior.
* PR feedback, add unit tests
* more PR feedback, move the new style cache to a context manager
* Update agent_chat.md
* more PR feedback, remove tests from contrib and have them run with the normal jobs
* doc
* updated
* Update website/docs/Use-Cases/agent_chat.md
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* update docs
* update docs; let openaiwrapper to use cache object
* typo
* Update website/docs/Use-Cases/enhanced_inference.md
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* save previous client cache and reset it after send/a_send
* a_run_chat
---------
Co-authored-by: Vijay Ramesh <vijay@regrello.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* allow initiate_chat without passing message
* test human input
* assert called
* Add missing method a_generate_init_message
* fix tests
* add back skipif
* Update test/agentchat/test_async_get_human_input.py
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* set use_docker to default to true
* black formatting
* centralize checking and add env variable option
* set docker env flag for contrib tests
* set docker env flag for contrib tests
* better error message and cleanup
* disable explicit docker tests
* docker is installed so can't check for that in test
* pr comments and fix test
* rename and fix function descriptions
* documentation
* update notebooks so that they can be run with change in default
* add unit tests for new code
* cache and restore env var
* skip on windows because docker is running in the CI but there are problems connecting the volume
* update documentation
* move header
* update contrib tests
* Switched to AzureOpenAI for api_type=="azure"
* Setting AzureOpenAI to empty object if no `openai`
* extra_ and openai_ kwargs
* test_client, support for Azure and "gpt-35-turbo-instruct"
* instruct/azure model in test_client_stream
* generalize aoai support (#1)
* generalize aoai support
* Null check, fixing tests
* cleanup test
---------
Co-authored-by: Maxim Saplin <smaxmail@gmail.com>
* Returning back model names for instruct
* process model in create
* None check
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* update
* update
* Update notebook/oai_client_cost.ipynb
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* update doc and test
---------
Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* #1206
* doc
* add test for azure openai
* prior to
* filter for versions
* up to
* literal type
* update doc
* update doc
* update model list
* Update autogen/agentchat/conversable_agent.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_tool_calls.py
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* Added the ability to add tags to the OAI_CONFIG_LIST, and filter on them.
* Update openai_utils.py
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* run sync and async in async
* test for async multitool call
* uncomment notebook
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Davor Runje <davor@airt.ai>
* documentation update and added tests for register_reply function
* added raising an exception on an async reply function in sync chat
* big fixing
* test expanded
* Update autogen/agentchat/conversable_agent.py
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* Update autogen/agentchat/conversable_agent.py
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* refactorization
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* bug fix for async functions
* Update test_conversable_agent.py
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* Update test/agentchat/test_conversable_agent.py
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* commented out cell in a notebook until issue #1205 is not fixed
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* adjust conversable and compressible agents to support tool_calls
* split out tools into their own reply def
* copilot typo
* address review comments
* revert compressible_agent and token_count_utils calls
* cleanup terminate check and remove unnecessary code
* doc search and update
* return function/tool calls as interrupted when user provides a reply to a tool call request
* fix tool name reference
* fix formatting
* fix initiate receiving a dict
* missed changed roled
* ignore incoming role, more similiar to existing code
* consistency
* redundant to_dict
* fix todo comment
* uneeded change
* handle dict reply in groupchat
* Fix generate_tool_call_calls_reply_comment
* change method annotation for register_for_llm from functions to tools
* typo autogen/agentchat/conversable_agent.py
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* add deprecation comments for function_call
* tweak doc strings
* switch to ToolFunction type
* update the return to
* fix generate_init_message return type
* Revert "fix generate_init_message return type"
This reverts commit 645ba8b76afa06f160223ecdac6f3dc1822fd249.
* undo force init to dict
* fix notebooks and groupchat tool handling
* fix type
* use get for key error
* fix teachable to pull content from dict
* change single message tool response
* cleanup unnessary changes
* little better tool response concatenation
* update tools tests
* add skip openai check to tools tests
* fix nits
* move func name normalization to oai_reply and assert configured names
* fix whitespace
* remove extra normalize
* tool name is now normalized in the generate_reply function, so will not be incorrect when sent to receive
* validate function names in init and expand comments for validation methods
* fix dict comprehension
* Dummy llm config for unit tests
* handle tool_calls set to None
* fix tool name reference
* method operates on responses not calls
---------
Co-authored-by: Yiran Wu <32823396+kevin666aa@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* 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
---------
Co-authored-by: Jieyu Zhang <jieyuz2@cs.washington.edu>
Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu>
* Remove GPT-4 as the default model.
* Updated test_compressible_agent to work around a bug that would otherwise default to gpt-4. Revist after #1073 is addressed.
* Worked around another bug in test_compressible_agent. It seems the config_list was always empty!
* Reverted changes to compressible agent.
* Noted that GPT-4 is the preferred model in the OAI_CONFIG_LIST_sample and README.
* Fixed failing tests after #1110
* Update OAI_CONFIG_LIST_sample
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* Throw an explicit and proper error when someone asks to load the OAI_CONFIG_LIST, and it is missing.
* Updated to use pytest.raises. Added docstring. Updated some tests to not try to load the config_list when skipping OAI tests.
* Fixed wrong indentation in config_list_from_json, and updated test_utils to work with non-empty lists.
* Read key location from global constants.
* Added missingpath.
* Moved config_list_from_json to inside a skip check.
* Improve config_list_from_json
The `env_or_file` variabe can point to an
environment variable of file path.
* Update autogen/oai/openai_utils.py
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* Use "with" to open config file
* Remove unused.
* Remove accidental added file
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* fix for #762 ,get_config_list/oia assetion, docs, test
* Improved docstrings
* test_utils using fake data and temp files
* "Black" formatting applied
* Fix build (KEY_LOC and OAI_CONFIG_LIST as consts in test_client)
* Ramping up openai_utils coverage
* Missing parameter doc.
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* Filter out candidates with the same name but different instructions, file IDs, and function names
* polish
* improve log
* improving log
* improve log
* Improve function signature (#2)
* try to fix ci
* try to fix ci
---------
Co-authored-by: gagb <gagb@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* add function decorator to converasble agent
* polishing
* polishing
* added function decorator to the notebook with async function calls
* added support for return type hint and JSON encoding of returned value if needed
* polishing
* polishing
* refactored async case
* Python 3.8 support added
* polishing
* polishing
* missing docs added
* refacotring and changes as requested
* getLogger
* documentation added
* test fix
* test fix
* added testing of agentchat_function_call_currency_calculator.ipynb to test_notebook.py
* added support for Pydantic parameters in function decorator
* polishing
* Update website/docs/Use-Cases/agent_chat.md
Co-authored-by: Li Jiang <bnujli@gmail.com>
* Update website/docs/Use-Cases/agent_chat.md
Co-authored-by: Li Jiang <bnujli@gmail.com>
* fixes problem with logprob parameter in openai.types.chat.chat_completion.Choice added by openai version 1.5.0
* get 100% code coverage on code added
* updated docs
* default values added to JSON schema
* serialization using json.dump() add for values not string or BaseModel
* added limit to openai version because of breaking changes in 1.5.0
* added line-by-line comments in docs to explain the process
* polishing
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Li Jiang <bnujli@gmail.com>
* fix: typo
* fix: typo
* fix: typo of function name
* fix: typo of function name of test file
* Update test_token_count.py
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* Add example nb for async funcs
* Add a notebook based test for async function calls
* Update nb
* Update nb
* Remove duplicate code
* Rename func for consistency
* Fix bug
* Add intro text for cmd cell 4
* Add a short comment on await
* Update agentchat_function_call_async.ipynb
Minor typo
* Add link to nb
---------
Co-authored-by: Joshua Kim <joshkyh@users.noreply.github.com>
Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu>