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>
This commit is contained in:
Jack Gerrits
2024-02-14 12:00:55 -05:00
committed by GitHub
parent a8cf7e3cf8
commit a62b5c3b2d
7 changed files with 123 additions and 223 deletions

View File

@@ -24,16 +24,16 @@
"\n",
"In this notebook, we demonstrate how to use `AssistantAgent` and `UserProxyAgent` to make function calls with the new feature of OpenAI models (in model version 0613). A specified prompt and function configs must be passed to `AssistantAgent` to initialize the agent. The corresponding functions must be passed to `UserProxyAgent`, which will execute any function calls made by `AssistantAgent`. Besides this requirement of matching descriptions with functions, we recommend checking the system message in the `AssistantAgent` to ensure the instructions align with the function call descriptions.\n",
"\n",
"\\:\\:\\:info Requirements\n",
"\n",
"````{=mdx}\n",
":::info Requirements\n",
"Install `pyautogen`:\n",
"```bash\n",
"pip install pyautogen\n",
"```\n",
"\n",
"For more information, please refer to the [installation guide](/docs/installation/).\n",
"\n",
"\\:\\:\\:\n"
":::\n",
"````\n"
]
},
{
@@ -53,25 +53,18 @@
"config_list = autogen.config_list_from_json(env_or_file=\"OAI_CONFIG_LIST\")"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "92fde41f",
"metadata": {},
"source": [
"\\:\\:\\:tip\n",
"\n",
"Learn more about the various ways to configure LLM endpoints [here](/docs/llm_configuration).\n",
"\n",
"\\:\\:\\:"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "2b9526e7",
"metadata": {},
"source": [
"````{=mdx}\n",
":::tip\n",
"Learn more about configuring LLMs for agents [here](/docs/llm_configuration).\n",
":::\n",
"````\n",
"\n",
"## Making Async and Sync Function Calls\n",
"\n",
"In this example, we demonstrate function call execution with `AssistantAgent` and `UserProxyAgent`. With the default system prompt of `AssistantAgent`, we allow the LLM assistant to perform tasks with code, and the `UserProxyAgent` would extract code blocks from the LLM response and execute them. With the new \"function_call\" feature, we define functions and specify the description of the function in the OpenAI config for the `AssistantAgent`. Then we register the functions in `UserProxyAgent`."