Codebase Analysis for: ./learning/TaskWeaver

Directory Structure:
└── TaskWeaver
    ├── 0.example_notebook.ipynb
    ├── README.md
    ├── _starter_projects
    │   ├── plugins
    │   │   ├── sql_data_analysis.py
    │   │   ├── __init__.py
    │   │   └── sql_data_analysis.yaml
    │   ├── workspace
    │   │   └── __init__.py
    │   ├── planner_examples
    │   │   └── __init__.py
    │   ├── sample_data
    │   │   └── __init__.py
    │   ├── logs
    │   │   └── __init__.py
    │   ├── codeinterpreter_examples
    │   │   └── __init__.py
    │   ├── tesla_stock_price_ytd.png
    │   └── _taskweaver_config_example.json
    └── 1.taskweaver_vs_autogen.ipynb

Summary:
Total files analyzed: 13
Total directories analyzed: 7
Estimated output size: 55.15 KB
Actual analyzed size: 216.82 KB
Total tokens: 24222
Actual text content size: 52.91 KB

File Contents:

==================================================
File: TaskWeaver/0.example_notebook.ipynb
==================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# TaskWeaver\n",
    "\n",
    "This notebook aims to condence all requirements needed for coding up a TaskWeaver project.  <br>\n",
    "https://export.arxiv.org/pdf/2311.17541 <br>\n",
    "\n",
    "#### Step 1:\n",
    "- Firstly, you need to make a project folder. this is a prerequisite to running TaskWeaver. See [starter_project](\"../_starter_projects/\") <br>\n",
    "\n",
    "#### Step 2:\n",
    "- Then we need to make a session:\n",
    "    > TaskWeaver supports a basic session management to keep different users' <br>\n",
    "    > data separate. The code execution is separated into different processes <br>\n",
    "    > in order not to interfere with each other.\n",
    "\n",
    "#### Step 3:\n",
    "- We also need to enable modules that the code interpreter can use and code verification.\n",
    "    > Code verification - TaskWeaver is designed to verify the generated code before execution. <br>\n",
    "    > It can detect potential issues in the generated code and provide suggestions to fix them.\n",
    "    \n",
    "#### Step 4:\n",
    "- TaskWeaver has restricted library use to mitigate against unforeseen consequences of running code, thus you need to call out the permitted libraries expicitly.\n",
    "- Add this to the `taskweaver_config.json`:\n",
    "    ```\n",
    "    \"code_verification.allowed_modules\": [\"pandas\", \"matplotlib\", \"numpy\", \"sklearn\", \"scipy\", \"seaborn\", \"datetime\", \"typing\"],\n",
    "    \"code_verification.code_verification_on\": true,\n",
    "    ```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "from typing import Any, Optional\n",
    "\n",
    "import pprint as pp\n",
    "from taskweaver.app.app import TaskWeaverApp\n",
    "\n",
    "# Create a session\n",
    "# would prefer if the expected folder structure was autogenerated\n",
    "app_dir = \"./_starter_projects/\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Configuration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Here is where the configurations from taskweaver_config.json are stored\n",
    "# https://github.com/microsoft/TaskWeaver/blob/main/docs/configuration.md \n",
    "# Categories of keys within the config\n",
    "# - session_manager\n",
    "# - llm\n",
    "# - workspace\n",
    "# - logging\n",
    "# - session\n",
    "# - planner\n",
    "# - plugin\n",
    "# - round_compressor\n",
    "# - code_generator\n",
    "# - embedding_model\n",
    "# - code_verification\n",
    "# - code_interpreter\n",
    "### session.config.src.config\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Simple test message"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "app = TaskWeaverApp(app_dir=app_dir)\n",
    "session = app.get_session()\n",
    "\n",
    "# Send a message to the session\n",
    "user_query = \"hello, what can you do?\"\n",
    "response_round = session.send_message(\n",
    "                            user_query,\n",
    "                            event_handler=lambda _type, _msg: print(f\"{_type}:\\n{_msg}\")\n",
    "                          )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "response_round.to_dict()['post_list'][-1]['message']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Heres what that looks like in JSON\n",
    "pp.pprint(response_round.to_dict())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### The classic stock market agent benchmark\n",
    "\n",
    "protip: make sure `llm.response_format` is `text` because when working with `json` i found it crashed when using the code interpreter.\n",
    "\n",
    "> 💡 Up to 11/30/2023, the json_object and text options of `llm.response_format` is only supported by the OpenAI models later than `1106`. If you are using an older version of OpenAI model, you need to set the llm.response_format to null."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "user_query = \"Write code to plot the price of tesla stock YTD and save it to the current working directory\"\n",
    "response_round = session.send_message(user_query,\n",
    "                                      event_handler=lambda _type, _msg: print(f\"{_type}:\\n{_msg}\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![](./_starter_projects/tesla_stock_price_ytd.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![](../_starter_projects/workspace/sessions/20231212-200217-2ba37e82/cwd/tesla_stock_price_ytd.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Plugins\n",
    "\n",
    "A plugin is the equivalent to a function call in Autogen, but it handles a lot of the orchestration for you. All you need to do is put the python file and yaml file in the `plugins` folder.\n",
    "Make sure you update `taskweaver_config.json` with the following:\n",
    "```json\n",
    "\"enable_auto_plugin_selection\": \"true\"\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# session.config.src.config"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "ename": "BadRequestError",
     "evalue": "Error code: 400 - {'error': {'message': \"'$.input' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mBadRequestError\u001b[0m                           Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[2], line 2\u001b[0m\n\u001b[1;32m      1\u001b[0m app \u001b[38;5;241m=\u001b[39m TaskWeaverApp(app_dir\u001b[38;5;241m=\u001b[39mapp_dir)\n\u001b[0;32m----> 2\u001b[0m session \u001b[38;5;241m=\u001b[39m \u001b[43mapp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_session\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m      4\u001b[0m user_query \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPerform analysis over the dataframe\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m      5\u001b[0m response_round \u001b[38;5;241m=\u001b[39m session\u001b[38;5;241m.\u001b[39msend_message(user_query,\n\u001b[1;32m      6\u001b[0m                                       event_handler\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mlambda\u001b[39;00m _type, _msg: \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m_type\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m:\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;132;01m{\u001b[39;00m_msg\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m))\n",
      "File \u001b[0;32m~/Desktop/personal/github/TaskWeaver/taskweaver/app/app.py:50\u001b[0m, in \u001b[0;36mTaskWeaverApp.get_session\u001b[0;34m(self, session_id, prev_round_id)\u001b[0m\n\u001b[1;32m     45\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget_session\u001b[39m(\n\u001b[1;32m     46\u001b[0m     \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m     47\u001b[0m     session_id: Optional[\u001b[38;5;28mstr\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m     48\u001b[0m     prev_round_id: Optional[\u001b[38;5;28mstr\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m     49\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Session:\n\u001b[0;32m---> 50\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msession_manager\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_session\u001b[49m\u001b[43m(\u001b[49m\u001b[43msession_id\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprev_round_id\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/Desktop/personal/github/TaskWeaver/taskweaver/app/session_manager.py:29\u001b[0m, in \u001b[0;36mSessionManager.get_session\u001b[0;34m(self, session_id, prev_round_id)\u001b[0m\n\u001b[1;32m     27\u001b[0m     \u001b[38;5;28;01massert\u001b[39;00m prev_round_id \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m     28\u001b[0m     session_id \u001b[38;5;241m=\u001b[39m create_id()\n\u001b[0;32m---> 29\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_session_from_store\u001b[49m\u001b[43m(\u001b[49m\u001b[43msession_id\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m     31\u001b[0m current_session \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_get_session_from_store(session_id, \u001b[38;5;28;01mFalse\u001b[39;00m)\n\u001b[1;32m     33\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m current_session \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
      "File \u001b[0;32m~/Desktop/personal/github/TaskWeaver/taskweaver/app/session_manager.py:75\u001b[0m, in \u001b[0;36mSessionManager._get_session_from_store\u001b[0;34m(self, session_id, create_new)\u001b[0m\n\u001b[1;32m     73\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m     74\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m create_new:\n\u001b[0;32m---> 75\u001b[0m         new_session \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minjector\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_object\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m     76\u001b[0m \u001b[43m            \u001b[49m\u001b[43mSession\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m     77\u001b[0m \u001b[43m            \u001b[49m\u001b[43m{\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43msession_id\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43msession_id\u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m     78\u001b[0m \u001b[43m        \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m     79\u001b[0m         \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msession_store\u001b[38;5;241m.\u001b[39mset_session(session_id, new_session)\n\u001b[1;32m     80\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m new_session\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:998\u001b[0m, in \u001b[0;36mInjector.create_object\u001b[0;34m(self, cls, additional_kwargs)\u001b[0m\n\u001b[1;32m    996\u001b[0m init \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__init__\u001b[39m\n\u001b[1;32m    997\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 998\u001b[0m     \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcall_with_injection\u001b[49m\u001b[43m(\u001b[49m\u001b[43minit\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mself_\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minstance\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43madditional_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    999\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m   1000\u001b[0m     \u001b[38;5;66;03m# Mypy says \"Cannot access \"__init__\" directly\"\u001b[39;00m\n\u001b[1;32m   1001\u001b[0m     init_function \u001b[38;5;241m=\u001b[39m instance\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__init__\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__func__\u001b[39m  \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:1040\u001b[0m, in \u001b[0;36mInjector.call_with_injection\u001b[0;34m(self, callable, self_, args, kwargs)\u001b[0m\n\u001b[1;32m   1037\u001b[0m dependencies\u001b[38;5;241m.\u001b[39mupdate(kwargs)\n\u001b[1;32m   1039\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1040\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mcallable\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mfull_args\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mdependencies\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1041\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m   1042\u001b[0m     reraise(e, CallError(self_, \u001b[38;5;28mcallable\u001b[39m, args, dependencies, e, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stack))\n",
      "File \u001b[0;32m~/Desktop/personal/github/TaskWeaver/taskweaver/session/session.py:63\u001b[0m, in \u001b[0;36mSession.__init__\u001b[0;34m(self, session_id, workspace, app_injector, logger, config)\u001b[0m\n\u001b[1;32m     54\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcode_executor \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msession_injector\u001b[38;5;241m.\u001b[39mcreate_object(\n\u001b[1;32m     55\u001b[0m     CodeExecutor,\n\u001b[1;32m     56\u001b[0m     {\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m     60\u001b[0m     },\n\u001b[1;32m     61\u001b[0m )\n\u001b[1;32m     62\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msession_injector\u001b[38;5;241m.\u001b[39mbinder\u001b[38;5;241m.\u001b[39mbind(CodeExecutor, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcode_executor)\n\u001b[0;32m---> 63\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcode_interpreter \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msession_injector\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mCodeInterpreter\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m     65\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmax_internal_chat_round_num \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig\u001b[38;5;241m.\u001b[39mmax_internal_chat_round_num\n\u001b[1;32m     66\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39minternal_chat_num \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:91\u001b[0m, in \u001b[0;36msynchronized.<locals>.outside_wrapper.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m     88\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(function)\n\u001b[1;32m     89\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mwrapper\u001b[39m(\u001b[38;5;241m*\u001b[39margs: Any, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs: Any) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Any:\n\u001b[1;32m     90\u001b[0m     \u001b[38;5;28;01mwith\u001b[39;00m lock:\n\u001b[0;32m---> 91\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunction\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:975\u001b[0m, in \u001b[0;36mInjector.get\u001b[0;34m(self, interface, scope)\u001b[0m\n\u001b[1;32m    971\u001b[0m log\u001b[38;5;241m.\u001b[39mdebug(\n\u001b[1;32m    972\u001b[0m     \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124mInjector.get(\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m, scope=\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m) using \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_log_prefix, interface, scope, binding\u001b[38;5;241m.\u001b[39mprovider\n\u001b[1;32m    973\u001b[0m )\n\u001b[1;32m    974\u001b[0m provider_instance \u001b[38;5;241m=\u001b[39m scope_instance\u001b[38;5;241m.\u001b[39mget(interface, binding\u001b[38;5;241m.\u001b[39mprovider)\n\u001b[0;32m--> 975\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mprovider_instance\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m    976\u001b[0m log\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m -> \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_log_prefix, result)\n\u001b[1;32m    977\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:264\u001b[0m, in \u001b[0;36mClassProvider.get\u001b[0;34m(self, injector)\u001b[0m\n\u001b[1;32m    263\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget\u001b[39m(\u001b[38;5;28mself\u001b[39m, injector: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mInjector\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m T:\n\u001b[0;32m--> 264\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43minjector\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_object\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_cls\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:998\u001b[0m, in \u001b[0;36mInjector.create_object\u001b[0;34m(self, cls, additional_kwargs)\u001b[0m\n\u001b[1;32m    996\u001b[0m init \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__init__\u001b[39m\n\u001b[1;32m    997\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 998\u001b[0m     \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcall_with_injection\u001b[49m\u001b[43m(\u001b[49m\u001b[43minit\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mself_\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minstance\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43madditional_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    999\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m   1000\u001b[0m     \u001b[38;5;66;03m# Mypy says \"Cannot access \"__init__\" directly\"\u001b[39;00m\n\u001b[1;32m   1001\u001b[0m     init_function \u001b[38;5;241m=\u001b[39m instance\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__init__\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__func__\u001b[39m  \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:1031\u001b[0m, in \u001b[0;36mInjector.call_with_injection\u001b[0;34m(self, callable, self_, args, kwargs)\u001b[0m\n\u001b[1;32m   1025\u001b[0m bound_arguments \u001b[38;5;241m=\u001b[39m signature\u001b[38;5;241m.\u001b[39mbind_partial(\u001b[38;5;241m*\u001b[39mfull_args)\n\u001b[1;32m   1027\u001b[0m needed \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mdict\u001b[39m(\n\u001b[1;32m   1028\u001b[0m     (k, v) \u001b[38;5;28;01mfor\u001b[39;00m (k, v) \u001b[38;5;129;01min\u001b[39;00m bindings\u001b[38;5;241m.\u001b[39mitems() \u001b[38;5;28;01mif\u001b[39;00m k \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m kwargs \u001b[38;5;129;01mand\u001b[39;00m k \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m bound_arguments\u001b[38;5;241m.\u001b[39marguments\n\u001b[1;32m   1029\u001b[0m )\n\u001b[0;32m-> 1031\u001b[0m dependencies \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43margs_to_inject\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m   1032\u001b[0m \u001b[43m    \u001b[49m\u001b[43mfunction\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mcallable\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m   1033\u001b[0m \u001b[43m    \u001b[49m\u001b[43mbindings\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mneeded\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m   1034\u001b[0m \u001b[43m    \u001b[49m\u001b[43mowner_key\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mself_\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__class__\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mself_\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mis\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mnot\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01melse\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43mcallable\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__module__\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m   1035\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1037\u001b[0m dependencies\u001b[38;5;241m.\u001b[39mupdate(kwargs)\n\u001b[1;32m   1039\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:91\u001b[0m, in \u001b[0;36msynchronized.<locals>.outside_wrapper.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m     88\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(function)\n\u001b[1;32m     89\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mwrapper\u001b[39m(\u001b[38;5;241m*\u001b[39margs: Any, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs: Any) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Any:\n\u001b[1;32m     90\u001b[0m     \u001b[38;5;28;01mwith\u001b[39;00m lock:\n\u001b[0;32m---> 91\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunction\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:1079\u001b[0m, in \u001b[0;36mInjector.args_to_inject\u001b[0;34m(self, function, bindings, owner_key)\u001b[0m\n\u001b[1;32m   1077\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m arg, interface \u001b[38;5;129;01min\u001b[39;00m bindings\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m   1078\u001b[0m     \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1079\u001b[0m         instance: Any \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43minterface\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1080\u001b[0m     \u001b[38;5;28;01mexcept\u001b[39;00m UnsatisfiedRequirement \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m   1081\u001b[0m         \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m e\u001b[38;5;241m.\u001b[39mowner:\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:91\u001b[0m, in \u001b[0;36msynchronized.<locals>.outside_wrapper.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m     88\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(function)\n\u001b[1;32m     89\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mwrapper\u001b[39m(\u001b[38;5;241m*\u001b[39margs: Any, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs: Any) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Any:\n\u001b[1;32m     90\u001b[0m     \u001b[38;5;28;01mwith\u001b[39;00m lock:\n\u001b[0;32m---> 91\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunction\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:975\u001b[0m, in \u001b[0;36mInjector.get\u001b[0;34m(self, interface, scope)\u001b[0m\n\u001b[1;32m    971\u001b[0m log\u001b[38;5;241m.\u001b[39mdebug(\n\u001b[1;32m    972\u001b[0m     \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124mInjector.get(\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m, scope=\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m) using \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_log_prefix, interface, scope, binding\u001b[38;5;241m.\u001b[39mprovider\n\u001b[1;32m    973\u001b[0m )\n\u001b[1;32m    974\u001b[0m provider_instance \u001b[38;5;241m=\u001b[39m scope_instance\u001b[38;5;241m.\u001b[39mget(interface, binding\u001b[38;5;241m.\u001b[39mprovider)\n\u001b[0;32m--> 975\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mprovider_instance\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m    976\u001b[0m log\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m -> \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_log_prefix, result)\n\u001b[1;32m    977\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:264\u001b[0m, in \u001b[0;36mClassProvider.get\u001b[0;34m(self, injector)\u001b[0m\n\u001b[1;32m    263\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget\u001b[39m(\u001b[38;5;28mself\u001b[39m, injector: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mInjector\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m T:\n\u001b[0;32m--> 264\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43minjector\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_object\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_cls\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:998\u001b[0m, in \u001b[0;36mInjector.create_object\u001b[0;34m(self, cls, additional_kwargs)\u001b[0m\n\u001b[1;32m    996\u001b[0m init \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__init__\u001b[39m\n\u001b[1;32m    997\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 998\u001b[0m     \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcall_with_injection\u001b[49m\u001b[43m(\u001b[49m\u001b[43minit\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mself_\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minstance\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43madditional_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    999\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m   1000\u001b[0m     \u001b[38;5;66;03m# Mypy says \"Cannot access \"__init__\" directly\"\u001b[39;00m\n\u001b[1;32m   1001\u001b[0m     init_function \u001b[38;5;241m=\u001b[39m instance\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__init__\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__func__\u001b[39m  \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/injector/__init__.py:1040\u001b[0m, in \u001b[0;36mInjector.call_with_injection\u001b[0;34m(self, callable, self_, args, kwargs)\u001b[0m\n\u001b[1;32m   1037\u001b[0m dependencies\u001b[38;5;241m.\u001b[39mupdate(kwargs)\n\u001b[1;32m   1039\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1040\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mcallable\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mfull_args\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mdependencies\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1041\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m   1042\u001b[0m     reraise(e, CallError(self_, \u001b[38;5;28mcallable\u001b[39m, args, dependencies, e, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stack))\n",
      "File \u001b[0;32m~/Desktop/personal/github/TaskWeaver/taskweaver/code_interpreter/code_generator/code_generator.py:93\u001b[0m, in \u001b[0;36mCodeGenerator.__init__\u001b[0;34m(self, config, plugin_registry, logger, llm_api, code_verification_config, round_compressor)\u001b[0m\n\u001b[1;32m     91\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig\u001b[38;5;241m.\u001b[39menable_auto_plugin_selection:\n\u001b[1;32m     92\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mplugin_selector \u001b[38;5;241m=\u001b[39m PluginSelector(plugin_registry, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mllm_api)\n\u001b[0;32m---> 93\u001b[0m     \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mplugin_selector\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgenerate_plugin_embeddings\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m     94\u001b[0m     logger\u001b[38;5;241m.\u001b[39minfo(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPlugin embeddings generated\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m     95\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mselected_plugin_pool \u001b[38;5;241m=\u001b[39m SelectedPluginPool()\n",
      "File \u001b[0;32m~/Desktop/personal/github/TaskWeaver/taskweaver/code_interpreter/code_generator/plugin_selection.py:73\u001b[0m, in \u001b[0;36mPluginSelector.generate_plugin_embeddings\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m     71\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m p \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mplugin_registry\u001b[38;5;241m.\u001b[39mget_list():\n\u001b[1;32m     72\u001b[0m     plugin_intro_text_list\u001b[38;5;241m.\u001b[39mappend(p\u001b[38;5;241m.\u001b[39mname \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m: \u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m+\u001b[39m p\u001b[38;5;241m.\u001b[39mspec\u001b[38;5;241m.\u001b[39mdescription)\n\u001b[0;32m---> 73\u001b[0m plugin_embeddings \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mllm_api\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_embedding_list\u001b[49m\u001b[43m(\u001b[49m\u001b[43mplugin_intro_text_list\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m     74\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, p \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mplugin_registry\u001b[38;5;241m.\u001b[39mget_list()):\n\u001b[1;32m     75\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mplugin_embedding_dict[p\u001b[38;5;241m.\u001b[39mname] \u001b[38;5;241m=\u001b[39m plugin_embeddings[i]\n",
      "File \u001b[0;32m~/Desktop/personal/github/TaskWeaver/taskweaver/llm/__init__.py:105\u001b[0m, in \u001b[0;36mLLMApi.get_embedding_list\u001b[0;34m(self, strings)\u001b[0m\n\u001b[1;32m    104\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget_embedding_list\u001b[39m(\u001b[38;5;28mself\u001b[39m, strings: List[\u001b[38;5;28mstr\u001b[39m]) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m List[List[\u001b[38;5;28mfloat\u001b[39m]]:\n\u001b[0;32m--> 105\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43membedding_service\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_embeddings\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstrings\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/Desktop/personal/github/TaskWeaver/taskweaver/llm/openai.py:213\u001b[0m, in \u001b[0;36mOpenAIService.get_embeddings\u001b[0;34m(self, strings)\u001b[0m\n\u001b[1;32m    212\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget_embeddings\u001b[39m(\u001b[38;5;28mself\u001b[39m, strings: List[\u001b[38;5;28mstr\u001b[39m]) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m List[List[\u001b[38;5;28mfloat\u001b[39m]]:\n\u001b[0;32m--> 213\u001b[0m     embedding_results \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mclient\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43membeddings\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m    214\u001b[0m \u001b[43m        \u001b[49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstrings\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    215\u001b[0m \u001b[43m        \u001b[49m\u001b[43mmodel\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconfig\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43membedding_model\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    216\u001b[0m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mdata\n\u001b[1;32m    217\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m [r\u001b[38;5;241m.\u001b[39membedding \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m embedding_results]\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/openai/resources/embeddings.py:105\u001b[0m, in \u001b[0;36mEmbeddings.create\u001b[0;34m(self, input, model, encoding_format, user, extra_headers, extra_query, extra_body, timeout)\u001b[0m\n\u001b[1;32m     99\u001b[0m         embedding\u001b[38;5;241m.\u001b[39membedding \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mfrombuffer(  \u001b[38;5;66;03m# type: ignore[no-untyped-call]\u001b[39;00m\n\u001b[1;32m    100\u001b[0m             base64\u001b[38;5;241m.\u001b[39mb64decode(data), dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfloat32\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m    101\u001b[0m         )\u001b[38;5;241m.\u001b[39mtolist()\n\u001b[1;32m    103\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m obj\n\u001b[0;32m--> 105\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_post\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m    106\u001b[0m \u001b[43m    \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m/embeddings\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m    107\u001b[0m \u001b[43m    \u001b[49m\u001b[43mbody\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmaybe_transform\u001b[49m\u001b[43m(\u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43membedding_create_params\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mEmbeddingCreateParams\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    108\u001b[0m \u001b[43m    \u001b[49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmake_request_options\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m    109\u001b[0m \u001b[43m        \u001b[49m\u001b[43mextra_headers\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mextra_headers\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    110\u001b[0m \u001b[43m        \u001b[49m\u001b[43mextra_query\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mextra_query\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    111\u001b[0m \u001b[43m        \u001b[49m\u001b[43mextra_body\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mextra_body\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    112\u001b[0m \u001b[43m        \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    113\u001b[0m \u001b[43m        \u001b[49m\u001b[43mpost_parser\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mparser\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    114\u001b[0m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    115\u001b[0m \u001b[43m    \u001b[49m\u001b[43mcast_to\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mCreateEmbeddingResponse\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    116\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/openai/_base_client.py:1055\u001b[0m, in \u001b[0;36mSyncAPIClient.post\u001b[0;34m(self, path, cast_to, body, options, files, stream, stream_cls)\u001b[0m\n\u001b[1;32m   1041\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mpost\u001b[39m(\n\u001b[1;32m   1042\u001b[0m     \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m   1043\u001b[0m     path: \u001b[38;5;28mstr\u001b[39m,\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m   1050\u001b[0m     stream_cls: \u001b[38;5;28mtype\u001b[39m[_StreamT] \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m   1051\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m ResponseT \u001b[38;5;241m|\u001b[39m _StreamT:\n\u001b[1;32m   1052\u001b[0m     opts \u001b[38;5;241m=\u001b[39m FinalRequestOptions\u001b[38;5;241m.\u001b[39mconstruct(\n\u001b[1;32m   1053\u001b[0m         method\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpost\u001b[39m\u001b[38;5;124m\"\u001b[39m, url\u001b[38;5;241m=\u001b[39mpath, json_data\u001b[38;5;241m=\u001b[39mbody, files\u001b[38;5;241m=\u001b[39mto_httpx_files(files), \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39moptions\n\u001b[1;32m   1054\u001b[0m     )\n\u001b[0;32m-> 1055\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m cast(ResponseT, \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcast_to\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mopts\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream_cls\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream_cls\u001b[49m\u001b[43m)\u001b[49m)\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/openai/_base_client.py:834\u001b[0m, in \u001b[0;36mSyncAPIClient.request\u001b[0;34m(self, cast_to, options, remaining_retries, stream, stream_cls)\u001b[0m\n\u001b[1;32m    825\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mrequest\u001b[39m(\n\u001b[1;32m    826\u001b[0m     \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m    827\u001b[0m     cast_to: Type[ResponseT],\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m    832\u001b[0m     stream_cls: \u001b[38;5;28mtype\u001b[39m[_StreamT] \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m    833\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m ResponseT \u001b[38;5;241m|\u001b[39m _StreamT:\n\u001b[0;32m--> 834\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m    835\u001b[0m \u001b[43m        \u001b[49m\u001b[43mcast_to\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcast_to\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    836\u001b[0m \u001b[43m        \u001b[49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    837\u001b[0m \u001b[43m        \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    838\u001b[0m \u001b[43m        \u001b[49m\u001b[43mstream_cls\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream_cls\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    839\u001b[0m \u001b[43m        \u001b[49m\u001b[43mremaining_retries\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremaining_retries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m    840\u001b[0m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/anaconda3/envs/masterclass/lib/python3.10/site-packages/openai/_base_client.py:877\u001b[0m, in \u001b[0;36mSyncAPIClient._request\u001b[0;34m(self, cast_to, options, remaining_retries, stream, stream_cls)\u001b[0m\n\u001b[1;32m    874\u001b[0m     \u001b[38;5;66;03m# If the response is streamed then we need to explicitly read the response\u001b[39;00m\n\u001b[1;32m    875\u001b[0m     \u001b[38;5;66;03m# to completion before attempting to access the response text.\u001b[39;00m\n\u001b[1;32m    876\u001b[0m     err\u001b[38;5;241m.\u001b[39mresponse\u001b[38;5;241m.\u001b[39mread()\n\u001b[0;32m--> 877\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_status_error_from_response(err\u001b[38;5;241m.\u001b[39mresponse) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m    878\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m httpx\u001b[38;5;241m.\u001b[39mTimeoutException \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m    879\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m retries \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0\u001b[39m:\n",
      "\u001b[0;31mBadRequestError\u001b[0m: Error code: 400 - {'error': {'message': \"'$.input' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}"
     ]
    }
   ],
   "source": [
    "app = TaskWeaverApp(app_dir=app_dir)\n",
    "session = app.get_session()\n",
    "\n",
    "user_query = \"Perform analysis over the dataframe\"\n",
    "response_round = session.send_message(user_query,\n",
    "                                      event_handler=lambda _type, _msg: print(f\"{_type}:\\n{_msg}\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Python 3.10.12\n"
     ]
    }
   ],
   "source": [
    "! python --version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "masterclass",
   "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",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}


==================================================
File: TaskWeaver/README.md
==================================================
### TaskWeaver

- **Planner**: Manages task decomposition and execution.
- **Code Generator (CG)**: Generates Python code snippets from user requests, leveraging plugins and examples.
- **Code Executor (CE)**: Executes generated code and maintains execution context.

https://github.com/microsoft/TaskWeaver.git


### Setup

**Ste 1: Install**
```
git clone https://github.com/microsoft/TaskWeaver.git
cd TaskWeaver
pip install -e . 
```


**Step 2: Make folder structure**

Project folder should look like this:
```bash
📦project
 ┣ 📜taskweaver_config.json # the configuration file for TaskWeaver
 ┣ 📂plugins # the folder to store plugins
 ┣ 📂planner_examples # the folder to store planner examples
 ┣ 📂codeinterpreter_examples # the folder to store code interpreter examples
 ┣ 📂sample_data # the folder to store sample data used for evaluations
 ┣ 📂logs # the folder to store logs, will be generated after program starts
 ┗ 📂workspace # the directory stores session data， will be generated after program starts
    ┗ 📂 session_id 
      ┣ 📂ces # the folder used by the code execution service
      ┗ 📂cwd # the current working directory to run the generated code
```

Here is the command to do this quickly:
```bash
mkdir <some_project_name>
cd <some_project_name>
mkdir -p plugins planner_examples codeinterpreter_examples sample_data logs workspace/session_id/ces workspace/session_id/cwd
touch taskweaver_config.json

cd .. # cd outside the project directory
```

**Step 3: Update `taskweaver_config.json`**
Add this to the file, by leaving `llm.api_key` blank it will ask you in the terminal.
```json
{
    "llm.api_base": "https://api.openai.com/v1",
    "llm.api_key": "", // replace with your own
    "llm.model": "gpt-4-1106-preview"
}
```

**Step 4: Run Taskweaver**

You can run taskweaver in the CLI
```bash
python -m taskweaver -p ./<project name>
```

Or you can run as a library (see notebooks for examples)

----


==================================================
File: TaskWeaver/_starter_projects/plugins/sql_data_analysis.py
==================================================
import pandas as pd
from taskweaver.plugin import Plugin, register_plugin, test_plugin

# Plugin definition
@register_plugin
class SQLDataAnalysis(Plugin):
    def __call__(self):
        """
        Performs a simple SQL Pull and return stats on the data.
        """
        df = pd.DataFrame({
            "A": [1, 2, 3],
            "B": ["A", "B", "C"]
        })

        row_count = len(df)
        column_count = len(df.columns)
        description = f"The data has {row_count} rows and {column_count} columns."
        return description

==================================================
File: TaskWeaver/_starter_projects/plugins/__init__.py
==================================================


==================================================
File: TaskWeaver/_starter_projects/plugins/sql_data_analysis.yaml
==================================================
name: sql_data_analysis 
description: Performs a simple SQL Pull and return stats on the data.
returns:
  - name: description
    type: string
    description: Description of analysis results.


==================================================
File: TaskWeaver/_starter_projects/workspace/__init__.py
==================================================
__init__.py

==================================================
File: TaskWeaver/_starter_projects/planner_examples/__init__.py
==================================================


==================================================
File: TaskWeaver/_starter_projects/sample_data/__init__.py
==================================================


==================================================
File: TaskWeaver/_starter_projects/logs/__init__.py
==================================================


==================================================
File: TaskWeaver/_starter_projects/codeinterpreter_examples/__init__.py
==================================================


==================================================
File: TaskWeaver/_starter_projects/_taskweaver_config_example.json
==================================================
{
    "llm.api_base": "https://api.openai.com/v1",
    "llm.api_key": "", // replace with your own
    "llm.model": "gpt-4-1106-preview"
}

==================================================
File: TaskWeaver/1.taskweaver_vs_autogen.ipynb
==================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Task Weaver vs Autogen:\n",
    "\n",
    "\n",
    "**Task Weaver:**\n",
    "- **Code Generation:** TaskWeaver’s primary advantage lies in its code-first design, which is especially beneficial for applications requiring direct manipulation and processing of data. It’s an effective tool for workloads that require interacting with code and data structures over abstract conversational models.\n",
    "- Handling of complex data structures like pandas DataFrame.\n",
    "- There are 3 components: Planner, Code Generator (CG), and Code Executor (CE). Autogen architecture is different, where the agent that corresponds with the human is the one who executes code. \n",
    "- TaskWeaver can be expanded into a multi-agent architecture for more complex projects and functionality."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Comparison with Autogen\n",
    "\n",
    "User(Human) input mode:\n",
    "- Autogen ✅ (`human_input_mode` with `UserProxyAgent`)\n",
    "- TaskWeaver ✅ (Planner can ask User)\n",
    "\n",
    "Compression:\n",
    "- Autogen ✅ (Compressible Agent)\n",
    "- TaskWeaver ✅ (Built in compression mechanism)\n",
    "\n",
    "Custom Agent Types:\n",
    "- Autogen  ✅ (Autogen is a multi-agent framework)\n",
    "- TaskWeaver ❌ (Taskweaver is single-agent framework)\n",
    "\n",
    "Predefined Code Tools:\n",
    "- Autogen  ✅ (with function calling)\n",
    "- TaskWeaver  ✅ (with Plugins)\n",
    "\n",
    "Adaptive Code Generative (for domain specific code):\n",
    "- Autogen  ✅ (Technically, with context stuffing the prompt)\n",
    "- TaskWeaver  ✅ (with Examples)\n",
    "\n",
    "Session Management:\n",
    "- Autogen ✅  (need to use different seed for cache)\n",
    "- TaskWeaver ✅ (Sessions built in natively)\n",
    "\n",
    "Stateful Code Execution:\n",
    "- Autogen ❌ (runs .py files)\n",
    "- TaskWeaver ✅ (runs stateful execution, like a jupyter notebook)\n",
    "\n",
    "Parallel Code Execution:\n",
    "- Autogen ❌ \n",
    "- TaskWeaver ✅ (If tasks are not dependent on eachother, they can run in different processes)\n",
    "\n",
    "Code Execution Security Measures:\n",
    "- Autogen ✅ (through containers)\n",
    "- TaskWeaver ✅ (through predefined rules)\n",
    "\n",
    "\n",
    "\n",
    "TaskWeaver seems excellent for when you have code dependent tasks, and appears to be a more structured way to manage those types of scenarios.\n",
    "Where it fails in comparison to Autogen is constraints. It's only meant to be used as a LLM coder. For my dynamic agent scenarios that would involve\n",
    "tasks from various roles Autogen would be a better choice. \n",
    "While TaskWeaver is ideal for data and code centric tasks and analytics, AutoGen's capabilities extend to a broader range of dynamic, interactive applications.\n",
    "This makes AutoGen more versatile in handling diverse scenarios, from decision-making tasks to interactive conversations.\n",
    "\n",
    "> *Our TaskWeaver is a single-agent framework that focuses on converting user requests into code, evenfor plugin calls.*\n",
    "\n",
    "\n",
    "Architectually speaking, TaskWeaver is akin to a two way chat in Autogen, where the UserProxyAgent is the Planner, and the Assistant is the Code Interpreter - but its the assistant who is running the code instead of UserProxyAgent. In terms of it's implementation - it's managed in a way that is more maintainable then Autogen for code execution. I would probably opt to use it for coding tasks in conjunction to using Autogen. Using taskweaver as a add-on agent in a Autogen GroupChat would most likely improve application performance a lot, not only in terms of code generation but in terms of security and maintainability also."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Extendibility?\n",
    "\n",
    "In [taskweaver.memory.post](https://github.com/microsoft/TaskWeaver/blob/4e9b71518c98bde20dbc87e6441ff1d84197dc48/taskweaver/memory/post.py#L13) it states that a post can only be one of these roles.\n",
    "> A post is the message used to communicate between two roles. <br>\n",
    "> It should always have a text_message to denote the string message,  <br>\n",
    ">while other data formats should be put in the attachment. <br>\n",
    "> The role can be either a User, a Planner, or a CodeInterpreter. <br>\n",
    "\n",
    "And in `type_vars.py`:\n",
    "```python\n",
    "RoleName = Literal[\"User\", \"Planner\", \"CodeInterpreter\"]\n",
    "```\n",
    "\n",
    "So it differs from autogen in that you don't create a number of agents that have different roles, with TaskWeaver it seems you use these three roles to do one specific type of task very well: **natural language to executable code**. In the paper they even state that multi-agent systems is \n",
    "\n",
    ">*The first approach involves one agent (powered by TaskWeaver) calling other agents via its plugins.\n",
    ">Fig. 4 (a) depicts a simple example, although this can be extended to a more complex network <br> where multiple agents form a mesh network.\n",
    "> he second approach involves embedding TaskWeaverpowered agents into an existing multi-agent framework, such as AutoGen [1], as demonstrated in Fig.*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### NOTE TO SELF:\n",
    "\n",
    "- Autogen as a plugin/example generator for TaskWeaver:\n",
    "    - Plugins:\n",
    "        - \"I need a plugin to do ____\" --> save it in Plugin store\n",
    "    - Examples:\n",
    "        - Domain specific code base -> llm to make examples -> store as examples"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "masterclass",
   "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",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}

