Skip to content

Commit 8d2e64b

Browse files
authored
Merge branch 'main' into lmm
2 parents d4f04c0 + 306ac4d commit 8d2e64b

19 files changed

+256
-516
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ AutoGen is powered by collaborative [research studies](https://microsoft.github.
3838

3939
## Quickstart
4040
The easiest way to start playing is
41-
1. Click below to use the Github Codespace
41+
1. Click below to use the GitHub Codespace
4242

4343
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/autogen?quickstart=1)
4444

@@ -66,7 +66,7 @@ Find more options in [Installation](https://microsoft.github.io/autogen/docs/Ins
6666

6767
<!-- Each of the [`notebook examples`](https://github.com/microsoft/autogen/tree/main/notebook) may require a specific option to be installed. -->
6868

69-
For [code execution](https://microsoft.github.io/autogen/docs/FAQ/#code-execution), we strongly recommend installing the python docker package, and using docker.
69+
For [code execution](https://microsoft.github.io/autogen/docs/FAQ/#code-execution), we strongly recommend installing the Python docker package and using docker.
7070

7171
For LLM inference configurations, check the [FAQs](https://microsoft.github.io/autogen/docs/FAQ#set-your-api-endpoints).
7272

TRANSPARENCY_FAQS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AutoGen: Responsible AI FAQ
1+
# AutoGen: Responsible AI FAQs
22

33
## What is AutoGen?
44
AutoGen is a framework for simplifying the orchestration, optimization, and automation of LLM workflows. It offers customizable and conversable agents that leverage the strongest capabilities of the most advanced LLMs, like GPT-4, while addressing their limitations by integrating with humans and tools and having conversations between multiple agents via automated chat.

autogen/oai/client.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def __init__(self, *, config_list: List[Dict] = None, **base_config):
7070
if type(config_list) is list and len(config_list) == 0:
7171
logger.warning("openai client was provided with an empty config_list, which may not be intended.")
7272
if config_list:
73-
self._clients = [self._client(config, openai_config) for config in config_list]
73+
config_list = [config.copy() for config in config_list] # make a copy before modifying
74+
self._clients = [self._client(config, openai_config) for config in config_list] # could modify the config
7475
self._config_list = [
7576
{**extra_kwargs, **{k: v for k, v in config.items() if k not in self.openai_kwargs}}
7677
for config in config_list
@@ -108,9 +109,9 @@ def _process_for_azure(self, config: Dict, extra_kwargs: Dict, segment: str = "d
108109
base_url = config.get("base_url")
109110
if base_url is None:
110111
raise ValueError("to use azure openai api, base_url must be specified.")
111-
suffix = f"openai/deployments/{model}"
112+
suffix = f"/openai/deployments/{model}"
112113
if not base_url.endswith(suffix):
113-
config["base_url"] += suffix
114+
config["base_url"] += suffix[1:] if base_url.endswith("/") else suffix
114115

115116
def _separate_openai_config(self, config):
116117
"""Separate the config into openai_config and extra_kwargs."""

autogen/oai/openai_utils.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -83,26 +83,26 @@ def config_list_openai_aoai(
8383
os.environ["OPENAI_API_KEY"] = key_file.read().strip()
8484
except FileNotFoundError:
8585
logging.info(
86-
"To use OpenAI API, please set OPENAI_API_KEY in os.environ "
87-
"or create key_openai.txt in the specified path, or specify the api_key in config_list."
86+
"OPENAI_API_KEY is not found in os.environ "
87+
"and key_openai.txt is not found in the specified path. You can specify the api_key in the config_list."
8888
)
8989
if "AZURE_OPENAI_API_KEY" not in os.environ and exclude != "aoai":
9090
try:
9191
with open(f"{key_file_path}/{aoai_api_key_file}") as key_file:
9292
os.environ["AZURE_OPENAI_API_KEY"] = key_file.read().strip()
9393
except FileNotFoundError:
9494
logging.info(
95-
"To use Azure OpenAI API, please set AZURE_OPENAI_API_KEY in os.environ "
96-
"or create key_aoai.txt in the specified path, or specify the api_key in config_list."
95+
"AZURE_OPENAI_API_KEY is not found in os.environ "
96+
"and key_aoai.txt is not found in the specified path. You can specify the api_key in the config_list."
9797
)
9898
if "AZURE_OPENAI_API_BASE" not in os.environ and exclude != "aoai":
9999
try:
100100
with open(f"{key_file_path}/{aoai_api_base_file}") as key_file:
101101
os.environ["AZURE_OPENAI_API_BASE"] = key_file.read().strip()
102102
except FileNotFoundError:
103103
logging.info(
104-
"To use Azure OpenAI API, please set AZURE_OPENAI_API_BASE in os.environ "
105-
"or create base_aoai.txt in the specified path, or specify the api_base in config_list."
104+
"AZURE_OPENAI_API_BASE is not found in os.environ "
105+
"and base_aoai.txt is not found in the specified path. You can specify the base_url in the config_list."
106106
)
107107
aoai_config = (
108108
get_config_list(
@@ -111,7 +111,7 @@ def config_list_openai_aoai(
111111
# Assuming Azure OpenAI api bases in os.environ["AZURE_OPENAI_API_BASE"], in separated lines
112112
base_urls=os.environ.get("AZURE_OPENAI_API_BASE", "").split("\n"),
113113
api_type="azure",
114-
api_version="2023-07-01-preview", # change if necessary
114+
api_version="2023-08-01-preview", # change if necessary
115115
)
116116
if exclude != "aoai"
117117
else []

autogen/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.2.0b1"
1+
__version__ = "0.2.0b2"

notebook/agentchat_auto_feedback_from_code_execution.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"outputs": [],
4747
"source": [
48-
"# %pip install pyautogen~=0.1.0"
48+
"# %pip install pyautogen~=0.2.0b2"
4949
]
5050
},
5151
{
@@ -105,9 +105,7 @@
105105
"]\n",
106106
"```\n",
107107
"\n",
108-
"If you open this notebook in colab, you can upload your files by clicking the file icon on the left panel and then choose \"upload file\" icon.\n",
109-
"\n",
110-
"You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file."
108+
"You can set the value of config_list in any way you prefer. Please refer to this [notebook](https://github.com/microsoft/autogen/blob/main/notebook/oai_openai_utils.ipynb) for full code examples of the different methods."
111109
]
112110
},
113111
{

notebook/agentchat_chess.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"outputs": [],
3636
"source": [
3737
"%%capture --no-stderr\n",
38-
"# %pip install pyautogen~=0.1.0\n",
38+
"# %pip install \"pyautogen~=0.2.0b2\"\n",
3939
"%pip install chess -U"
4040
]
4141
},
@@ -119,9 +119,7 @@
119119
"]\n",
120120
"```\n",
121121
"\n",
122-
"If you open this notebook in colab, you can upload your files by clicking the file icon on the left panel and then choosing \"upload file\" icon.\n",
123-
"\n",
124-
"You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file."
122+
"You can set the value of config_list in any way you prefer. Please refer to this [notebook](https://github.com/microsoft/autogen/blob/main/notebook/oai_openai_utils.ipynb) for full code examples of the different methods."
125123
]
126124
},
127125
{

notebook/agentchat_function_call.ipynb

+36-193
Large diffs are not rendered by default.

notebook/agentchat_groupchat.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"outputs": [],
3636
"source": [
3737
"%%capture --no-stderr\n",
38-
"# %pip install pyautogen~=0.1.0"
38+
"# %pip install pyautogen~=0.2.0b2"
3939
]
4040
},
4141
{
@@ -107,9 +107,7 @@
107107
"]\n",
108108
"```\n",
109109
"\n",
110-
"If you open this notebook in colab, you can upload your files by clicking the file icon on the left panel and then choose \"upload file\" icon.\n",
111-
"\n",
112-
"You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file."
110+
"You can set the value of config_list in any way you prefer. Please refer to this [notebook](https://github.com/microsoft/autogen/blob/main/notebook/oai_openai_utils.ipynb) for full code examples of the different methods."
113111
]
114112
},
115113
{

notebook/agentchat_groupchat_RAG.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,13 @@
9191
" \"model\": \"gpt-35-turbo-0631\", # 0631 or newer is needed to use functions\n",
9292
" \"base_url\": \"<your Azure OpenAI API base>\", \n",
9393
" \"api_type\": \"azure\", \n",
94-
" \"api_version\": \"2023-07-01-preview\", # 2023-07-01-preview or newer is needed to use functions\n",
94+
" \"api_version\": \"2023-08-01-preview\", # 2023-07-01-preview or newer is needed to use functions\n",
9595
" \"api_key\": \"<your Azure OpenAI API key>\"\n",
9696
" }\n",
9797
"]\n",
9898
"```\n",
9999
"\n",
100-
"If you open this notebook in colab, you can upload your files by clicking the file icon on the left panel and then choose \"upload file\" icon.\n",
101-
"\n",
102-
"You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file."
100+
"You can set the value of config_list in any way you prefer. Please refer to this [notebook](https://github.com/microsoft/autogen/blob/main/notebook/oai_openai_utils.ipynb) for full code examples of the different methods."
103101
]
104102
},
105103
{
@@ -424,6 +422,7 @@
424422
]
425423
},
426424
{
425+
"attachments": {},
427426
"cell_type": "markdown",
428427
"metadata": {},
429428
"source": [
@@ -1087,6 +1086,7 @@
10871086
]
10881087
},
10891088
{
1089+
"attachments": {},
10901090
"cell_type": "markdown",
10911091
"metadata": {},
10921092
"source": [

notebook/agentchat_groupchat_research.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"outputs": [],
3434
"source": [
3535
"%%capture --no-stderr\n",
36-
"# %pip install pyautogen~=0.1.0"
36+
"# %pip install pyautogen~=0.2.0b2"
3737
]
3838
},
3939
{
@@ -93,9 +93,7 @@
9393
"]\n",
9494
"```\n",
9595
"\n",
96-
"If you open this notebook in colab, you can upload your files by clicking the file icon on the left panel and then choosing \"upload file\" icon.\n",
97-
"\n",
98-
"You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file."
96+
"You can set the value of config_list in any way you prefer. Please refer to this [notebook](https://github.com/microsoft/autogen/blob/main/notebook/oai_openai_utils.ipynb) for full code examples of the different methods."
9997
]
10098
},
10199
{

notebook/agentchat_groupchat_vis.ipynb

+6-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"outputs": [],
3434
"source": [
3535
"%%capture --no-stderr\n",
36-
"# %pip install pyautogen~=0.1.0"
36+
"# %pip install pyautogen~=0.2.0b2"
3737
]
3838
},
3939
{
@@ -93,21 +93,19 @@
9393
" 'api_key': '<your Azure OpenAI API key here>',\n",
9494
" 'base_url': '<your Azure OpenAI API base here>',\n",
9595
" 'api_type': 'azure',\n",
96-
" 'api_version': '2023-06-01-preview',\n",
96+
" 'api_version': '2023-08-01-preview',\n",
9797
" },\n",
9898
" {\n",
9999
" 'model': 'gpt-4-32k',\n",
100100
" 'api_key': '<your Azure OpenAI API key here>',\n",
101101
" 'base_url': '<your Azure OpenAI API base here>',\n",
102102
" 'api_type': 'azure',\n",
103-
" 'api_version': '2023-06-01-preview',\n",
103+
" 'api_version': '2023-08-01-preview',\n",
104104
" },\n",
105105
"]\n",
106106
"```\n",
107107
"\n",
108-
"If you open this notebook in colab, you can upload your files by clicking the file icon on the left panel and then choose \"upload file\" icon.\n",
109-
"\n",
110-
"You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file."
108+
"You can set the value of config_list in any way you prefer. Please refer to this [notebook](https://github.com/microsoft/autogen/blob/main/notebook/oai_openai_utils.ipynb) for full code examples of the different methods."
111109
]
112110
},
113111
{
@@ -119,6 +117,7 @@
119117
]
120118
},
121119
{
120+
"attachments": {},
122121
"cell_type": "markdown",
123122
"metadata": {},
124123
"source": [
@@ -1038,7 +1037,7 @@
10381037
"name": "python",
10391038
"nbconvert_exporter": "python",
10401039
"pygments_lexer": "ipython3",
1041-
"version": "3.10.12"
1040+
"version": "3.11.4"
10421041
},
10431042
"orig_nbformat": 4
10441043
},

notebook/agentchat_human_feedback.ipynb

+13-33
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"outputs": [],
4747
"source": [
48-
"# %pip install pyautogen~=0.1.0"
48+
"# %pip install pyautogen~=0.2.0b2"
4949
]
5050
},
5151
{
@@ -74,53 +74,33 @@
7474
"cell_type": "markdown",
7575
"metadata": {},
7676
"source": [
77-
"It first looks for environment variable \"OAI_CONFIG_LIST\" which needs to be a valid json string. If that variable is not found, it then looks for a json file named \"OAI_CONFIG_LIST\".\n",
77+
"It first looks for environment variable \"OAI_CONFIG_LIST\" which needs to be a valid json string. If that variable is not found, it then looks for a json file named \"OAI_CONFIG_LIST\". It filters the configs by models (you can filter by other keys as well). Only the models with matching names are kept in the list based on the filter condition.\n",
7878
"\n",
7979
"The config list looks like the following:\n",
8080
"```python\n",
8181
"config_list = [\n",
8282
" {\n",
8383
" 'model': 'gpt-4',\n",
8484
" 'api_key': '<your OpenAI API key here>',\n",
85-
" }, # OpenAI API endpoint for gpt-4\n",
86-
" {\n",
87-
" 'model': 'gpt-4',\n",
88-
" 'api_key': '<your first Azure OpenAI API key here>',\n",
89-
" 'base_url': '<your first Azure OpenAI API base here>',\n",
90-
" 'api_type': 'azure',\n",
91-
" 'api_version': '2023-06-01-preview',\n",
92-
" }, # Azure OpenAI API endpoint for gpt-4\n",
93-
" {\n",
94-
" 'model': 'gpt-4',\n",
95-
" 'api_key': '<your second Azure OpenAI API key here>',\n",
96-
" 'base_url': '<your second Azure OpenAI API base here>',\n",
97-
" 'api_type': 'azure',\n",
98-
" 'api_version': '2023-06-01-preview',\n",
99-
" }, # another Azure OpenAI API endpoint for gpt-4\n",
85+
" },\n",
10086
" {\n",
10187
" 'model': 'gpt-3.5-turbo',\n",
102-
" 'api_key': '<your OpenAI API key here>',\n",
103-
" }, # OpenAI API endpoint for gpt-3.5-turbo\n",
104-
" {\n",
105-
" 'model': 'gpt-3.5-turbo',\n",
106-
" 'api_key': '<your first Azure OpenAI API key here>',\n",
107-
" 'base_url': '<your first Azure OpenAI API base here>',\n",
88+
" 'api_key': '<your Azure OpenAI API key here>',\n",
89+
" 'base_url': '<your Azure OpenAI API base here>',\n",
10890
" 'api_type': 'azure',\n",
109-
" 'api_version': '2023-06-01-preview',\n",
110-
" }, # Azure OpenAI API endpoint for gpt-3.5-turbo\n",
91+
" 'api_version': '2023-08-01-preview',\n",
92+
" },\n",
11193
" {\n",
112-
" 'model': 'gpt-3.5-turbo',\n",
113-
" 'api_key': '<your second Azure OpenAI API key here>',\n",
114-
" 'base_url': '<your second Azure OpenAI API base here>',\n",
94+
" 'model': 'gpt-3.5-turbo-16k',\n",
95+
" 'api_key': '<your Azure OpenAI API key here>',\n",
96+
" 'base_url': '<your Azure OpenAI API base here>',\n",
11597
" 'api_type': 'azure',\n",
116-
" 'api_version': '2023-06-01-preview',\n",
117-
" }, # another Azure OpenAI API endpoint for gpt-3.5-turbo\n",
98+
" 'api_version': '2023-08-01-preview',\n",
99+
" },\n",
118100
"]\n",
119101
"```\n",
120102
"\n",
121-
"If you open this notebook in colab, you can upload your files by clicking the file icon on the left panel and then choosing \"upload file\" icon.\n",
122-
"\n",
123-
"You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file."
103+
"You can set the value of config_list in any way you prefer. Please refer to this [notebook](https://github.com/microsoft/autogen/blob/main/notebook/oai_openai_utils.ipynb) for full code examples of the different methods."
124104
]
125105
},
126106
{

0 commit comments

Comments
 (0)