"# Auto Generated Agent Chat: Group Chat with GPTAssistantAgent\n",
"\n",
"AutoGen offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n",
"Please find documentation about this feature [here](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat).\n",
"\n",
"In this notebook, we demonstrate how to get multiple `GPTAssistantAgent` converse through group chat.\n",
"\n",
"## Requirements\n",
"\n",
"AutoGen requires `Python>=3.8`. To run this notebook example, please install:\n",
"The [`config_list_from_json`](https://microsoft.github.io/autogen/docs/reference/oai/openai_utils#config_list_from_json) function loads a list of configurations from an environment variable or a json file."
" }, # Please set use_docker=True if docker is available to run the generated code. Using docker is safer than running the generated code directly.\n",
"Get the number of issues and pull requests for the repository 'microsoft/autogen' over the past three weeks and offer analyzes to the data. You should print the data in csv format grouped by weeks.\n",
"To gather the number of issues and pull requests for the repository 'microsoft/autogen' over the past three weeks and to offer an analysis of the data, we'll need to modify the previous script.\n",
"\n",
"We will enhance the script to gather data from the past three weeks, separated by each week, and then output the data in CSV format, grouped by the week during which the issues and pull requests were created. This will require us to make multiple API calls for each week and aggregate the data accordingly.\n",
"\n",
"I will provide you a python script to execute.\n",
"\n",
"```python\n",
"# filename: github_data_weekly_analyzer.py\n",
"import requests\n",
"from datetime import datetime, timedelta\n",
"import csv\n",
"\n",
"# Constants to define the GitHub repository and the API URLs\n",
"Please save this code as `github_data_weekly_analyzer.py` and run it. The script will output the number of issues and pull requests for the repository 'microsoft/autogen' over the past three weeks, grouped by week in CSV format.\n",
"\n",
"If there are any issues or errors during the execution of this script, please let me know the exact error message, and I will assist you in resolving it.\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...\u001b[0m\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"execute_code was called without specifying a value for use_docker. Since the python docker package is not available, code will be run natively. Note: this fallback behavior is subject to change\n"
"It looks like I forgot to import `sys` module which is necessary for writing output to stdout using the `csv.writer`. I will fix the code by adding the import statement for the `sys` module at the beginning of the script. Please run the updated script below:\n",
"\n",
"```python\n",
"# filename: github_data_weekly_analyzer.py\n",
"import requests\n",
"from datetime import datetime, timedelta\n",
"import csv\n",
"import sys\n",
"\n",
"# Constants to define the GitHub repository and the API URLs\n",
"Once again, please save this code as `github_data_weekly_analyzer.py` and run it. The script should produce the intended CSV output. If you run into any more issues, let me know, and I will provide further assistance.\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...\u001b[0m\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"execute_code was called without specifying a value for use_docker. Since the python docker package is not available, code will be run natively. Note: this fallback behavior is subject to change\n"
"The script executed successfully and provided the following data output in CSV format for the past three weeks:\n",
"\n",
"```\n",
"week,issue_count,pull_request_count\n",
"46,11,10\n",
"45,40,30\n",
"44,9,26\n",
"```\n",
"\n",
"Week numbers are based on the `%U` directive of `strftime`, which considers week 00 as the first week of the year with a Sunday in it.\n",
"\n",
"Here's the analysis by week:\n",
"\n",
"- Week 46: There were 11 issues and 10 pull requests. This suggests a balanced amount of reported issues and new code contributions. The relatively close numbers might indicate that the repository sees simultaneous reporting of issues and active development.\n",
" \n",
"- Week 45: This week shows significantly more activity than the other two, with 40 issues and 30 pull requests being recorded. This could be a result of a coordinated milestone or sprint ending, where a large set of changes were made, and corresponding issues either surfaced or were also worked on.\n",
" \n",
"- Week 44: The activity dropped to 9 issues and 26 pull requests. While the number of issues decreased, the number of pull requests remained substantial. This may imply a continuation of effort to address the issues raised in the busier previous week or ongoing development work.\n",
"\n",
"The overall impression over the past three weeks is that the `microsoft/autogen` repository is actively maintained and developed, with varying levels of activity that could be associated with the development cycle or external events impacting the project.\n",
"\n",
"Please note that the numbers may be overlapping because the GitHub API will include issues and pull requests updated within the date range, which could increase the count if the items are updated but not necessarily created within that range.\n",
"\n",
"It's also important to consider that the collected data might not fully represent what happened in each week if there are items created before Week 44 that were updated during the weeks considered. For a more accurate approach, we would need to consider only issues and pull requests created within each week specifically, which would require additional filtering based on the `created_at` attribute.\n",
"\n",
"If more in-depth analysis or longer trends are needed, additional data over a more extended period would be recommended, along with information about the nature of the issues and pull requests (e.g., what kind of issues are most common, how quickly they're closed, how often pull requests are merged, etc.).\n",
" message=\"Get the number of issues and pull requests for the repository 'microsoft/autogen' over the past three weeks and offer analysis to the data. You should print the data in csv format grouped by weeks.\",\n",
"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.",