Commit Graph

376 Commits

Author SHA1 Message Date
Chi Wang c94b5c6a61
Use config list in notebook (#2537) 2024-04-28 19:47:27 +00:00
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
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
Eric Zhu 2df0f39b00
Update the auto_feedback_from_code_execution notebook to use code executor (#2366)
* Use code executors in notebook.

* Add custom code executor guide

* Add to gitignore

* Update

* fix links

* link

* typo

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-18 07:53:19 +00:00
Eric Zhu 3c266c5c01
Fix function call notebook to make sure title is displayed. (#2403)
* Fix function call notebook to make sure title is displayed.

* Fix formatting

* formatting
2024-04-17 14:02:10 +00:00
Li Jiang c4e570393d
Support setting vector_db as a param (#2313)
* 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

* Update init params

* Update init vector db

* Add get all docs

* Move chroma_results_to_query_results to utils

* Add init vectordb

* Convert format of results for old version

* Improve type hints

* Update get_context for new query results format

* Fix typo

* Improve init db

* Update default folder

* Update logger

* Update init, add embedding func

* Update distance_threshold

* Fix logger name

* Update qdrant

* Fix init db

* Update notebooks

* Use kwargs to improve readability

* Improve docstring of vectordb, add two attributes

* Add db_config

* Update gitignore

* Update comments

* Add source

* Fix file downloaded from urls have the same name

* Remove files added by mistake

* Improve docstring

* Update docstring

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

* Update docstring

* Update docstring

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-17 08:30:05 +00:00
Grigorij Dudnik 36f1bf5a56
Code writing with a function call notebook created (#2121)
* code writing with function call notebook created

* code formatting

* code formatting

* code formatting

* Remarks improved

* trying to resolve conflicts in Examples.md

* trying to solve conflict, improving llm_config

* working on conflict in examples

* working on conflict in examples

* working with examples.md

* examples

* repairing examples

* Examples updated

* notebook included

* code formatting

* code formatting

* tool defenition added

* code formatting

* dot removed

* starting code

* starting code

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-04-16 15:40:49 +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
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
Yiran Wu 72bd0bde3c
Update StateFlow to use LocalCommandLineCodeExecutor (#2335)
* update

* update
2024-04-10 21:53:26 +00:00
Mart 918fd6b481
Improve readability of notebooks (#2200)
* Improve readability

* Update context_handling.py

update line breaks according to comment of reviewer

* Update agentchat_groupchat_finite_state_machine.ipynb

corrected sentence according to comment of reviewer

* Update autogen/agentchat/contrib/capabilities/context_handling.py

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

---------

Co-authored-by: Shaokun Zhang <shaokunzhang529@gmail.com>
Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
2024-04-09 15:07:44 +00:00
Davor Runje 0e0895fe18
Fix typo in websockets notebook (#2287)
* Fixe typo in websockets notebook

* fixes
2024-04-05 15:49:23 +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 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
Li Jiang 46bee1f366
Update RetrieveChat blog to fix some outdated APIs (#2273)
* Fix rag blog

* Update wording
2024-04-04 19:18:39 +00:00
Eric Zhu c63c52adec
Notebook on web scraping with tool use (#2192)
* Add web scrapping notebook

* formatting

* tags

* Update

* update
2024-04-02 14:09:10 +00:00
Davor Runje d970449d5a
added PNG and JPEG files to LFS automatically (#2226) 2024-04-02 05:20:47 +00:00
Andrew Kulakov 44acab46db
Fixed spelling in agentchat_transform_messages.ipynb (#2234) 2024-04-01 16:40:51 +00:00
Davor Runje 3b04210ee7
polishing (#2227) 2024-04-01 16:27:31 +00:00
Wael Karkoub fd96d3d1f5
Improve Image Generation Notebook (#2213)
* notebook improved

* metadata
2024-03-31 22:53:35 +00:00
jtoy 989c18274d
2147 - Fix notebook bug to make a copy of configs for each agent (#2176)
* try fix groupchat llm_config

* Update agentchat_groupchat_RAG.ipynb

* use better config options

* formatting

---------

Co-authored-by: i <i@jtoy.net>
Co-authored-by: Li Jiang <bnujli@gmail.com>
Co-authored-by: Jason <jtoy@grids.local>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-31 16:39:20 +00:00
Shaokun Zhang 16db0b957f
Render AgentOptimzier notebook in web (#2197)
* update

* change tag

---------

Co-authored-by: AnonymousRepoSub <“shaokunzhang529@outlook.com” >
2024-03-29 14:32:22 +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 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
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
Eric Zhu 2bfa181b4d
New conversational chess notebook using nested chats and tool use (#2137)
* add chess notebook

* update

* update

* Update notebook with figure

* Add example link

* redirect

* Clean up example format

* address gagan's comments

* update references

* fix links
2024-03-25 16:24:08 +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
Ikko Eltociear Ashimine a8abe59085
Update agentchat_nestedchat_optiguide.ipynb (#2122)
auxillary -> auxiliary
2024-03-23 01:29:55 +00:00
Aristo 96cbaf72d3
Fix a initiate chats (#1938)
* Fix async a_initiate_chats

* Fix type compatibility for python 3.8

* Use partial func to fix context error

* website/docs/tutorial/assets/conversable-agent.jpg: convert to Git LFS

* Update notebook examples

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Davor Runje <davor@airt.ai>
2024-03-17 22:51:37 +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
Jack Gerrits ea2c1b270e
Add another batch of notebooks to the website (#1969)
* Add another batch of notebooks to the website

* update link

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-03-15 14:30:34 +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
Qingyun Wu e1c0423d9a
add RAG under topics (#1990)
* add RAG

* demo

* correct notebook

* Update quarto installation

* Update gitignore

* Update format

* RAG doc

---------

Co-authored-by: Li Jiang <bnujli@gmail.com>
2024-03-14 00:49:39 +00:00
Jack Gerrits 11df53bb39
Make notebooks available in navbar (#1956) 2024-03-11 22:46:39 +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
Jack Gerrits 968483369c
Update whisper notebook to use new function registration syntax (#1918)
* Update notebook to use new function registration syntax

* Update agentchat_video_transcript_translate_with_whisper.ipynb

* formatting
2024-03-11 18:10:50 +00:00
Jack Gerrits 00e097d4a5
Update more notebooks to be available on the website (#1890)
* Update more notebooks to be available on the website

* fix notebook

* update link
2024-03-10 02:14:45 +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
Jack Gerrits 78a5a6b20c
Fix formatting in sequential chat notebook (#1914) 2024-03-08 04:38:18 +00:00
Ricky Loynd c5e76653cb
Fix links (#1905) 2024-03-07 22:15:19 +00:00
Yiran Wu 1f9284ce54
Compressible Agent require `model` field for `llm_config` (#1903)
* update

* update

* update

* update

* Update autogen/agentchat/contrib/compressible_agent.py

---------

Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>
2024-03-07 16:45:17 +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 799a24e04f
Create topics dir and move llm config (#1853)
* create topics dir and move llm config

* fix redirect

* fix link
2024-03-04 18:02:26 +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
Jack Gerrits d60464374d
Upgrade Quarto and use notebook metadata for frontmatter (#1836)
* Update process_notebook to use metadata instead of a yaml comment

* upgrade quarto and version check in tool

* formatting

* address comments
2024-03-02 14:27:11 +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 f6c9b13ac4
Extend process_notebooks for testing (#1789)
* Extend process_notebooks for testing

* add command

* spelling and lint

* update docs

* Update contributing.md

* add shebang

* Update contributing.md

* lint
2024-02-29 20:47:30 +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
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
Shreyas Kulkarni 25f3d12f18
Update agentchat_custom_model.ipynb (#1768)
Wrong Google Colab URL

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-02-26 17:42:00 +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
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
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 4ccff54dbe
Logging (#1146)
* WIP:logging

* serialize request, response and client

* Fixed code formatting.

* Updated to use a global package, and added some test cases. Still very-much a draft.

* Update work in progress.

* adding cost

* log new agent

* update log_completion test in test_agent_telemetry

* tests

* fix formatting

* Added additional telemetry for wrappers and clients.

* WIP: add test for oai client and oai wrapper table

* update test_telemetry

* fix format

* More tests, update doc and clean up

* small fix for session id - moved to start_logging and return from start_logging

* update start_logging type to return str, add notebook to demonstrate use of telemetry

* add ability to get log dataframe

* precommit formatting fixes

* formatting fix

* Remove pandas dependency from telemetry and only use in notebook

* formatting fixes

* log query exceptions

* fix formatting

* fix ci

* fix comment - add notebook link in doc and fix groupchat serialization

* small fix

* do not serialize Agent

* formatting

* wip

* fix test

* serialization bug fix for soc moderator

* fix test and clean up

* wip: add version table

* fix test

* fix test

* fix test

* make the logging interface more general and fix client model logging

* fix format

* fix formatting and tests

* fix

* fix comment

* Renaming telemetry to logging

* update notebook

* update doc

* formatting

* formatting and clean up

* fix doc

* fix link and title

* fix notebook format and fix comment

* format

* try fixing agent test and update migration guide

* fix link

* debug print

* debug

* format

* add back tests

* fix tests

---------

Co-authored-by: Adam Fourney <adamfo@microsoft.com>
Co-authored-by: Victor Dibia <victordibia@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-15 00:54:17 +00:00
Jack Gerrits a62b5c3b2d
Update notebook contrib guidance, update a few notebooks for site (#1651)
* update some notebooks

* Update contributing.md

* remove os

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-02-14 17:00:55 +00:00
Qingyun Wu fb22f78b08
add autogen.initiate_chats (#1638)
* add initiate_chats

* update notebook

* different user

* add notebook

* add link to website

* update notebook title

* remove redundancy

* notebook

* return list

* tag

* update notebook

* update notebook

* return finished tasks

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-13 05:23:08 +00:00
Jack Gerrits b4a2c6e26f
Rewrite and consolidate configuration docs (#1581)
* Rewrite and consolidate configuration docs

* add link to filtering

* updates based on comments

* update lockfile

* update redirect

* spelling mistake

* update the noqa

* update links

* fix broken links

* lint fixes

* address comments

* update wording about model selection

* update cache_seed and json pattern

* add periods

* Update the config json func and other small changes

* update wording of json string

* update intro

* update description of caching

* fix link

* spelling mistake

* fix llm config

* Update website/docs/llm_configuration.ipynb

Co-authored-by: gagb <gagb@users.noreply.github.com>

* Add examples back as notebook

---------

Co-authored-by: gagb <gagb@users.noreply.github.com>
Co-authored-by: Aaron <aaronlaptop12@hotmail.com>
2024-02-11 18:04:43 +00:00
Eric Zhu 609ba7c649
Code executors (#1405)
* code executor

* test

* revert to main conversable agent

* prepare for pr

* kernel

* run open ai tests only when it's out of draft status

* update workflow file

* revert workflow changes

* ipython executor

* check kernel installed; fix tests

* fix tests

* fix tests

* update system prompt

* Update notebook, more tests

* notebook

* raise instead of return None

* allow user provided code executor.

* fixing types

* wip

* refactoring

* polishing

* fixed failing tests

* resolved merge conflict

* fixing failing test

* wip

* local command line executor and embedded ipython executor

* revert notebook

* fix format

* fix merged error

* fix lmm test

* fix lmm test

* move warning

* name and description should be part of the agent protocol, reset is not as it is only used for ConversableAgent; removing accidentally commited file

* version for dependency

* Update autogen/agentchat/conversable_agent.py

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

* ordering of protocol

* description

* fix tests

* make ipython executor dependency optional

* update document optional dependencies

* Remove exclude from Agent protocol

* Make ConversableAgent consistent with Agent

* fix tests

* add doc string

* add doc string

* fix notebook

* fix interface

* merge and update agents

* disable config usage in reply function

* description field setter

* customize system message update

* update doc

---------

Co-authored-by: Davor Runje <davor@airt.ai>
Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
Co-authored-by: Aaron <aaronlaptop12@hotmail.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-10 04:52:16 +00:00
gagb 47d6c7567e
Proxy PR for Long Context Capability 1513 (#1591)
* Add new capability to handle long context

* Make print conditional

* Remove superfluous comment

* Fix msg order

* Allow user to specify max_tokens

* Add ability to specify max_tokens per message; improve name

* Improve doc and readability

* Add tests

* Improve documentation and add tests per Erik and Chi's feedback

* Update notebook

* Update doc string of add to agents

* Improve doc string

* improve notebook

* Update github workflows for context handling

* Update docstring

* update notebook to use raw config list.

* Update contrib-openai.yml remove _target

* Fix code formatting

* Fix workflow file

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

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-08 18:26:00 +00:00
Matt Adams 9eab2b5a24
Fix typo in title (#1594) 2024-02-08 16:34:33 +00:00
Qingyun Wu 2a2e466932
Using a more robust "reflection_with_llm" summary method (#1575)
* summary exception

* badrequest error

* test

* skip reason

* error

* address func call in summary

* reflection_with_llm enhancement and tests

* remove old

* update notebook

* update notebook
2024-02-07 17:17:05 +00:00
Joshua Kim 6ab0487fad
Quick Fix on the Google Colab Link (#1571) 2024-02-07 01:43:26 +00:00
Qingyun Wu 3e33a2c410
New `initiate_chats` Interface for Managing Dependent Chats in ConversableAgent (#1402)
* add initiate_chats implementation and example

* update notebook

* improve takeaway method

* improve print

* improve print

* improve print

* improve print

* add tests

* minor changes

* format

* correct typo

* make prompt a parameter

* add takeaway method

* groupchat messages

* add SoM example

* fix typo

* fix SoM typo

* simplify chat function

* add carryover

* update notebook

* doc

* remove async for now

* remove condition on reply

* correct argument name

* add notebook in website

* format

* make get_chat_takeaway private

* rename takeaway method and add example

* removing SoM example for now

* carryover test

* add test

* takeaway_method

* update tests

* update notebook

* chats_queue

* add get_chat_takeaway

* delete

* add test

* Update autogen/agentchat/conversable_agent.py

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

* docstr

* wording etc

* add chat res

* revise title

* update agent_utils

* unify the async method

* add todo about overriding

* attribute check

* ChatResult type

* revise test

* takeaway to summary

* cache and documentation

* Use cache in summarize chat; polish tests

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2024-02-06 18:29:15 +00:00
Chi Wang 18a15d78fd
patch to graph groupchat (#1555)
* patch to #1541

* graph validity test

* update docstr
2024-02-06 07:18:13 +00:00
Joshua Kim c603ca434e
Graph group chat (#857)
* Move contrib-openai.yml

* Moved groupgroupchat

* From #753

* Removed local test references

* Added ignore=test/agentchat/contrib

* Trying to pass contrib-openai tests

* More specific in unit testing.

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

Co-authored-by: Li Jiang <lijiang1@microsoft.com>

* Remove coverage as it is included in test dependencies

* Improved docstring with overview of GraphGroupChat

* Iterate on feedback

* Precommit pass

* user just use pip install pyautogen[graphs]

* Pass precommit

* Pas precommit

* Graph utils an test completed

* Added inversion tests

* Added inversion util

* allow_repeat_speaker can be a list of Agents

* Remove unnessary imports

* Expect ValueError with 1 and 0 agents

* Check that main passes all tests

* Check main

* Pytest all in main

* All done

* pre-commit changes

* noqa E402

* precommit pass

* Removed bin

* Removed old unit test

* Test test_graph_utils

* minor cleanup

* restore tests

* Correct documentation

* Special case of only one agent remaining.

* Improved pytest

* precommit pass

* Delete OAI_CONFIG_LIST_sample copy

* Returns a filtered list for auto to work

* Rename var speaker_order_dict

* To write test cases

* Added check for a list of Agents to repeat

* precommit pass

* Update documentation

* Extract names in allow_repeat_speaker

* Post review changes

* hange "pull_request_target" into "pull_request" temporarily.

* 3 return values from main

* pre-commit changes

* PC edits

* docstr changes

* PC edits

* Rest of changes from main

* Update autogen/agentchat/groupchat.py

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

* Remove unnecessary script files from tracking

* Non empty scripts files from main

* Revert changes in script files to match main branch

* Removed link from website as notebook is removed.

* test/test_graph_utils.py is tested as part of L52 of build.yml

* GroupChat ValueError check

* docstr update

* More clarification in docstr

* Update autogen/agentchat/groupchat.py

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

* Update autogen/agentchat/groupchat.py

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

* Update autogen/agentchat/groupchat.py

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

* Update autogen/agentchat/groupchat.py

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

* 1.add commit to line138 in groupchat.py;2.fix bug if random choice [];3.return selected_agent if len(graph_eligible_agents) is 1;4.replace all speaker_order to speaker_transitions;5.format

* fix graph_modelling notebook in the last cell

* fix failure in test_groupchat.py

* fix agent out of group to initiate a chat like SocietyOfMind

* add a warning rule in graph_utils to check duplicates in any lists

* refactor allowed_or_disallowed_speaker_transitions to Dict[Agent, List[Agent]] and modify the tests and notebook

* delete Rule 4 in graph_utils and related test case. Add a test to resolve 993fd006e9 (r1460726831)

* fix as the final comments

* modify setup option from graphs to graph and add texts in optional-dependencies.md

* Update autogen/graph_utils.py

---------

Co-authored-by: Li Jiang <lijiang1@microsoft.com>
Co-authored-by: Beibin Li <BeibinLi@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>
Co-authored-by: Yishen Sun <freedeaths@FREEDEATHS-XPS>
Co-authored-by: freedeaths <register917@gmail.com>
2024-02-06 03:13:18 +00:00
olgavrou b1817ab5f6
Custom Model Client docs follow-up (#1545)
* custom model client docs followup

* fix function name in docs

* Update website/docs/Use-Cases/enhanced_inference.md

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

* Update website/docs/Use-Cases/enhanced_inference.md

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

* Update website/docs/Use-Cases/enhanced_inference.md

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

* Update website/docs/Use-Cases/enhanced_inference.md

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

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-05 16:48:23 +00:00
Jack Gerrits d999b452e8
Fix formatting of notebook contributing.md (#1540) 2024-02-05 15:29:25 +00:00
Jack Gerrits 38d03b0e63
Add notebooks section on website (#1495)
* Initial infrasctructure for notebooks page

* migrate two notebooks

* add readme notification for notebook dir

* override 'text' prism language to add basic syntactical structure to autogens output

* Rework to retain existing directory and not expose front matter to consumers of the notebook

* improve error handling of process notebooks

* format, ruff and type fixes

* undo changes to navbar

* update readme, CI

* whitespace

* spelling mistakes

* spelling

* Add contributing guide for notebooks

* update notebook

* formatting
2024-02-03 17:01:00 +00:00
olgavrou 00417edb5a
Custom Model Client support (#1345)
* add client interface, response protocol, and move code into openai client class

* add ability to register custom client

* tidy up code

* adding checks and errors, and more unit tests

* remove code

* fix error msg

* add use_docer False in notebook

* better error message

* add another example to custom model notebook

* rename and have register_client take model name too

* make Client protocol and remove inheritance

* renames

* update notebook

* add link

* rename and more error checking for registered agents

* adding message retrieval to client protocol for more flexible response

* fix failing openai test

* api_type req made model_client_cls requirement

* notebook cleanup and added blog

* remove raise error if client list is empty - client list will never be empty it will have placeholders

* rename Client -> ModelClient

* add forgotten file

* fix test by fetching internal client

* Update autogen/oai/client.py

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

* don't add retrieval function to cache

* added placeholder cllient class during initial client init, and rewrote registration

* fix spelling

* Update autogen/agentchat/conversable_agent.py

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

* type hints, small fixes, docstr comment

* fix api type checking

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-02-02 17:21:19 +00:00
Jack Gerrits 82e0a0c050
fix broken links from moving oai utils notebook (#1497) 2024-02-02 16:52:07 +00:00
Pierre Malarme 710862df9a
Fix image print for auto feedback from code notebook (#1389)
* Add .notebook folder to gitignore

* Add the import of display (IPython) and call it to display the chart

* Remove the update of .gitignore
2024-02-02 02:05:04 +00:00
Davor Runje a2d4b47503
Function calling upgrade (#1443)
* 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>
2024-01-31 15:30:55 +00:00
afourney 0107b52d5a
Adds a SocietyOfMindAgent that presents as a single agent, but runs GroupChat as an inner-monologue (#890)
* 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>
2024-01-31 00:01:40 +00:00
Jack Gerrits 276d5b7d31
docs: initial Jupyter support for website docs, move config notebook (#1448)
* docs: jupyter support for website docs, move config docs

* update devcontainer dockerfile, fix CI issues

* update bsed on working directory

* update TLDR

* install into temp

* remove unrelated change from diff

* fix spelling issue

* Update sidebars.js
2024-01-30 22:54:44 +00:00
Maxim Saplin 74a4d70a05
FAQ, working with LLM endpoints and explaining why config-list is a list (#1451)
* FAQ and notebook extended

* Update notebook/oai_openai_utils.ipynb

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

* Update website/docs/FAQ.md

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

* Update website/docs/FAQ.md

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

* Update website/docs/FAQ.md

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

* Update website/docs/FAQ.md

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

* Update FAQ.md

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-01-30 14:48:36 +00:00
Byron Xu fe7876d6ed
Add SQL agent and Spider environment (#1218)
* add SQL agent and Spider environment

* Make a notebook. Clean up environment.

* add SQL agent and Spider environment

* Make a notebook. Clean up environment.

* clarify that sql agent is for spider environment

* add link to notebook in docs

* Update doc.

---------

Co-authored-by: Wangda Zhang <wangdazhang@microsoft.com>
Co-authored-by: Beibin Li <BeibinLi@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-01-27 18:59:38 +00:00
Chi Wang fd0094ce51
bump version to 0.2.9 (#1430)
* Fixed rounding bug.

* bump version to 0.2.9

* fix format error

* simplify contrib tests

---------

Co-authored-by: Adam Fourney <adamfo@microsoft.com>
2024-01-27 18:49:24 +00:00
afourney 708eb4d884
Add a web surfer agent that can search and browse the web. (#1093)
* 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
2024-01-22 03:43:15 +00:00
olgavrou a911d1c2ec
set use_docker to default to True (#1147)
* 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
2024-01-18 17:03:49 +00:00
Eric Zhu 22e36cbb10
Support for Python 3.12 (#1317)
* support for Python 3.12

* add python 3.12 to workflows

* version string fix

* retrieval chat

* teachability

* workflow

* redistribute notebook tests

* fix incorrect notebook introduction

* update banner; remove unused imports; update openai workflow

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-01-18 07:15:06 +00:00
Brian Finney 73c75226b6
def _prepare_chat for groupchat manager to reset the groupchat (#1254)
* def _prepare_chat for groupchat manager to reset the groupchat

* typo

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

* typehint and simplify

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-01-18 03:39:04 +00:00
Yiran Wu acf81ac420
Add usage summary for agents (#1269)
* 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>
2024-01-17 01:55:29 +00:00
Chi Wang adbfb206dc
add workdir in test (#1274)
* add workdir in test

* catch filenotfound

* modify print msg
2024-01-16 03:26:18 +00:00
Brian Finney 63a35e79f8
run sync and async in async (#1242)
* 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>
2024-01-15 02:34:27 +00:00
Davor Runje 2e519b016a
Fix registration of async functions (#1201)
* 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>
2024-01-11 09:01:58 +00:00
Davor Runje 9e45e9fe48
Documentation: polish docs for tools calls (#1185)
* polish docs

* bug fixing
2024-01-09 22:45:34 +00:00
Davor Runje 1c4ae3d303
nbqa adedd to pre-commit, added black and ruff for notebooks (#1171)
* nbqa adedd to pre-commit, added black and ruff for notebooks

* polishing

* polishing

* polishing
2024-01-08 03:47:01 +00:00
Ricky Loynd 3680197f70
Teachability for any agent (#1091)
* Partial implementation

* Partial implementation

* Fixes

* update tests

* cleanup

* update tests

* comments

* logging

* wording

* underscore

* Extend notebook for teachable GPTAssistantAgent

* Notebook for teachable GPTAssistantAgents

* Update notebook

* Update notebook

* Update notebook

* Update notebook

* revert file

* Update blog post and other documentation.

* pre-commit

* Address reviewer feedback.

* Add new nb link to examples page.

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-01-07 19:59:42 +00:00
Davor Runje 8f065e06e4
Add codespell to pre-commit hooks and fix spelling of existing files (#1161)
* fixed spelling, minor errors and reformatted using black

* polishing

* added codespell to pre-commit hooks, fixed a number of spelling errors and a few minor bugs in the code

* update autogen library version in notebooks

* update autogen library version in notebooks

* update autogen library version in notebooks

* update autogen library version in notebooks

* update autogen library version in notebooks
2024-01-07 01:41:33 +00:00
Brian Finney 40dbf31a92
[Core] [Tool Call] adjust conversable agent to support tool_calls (#974)
* 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 645ba8b76a.

* 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>
2024-01-06 17:55:25 +00:00
Linxin Song e673500129
[AutoBuild] Supporting build agents from library; supporting generating agent descriptions (#1039)
* 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>
2024-01-06 17:23:23 +00:00
Maxim Saplin 3f343654bd
Let run tests directly via `python test_xyz.py`, fix for `conftest` import via `sys.path.append` (#1144)
* Runnig tests directly

* All tests with contrib add sys.path
2024-01-05 14:24:49 +00:00