Skip to content

Commit

Permalink
Merge branch 'main' into add-role-to-reflection-with-llm
Browse files Browse the repository at this point in the history
  • Loading branch information
sonichi authored May 4, 2024
2 parents bf32bf0 + 4711d7b commit 72a0e38
Show file tree
Hide file tree
Showing 12 changed files with 901 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lfs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
uses: actions/checkout@v4
with:
lfs: true
- name: Check Git LFS files for consistency
- name: "Check Git LFS files for consistency, if you see error like 'pointer: unexpectedGitObject ... should have been a pointer but was not', please install Git LFS locally, delete the problematic file, and then add it back again. This ensures it's properly tracked."
run: |
git lfs fsck
8 changes: 7 additions & 1 deletion autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@ def __init__(
)
# Take a copy to avoid modifying the given dict
if isinstance(llm_config, dict):
llm_config = copy.deepcopy(llm_config)
try:
llm_config = copy.deepcopy(llm_config)
except TypeError as e:
raise TypeError(
"Please implement __deepcopy__ method for each value class in llm_config to support deepcopy."
" Refer to the docs for more details: https://microsoft.github.io/autogen/docs/topics/llm_configuration#adding-http-client-in-llm_config-for-proxy"
) from e

self._validate_llm_config(llm_config)

Expand Down
37 changes: 31 additions & 6 deletions notebook/agentchat_oai_assistant_function_call.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Chat with OpenAI Assistant using function call in AutoGen: OSS Insights for Advanced GitHub Data Analysis\n",
"# Chat with OpenAI Assistant using function call in AutoGen: OSS Insights for Advanced GitHub Data Analysis\n",
"\n",
"This Jupyter Notebook demonstrates how to leverage OSS Insight (Open Source Software Insight) for advanced GitHub data analysis by defining `Function calls` in AutoGen for the OpenAI Assistant. \n",
"\n",
Expand All @@ -14,12 +14,19 @@
"2. Defining an OpenAI Assistant Agent in AutoGen\n",
"3. Fetching GitHub Insight Data using Function Call\n",
"\n",
"### Requirements\n",
"## Requirements\n",
"\n",
"AutoGen requires `Python>=3.8`. To run this notebook example, please install:\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",
"````"
]
},
{
Expand All @@ -36,7 +43,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Function Schema and Implementation\n",
"## Function Schema and Implementation\n",
"\n",
"This section provides the function schema definition and their implementation details. These functions are tailored to fetch and process data from GitHub, utilizing OSS Insight's capabilities."
]
Expand Down Expand Up @@ -101,7 +108,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Defining an OpenAI Assistant Agent in AutoGen\n",
"## Defining an OpenAI Assistant Agent in AutoGen\n",
"\n",
"Here, we explore how to define an OpenAI Assistant Agent within the AutoGen. This includes setting up the agent to make use of the previously defined function calls for data retrieval and analysis."
]
Expand Down Expand Up @@ -159,7 +166,18 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Fetching GitHub Insight Data using Function Call\n",
"````{=mdx}\n",
":::tip\n",
"Learn more about configuring LLMs for agents [here](/docs/topics/llm_configuration).\n",
":::\n",
"````\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Fetching GitHub Insight Data using Function Call\n",
"\n",
"This part of the notebook demonstrates the practical application of the defined functions and the OpenAI Assistant Agent in fetching and interpreting GitHub Insight data."
]
Expand Down Expand Up @@ -256,6 +274,13 @@
}
],
"metadata": {
"front_matter": {
"description": "This Jupyter Notebook demonstrates how to leverage OSS Insight (Open Source Software Insight) for advanced GitHub data analysis by defining `Function calls` in AutoGen for the OpenAI Assistant.",
"tags": [
"OpenAI Assistant",
"function call"
]
},
"kernelspec": {
"display_name": "autogen",
"language": "python",
Expand Down
36 changes: 21 additions & 15 deletions notebook/agentchat_oai_assistant_groupchat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@
"## Requirements\n",
"\n",
"AutoGen requires `Python>=3.8`. To run this notebook example, please install:\n",
"````{=mdx}\n",
":::info Requirements\n",
"Install `pyautogen`:\n",
"```bash\n",
"pip install \"pyautogen>=0.2.3\"\n",
"```"
"pip install pyautogen\n",
"```\n",
"\n",
"For more information, please refer to the [installation guide](/docs/installation/).\n",
":::\n",
"````"
]
},
{
Expand Down Expand Up @@ -50,19 +57,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"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).\n",
"\n",
"The config list looks like the following:\n",
"```python\n",
"config_list = [\n",
" {\n",
" \"model\": \"gpt-4\",\n",
" \"api_key\": \"<your OpenAI API key>\",\n",
" }, # OpenAI API endpoint for gpt-4\n",
"]\n",
"```\n",
"\n",
"Currently Azure OpenAI does not support assistant api. 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/website/docs/topics/llm_configuration.ipynb) for full code examples of the different methods."
"````{=mdx}\n",
":::tip\n",
"Learn more about configuring LLMs for agents [here](/docs/topics/llm_configuration).\n",
":::\n",
"````"
]
},
{
Expand Down Expand Up @@ -482,6 +481,13 @@
}
],
"metadata": {
"front_matter": {
"description": "This Jupyter Notebook demonstrates how to use the GPTAssistantAgent in AutoGen's group chat mode, enabling collaborative task performance through automated chat with agents powered by LLMs, tools, or humans.",
"tags": [
"OpenAI Assistant",
"group chat"
]
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand Down
34 changes: 20 additions & 14 deletions notebook/agentchat_oai_code_interpreter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@
"## Requirements\n",
"\n",
"AutoGen requires `Python>=3.8`. To run this notebook example, please install:\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",
"````"
]
},
{
Expand Down Expand Up @@ -52,19 +59,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"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).\n",
"\n",
"The config list looks like the following:\n",
"```python\n",
"config_list = [\n",
" {\n",
" \"model\": \"gpt-4\",\n",
" \"api_key\": \"<your OpenAI API key>\",\n",
" }, # OpenAI API endpoint for gpt-4\n",
"]\n",
"```\n",
"\n",
"Currently Azure OpenAi does not support assistant api. 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/website/docs/llm_endpoint_configuration.ipynb) for full code examples of the different methods."
"````{=mdx}\n",
":::tip\n",
"Learn more about configuring LLMs for agents [here](/docs/topics/llm_configuration).\n",
":::\n",
"````"
]
},
{
Expand Down Expand Up @@ -297,6 +296,13 @@
}
],
"metadata": {
"front_matter": {
"description": "This Jupyter Notebook showcases the integration of the Code Interpreter tool which executes Python code dynamically within applications.",
"tags": [
"OpenAI Assistant",
"code interpreter"
]
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand Down
Loading

0 comments on commit 72a0e38

Please sign in to comment.