Add overview diagram for Assistants API Overview. (#850)

pull/851/head
Ilan Bigio 7 months ago committed by GitHub
parent 08a51a3ec5
commit 5060a68179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,7 +4,20 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Assistants API Overview (Python SDK)\n",
"# Assistants API Overview (Python SDK)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![Assistants API Diagram](../images/assistants_overview_diagram.png)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"The new [Assistants API](https://platform.openai.com/docs/assistants/overview) is a stateful evolution of our [Chat Completions API](https://platform.openai.com/docs/guides/text-generation/chat-completions-api) meant to simplify the creation of assistant-like experiences, and enable developer access to powerful tools like Code Interpreter and Retrieval.\n",
"\n",
@ -35,7 +48,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
@ -81,7 +94,6 @@
"source": [
"import json\n",
"\n",
"\n",
"def show_json(obj):\n",
" display(json.loads(obj.model_dump_json()))"
]
@ -157,8 +169,8 @@
{
"data": {
"text/plain": [
"{'id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
" 'created_at': 1699713024,\n",
"{'id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'created_at': 1699828331,\n",
" 'description': None,\n",
" 'file_ids': [],\n",
" 'instructions': 'You are a personal math tutor. Answer questions briefly, in a sentence or less.',\n",
@ -197,7 +209,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, we'll create a new Thread and add a message to it. This will hold the state of our conversation, so we don't have re-send the entire message history each time.\n"
"Next, we'll create a new Thread and add a Message to it. This will hold the state of our conversation, so we don't have re-send the entire message history each time.\n"
]
},
{
@ -222,8 +234,8 @@
{
"data": {
"text/plain": [
"{'id': 'thread_92NwAX7i7EOgfQ4BaX2dfeZl',\n",
" 'created_at': 1699713024,\n",
"{'id': 'thread_bw42vPoQtYBMQE84WubNcJXG',\n",
" 'created_at': 1699828331,\n",
" 'metadata': {},\n",
" 'object': 'thread'}"
]
@ -252,18 +264,18 @@
{
"data": {
"text/plain": [
"{'id': 'msg_jJpZrc7akLYXgiwUj3tV3IIQ',\n",
"{'id': 'msg_IBiZDAWHhWPewxzN0EfTYNew',\n",
" 'assistant_id': None,\n",
" 'content': [{'text': {'annotations': [],\n",
" 'value': 'I need to solve the equation `3x + 11 = 14`. Can you help me?'},\n",
" 'type': 'text'}],\n",
" 'created_at': 1699713025,\n",
" 'created_at': 1699828332,\n",
" 'file_ids': [],\n",
" 'metadata': {},\n",
" 'object': 'thread.message',\n",
" 'role': 'user',\n",
" 'run_id': None,\n",
" 'thread_id': 'thread_92NwAX7i7EOgfQ4BaX2dfeZl'}"
" 'thread_id': 'thread_bw42vPoQtYBMQE84WubNcJXG'}"
]
},
"metadata": {},
@ -311,12 +323,12 @@
{
"data": {
"text/plain": [
"{'id': 'run_MBQkkPC9hw6M3NJP5XDcjrG9',\n",
" 'assistant_id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
"{'id': 'run_LA08RjouV3RemQ78UZXuyzv6',\n",
" 'assistant_id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'cancelled_at': None,\n",
" 'completed_at': None,\n",
" 'created_at': 1699713025,\n",
" 'expires_at': 1699713625,\n",
" 'created_at': 1699828332,\n",
" 'expires_at': 1699828932,\n",
" 'failed_at': None,\n",
" 'file_ids': [],\n",
" 'instructions': 'You are a personal math tutor. Answer questions briefly, in a sentence or less.',\n",
@ -327,7 +339,7 @@
" 'required_action': None,\n",
" 'started_at': None,\n",
" 'status': 'queued',\n",
" 'thread_id': 'thread_92NwAX7i7EOgfQ4BaX2dfeZl',\n",
" 'thread_id': 'thread_bw42vPoQtYBMQE84WubNcJXG',\n",
" 'tools': []}"
]
},
@ -360,7 +372,6 @@
"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",
@ -379,11 +390,11 @@
{
"data": {
"text/plain": [
"{'id': 'run_MBQkkPC9hw6M3NJP5XDcjrG9',\n",
" 'assistant_id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
"{'id': 'run_LA08RjouV3RemQ78UZXuyzv6',\n",
" 'assistant_id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'cancelled_at': None,\n",
" 'completed_at': 1699713027,\n",
" 'created_at': 1699713025,\n",
" 'completed_at': 1699828333,\n",
" 'created_at': 1699828332,\n",
" 'expires_at': None,\n",
" 'failed_at': None,\n",
" 'file_ids': [],\n",
@ -393,9 +404,9 @@
" 'model': 'gpt-4-1106-preview',\n",
" 'object': 'thread.run',\n",
" 'required_action': None,\n",
" 'started_at': 1699713025,\n",
" 'started_at': 1699828332,\n",
" 'status': 'completed',\n",
" 'thread_id': 'thread_92NwAX7i7EOgfQ4BaX2dfeZl',\n",
" 'thread_id': 'thread_bw42vPoQtYBMQE84WubNcJXG',\n",
" 'tools': []}"
]
},
@ -430,33 +441,33 @@
{
"data": {
"text/plain": [
"{'data': [{'id': 'msg_cqd6LDKJJTxGMQTBpYRrTaW3',\n",
" 'assistant_id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
"{'data': [{'id': 'msg_S0ZtKIWjyWtbIW9JNUocPdUS',\n",
" 'assistant_id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'content': [{'text': {'annotations': [],\n",
" 'value': 'Yes, subtract 11 from both sides to get `3x = 3` and then divide by 3 to find `x = 1`.'},\n",
" 'value': 'Yes. Subtract 11 from both sides to get `3x = 3`, then divide by 3 to find `x = 1`.'},\n",
" 'type': 'text'}],\n",
" 'created_at': 1699713026,\n",
" 'created_at': 1699828333,\n",
" 'file_ids': [],\n",
" 'metadata': {},\n",
" 'object': 'thread.message',\n",
" 'role': 'assistant',\n",
" 'run_id': 'run_MBQkkPC9hw6M3NJP5XDcjrG9',\n",
" 'thread_id': 'thread_92NwAX7i7EOgfQ4BaX2dfeZl'},\n",
" {'id': 'msg_jJpZrc7akLYXgiwUj3tV3IIQ',\n",
" 'run_id': 'run_LA08RjouV3RemQ78UZXuyzv6',\n",
" 'thread_id': 'thread_bw42vPoQtYBMQE84WubNcJXG'},\n",
" {'id': 'msg_IBiZDAWHhWPewxzN0EfTYNew',\n",
" 'assistant_id': None,\n",
" 'content': [{'text': {'annotations': [],\n",
" 'value': 'I need to solve the equation `3x + 11 = 14`. Can you help me?'},\n",
" 'type': 'text'}],\n",
" 'created_at': 1699713025,\n",
" 'created_at': 1699828332,\n",
" 'file_ids': [],\n",
" 'metadata': {},\n",
" 'object': 'thread.message',\n",
" 'role': 'user',\n",
" 'run_id': None,\n",
" 'thread_id': 'thread_92NwAX7i7EOgfQ4BaX2dfeZl'}],\n",
" 'thread_id': 'thread_bw42vPoQtYBMQE84WubNcJXG'}],\n",
" 'object': 'list',\n",
" 'first_id': 'msg_cqd6LDKJJTxGMQTBpYRrTaW3',\n",
" 'last_id': 'msg_jJpZrc7akLYXgiwUj3tV3IIQ',\n",
" 'first_id': 'msg_S0ZtKIWjyWtbIW9JNUocPdUS',\n",
" 'last_id': 'msg_IBiZDAWHhWPewxzN0EfTYNew',\n",
" 'has_more': False}"
]
},
@ -491,21 +502,21 @@
{
"data": {
"text/plain": [
"{'data': [{'id': 'msg_Jjzs9ndqcBcrIAWTNcvpDCQy',\n",
" 'assistant_id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
"{'data': [{'id': 'msg_9MAeOrGriHcImeQnAzvYyJbs',\n",
" 'assistant_id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'content': [{'text': {'annotations': [],\n",
" 'value': 'Certainly! The goal is to get x by itself on one side of the equation. \\n\\nStep 1: Subtract 11 from both sides to isolate the term with x: \\n`3x + 11 - 11 = 14 - 11`\\nThis simplifies to: \\n`3x = 3`\\n\\nStep 2: Now, divide both sides by 3, the coefficient of x, to solve for x:\\n`3x / 3 = 3 / 3`\\nThis results in:\\n`x = 1`'},\n",
" 'value': 'Certainly. To solve for x in the equation `3x + 11 = 14`:\\n\\n1. Subtract 11 from both sides: `3x + 11 - 11 = 14 - 11` simplifies to `3x = 3`.\\n2. Divide both sides by 3: `3x / 3 = 3 / 3` simplifies to `x = 1`.\\n\\nSo, the solution is `x = 1`.'},\n",
" 'type': 'text'}],\n",
" 'created_at': 1699713029,\n",
" 'created_at': 1699828335,\n",
" 'file_ids': [],\n",
" 'metadata': {},\n",
" 'object': 'thread.message',\n",
" 'role': 'assistant',\n",
" 'run_id': 'run_8OreNVOPKIJ6Z4B9ufiFfxjk',\n",
" 'thread_id': 'thread_92NwAX7i7EOgfQ4BaX2dfeZl'}],\n",
" 'run_id': 'run_IFHfsubkJv7RSUbDZpNVs4PG',\n",
" 'thread_id': 'thread_bw42vPoQtYBMQE84WubNcJXG'}],\n",
" 'object': 'list',\n",
" 'first_id': 'msg_Jjzs9ndqcBcrIAWTNcvpDCQy',\n",
" 'last_id': 'msg_Jjzs9ndqcBcrIAWTNcvpDCQy',\n",
" 'first_id': 'msg_9MAeOrGriHcImeQnAzvYyJbs',\n",
" 'last_id': 'msg_9MAeOrGriHcImeQnAzvYyJbs',\n",
" 'has_more': False}"
]
},
@ -573,7 +584,6 @@
"\n",
"client = OpenAI()\n",
"\n",
"\n",
"def submit_message(assistant_id, thread, user_message):\n",
" client.beta.threads.messages.create(\n",
" thread_id=thread.id, role=\"user\", content=user_message\n",
@ -637,21 +647,21 @@
"text": [
"# Messages\n",
"user: I need to solve the equation `3x + 11 = 14`. Can you help me?\n",
"assistant: Yes, subtract 11 from both sides to get `3x = 3`, and then divide both sides by 3 to find `x = 1`.\n",
"assistant: Yes, subtract 11 from both sides to get `3x = 3`, then divide both sides by 3 to find `x = 1`.\n",
"\n",
"# Messages\n",
"user: Could you explain linear algebra to me?\n",
"assistant: Linear algebra is the branch of mathematics concerning vector spaces and linear mappings between these spaces, which includes the study of lines, planes, and subspaces, but is also concerned with properties common to all vector spaces.\n",
"assistant: Linear algebra is the branch of mathematics that deals with vector spaces, linear equations, and matrices, focusing on the properties and operations that can be applied to vectors and linear transformations.\n",
"\n",
"# Messages\n",
"user: I don't like math. What can I do?\n",
"assistant: Find aspects of math that connect with your interests or everyday life to make it more relatable and engaging, and consider working with a tutor or using interactive tools that can make learning math more enjoyable.\n",
"assistant: Try finding aspects of math that relate to your interests or daily life, and consider a tutor or interactive resources to make learning more enjoyable.\n",
"\n",
"# Messages\n",
"user: I don't like math. What can I do?\n",
"assistant: Find aspects of math that connect with your interests or everyday life to make it more relatable and engaging, and consider working with a tutor or using interactive tools that can make learning math more enjoyable.\n",
"assistant: Try finding aspects of math that relate to your interests or daily life, and consider a tutor or interactive resources to make learning more enjoyable.\n",
"user: Thank you!\n",
"assistant: You're welcome! If you have any more questions or need assistance with math, feel free to ask.\n",
"assistant: You're welcome! If you have any more questions, feel free to ask.\n",
"\n"
]
}
@ -659,7 +669,6 @@
"source": [
"import time\n",
"\n",
"\n",
"# Pretty printing helper\n",
"def pretty_print(messages):\n",
" print(\"# Messages\")\n",
@ -741,8 +750,8 @@
{
"data": {
"text/plain": [
"{'id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
" 'created_at': 1699713024,\n",
"{'id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'created_at': 1699828331,\n",
" 'description': None,\n",
" 'file_ids': [],\n",
" 'instructions': 'You are a personal math tutor. Answer questions briefly, in a sentence or less.',\n",
@ -783,8 +792,7 @@
"text": [
"# Messages\n",
"user: Generate the first 20 fibbonaci numbers with code.\n",
"assistant: The first 20 Fibonacci numbers are:\n",
"0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181.\n",
"assistant: The first 20 Fibonacci numbers are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, and 4181.\n",
"\n"
]
}
@ -841,8 +849,8 @@
{
"data": {
"text/plain": [
"{'tool_calls': [{'id': 'call_VuUeEz8f6tODxKqNbOXotPbp',\n",
" 'code_interpreter': {'input': '# Function to generate first 20 Fibonacci numbers\\ndef generate_fibonacci(n):\\n fib_series = [0, 1]\\n for _ in range(2, n):\\n fib_series.append(fib_series[-1] + fib_series[-2])\\n return fib_series\\n\\n# Generate and display the first 20 Fibonacci numbers\\nfirst_20_fibonacci = generate_fibonacci(20)\\nfirst_20_fibonacci',\n",
"{'tool_calls': [{'id': 'call_WMNqd63PtX8vZzTwaA6eWpBg',\n",
" 'code_interpreter': {'input': '# Python function to generate the first 20 Fibonacci numbers\\ndef fibonacci(n):\\n fib_sequence = [0, 1]\\n while len(fib_sequence) < n:\\n fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])\\n return fib_sequence\\n\\n# Generate the first 20 Fibonacci numbers\\nfirst_20_fibonacci = fibonacci(20)\\nfirst_20_fibonacci',\n",
" 'outputs': [{'logs': '[0,\\n 1,\\n 1,\\n 2,\\n 3,\\n 5,\\n 8,\\n 13,\\n 21,\\n 34,\\n 55,\\n 89,\\n 144,\\n 233,\\n 377,\\n 610,\\n 987,\\n 1597,\\n 2584,\\n 4181]',\n",
" 'type': 'logs'}]},\n",
" 'type': 'code_interpreter'}],\n",
@ -862,7 +870,7 @@
{
"data": {
"text/plain": [
"{'message_creation': {'message_id': 'msg_5MKMkxkBGgjaWo24rnOngYRn'},\n",
"{'message_creation': {'message_id': 'msg_z593lE5bvcD6BngeDFHDxzwm'},\n",
" 'type': 'message_creation'}"
]
},
@ -924,10 +932,10 @@
{
"data": {
"text/plain": [
"{'id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
" 'created_at': 1699713024,\n",
"{'id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'created_at': 1699828331,\n",
" 'description': None,\n",
" 'file_ids': ['file-AapssvnjRaBEvfZQkdfknfr6'],\n",
" 'file_ids': ['file-MdXcQI8OdPp76wukWI4dpLwW'],\n",
" 'instructions': 'You are a personal math tutor. Answer questions briefly, in a sentence or less.',\n",
" 'metadata': {},\n",
" 'model': 'gpt-4-1106-preview',\n",
@ -969,7 +977,8 @@
"text": [
"# Messages\n",
"user: What are some cool math concepts behind this ML paper pdf? Explain in two sentences.\n",
"assistant: One cool math concept in this ML paper is the application of zero-shot learning where language models (LMs) demonstrate the ability to transfer well across different domains and datasets without task-specific training, improving the state of the art in seven out of eight datasets【11†source】. Specifically, it highlights the models' performance on complex tasks like LAMBADA and the Childrens Book Test, which are benchmarks created to measure long-term dependencies in text, and notes challenges in datasets with extensive pre-processing that disrupts long-range structure【11†source】.\n",
"assistant: I am unable to find specific sections referring to \"cool math concepts\" directly in the paper using the available tools. I will now read the beginning of the paper to identify any mathematical concepts that are fundamental to the paper.\n",
"assistant: The paper discusses leveraging large language models as a framework for unsupervised multitask learning, where tasks are implicitly defined by the context within sequences of text. It explores the zero-shot learning capabilities of such models by showing that when a language model is trained on a vast dataset, it begins to generalize and perform tasks without explicit supervision, achieving competitive results across various natural language processing tasks using a probabilistic framework based on sequential modeling and conditional probabilities.\n",
"\n"
]
}
@ -1148,7 +1157,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"1728\" alt=\"Enabling custom function\" src=\"../images/assistants_overview_enable_function.png\">\n"
"![Enabling custom function](../images/assistants_overview_enable_function.png)"
]
},
{
@ -1167,10 +1176,10 @@
{
"data": {
"text/plain": [
"{'id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
" 'created_at': 1699713024,\n",
"{'id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'created_at': 1699828331,\n",
" 'description': None,\n",
" 'file_ids': ['file-AapssvnjRaBEvfZQkdfknfr6'],\n",
" 'file_ids': ['file-MdXcQI8OdPp76wukWI4dpLwW'],\n",
" 'instructions': 'You are a personal math tutor. Answer questions briefly, in a sentence or less.',\n",
" 'metadata': {},\n",
" 'model': 'gpt-4-1106-preview',\n",
@ -1256,27 +1265,27 @@
{
"data": {
"text/plain": [
"{'id': 'run_oF6mkM82eL4EZXNpGJNLHjTl',\n",
" 'assistant_id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
"{'id': 'run_98PGE3qGtHoaWaCLoytyRUBf',\n",
" 'assistant_id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'cancelled_at': None,\n",
" 'completed_at': None,\n",
" 'created_at': 1699713070,\n",
" 'expires_at': 1699713670,\n",
" 'created_at': 1699828370,\n",
" 'expires_at': 1699828970,\n",
" 'failed_at': None,\n",
" 'file_ids': ['file-AapssvnjRaBEvfZQkdfknfr6'],\n",
" 'file_ids': ['file-MdXcQI8OdPp76wukWI4dpLwW'],\n",
" 'instructions': 'You are a personal math tutor. Answer questions briefly, in a sentence or less.',\n",
" 'last_error': None,\n",
" 'metadata': {},\n",
" 'model': 'gpt-4-1106-preview',\n",
" 'object': 'thread.run',\n",
" 'required_action': {'submit_tool_outputs': {'tool_calls': [{'id': 'call_J1aEG51Vx15HFRmRI4p3srdS',\n",
" 'function': {'arguments': '{\\n \"title\": \"Math Fundamentals Quiz\",\\n \"questions\": [\\n {\\n \"question_text\": \"Explain in your own words why a negative times a negative is a positive.\",\\n \"question_type\": \"FREE_RESPONSE\"\\n },\\n {\\n \"question_text\": \"What is the result of the expression 2^(3) * 2^(-4)?\",\\n \"question_type\": \"MULTIPLE_CHOICE\",\\n \"choices\": [\"1/2\", \"1/4\", \"1/8\", \"1/16\"]\\n }\\n ]\\n}',\n",
" 'required_action': {'submit_tool_outputs': {'tool_calls': [{'id': 'call_Zf650sWT1wW4Uwbf5YeDS0VG',\n",
" 'function': {'arguments': '{\\n \"title\": \"Mathematics Quiz\",\\n \"questions\": [\\n {\\n \"question_text\": \"Explain why the square root of a negative number is not a real number.\",\\n \"question_type\": \"FREE_RESPONSE\"\\n },\\n {\\n \"question_text\": \"What is the value of an angle in a regular pentagon?\",\\n \"choices\": [\\n \"72 degrees\",\\n \"90 degrees\",\\n \"108 degrees\",\\n \"120 degrees\"\\n ],\\n \"question_type\": \"MULTIPLE_CHOICE\"\\n }\\n ]\\n}',\n",
" 'name': 'display_quiz'},\n",
" 'type': 'function'}]},\n",
" 'type': 'submit_tool_outputs'},\n",
" 'started_at': 1699713070,\n",
" 'started_at': 1699828370,\n",
" 'status': 'requires_action',\n",
" 'thread_id': 'thread_hQNP1xhlm8aMSKYNyCY5HbDi',\n",
" 'thread_id': 'thread_bICTESFvWoRdj0O0SzsosLCS',\n",
" 'tools': [{'type': 'code_interpreter'},\n",
" {'type': 'retrieval'},\n",
" {'function': {'name': 'display_quiz',\n",
@ -1329,12 +1338,12 @@
{
"data": {
"text/plain": [
"{'title': 'Math Fundamentals Quiz',\n",
" 'questions': [{'question_text': 'Explain in your own words why a negative times a negative is a positive.',\n",
"{'title': 'Mathematics Quiz',\n",
" 'questions': [{'question_text': 'Explain why the square root of a negative number is not a real number.',\n",
" 'question_type': 'FREE_RESPONSE'},\n",
" {'question_text': 'What is the result of the expression 2^(3) * 2^(-4)?',\n",
" 'question_type': 'MULTIPLE_CHOICE',\n",
" 'choices': ['1/2', '1/4', '1/8', '1/16']}]}"
" {'question_text': 'What is the value of an angle in a regular pentagon?',\n",
" 'choices': ['72 degrees', '90 degrees', '108 degrees', '120 degrees'],\n",
" 'question_type': 'MULTIPLE_CHOICE'}]}"
]
},
"execution_count": 27,
@ -1369,15 +1378,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Quiz: Math Fundamentals Quiz\n",
"Quiz: Mathematics Quiz\n",
"\n",
"Explain in your own words why a negative times a negative is a positive.\n",
"Explain why the square root of a negative number is not a real number.\n",
"\n",
"What is the result of the expression 2^(3) * 2^(-4)?\n",
"0. 1/2\n",
"1. 1/4\n",
"2. 1/8\n",
"3. 1/16\n",
"What is the value of an angle in a regular pentagon?\n",
"0. 72 degrees\n",
"1. 90 degrees\n",
"2. 108 degrees\n",
"3. 120 degrees\n",
"\n",
"Responses: [\"I don't know.\", 'a']\n"
]
@ -1405,23 +1414,23 @@
{
"data": {
"text/plain": [
"{'id': 'run_oF6mkM82eL4EZXNpGJNLHjTl',\n",
" 'assistant_id': 'asst_LTdumekzlZEXmAbrfssoXroe',\n",
"{'id': 'run_98PGE3qGtHoaWaCLoytyRUBf',\n",
" 'assistant_id': 'asst_9HAjl9y41ufsViNcThW1EXUS',\n",
" 'cancelled_at': None,\n",
" 'completed_at': None,\n",
" 'created_at': 1699713070,\n",
" 'expires_at': 1699713670,\n",
" 'created_at': 1699828370,\n",
" 'expires_at': 1699828970,\n",
" 'failed_at': None,\n",
" 'file_ids': ['file-AapssvnjRaBEvfZQkdfknfr6'],\n",
" 'file_ids': ['file-MdXcQI8OdPp76wukWI4dpLwW'],\n",
" 'instructions': 'You are a personal math tutor. Answer questions briefly, in a sentence or less.',\n",
" 'last_error': None,\n",
" 'metadata': {},\n",
" 'model': 'gpt-4-1106-preview',\n",
" 'object': 'thread.run',\n",
" 'required_action': None,\n",
" 'started_at': 1699713070,\n",
" 'started_at': 1699828370,\n",
" 'status': 'queued',\n",
" 'thread_id': 'thread_hQNP1xhlm8aMSKYNyCY5HbDi',\n",
" 'thread_id': 'thread_bICTESFvWoRdj0O0SzsosLCS',\n",
" 'tools': [{'type': 'code_interpreter'},\n",
" {'type': 'retrieval'},\n",
" {'function': {'name': 'display_quiz',\n",
@ -1476,13 +1485,11 @@
"text": [
"# Messages\n",
"user: Make a quiz with 2 questions: One open ended, one multiple choice. Then, give me feedback for the responses.\n",
"assistant: Your responses show that there is some confusion that we need to address.\n",
"\n",
"For the open-ended question, saying \"I don't know\" indicates we need to explore the concept of multiplying negatives together. Remember, a negative number is essentially an opposite sign, so when you multiply two negatives, you are effectively doing the \"opposite of an opposite,\" which results in a positive. It's a fundamental rule in math that helps maintain consistency in mathematical operations.\n",
"assistant: Thank you for attempting the quiz.\n",
"\n",
"Regarding the multiple choice question, the answer you chose, \"a,\" corresponds to the option \"1/2.\" However, the correct answer is actually \"1/16.\" To solve this, you can use the rule of exponents that states when multiplying powers with the same base, you can add the exponents: 2^(3 + (-4)) = 2^(-1) = 1/2^1 = 1/2.\n",
"For the first question, it's important to know that the square root of a negative number is not a real number because real numbers consist of all the numbers on the number line, and that includes all positive numbers, zero, and negative numbers. However, the square root of a negative number is not on this number line; instead, it is what we call an imaginary number. When we want to take the square root of a negative number, we typically use the imaginary unit \\(i\\), where \\(i\\) is defined as \\(\\sqrt{-1}\\).\n",
"\n",
"Don't be discouraged; these concepts can be tricky, but with practice, you'll get the hang of it! Let's work through similar problems to build your understanding. Would you like to go over more examples together?\n",
"For the second question, the correct answer is \"108 degrees.\" In a regular pentagon, which is a five-sided polygon with equal sides and angles, each interior angle is \\(108\\) degrees. This is because the sum of the interior angles of a pentagon is \\(540\\) degrees, and when divided by \\(5\\) (the number of angles), it gives \\(108\\) degrees per angle. The choice you selected, \"72 degrees,\" actually refers to the external angle of a regular pentagon, not the internal angle.\n",
"\n"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 KiB

Loading…
Cancel
Save