Skip to content

Commit b163124

Browse files
authored
Merge pull request #13 from NYU-RTS/slides
responses api
2 parents 1c119c5 + 388ecaa commit b163124

3 files changed

Lines changed: 167 additions & 175 deletions

File tree

notebooks/custom_tool.ipynb

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
{
124124
"data": {
125125
"text/plain": [
126-
"[ResponseFunctionToolCall(arguments='{\"num_sides\":10}', call_id='call_l38M88Up4bBKgxsU9ZshNVcK', name='roll_dice', type='function_call', id='fc_1fa5cd13-13c2-4b66-9937-7907c60fc118', namespace=None, status='completed')]"
126+
"[ResponseFunctionToolCall(arguments='{\"num_sides\":10}', call_id='call_luKwTR3dskDp3OVI3RZ0A4to', name='roll_dice', type='function_call', id='fc_16624739-61fa-4ebf-b0eb-f5c1ac84b6ae', namespace=None, status='completed')]"
127127
]
128128
},
129129
"execution_count": 5,
@@ -230,10 +230,10 @@
230230
"text/plain": [
231231
"[{'role': 'user',\n",
232232
" 'content': 'Roll a 10 sided die and check if the dice roll was valid. Explain your reasoning.'},\n",
233-
" ResponseFunctionToolCall(arguments='{\"num_sides\":10}', call_id='call_l38M88Up4bBKgxsU9ZshNVcK', name='roll_dice', type='function_call', id='fc_1fa5cd13-13c2-4b66-9937-7907c60fc118', namespace=None, status='completed'),\n",
233+
" ResponseFunctionToolCall(arguments='{\"num_sides\":10}', call_id='call_luKwTR3dskDp3OVI3RZ0A4to', name='roll_dice', type='function_call', id='fc_16624739-61fa-4ebf-b0eb-f5c1ac84b6ae', namespace=None, status='completed'),\n",
234234
" {'type': 'function_call_output',\n",
235-
" 'call_id': 'call_l38M88Up4bBKgxsU9ZshNVcK',\n",
236-
" 'output': '4'}]"
235+
" 'call_id': 'call_luKwTR3dskDp3OVI3RZ0A4to',\n",
236+
" 'output': '6'}]"
237237
]
238238
},
239239
"execution_count": 12,
@@ -262,27 +262,29 @@
262262
{
263263
"data": {
264264
"text/html": [
265-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">The result of rolling the 10-sided die is <span style=\"font-weight: bold\">4</span>. \n",
265+
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">The result of the 10-sided die roll is <span style=\"font-weight: bold\">6</span>. \n",
266266
"\n",
267-
"<span style=\"font-weight: bold\">Reasoning for validity:</span> \n",
267+
"<span style=\"font-weight: bold\">Validity Check:</span> \n",
268268
"\n",
269-
"<span style=\"color: #008080; text-decoration-color: #008080\"> 1 </span><span style=\"font-weight: bold\">Range Check:</span> A standard 10-sided die (d10) has faces numbered from 1 to 10. The result obtained is 4, which \n",
270-
"<span style=\"color: #008080; text-decoration-color: #008080\"> </span>falls within this valid range ($1 \\le 4 \\le 10$). \n",
271-
"<span style=\"color: #008080; text-decoration-color: #008080\"> 2 </span><span style=\"font-weight: bold\">Integer Check:</span> Dice rolls must result in whole numbers (integers). The result is 4, which is an integer. \n",
269+
"<span style=\"font-weight: bold\"> • Die Type:</span> 10-sided die ($d10$). \n",
270+
"<span style=\"font-weight: bold\"> • Possible Outcomes:</span> Any integer from 1 to 10 (inclusive): ${1, 2, 3, 4, 5, 6, 7, 8, 9, 10}$. \n",
271+
"<span style=\"font-weight: bold\"> • Actual Outcome:</span> 6. \n",
272272
"\n",
273-
"Therefore, the dice roll is <span style=\"font-weight: bold\">valid</span>. \n",
273+
"<span style=\"font-weight: bold\">Reasoning:</span> Since the roll produced the number 6, which is an integer and falls within the valid range of 1 to 10 \n",
274+
"for a 10-sided die, the dice roll is <span style=\"font-weight: bold\">valid</span>. \n",
274275
"</pre>\n"
275276
],
276277
"text/plain": [
277-
"The result of rolling the 10-sided die is \u001b[1m4\u001b[0m. \n",
278+
"The result of the 10-sided die roll is \u001b[1m6\u001b[0m. \n",
278279
"\n",
279-
"\u001b[1mReasoning for validity:\u001b[0m \n",
280+
"\u001b[1mValidity Check:\u001b[0m \n",
280281
"\n",
281-
"\u001b[36m 1 \u001b[0m\u001b[1mRange Check:\u001b[0m A standard 10-sided die (d10) has faces numbered from 1 to 10. The result obtained is 4, which \n",
282-
"\u001b[36m \u001b[0mfalls within this valid range ($1 \\le 4 \\le 10$). \n",
283-
"\u001b[36m 2 \u001b[0m\u001b[1mInteger Check:\u001b[0m Dice rolls must result in whole numbers (integers). The result is 4, which is an integer. \n",
282+
"\u001b[1m • \u001b[0m\u001b[1mDie Type:\u001b[0m 10-sided die ($d10$). \n",
283+
"\u001b[1m • \u001b[0m\u001b[1mPossible Outcomes:\u001b[0m Any integer from 1 to 10 (inclusive): ${1, 2, 3, 4, 5, 6, 7, 8, 9, 10}$. \n",
284+
"\u001b[1m • \u001b[0m\u001b[1mActual Outcome:\u001b[0m 6. \n",
284285
"\n",
285-
"Therefore, the dice roll is \u001b[1mvalid\u001b[0m. \n"
286+
"\u001b[1mReasoning:\u001b[0m Since the roll produced the number 6, which is an integer and falls within the valid range of 1 to 10 \n",
287+
"for a 10-sided die, the dice roll is \u001b[1mvalid\u001b[0m. \n"
286288
]
287289
},
288290
"metadata": {},
@@ -299,14 +301,6 @@
299301
"console = Console()\n",
300302
"console.print(Markdown(response.output_text))"
301303
]
302-
},
303-
{
304-
"cell_type": "code",
305-
"execution_count": null,
306-
"id": "c114728e-7f77-470c-9d5f-d0d6b57b80fd",
307-
"metadata": {},
308-
"outputs": [],
309-
"source": []
310304
}
311305
],
312306
"metadata": {

0 commit comments

Comments
 (0)