|
814 | 814 | },
|
815 | 815 | {
|
816 | 816 | "cell_type": "code",
|
817 |
| - "execution_count": 2, |
| 817 | + "execution_count": null, |
818 | 818 | "id": "1f758726-33ef-4c04-8a54-49adb783bbb3",
|
819 | 819 | "metadata": {},
|
820 | 820 | "outputs": [
|
|
860 | 860 | "llm_with_tools = llm.bind_tools([tool])\n",
|
861 | 861 | "\n",
|
862 | 862 | "response = llm_with_tools.invoke(\"What is deep research by OpenAI?\")\n",
|
863 |
| - "print(response.text())" |
| 863 | + "print(response.text)" |
864 | 864 | ]
|
865 | 865 | },
|
866 | 866 | {
|
|
1151 | 1151 | },
|
1152 | 1152 | {
|
1153 | 1153 | "cell_type": "code",
|
1154 |
| - "execution_count": 8, |
| 1154 | + "execution_count": null, |
1155 | 1155 | "id": "073f6010-6b0e-4db6-b2d3-7427c8dec95b",
|
1156 | 1156 | "metadata": {},
|
1157 | 1157 | "outputs": [
|
|
1167 | 1167 | }
|
1168 | 1168 | ],
|
1169 | 1169 | "source": [
|
1170 |
| - "response_2.text()" |
| 1170 | + "response_2.text" |
1171 | 1171 | ]
|
1172 | 1172 | },
|
1173 | 1173 | {
|
|
1198 | 1198 | },
|
1199 | 1199 | {
|
1200 | 1200 | "cell_type": "code",
|
1201 |
| - "execution_count": 10, |
| 1201 | + "execution_count": null, |
1202 | 1202 | "id": "b6da5bd6-a44a-4c64-970b-30da26b003d6",
|
1203 | 1203 | "metadata": {},
|
1204 | 1204 | "outputs": [
|
|
1214 | 1214 | }
|
1215 | 1215 | ],
|
1216 | 1216 | "source": [
|
1217 |
| - "response_2.text()" |
| 1217 | + "response_2.text" |
1218 | 1218 | ]
|
1219 | 1219 | },
|
1220 | 1220 | {
|
|
1404 | 1404 | },
|
1405 | 1405 | {
|
1406 | 1406 | "cell_type": "code",
|
1407 |
| - "execution_count": 1, |
| 1407 | + "execution_count": null, |
1408 | 1408 | "id": "51d3e4d3-ea78-426c-9205-aecb0937fca7",
|
1409 | 1409 | "metadata": {},
|
1410 | 1410 | "outputs": [
|
|
1428 | 1428 | "messages = [{\"role\": \"user\", \"content\": first_query}]\n",
|
1429 | 1429 | "\n",
|
1430 | 1430 | "response = llm_with_tools.invoke(messages)\n",
|
1431 |
| - "response_text = response.text()\n", |
| 1431 | + "response_text = response.text\n", |
1432 | 1432 | "print(f\"{response_text[:100]}... {response_text[-100:]}\")"
|
1433 | 1433 | ]
|
1434 | 1434 | },
|
1435 | 1435 | {
|
1436 | 1436 | "cell_type": "code",
|
1437 |
| - "execution_count": 2, |
| 1437 | + "execution_count": null, |
1438 | 1438 | "id": "b248bedf-2050-4c17-a90e-3a26eeb1b055",
|
1439 | 1439 | "metadata": {},
|
1440 | 1440 | "outputs": [
|
|
1460 | 1460 | " ]\n",
|
1461 | 1461 | ")\n",
|
1462 | 1462 | "second_response = llm_with_tools.invoke(messages)\n",
|
1463 |
| - "print(second_response.text())" |
| 1463 | + "print(second_response.text)" |
1464 | 1464 | ]
|
1465 | 1465 | },
|
1466 | 1466 | {
|
|
1482 | 1482 | },
|
1483 | 1483 | {
|
1484 | 1484 | "cell_type": "code",
|
1485 |
| - "execution_count": 3, |
| 1485 | + "execution_count": null, |
1486 | 1486 | "id": "009e541a-b372-410e-b9dd-608a8052ce09",
|
1487 | 1487 | "metadata": {},
|
1488 | 1488 | "outputs": [
|
|
1502 | 1502 | " output_version=\"responses/v1\",\n",
|
1503 | 1503 | ")\n",
|
1504 | 1504 | "response = llm.invoke(\"Hi, I'm Bob.\")\n",
|
1505 |
| - "print(response.text())" |
| 1505 | + "print(response.text)" |
1506 | 1506 | ]
|
1507 | 1507 | },
|
1508 | 1508 | {
|
1509 | 1509 | "cell_type": "code",
|
1510 |
| - "execution_count": 4, |
| 1510 | + "execution_count": null, |
1511 | 1511 | "id": "393a443a-4c5f-4a07-bc0e-c76e529b35e3",
|
1512 | 1512 | "metadata": {},
|
1513 | 1513 | "outputs": [
|
|
1524 | 1524 | " \"What is my name?\",\n",
|
1525 | 1525 | " previous_response_id=response.response_metadata[\"id\"],\n",
|
1526 | 1526 | ")\n",
|
1527 |
| - "print(second_response.text())" |
| 1527 | + "print(second_response.text)" |
1528 | 1528 | ]
|
1529 | 1529 | },
|
1530 | 1530 | {
|
|
1589 | 1589 | },
|
1590 | 1590 | {
|
1591 | 1591 | "cell_type": "code",
|
1592 |
| - "execution_count": 2, |
| 1592 | + "execution_count": null, |
1593 | 1593 | "id": "8d322f3a-0732-45ab-ac95-dfd4596e0d85",
|
1594 | 1594 | "metadata": {},
|
1595 | 1595 | "outputs": [
|
|
1616 | 1616 | "response = llm.invoke(\"What is 3^3?\")\n",
|
1617 | 1617 | "\n",
|
1618 | 1618 | "# Output\n",
|
1619 |
| - "response.text()" |
| 1619 | + "response.text" |
1620 | 1620 | ]
|
1621 | 1621 | },
|
1622 | 1622 | {
|
|
0 commit comments