Add images correctly

This commit is contained in:
simonpfish 2023-11-10 16:43:44 -05:00
parent 57a727b72e
commit c40506abcb

View File

@ -27,7 +27,7 @@
"source": [
"## Setup\n",
"\n",
"### Python SDK \n",
"### Python SDK\n",
"\n",
"> **Note**\n",
"> We've updated our [Python SDK](https://github.com/openai/openai-python) to add support for the Assistants API, so you'll need to update it to the latest version (`1.2.3` at time of writing).\n"
@ -35,29 +35,9 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: openai in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (1.2.3)\n",
"Requirement already satisfied: anyio<4,>=3.5.0 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from openai) (3.6.2)\n",
"Requirement already satisfied: distro<2,>=1.7.0 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from openai) (1.8.0)\n",
"Requirement already satisfied: httpx<1,>=0.23.0 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from openai) (0.23.3)\n",
"Requirement already satisfied: pydantic<3,>=1.9.0 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from openai) (1.10.9)\n",
"Requirement already satisfied: tqdm>4 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from openai) (4.64.1)\n",
"Requirement already satisfied: typing-extensions<5,>=4.5 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from openai) (4.5.0)\n",
"Requirement already satisfied: idna>=2.8 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from anyio<4,>=3.5.0->openai) (3.4)\n",
"Requirement already satisfied: sniffio>=1.1 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from anyio<4,>=3.5.0->openai) (1.3.0)\n",
"Requirement already satisfied: certifi in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from httpx<1,>=0.23.0->openai) (2022.12.7)\n",
"Requirement already satisfied: httpcore<0.17.0,>=0.15.0 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from httpx<1,>=0.23.0->openai) (0.16.3)\n",
"Requirement already satisfied: rfc3986<2,>=1.3 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from rfc3986[idna2008]<2,>=1.3->httpx<1,>=0.23.0->openai) (1.5.0)\n",
"Requirement already satisfied: h11<0.15,>=0.13 in /Users/ilan/.virtualenvs/openai/lib/python3.9/site-packages (from httpcore<0.17.0,>=0.15.0->httpx<1,>=0.23.0->openai) (0.14.0)\n"
]
}
],
"outputs": [],
"source": [
"!pip install --upgrade openai"
]
@ -90,7 +70,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Pretty Printing Helper"
"### Pretty Printing Helper\n"
]
},
{
@ -101,6 +81,7 @@
"source": [
"import json\n",
"\n",
"\n",
"def show_json(obj):\n",
" display(json.loads(obj.model_dump_json()))"
]
@ -130,7 +111,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"1728\" alt=\"Assistants Playground\" src=\"../images/assistants_overview_assistants_playground.png\">\n"
"![Assistants Playground](../images/assistants_overview_assistants_playground.png)\n"
]
},
{
@ -144,7 +125,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"1728\" alt=\"Creating New Assistant\" src=\"../images/assistants_overview_new_assistant.png\">\n"
"![Creating New Assistant](../images/assistants_overview_new_assistant.png)\n"
]
},
{
@ -158,7 +139,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"1728\" alt=\"Assistants Dashboard\" src=\"../images/assistants_overview_assistants_dashboard.png\">\n"
"![Assistants Dashboard](../images/assistants_overview_assistants_dashboard.png)\n"
]
},
{
@ -379,6 +360,7 @@
"source": [
"import time\n",
"\n",
"\n",
"def wait_on_run(run, thread):\n",
" while run.status == \"queued\" or run.status == \"in_progress\":\n",
" run = client.beta.threads.runs.retrieve(\n",
@ -628,7 +610,9 @@
"\n",
"\n",
"# Emulating concurrent user requests\n",
"thread1, run1 = create_thread_and_run(\"I need to solve the equation `3x + 11 = 14`. Can you help me?\")\n",
"thread1, run1 = create_thread_and_run(\n",
" \"I need to solve the equation `3x + 11 = 14`. Can you help me?\"\n",
")\n",
"thread2, run2 = create_thread_and_run(\"Could you explain linear algebra to me?\")\n",
"thread3, run3 = create_thread_and_run(\"I don't like math. What can I do?\")\n",
"\n",
@ -739,7 +723,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"1728\" alt=\"Enabling code interpreter\" src=\"../images/assistants_overview_enable_code_interpreter.png\">\n"
"![Enabling code interpreter](../images/assistants_overview_enable_code_interpreter.png)\n"
]
},
{
@ -928,7 +912,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"1728\" alt=\"Enabling retrieval\" src=\"../images/assistants_overview_enable_retrieval.png\">\n"
"![Enabling retrieval](../images/assistants_overview_enable_retrieval.png)\n"
]
},
{
@ -1526,13 +1510,14 @@
"We covered a lot of ground in this notebook, give yourself a high-five! Hopefully you should now have a strong foundation to build powerful, stateful experiences with tools like Code Interpreter, Retrieval, and Functions!\n",
"\n",
"There's a few sections we didn't cover for the sake of brevity, so here's a few resources to explore further:\n",
"\n",
"- [Annotations](https://platform.openai.com/docs/assistants/how-it-works/managing-threads-and-messages): parsing file citations\n",
"- [Files](https://platform.openai.com/docs/api-reference/assistants/file-object): Thread scoped vs Assistant scoped\n",
"- [Parallel Function Calls](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling): calling multiple tools in a single Step\n",
"- Multi-Assistant Thread Runs: single Thread with Messages from multiple Assistants\n",
"- Streaming: coming soon!\n",
"\n",
"Now go off and build something ama[zing](https://www.youtube.com/watch?v=xvFZjo5PgG0&pp=ygUQcmljayByb2xsIG5vIGFkcw%3D%3D)! "
"Now go off and build something ama[zing](https://www.youtube.com/watch?v=xvFZjo5PgG0&pp=ygUQcmljayByb2xsIG5vIGFkcw%3D%3D)!\n"
]
}
],
@ -1552,7 +1537,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.11.4"
}
},
"nbformat": 4,