2023-06-09 11:40:04 -07:00
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
2023-07-28 21:17:51 -07:00
"<a href=\"https://colab.research.google.com/github/microsoft/FLAML/blob/main/notebook/autogen_agentchat_web_info.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
2023-06-09 11:40:04 -07:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
2023-07-28 21:17:51 -07:00
"# Auto Generated Agent Chat: Solving Tasks Requiring Web Info\n",
2023-06-09 11:40:04 -07:00
"\n",
2023-08-14 00:09:45 -07:00
"`flaml.autogen` offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framwork allows tool use and human participance through multi-agent conversation.\n",
"Please find documentation about this feature [here](https://microsoft.github.io/FLAML/docs/Use-Cases/Autogen#agents).\n",
2023-06-09 11:40:04 -07:00
"\n",
2023-07-10 09:07:48 -07:00
"In this notebook, we demonstrate how to use `AssistantAgent` and `UserProxyAgent` to perform tasks which require acquiring info from the web:\n",
"* discuss a paper based on its URL.\n",
"* discuss about stock market.\n",
"\n",
2023-07-28 21:17:51 -07:00
"Here `AssistantAgent` is an LLM-based agent that can write Python code (in a Python coding block) for a user to execute for a given task. `UserProxyAgent` is an agent which serves as a proxy for a user to execute the code written by `AssistantAgent`. By setting `human_input_mode` properly, the `UserProxyAgent` can also prompt the user for feedback to `AssistantAgent`. For example, when `human_input_mode` is set to \"TERMINATE\", the `UserProxyAgent` will execute the code written by `AssistantAgent` directly and return the execution results (success or failure and corresponding outputs) to `AssistantAgent`, and prompt the user for feedback when the task is finished. When user feedback is provided, the `UserProxyAgent` will directly pass the feedback to `AssistantAgent`.\n",
2023-06-09 11:40:04 -07:00
"\n",
"## Requirements\n",
"\n",
2023-07-31 19:22:30 -07:00
"FLAML requires `Python>=3.8`. To run this notebook example, please install flaml with the [autogen] option and docker:\n",
2023-06-09 11:40:04 -07:00
"```bash\n",
"pip install flaml[autogen]\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2023-02-13T23:40:52.317406Z",
"iopub.status.busy": "2023-02-13T23:40:52.316561Z",
"iopub.status.idle": "2023-02-13T23:40:52.321193Z",
"shell.execute_reply": "2023-02-13T23:40:52.320628Z"
}
},
"outputs": [],
"source": [
2023-08-27 15:16:52 -07:00
"# %pip install flaml[autogen]~=2.0.1 docker"
2023-06-09 11:40:04 -07:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set your API Endpoint\n",
"\n",
2023-07-23 06:23:09 -07:00
"The [`config_list_from_json`](https://microsoft.github.io/FLAML/docs/reference/autogen/oai/openai_utils#config_list_from_json) function loads a list of configurations from an environment variable or a json file.\n"
2023-06-09 11:40:04 -07:00
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
2023-07-31 19:22:30 -07:00
"from flaml import autogen\n",
2023-06-09 11:40:04 -07:00
"\n",
2023-07-31 19:22:30 -07:00
"config_list = autogen.config_list_from_json(\n",
2023-07-23 06:23:09 -07:00
" \"OAI_CONFIG_LIST\",\n",
" filter_dict={\n",
2023-08-14 00:09:45 -07:00
" \"model\": [\"gpt4\", \"gpt-4-32k\", \"gpt-4-32k-0314\", \"gpt-4-32k-v0314\"],\n",
2023-07-23 06:23:09 -07:00
" },\n",
2023-07-31 19:22:30 -07:00
")\n",
"\n",
"llm_config={\n",
" \"request_timeout\": 600,\n",
" \"seed\": 42,\n",
" \"config_list\": config_list,\n",
" \"temperature\": 0,\n",
"}"
2023-07-23 06:23:09 -07:00
]
},
{
"attachments": {},
"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). Only the models with matching names are kept in the list based on the filter condition.\n",
"\n",
"The config list looks like the following:\n",
"```python\n",
"config_list = [\n",
" {\n",
" 'model': 'gpt-4-32k',\n",
" 'api_key': '<your OpenAI API key here>',\n",
" },\n",
" {\n",
" 'model': 'gpt4',\n",
" 'api_key': '<your Azure OpenAI API key here>',\n",
" 'api_base': '<your Azure OpenAI API base here>',\n",
" 'api_type': 'azure',\n",
" 'api_version': '2023-06-01-preview',\n",
" },\n",
" {\n",
" 'model': 'gpt-4-32k-0314',\n",
" 'api_key': '<your Azure OpenAI API key here>',\n",
" 'api_base': '<your Azure OpenAI API base here>',\n",
" 'api_type': 'azure',\n",
" 'api_version': '2023-06-01-preview',\n",
" },\n",
"]\n",
"```\n",
"\n",
"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",
"\n",
"You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file."
2023-06-09 11:40:04 -07:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Construct Agents\n",
"\n",
2023-07-28 21:17:51 -07:00
"We construct the assistant agent and the user proxy agent. We specify `human_input_mode` as \"TERMINATE\" in the user proxy agent, which will ask for human feedback when it receives a \"TERMINATE\" signal from the assistant agent."
2023-06-09 11:40:04 -07:00
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# create an AssistantAgent instance named \"assistant\"\n",
2023-07-31 19:22:30 -07:00
"assistant = autogen.AssistantAgent(\n",
2023-06-09 11:40:04 -07:00
" name=\"assistant\",\n",
2023-07-31 19:22:30 -07:00
" llm_config=llm_config,\n",
2023-06-09 11:40:04 -07:00
")\n",
2023-07-28 21:17:51 -07:00
"# create a UserProxyAgent instance named \"user_proxy\"\n",
2023-07-31 19:22:30 -07:00
"user_proxy = autogen.UserProxyAgent(\n",
2023-07-28 21:17:51 -07:00
" name=\"user_proxy\",\n",
2023-06-09 11:40:04 -07:00
" human_input_mode=\"TERMINATE\",\n",
" max_consecutive_auto_reply=10,\n",
2023-07-06 06:08:44 +08:00
" is_termination_msg=lambda x: x.get(\"content\", \"\").rstrip().endswith(\"TERMINATE\"),\n",
2023-07-23 06:23:09 -07:00
" code_execution_config={\"work_dir\": \"web\"},\n",
2023-07-31 19:22:30 -07:00
" llm_config=llm_config,\n",
" system_message=\"\"\"Reply TERMINATE if the task has been solved at full satisfaction.\n",
"Otherwise, reply CONTINUE, or the reason why the task is not solved yet.\"\"\"\n",
2023-06-09 11:40:04 -07:00
")"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
2023-07-10 09:07:48 -07:00
"## Example Task: Paper Talk from URL\n",
2023-06-09 11:40:04 -07:00
"\n",
2023-07-23 06:23:09 -07:00
"We invoke the `initiate_chat()` method of the user proxy agent to start the conversation. When you run the cell below, you will be prompted to provide feedback after the assistant agent sends a \"TERMINATE\" signal in the end of the message. If you don't provide any feedback (by pressing Enter directly), the conversation will finish. Before the \"TERMINATE\" signal, the user proxy agent will try to execute the code suggested by the assistant agent on behalf of the user."
2023-06-09 11:40:04 -07:00
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2023-07-31 19:22:30 -07:00
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
2023-06-09 11:40:04 -07:00
"\n",
"\n",
2023-07-08 22:25:43 -07:00
"Who should read this paper: https://arxiv.org/abs/2306.01337\n",
2023-06-09 11:40:04 -07:00
"\n",
"\n",
2023-07-08 22:25:43 -07:00
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
2023-07-08 22:25:43 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"To determine who should read this paper, I will first fetch the abstract and analyze its content. Then, I will provide a summary and suggest the target audience based on the paper's topic and focus.\n",
"\n",
"Please execute the following Python code to fetch the abstract:\n",
2023-06-09 11:40:04 -07:00
"\n",
"```python\n",
"import requests\n",
"from bs4 import BeautifulSoup\n",
"\n",
"url = \"https://arxiv.org/abs/2306.01337\"\n",
2023-07-08 22:25:43 -07:00
"response = requests.get(url)\n",
"soup = BeautifulSoup(response.text, \"html.parser\")\n",
"abstract = soup.find(\"blockquote\", {\"class\": \"abstract\"}).text.strip()\n",
2023-07-14 15:52:45 -07:00
"print(abstract)\n",
2023-07-08 22:25:43 -07:00
"```\n",
2023-08-27 15:16:52 -07:00
"After you provide the abstract, I will analyze it and suggest the target audience.\n",
2023-06-09 11:40:04 -07:00
"\n",
2023-07-08 22:25:43 -07:00
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[31m\n",
2023-08-27 15:16:52 -07:00
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...\u001b[0m\n",
2023-07-31 19:22:30 -07:00
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
2023-07-08 22:25:43 -07:00
"\n",
2023-06-09 11:40:04 -07:00
"exitcode: 0 (execution succeeded)\n",
"Code output: \n",
2023-07-14 15:52:45 -07:00
"Abstract: Employing Large Language Models (LLMs) to address mathematical problems is an\n",
2023-06-09 11:40:04 -07:00
"intriguing research endeavor, considering the abundance of math problems\n",
"expressed in natural language across numerous science and engineering fields.\n",
"While several prior works have investigated solving elementary mathematics\n",
"using LLMs, this work explores the frontier of using GPT-4 for solving more\n",
"complex and challenging math problems. We evaluate various ways of using GPT-4.\n",
2023-07-08 22:25:43 -07:00
"Some of them are adapted from existing work, and one is MathChat, a\n",
2023-06-09 11:40:04 -07:00
"conversational problem-solving framework newly proposed in this work. We\n",
"perform the evaluation on difficult high school competition problems from the\n",
"MATH dataset, which shows the advantage of the proposed conversational\n",
"approach.\n",
"\n",
"\n",
2023-07-08 22:25:43 -07:00
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
2023-06-09 11:40:04 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"Based on the abstract, this paper discusses the use of Large Language Models (LLMs), specifically GPT-4, for solving complex and challenging math problems. The authors propose a conversational problem-solving framework called MathChat and evaluate its performance on difficult high school competition problems from the MATH dataset.\n",
2023-07-14 15:52:45 -07:00
"\n",
"The target audience for this paper includes:\n",
2023-07-08 22:25:43 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"1. Researchers and practitioners in the field of artificial intelligence, particularly those working with large language models like GPT-4.\n",
2023-07-28 21:17:51 -07:00
"2. Mathematicians and educators interested in the application of AI for solving complex mathematical problems.\n",
2023-08-27 15:16:52 -07:00
"3. Developers and engineers working on natural language processing and conversational AI systems for problem-solving tasks.\n",
2023-06-09 11:40:04 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"If you belong to any of these groups or have an interest in the intersection of AI and mathematics, this paper would be relevant to you.\n",
"\n",
"TERMINATE\n",
2023-06-09 11:40:04 -07:00
"\n",
2023-07-31 19:22:30 -07:00
"--------------------------------------------------------------------------------\n",
"\u001b[31m\n",
">>>>>>>> NO HUMAN INPUT RECEIVED.\u001b[0m\n"
2023-06-09 11:40:04 -07:00
]
}
],
"source": [
"# the assistant receives a message from the user, which contains the task description\n",
2023-07-28 21:17:51 -07:00
"user_proxy.initiate_chat(\n",
2023-07-23 06:23:09 -07:00
" assistant,\n",
" message=\"\"\"\n",
2023-06-09 11:40:04 -07:00
"Who should read this paper: https://arxiv.org/abs/2306.01337\n",
"\"\"\",\n",
")"
]
2023-07-10 09:07:48 -07:00
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example Task: Chat about Stock Market"
]
},
{
"cell_type": "code",
2023-07-28 21:17:51 -07:00
"execution_count": 5,
2023-07-10 09:07:48 -07:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2023-07-31 19:22:30 -07:00
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-07-14 15:52:45 -07:00
"Show me the YTD gain of 10 largest technology companies as of today.\n",
2023-07-10 09:07:48 -07:00
"\n",
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"To get the YTD gain of the 10 largest technology companies, we will first need to fetch the list of these companies and their stock symbols. Then, we will use a financial API to get the YTD gain for each company. Here's the plan:\n",
"\n",
"1. Use Python to scrape the list of the 10 largest technology companies and their stock symbols from a reliable source.\n",
"2. Use a financial API to fetch the YTD gain for each company.\n",
"3. Print the YTD gain for each company.\n",
"\n",
"First, let's fetch the list of the 10 largest technology companies and their stock symbols. We will use the BeautifulSoup library to scrape the data from a webpage. Please make sure you have the 'beautifulsoup4' and 'requests' packages installed. If not, you can install them using the following command:\n",
"\n",
"```sh\n",
"pip install beautifulsoup4 requests\n",
"```\n",
"\n",
"Now, execute the following Python code to fetch the list of the 10 largest technology companies and their stock symbols:\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-07-14 15:52:45 -07:00
"```python\n",
"import requests\n",
2023-07-28 21:17:51 -07:00
"from bs4 import BeautifulSoup\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"url = \"https://www.investopedia.com/top-10-technology-stocks-4582443\"\n",
"response = requests.get(url)\n",
"soup = BeautifulSoup(response.text, \"html.parser\")\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"company_symbols = []\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"for symbol in soup.find_all(\"strong\"):\n",
" if symbol.text.startswith(\"NASDAQ:\") or symbol.text.startswith(\"NYSE:\"):\n",
" company_symbols.append(symbol.text.split(\":\")[1].strip())\n",
2023-07-28 21:17:51 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"print(\"The 10 largest technology companies and their stock symbols are:\")\n",
"for symbol in company_symbols:\n",
" print(symbol)\n",
2023-07-10 09:07:48 -07:00
"```\n",
"\n",
2023-08-27 15:16:52 -07:00
"After you have the list of stock symbols, I will provide the code to fetch the YTD gain for each company.\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-07-14 15:52:45 -07:00
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
2023-08-27 15:16:52 -07:00
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is sh)...\u001b[0m\n",
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 1 (inferred language is python)...\u001b[0m\n",
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
"\n",
"exitcode: 0 (execution succeeded)\n",
"Code output: \n",
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: beautifulsoup4 in /home/vscode/.local/lib/python3.9/site-packages (4.12.2)\n",
"Requirement already satisfied: requests in /usr/local/lib/python3.9/site-packages (2.31.0)\n",
"Requirement already satisfied: soupsieve>1.2 in /home/vscode/.local/lib/python3.9/site-packages (from beautifulsoup4) (2.4.1)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.9/site-packages (from requests) (3.2.0)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.9/site-packages (from requests) (2.0.3)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests) (2023.5.7)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests) (3.4)\n",
"\n",
"The 10 largest technology companies and their stock symbols are:\n",
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
"\n",
"It seems the code didn't output the stock symbols as expected. I apologize for the confusion. I will try a different approach to fetch the stock symbols.\n",
"\n",
"Please execute the following Python code to fetch the list of the 10 largest technology companies and their stock symbols:\n",
"\n",
"```python\n",
"import requests\n",
"from bs4 import BeautifulSoup\n",
"\n",
"url = \"https://www.suredividend.com/top-10-technology-stocks/\"\n",
"response = requests.get(url)\n",
"soup = BeautifulSoup(response.text, \"html.parser\")\n",
"\n",
"company_symbols = []\n",
"\n",
"for symbol in soup.find_all(\"a\"):\n",
" if symbol.get(\"href\") and \"https://www.marketbeat.com/stocks/\" in symbol.get(\"href\"):\n",
" company_symbols.append(symbol.text.strip())\n",
"\n",
"print(\"The 10 largest technology companies and their stock symbols are:\")\n",
"for symbol in company_symbols:\n",
" print(symbol)\n",
"```\n",
"\n",
"After you have the list of stock symbols, I will provide the code to fetch the YTD gain for each company.\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...\u001b[0m\n",
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
"\n",
"exitcode: 0 (execution succeeded)\n",
"Code output: \n",
"The 10 largest technology companies and their stock symbols are:\n",
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
"\n",
"I apologize for the confusion again. It seems the code still didn't output the stock symbols as expected. I will try another approach to fetch the stock symbols.\n",
"\n",
"Please execute the following Python code to fetch the list of the 10 largest technology companies and their stock symbols:\n",
"\n",
"```python\n",
"import requests\n",
"from bs4 import BeautifulSoup\n",
"\n",
"url = \"https://www.marketbeat.com/market-data/largest-companies/technology/\"\n",
"response = requests.get(url)\n",
"soup = BeautifulSoup(response.text, \"html.parser\")\n",
"\n",
"company_symbols = []\n",
"\n",
"table = soup.find(\"table\", {\"class\": \"scroll-table\"})\n",
"for row in table.find_all(\"tr\")[1:11]:\n",
" cells = row.find_all(\"td\")\n",
" symbol = cells[1].text.strip()\n",
" company_symbols.append(symbol)\n",
"\n",
"print(\"The 10 largest technology companies and their stock symbols are:\")\n",
"for symbol in company_symbols:\n",
" print(symbol)\n",
"```\n",
"\n",
"After you have the list of stock symbols, I will provide the code to fetch the YTD gain for each company.\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...\u001b[0m\n",
2023-07-31 19:22:30 -07:00
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-07-14 15:52:45 -07:00
"exitcode: 1 (execution failed)\n",
"Code output: \n",
"Traceback (most recent call last):\n",
2023-08-27 15:16:52 -07:00
" File \"\", line 11, in <module>\n",
" for row in table.find_all(\"tr\")[1:11]:\n",
2023-07-28 21:17:51 -07:00
"AttributeError: 'NoneType' object has no attribute 'find_all'\n",
2023-07-10 09:07:48 -07:00
"\n",
"\n",
2023-07-14 15:52:45 -07:00
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"I apologize for the inconvenience. It seems the code still didn't work as expected. I will try a different source to fetch the stock symbols.\n",
2023-07-28 21:17:51 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"Please execute the following Python code to fetch the list of the 10 largest technology companies and their stock symbols:\n",
"\n",
"```python\n",
"import requests\n",
"from bs4 import BeautifulSoup\n",
"\n",
"url = \"https://www.macrotrends.net/stocks/sector/technology/largest-market-cap\"\n",
"response = requests.get(url)\n",
"soup = BeautifulSoup(response.text, \"html.parser\")\n",
"\n",
"company_symbols = []\n",
"\n",
"table = soup.find(\"table\", {\"class\": \"historical_data_table\"})\n",
"for row in table.find_all(\"tr\")[1:11]:\n",
" cells = row.find_all(\"td\")\n",
" symbol = cells[1].text.strip()\n",
" company_symbols.append(symbol)\n",
"\n",
"print(\"The 10 largest technology companies and their stock symbols are:\")\n",
"for symbol in company_symbols:\n",
" print(symbol)\n",
2023-07-28 21:17:51 -07:00
"```\n",
"\n",
2023-08-27 15:16:52 -07:00
"After you have the list of stock symbols, I will provide the code to fetch the YTD gain for each company.\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...\u001b[0m\n",
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
"\n",
"exitcode: 1 (execution failed)\n",
"Code output: \n",
"Traceback (most recent call last):\n",
" File \"\", line 11, in <module>\n",
" for row in table.find_all(\"tr\")[1:11]:\n",
"AttributeError: 'NoneType' object has no attribute 'find_all'\n",
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
"\n",
"I apologize for the repeated issues. I will try a different approach to fetch the stock symbols using a different source.\n",
"\n",
"Please execute the following Python code to fetch the list of the 10 largest technology companies and their stock symbols:\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-07-14 15:52:45 -07:00
"```python\n",
2023-08-27 15:16:52 -07:00
"import requests\n",
"from bs4 import BeautifulSoup\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"url = \"https://www.tradingview.com/markets/stocks-usa/sectorandindustry-sector/technology/\"\n",
"response = requests.get(url)\n",
"soup = BeautifulSoup(response.text, \"html.parser\")\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"company_symbols = []\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"table = soup.find(\"table\", {\"class\": \"tv-data-table\"})\n",
"for row in table.find_all(\"tr\")[1:11]:\n",
" cells = row.find_all(\"td\")\n",
" symbol = cells[0].text.strip()\n",
" company_symbols.append(symbol)\n",
2023-07-28 21:17:51 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"print(\"The 10 largest technology companies and their stock symbols are:\")\n",
"for symbol in company_symbols:\n",
" print(symbol)\n",
2023-07-10 09:07:48 -07:00
"```\n",
"\n",
2023-08-27 15:16:52 -07:00
"After you have the list of stock symbols, I will provide the code to fetch the YTD gain for each company.\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-07-10 09:07:48 -07:00
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
2023-08-27 15:16:52 -07:00
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...\u001b[0m\n",
2023-07-31 19:22:30 -07:00
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
2023-07-10 09:07:48 -07:00
"\n",
"exitcode: 1 (execution failed)\n",
"Code output: \n",
"Traceback (most recent call last):\n",
2023-08-27 15:16:52 -07:00
" File \"\", line 11, in <module>\n",
" for row in table.find_all(\"tr\")[1:11]:\n",
"AttributeError: 'NoneType' object has no attribute 'find_all'\n",
2023-07-10 09:07:48 -07:00
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"I apologize for the continued issues. I will try one more approach to fetch the stock symbols using a different source.\n",
"\n",
"Please execute the following Python code to fetch the list of the 10 largest technology companies and their stock symbols:\n",
2023-07-10 09:07:48 -07:00
"\n",
"```python\n",
2023-08-27 15:16:52 -07:00
"import requests\n",
"from bs4 import BeautifulSoup\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"url = \"https://www.slickcharts.com/sp500\"\n",
"response = requests.get(url)\n",
"soup = BeautifulSoup(response.text, \"html.parser\")\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"company_symbols = []\n",
"\n",
"table = soup.find(\"table\", {\"class\": \"table table-hover table-borderless table-sm\"})\n",
"for row in table.find_all(\"tr\")[1:11]:\n",
" cells = row.find_all(\"td\")\n",
" symbol = cells[2].text.strip()\n",
" company_symbols.append(symbol)\n",
"\n",
"print(\"The 10 largest technology companies and their stock symbols are:\")\n",
"for symbol in company_symbols:\n",
" print(symbol)\n",
2023-07-14 15:52:45 -07:00
"```\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"Please note that this code will fetch the top 10 companies in the S&P 500, which may not be exclusively technology companies. However, it should provide a list of stock symbols that we can use to fetch the YTD gain for each company.\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-07-14 15:52:45 -07:00
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
2023-08-27 15:16:52 -07:00
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...\u001b[0m\n",
2023-07-31 19:22:30 -07:00
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"exitcode: 1 (execution failed)\n",
2023-07-14 15:52:45 -07:00
"Code output: \n",
2023-08-27 15:16:52 -07:00
"Traceback (most recent call last):\n",
" File \"\", line 11, in <module>\n",
" for row in table.find_all(\"tr\")[1:11]:\n",
"AttributeError: 'NoneType' object has no attribute 'find_all'\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-07-28 21:17:51 -07:00
"\n",
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
2023-07-28 21:17:51 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"I apologize for the continued issues. It seems that web scraping is not a reliable method to fetch the stock symbols in this case. As an alternative, I will provide you with a list of the 10 largest technology companies and their stock symbols manually. Then, we can proceed with fetching the YTD gain for each company.\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"Here is a list of the 10 largest technology companies and their stock symbols:\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"1. Apple Inc. (AAPL)\n",
"2. Microsoft Corporation (MSFT)\n",
"3. Alphabet Inc. (GOOGL)\n",
"4. Amazon.com, Inc. (AMZN)\n",
"5. Meta Platforms, Inc. (FB)\n",
"6. NVIDIA Corporation (NVDA)\n",
"7. Tesla, Inc. (TSLA)\n",
"8. Adobe Inc. (ADBE)\n",
"9. PayPal Holdings, Inc. (PYPL)\n",
"10. Cisco Systems, Inc. (CSCO)\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"Now that we have the stock symbols, let's fetch the YTD gain for each company. We will use the Alpha Vantage API to get the stock data. Please sign up for a free API key at https://www.alphavantage.co/support/#api-key.\n",
"\n",
"Once you have the API key, replace `YOUR_API_KEY` in the following Python code with your actual API key and execute the code to fetch the YTD gain for each company:\n",
"\n",
"```python\n",
"import requests\n",
"import json\n",
"from datetime import datetime\n",
"\n",
"api_key = \"YOUR_API_KEY\"\n",
"stock_symbols = [\"AAPL\", \"MSFT\", \"GOOGL\", \"AMZN\", \"FB\", \"NVDA\", \"TSLA\", \"ADBE\", \"PYPL\", \"CSCO\"]\n",
"\n",
"def get_ytd_gain(symbol):\n",
" url = f\"https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol={symbol}&apikey={api_key}&outputsize=full\"\n",
" response = requests.get(url)\n",
" data = json.loads(response.text)\n",
"\n",
" if \"Time Series (Daily)\" not in data:\n",
" print(f\"Error fetching data for {symbol}: {data.get('Note', 'Unknown error')}\")\n",
" return\n",
"\n",
" time_series = data[\"Time Series (Daily)\"]\n",
" sorted_dates = sorted(time_series.keys(), reverse=True)\n",
" latest_date = sorted_dates[0]\n",
" start_of_year = f\"{datetime.now().year}-01-01\"\n",
"\n",
" if start_of_year not in sorted_dates:\n",
" print(f\"Error: Data for {start_of_year} not found for {symbol}\")\n",
" return\n",
"\n",
" latest_close = float(time_series[latest_date][\"4. close\"])\n",
" start_of_year_close = float(time_series[start_of_year][\"4. close\"])\n",
" ytd_gain = ((latest_close - start_of_year_close) / start_of_year_close) * 100\n",
"\n",
" return ytd_gain\n",
"\n",
"print(\"YTD gain for the 10 largest technology companies:\")\n",
"for symbol in stock_symbols:\n",
" ytd_gain = get_ytd_gain(symbol)\n",
" if ytd_gain is not None:\n",
" print(f\"{symbol}: {ytd_gain:.2f}%\")\n",
"```\n",
"\n",
"This code will print the YTD gain for each of the 10 largest technology companies.\n",
2023-07-28 21:17:51 -07:00
"\n",
"--------------------------------------------------------------------------------\n",
2023-08-27 15:16:52 -07:00
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...\u001b[0m\n",
2023-07-31 19:22:30 -07:00
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
2023-07-28 21:17:51 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"exitcode: 0 (execution succeeded)\n",
"Code output: \n",
"YTD gain for the 10 largest technology companies:\n",
"Error fetching data for AAPL: Unknown error\n",
"Error fetching data for MSFT: Unknown error\n",
"Error fetching data for GOOGL: Unknown error\n",
"Error fetching data for AMZN: Unknown error\n",
"Error fetching data for FB: Unknown error\n",
"Error fetching data for NVDA: Unknown error\n",
"Error fetching data for TSLA: Unknown error\n",
"Error fetching data for ADBE: Unknown error\n",
"Error fetching data for PYPL: Unknown error\n",
"Error fetching data for CSCO: Unknown error\n",
"\n",
2023-07-28 21:17:51 -07:00
"\n",
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"I apologize for the issues with fetching the YTD gain using the Alpha Vantage API. It seems there might be a problem with the API or the API key. As an alternative, we can use the Yahoo Finance API to fetch the YTD gain for each company.\n",
"\n",
"Please install the `yfinance` package using the following command:\n",
"\n",
"```sh\n",
"pip install yfinance\n",
"```\n",
"\n",
"After installing the package, execute the following Python code to fetch the YTD gain for each of the 10 largest technology companies:\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-07-14 15:52:45 -07:00
"```python\n",
"import yfinance as yf\n",
2023-08-27 15:16:52 -07:00
"from datetime import datetime\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"stock_symbols = [\"AAPL\", \"MSFT\", \"GOOGL\", \"AMZN\", \"FB\", \"NVDA\", \"TSLA\", \"ADBE\", \"PYPL\", \"CSCO\"]\n",
2023-07-14 15:52:45 -07:00
"\n",
"def get_ytd_gain(symbol):\n",
2023-08-27 15:16:52 -07:00
" start_of_year = f\"{datetime.now().year}-01-01\"\n",
" stock_data = yf.download(symbol, start=start_of_year)\n",
" if stock_data.empty:\n",
" print(f\"Error fetching data for {symbol}\")\n",
" return\n",
"\n",
" latest_close = stock_data.iloc[-1][\"Close\"]\n",
" start_of_year_close = stock_data.iloc[0][\"Close\"]\n",
" ytd_gain = ((latest_close - start_of_year_close) / start_of_year_close) * 100\n",
"\n",
" return ytd_gain\n",
"\n",
"print(\"YTD gain for the 10 largest technology companies:\")\n",
"for symbol in stock_symbols:\n",
" ytd_gain = get_ytd_gain(symbol)\n",
" if ytd_gain is not None:\n",
" print(f\"{symbol}: {ytd_gain:.2f}%\")\n",
2023-07-10 09:07:48 -07:00
"```\n",
"\n",
2023-08-27 15:16:52 -07:00
"This code will print the YTD gain for each of the 10 largest technology companies.\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-07-10 09:07:48 -07:00
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
2023-08-27 15:16:52 -07:00
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is sh)...\u001b[0m\n",
"\u001b[31m\n",
">>>>>>>> EXECUTING CODE BLOCK 1 (inferred language is python)...\u001b[0m\n",
2023-07-31 19:22:30 -07:00
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
2023-07-10 09:07:48 -07:00
"\n",
"exitcode: 0 (execution succeeded)\n",
"Code output: \n",
2023-08-27 15:16:52 -07:00
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: yfinance in /home/vscode/.local/lib/python3.9/site-packages (0.2.26)\n",
"Requirement already satisfied: frozendict>=2.3.4 in /home/vscode/.local/lib/python3.9/site-packages (from yfinance) (2.3.8)\n",
"Requirement already satisfied: appdirs>=1.4.4 in /home/vscode/.local/lib/python3.9/site-packages (from yfinance) (1.4.4)\n",
"Requirement already satisfied: beautifulsoup4>=4.11.1 in /home/vscode/.local/lib/python3.9/site-packages (from yfinance) (4.12.2)\n",
"Requirement already satisfied: pytz>=2022.5 in /home/vscode/.local/lib/python3.9/site-packages (from yfinance) (2023.3)\n",
"Requirement already satisfied: html5lib>=1.1 in /home/vscode/.local/lib/python3.9/site-packages (from yfinance) (1.1)\n",
"Requirement already satisfied: numpy>=1.16.5 in /home/vscode/.local/lib/python3.9/site-packages (from yfinance) (1.25.1)\n",
"Requirement already satisfied: multitasking>=0.0.7 in /home/vscode/.local/lib/python3.9/site-packages (from yfinance) (0.0.11)\n",
"Requirement already satisfied: lxml>=4.9.1 in /home/vscode/.local/lib/python3.9/site-packages (from yfinance) (4.9.3)\n",
"Requirement already satisfied: pandas>=1.3.0 in /home/vscode/.local/lib/python3.9/site-packages (from yfinance) (1.3.3)\n",
"Requirement already satisfied: requests>=2.31 in /usr/local/lib/python3.9/site-packages (from yfinance) (2.31.0)\n",
"Requirement already satisfied: soupsieve>1.2 in /home/vscode/.local/lib/python3.9/site-packages (from beautifulsoup4>=4.11.1->yfinance) (2.4.1)\n",
"Requirement already satisfied: webencodings in /home/vscode/.local/lib/python3.9/site-packages (from html5lib>=1.1->yfinance) (0.5.1)\n",
"Requirement already satisfied: six>=1.9 in /usr/local/lib/python3.9/site-packages (from html5lib>=1.1->yfinance) (1.16.0)\n",
"Requirement already satisfied: python-dateutil>=2.7.3 in /home/vscode/.local/lib/python3.9/site-packages (from pandas>=1.3.0->yfinance) (2.8.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests>=2.31->yfinance) (3.4)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.9/site-packages (from requests>=2.31->yfinance) (2.0.3)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests>=2.31->yfinance) (2023.5.7)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.9/site-packages (from requests>=2.31->yfinance) (3.2.0)\n",
"\n",
"YTD gain for the 10 largest technology companies:\n",
"[*********************100%***********************] 1 of 1 completed\n",
"AAPL: 42.81%\n",
"[*********************100%***********************] 1 of 1 completed\n",
"MSFT: 34.81%\n",
"[*********************100%***********************] 1 of 1 completed\n",
"GOOGL: 45.74%\n",
"[*********************100%***********************] 1 of 1 completed\n",
"AMZN: 55.28%\n",
"[*********************100%***********************] 1 of 1 completed\n",
"Error fetching data for FB\n",
"[*********************100%***********************] 1 of 1 completed\n",
"NVDA: 221.47%\n",
"[*********************100%***********************] 1 of 1 completed\n",
"TSLA: 120.71%\n",
"[*********************100%***********************] 1 of 1 completed\n",
"ADBE: 55.84%\n",
"[*********************100%***********************] 1 of 1 completed\n",
"PYPL: -17.95%\n",
"[*********************100%***********************] 1 of 1 completed\n",
"CSCO: 16.19%\n",
2023-07-10 09:07:48 -07:00
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
2023-07-31 19:22:30 -07:00
"\u001b[33massistant\u001b[0m (to user_proxy):\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"Great! The code has successfully fetched the YTD gain for the 10 largest technology companies. Here are the results:\n",
2023-07-14 15:52:45 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"1. Apple Inc. (AAPL): 42.81%\n",
"2. Microsoft Corporation (MSFT): 34.81%\n",
"3. Alphabet Inc. (GOOGL): 45.74%\n",
"4. Amazon.com, Inc. (AMZN): 55.28%\n",
"5. Meta Platforms, Inc. (FB): Error fetching data\n",
"6. NVIDIA Corporation (NVDA): 221.47%\n",
"7. Tesla, Inc. (TSLA): 120.71%\n",
"8. Adobe Inc. (ADBE): 55.84%\n",
"9. PayPal Holdings, Inc. (PYPL): -17.95%\n",
"10. Cisco Systems, Inc. (CSCO): 16.19%\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"Please note that there was an error fetching data for Meta Platforms, Inc. (FB). This might be due to a temporary issue with the Yahoo Finance API or a change in the stock symbol.\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-08-27 15:16:52 -07:00
"If you have any further questions or need assistance with another task, feel free to ask. Otherwise, if everything is done, you can reply with \"TERMINATE\" to end this session.\n",
2023-07-10 09:07:48 -07:00
"\n",
2023-07-31 19:22:30 -07:00
"--------------------------------------------------------------------------------\n",
"\u001b[31m\n",
2023-08-27 15:16:52 -07:00
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
"\u001b[33muser_proxy\u001b[0m (to assistant):\n",
"\n",
"TERMINATE\n",
"\n",
"--------------------------------------------------------------------------------\n"
2023-07-10 09:07:48 -07:00
]
}
],
"source": [
2023-07-28 21:17:51 -07:00
"user_proxy.initiate_chat(\n",
2023-07-23 06:23:09 -07:00
" assistant,\n",
" message=\"\"\"Show me the YTD gain of 10 largest technology companies as of today.\"\"\",\n",
2023-07-10 09:07:48 -07:00
")"
]
2023-06-09 11:40:04 -07:00
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2023-07-28 21:17:51 -07:00
"version": "3.9.17"
2023-06-09 11:40:04 -07:00
},
"vscode": {
"interpreter": {
"hash": "949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1"
}
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {
"2d910cfd2d2a4fc49fc30fbbdc5576a7": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "2.0.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "2.0.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "2.0.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border_bottom": null,
"border_left": null,
"border_right": null,
"border_top": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"454146d0f7224f038689031002906e6f": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HBoxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "2.0.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "2.0.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_e4ae2b6f5a974fd4bafb6abb9d12ff26",
"IPY_MODEL_577e1e3cc4db4942b0883577b3b52755",
"IPY_MODEL_b40bdfb1ac1d4cffb7cefcb870c64d45"
],
"layout": "IPY_MODEL_dc83c7bff2f241309537a8119dfc7555",
"tabbable": null,
"tooltip": null
}
},
"577e1e3cc4db4942b0883577b3b52755": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "FloatProgressModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "2.0.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "2.0.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_allow_html": false,
"layout": "IPY_MODEL_2d910cfd2d2a4fc49fc30fbbdc5576a7",
"max": 1,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_74a6ba0c3cbc4051be0a83e152fe1e62",
"tabbable": null,
"tooltip": null,
"value": 1
}
},
"6086462a12d54bafa59d3c4566f06cb2": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "2.0.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "2.0.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "2.0.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border_bottom": null,
"border_left": null,
"border_right": null,
"border_top": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"74a6ba0c3cbc4051be0a83e152fe1e62": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "ProgressStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "2.0.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "2.0.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"7d3f3d9e15894d05a4d188ff4f466554": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HTMLStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "2.0.0",
"_model_name": "HTMLStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "2.0.0",
"_view_name": "StyleView",
"background": null,
"description_width": "",
"font_size": null,
"text_color": null
}
},
"b40bdfb1ac1d4cffb7cefcb870c64d45": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "2.0.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "2.0.0",
"_view_name": "HTMLView",
"description": "",
"description_allow_html": false,
"layout": "IPY_MODEL_f1355871cc6f4dd4b50d9df5af20e5c8",
"placeholder": " ",
"style": "IPY_MODEL_ca245376fd9f4354af6b2befe4af4466",
"tabbable": null,
"tooltip": null,
"value": " 1/1 [00:00<00:00, 44.69it/s]"
}
},
"ca245376fd9f4354af6b2befe4af4466": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HTMLStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "2.0.0",
"_model_name": "HTMLStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "2.0.0",
"_view_name": "StyleView",
"background": null,
"description_width": "",
"font_size": null,
"text_color": null
}
},
"dc83c7bff2f241309537a8119dfc7555": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "2.0.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "2.0.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "2.0.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border_bottom": null,
"border_left": null,
"border_right": null,
"border_top": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"e4ae2b6f5a974fd4bafb6abb9d12ff26": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "2.0.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "2.0.0",
"_view_name": "HTMLView",
"description": "",
"description_allow_html": false,
"layout": "IPY_MODEL_6086462a12d54bafa59d3c4566f06cb2",
"placeholder": " ",
"style": "IPY_MODEL_7d3f3d9e15894d05a4d188ff4f466554",
"tabbable": null,
"tooltip": null,
"value": "100%"
}
},
"f1355871cc6f4dd4b50d9df5af20e5c8": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "2.0.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "2.0.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "2.0.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border_bottom": null,
"border_left": null,
"border_right": null,
"border_top": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
}
},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}