mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-23 16:12:25 +02:00
docs: run codespell on all notebooks (#736)
* run codespell on all notebooks * fix codespell
This commit is contained in:
@@ -137,7 +137,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Let's kick off a run\n",
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in sf\"}]}\n",
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in sf\"}]}\n",
|
||||
"run = await client.runs.create(thread['thread_id'], assistant[\"assistant_id\"], input=input)\n"
|
||||
]
|
||||
},
|
||||
@@ -213,7 +213,7 @@
|
||||
" 'data': {'chunk': {'messages': [{'id': '46b31c3a-01bf-4946-bd5a-fa6a7f6c97ce',\n",
|
||||
" 'name': None,\n",
|
||||
" 'type': 'human',\n",
|
||||
" 'content': 'whats the weather in sf',\n",
|
||||
" 'content': 'what's the weather in sf',\n",
|
||||
" 'example': False,\n",
|
||||
" 'additional_kwargs': {},\n",
|
||||
" 'response_metadata': {}},\n",
|
||||
@@ -243,7 +243,7 @@
|
||||
" 'event': 'on_chain_end',\n",
|
||||
" 'name': 'agent',\n",
|
||||
" 'data': {'input': {'messages': [{'role': 'human',\n",
|
||||
" 'content': 'whats the weather in sf'}]},\n",
|
||||
" 'content': 'what's the weather in sf'}]},\n",
|
||||
" 'output': {'messages': [{'id': 'run-4885d5a0-cd89-4f00-8558-e85b542a710c',\n",
|
||||
" 'name': None,\n",
|
||||
" 'type': 'ai',\n",
|
||||
@@ -297,7 +297,7 @@
|
||||
" 'data': {'input': {'messages': [{'id': 'abc3581e-417b-4ca1-ab31-de7108e64b3b',\n",
|
||||
" 'name': None,\n",
|
||||
" 'type': 'human',\n",
|
||||
" 'content': 'whats the weather in sf',\n",
|
||||
" 'content': 'what's the weather in sf',\n",
|
||||
" 'example': False,\n",
|
||||
" 'additional_kwargs': {},\n",
|
||||
" 'response_metadata': {}},\n",
|
||||
@@ -330,7 +330,7 @@
|
||||
" 'data': {'input': {'messages': [{'id': 'abc3581e-417b-4ca1-ab31-de7108e64b3b',\n",
|
||||
" 'name': None,\n",
|
||||
" 'type': 'human',\n",
|
||||
" 'content': 'whats the weather in sf',\n",
|
||||
" 'content': 'what's the weather in sf',\n",
|
||||
" 'example': False,\n",
|
||||
" 'additional_kwargs': {},\n",
|
||||
" 'response_metadata': {}},\n",
|
||||
@@ -362,7 +362,7 @@
|
||||
" 'data': {'input': {'messages': [[{'id': None,\n",
|
||||
" 'name': None,\n",
|
||||
" 'type': 'human',\n",
|
||||
" 'content': 'whats the weather in sf',\n",
|
||||
" 'content': 'what's the weather in sf',\n",
|
||||
" 'example': False,\n",
|
||||
" 'additional_kwargs': {},\n",
|
||||
" 'response_metadata': {}}]]},\n",
|
||||
@@ -430,7 +430,7 @@
|
||||
" 'data': {'input': {'messages': [[{'id': None,\n",
|
||||
" 'name': None,\n",
|
||||
" 'type': 'human',\n",
|
||||
" 'content': 'whats the weather in sf',\n",
|
||||
" 'content': 'what's the weather in sf',\n",
|
||||
" 'example': False,\n",
|
||||
" 'additional_kwargs': {},\n",
|
||||
" 'response_metadata': {}}]]}},\n",
|
||||
@@ -520,7 +520,7 @@
|
||||
" 'data': {'output': {'messages': [{'id': '46b31c3a-01bf-4946-bd5a-fa6a7f6c97ce',\n",
|
||||
" 'name': None,\n",
|
||||
" 'type': 'human',\n",
|
||||
" 'content': 'whats the weather in sf',\n",
|
||||
" 'content': 'what's the weather in sf',\n",
|
||||
" 'example': False,\n",
|
||||
" 'additional_kwargs': {},\n",
|
||||
" 'response_metadata': {}},\n",
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"first_run = await client.runs.create(\n",
|
||||
" thread[\"thread_id\"],\n",
|
||||
" assistant[\"assistant_id\"],\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in sf?\"}]},\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in sf?\"}]},\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
@@ -55,7 +55,7 @@
|
||||
"second_run = await client.runs.create(\n",
|
||||
" thread[\"thread_id\"],\n",
|
||||
" assistant[\"assistant_id\"],\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in nyc?\"}]},\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in nyc?\"}]},\n",
|
||||
" multitask_strategy=\"enqueue\",\n",
|
||||
")"
|
||||
]
|
||||
@@ -97,7 +97,7 @@
|
||||
"text": [
|
||||
"================================\u001b[1m Human Message \u001b[0m=================================\n",
|
||||
"\n",
|
||||
"whats the weather in sf?\n",
|
||||
"what's the weather in sf?\n",
|
||||
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
|
||||
"\n",
|
||||
"[{'id': 'toolu_01Dez1sJre4oA2Y7NsKJV6VT', 'input': {'query': 'weather in san francisco'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}]\n",
|
||||
@@ -132,7 +132,7 @@
|
||||
"So in summary, expect seasonable spring weather in San Francisco over the next several days, with a mix of sun and clouds and temperatures ranging from the upper 40s at night to the low 60s during the days. Typical dry conditions with no rain in the forecast.\n",
|
||||
"================================\u001b[1m Human Message \u001b[0m=================================\n",
|
||||
"\n",
|
||||
"whats the weather in nyc?\n",
|
||||
"what's the weather in nyc?\n",
|
||||
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
|
||||
"\n",
|
||||
"[{'text': 'Here are the current weather conditions and forecast for New York City:', 'type': 'text'}, {'id': 'toolu_01FFft5Sx9oS6AdVJuRWWcGp', 'input': {'query': 'weather in new york city'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}]\n",
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in sf\"}]}\n",
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in sf\"}]}\n",
|
||||
"async for chunk in client.runs.stream(\n",
|
||||
" thread['thread_id'], assistant['assistant_id'], input=input, stream_mode=\"updates\", interrupt_before=['action']\n",
|
||||
"):\n",
|
||||
@@ -287,7 +287,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in la?\"}]}\n",
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in la?\"}]}\n",
|
||||
"async for chunk in client.runs.stream(\n",
|
||||
" thread['thread_id'], assistant['assistant_id'], input=input, stream_mode=\"updates\", interrupt_before=['action']\n",
|
||||
"):\n",
|
||||
|
||||
@@ -44,13 +44,13 @@
|
||||
"interrupted_run = await client.runs.create(\n",
|
||||
" thread[\"thread_id\"],\n",
|
||||
" assistant[\"assistant_id\"],\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in sf?\"}]},\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in sf?\"}]},\n",
|
||||
")\n",
|
||||
"await asyncio.sleep(2)\n",
|
||||
"run = await client.runs.create(\n",
|
||||
" thread[\"thread_id\"],\n",
|
||||
" assistant[\"assistant_id\"],\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in nyc?\"}]},\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in nyc?\"}]},\n",
|
||||
" multitask_strategy=\"interrupt\",\n",
|
||||
")"
|
||||
]
|
||||
@@ -92,7 +92,7 @@
|
||||
"text": [
|
||||
"================================\u001b[1m Human Message \u001b[0m=================================\n",
|
||||
"\n",
|
||||
"whats the weather in sf?\n",
|
||||
"what's the weather in sf?\n",
|
||||
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
|
||||
"\n",
|
||||
"[{'id': 'toolu_01MjNtVJwEcpujRGrf3x6Pih', 'input': {'query': 'weather in san francisco'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}]\n",
|
||||
@@ -107,7 +107,7 @@
|
||||
"[{\"url\": \"https://www.wunderground.com/hourly/us/ca/san-francisco/KCASANFR2002/date/2024-6-18\", \"content\": \"High 64F. Winds W at 10 to 20 mph. A few clouds from time to time. Low 49F. Winds W at 10 to 20 mph. Temp. San Francisco Weather Forecasts. Weather Underground provides local & long-range weather ...\"}]\n",
|
||||
"================================\u001b[1m Human Message \u001b[0m=================================\n",
|
||||
"\n",
|
||||
"whats the weather in nyc?\n",
|
||||
"what's the weather in nyc?\n",
|
||||
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
|
||||
"\n",
|
||||
"[{'id': 'toolu_01KtE1m1ifPLQAx4fQLyZL9Q', 'input': {'query': 'weather in new york city'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}]\n",
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
"run = await client.runs.create(\n",
|
||||
" thread[\"thread_id\"],\n",
|
||||
" assistant[\"assistant_id\"],\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in sf?\"}]},\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in sf?\"}]},\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
@@ -81,7 +81,7 @@
|
||||
" await client.runs.create(\n",
|
||||
" thread[\"thread_id\"],\n",
|
||||
" assistant[\"assistant_id\"],\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in nyc?\"}]},\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in nyc?\"}]},\n",
|
||||
" multitask_strategy=\"reject\",\n",
|
||||
" )\n",
|
||||
"except httpx.HTTPStatusError as e:\n",
|
||||
@@ -125,7 +125,7 @@
|
||||
"text": [
|
||||
"================================\u001b[1m Human Message \u001b[0m=================================\n",
|
||||
"\n",
|
||||
"whats the weather in sf?\n",
|
||||
"what's the weather in sf?\n",
|
||||
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
|
||||
"\n",
|
||||
"[{'id': 'toolu_01CyewEifV2Kmi7EFKHbMDr1', 'input': {'query': 'weather in san francisco'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}]\n",
|
||||
|
||||
@@ -45,13 +45,13 @@
|
||||
"rolled_back_run = await client.runs.create(\n",
|
||||
" thread[\"thread_id\"],\n",
|
||||
" assistant[\"assistant_id\"],\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in sf?\"}]},\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in sf?\"}]},\n",
|
||||
")\n",
|
||||
"await asyncio.sleep(2)\n",
|
||||
"run = await client.runs.create(\n",
|
||||
" thread[\"thread_id\"],\n",
|
||||
" assistant[\"assistant_id\"],\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in nyc?\"}]},\n",
|
||||
" input={\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in nyc?\"}]},\n",
|
||||
" multitask_strategy=\"rollback\",\n",
|
||||
")"
|
||||
]
|
||||
@@ -93,7 +93,7 @@
|
||||
"text": [
|
||||
"================================\u001b[1m Human Message \u001b[0m=================================\n",
|
||||
"\n",
|
||||
"whats the weather in nyc?\n",
|
||||
"what's the weather in nyc?\n",
|
||||
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
|
||||
"\n",
|
||||
"[{'id': 'toolu_01JzPqefao1gxwajHQ3Yh3JD', 'input': {'query': 'weather in nyc'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}]\n",
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
"text": [
|
||||
"Metadata: Run ID - c64b3e27-c7a4-4851-9618-07641fa24296\n",
|
||||
"--------------------------------------------------\n",
|
||||
"Human: whats the weather in sf\n",
|
||||
"Human: what's the weather in sf\n",
|
||||
"--------------------------------------------------\n",
|
||||
"Invalid Tool Calls:\n",
|
||||
"Tool Call ID: call_8XskpDf4mjpQOuIL8F9IzQR8, Function: tavily_search_results_json, Arguments: \n",
|
||||
@@ -205,7 +205,7 @@
|
||||
"Tool Call ID: call_8XskpDf4mjpQOuIL8F9IzQR8, Function: tavily_search_results_json, Arguments: {'query': 'current weather in San Francisco'}\n",
|
||||
"Response Metadata: Finish Reason - tool_calls\n",
|
||||
"--------------------------------------------------\n",
|
||||
"AI: whats the weather in sf\n",
|
||||
"AI: what's the weather in sf\n",
|
||||
"Tool Calls:\n",
|
||||
"Tool Call ID: call_8XskpDf4mjpQOuIL8F9IzQR8, Function: tavily_search_results_json, Arguments: {'query': 'current weather in San Francisco'}\n",
|
||||
"Response Metadata: Finish Reason - tool_calls\n",
|
||||
@@ -1344,7 +1344,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"input = {\"messages\": [{\"role\": \"user\", \"content\": \"whats the weather in sf\"}]}\n",
|
||||
"input = {\"messages\": [{\"role\": \"user\", \"content\": \"what's the weather in sf\"}]}\n",
|
||||
"\n",
|
||||
"async for event in client.runs.stream(thread['thread_id'], assistant['assistant_id'], input=input, stream_mode='messages'):\n",
|
||||
" if event.event == 'metadata':\n",
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in la\"}]}\n",
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in la\"}]}\n",
|
||||
"async for chunk in client.runs.stream(thread['thread_id'], assistant['assistant_id'], input=input, stream_mode=\"updates\", ):\n",
|
||||
" print(f\"Receiving new event of type: {chunk.event}...\")\n",
|
||||
" print(chunk.data)\n",
|
||||
|
||||
@@ -109,22 +109,22 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"Receiving new event of type: values...\n",
|
||||
"{'messages': [{'role': 'human', 'content': 'whats the weather in la'}]}\n",
|
||||
"{'messages': [{'role': 'human', 'content': 'what's the weather in la'}]}\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"Receiving new event of type: values...\n",
|
||||
"{'messages': [{'content': 'whats the weather in la', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'human', 'name': None, 'id': 'faa15565-8823-4aa1-87af-e21b40526fae', 'example': False}, {'content': [{'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g', 'input': {'query': 'weather in los angeles'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}], 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'ai', 'name': None, 'id': 'run-3fe1db7a-6b8d-4d83-ba07-8657190ad811', 'example': False, 'tool_calls': [{'name': 'tavily_search_results_json', 'args': {'query': 'weather in los angeles'}, 'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}], 'invalid_tool_calls': []}]}\n",
|
||||
"{'messages': [{'content': 'what's the weather in la', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'human', 'name': None, 'id': 'faa15565-8823-4aa1-87af-e21b40526fae', 'example': False}, {'content': [{'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g', 'input': {'query': 'weather in los angeles'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}], 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'ai', 'name': None, 'id': 'run-3fe1db7a-6b8d-4d83-ba07-8657190ad811', 'example': False, 'tool_calls': [{'name': 'tavily_search_results_json', 'args': {'query': 'weather in los angeles'}, 'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}], 'invalid_tool_calls': []}]}\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"Receiving new event of type: values...\n",
|
||||
"{'messages': [{'content': 'whats the weather in la', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'human', 'name': None, 'id': 'faa15565-8823-4aa1-87af-e21b40526fae', 'example': False}, {'content': [{'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g', 'input': {'query': 'weather in los angeles'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}], 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'ai', 'name': None, 'id': 'run-3fe1db7a-6b8d-4d83-ba07-8657190ad811', 'example': False, 'tool_calls': [{'name': 'tavily_search_results_json', 'args': {'query': 'weather in los angeles'}, 'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}], 'invalid_tool_calls': []}, {'content': '[{\"url\": \"https://www.weatherapi.com/\", \"content\": \"{\\'location\\': {\\'name\\': \\'Los Angeles\\', \\'region\\': \\'California\\', \\'country\\': \\'United States of America\\', \\'lat\\': 34.05, \\'lon\\': -118.24, \\'tz_id\\': \\'America/Los_Angeles\\', \\'localtime_epoch\\': 1716310320, \\'localtime\\': \\'2024-05-21 9:52\\'}, \\'current\\': {\\'last_updated_epoch\\': 1716309900, \\'last_updated\\': \\'2024-05-21 09:45\\', \\'temp_c\\': 16.7, \\'temp_f\\': 62.1, \\'is_day\\': 1, \\'condition\\': {\\'text\\': \\'Overcast\\', \\'icon\\': \\'//cdn.weatherapi.com/weather/64x64/day/122.png\\', \\'code\\': 1009}, \\'wind_mph\\': 8.1, \\'wind_kph\\': 13.0, \\'wind_degree\\': 250, \\'wind_dir\\': \\'WSW\\', \\'pressure_mb\\': 1015.0, \\'pressure_in\\': 29.97, \\'precip_mm\\': 0.0, \\'precip_in\\': 0.0, \\'humidity\\': 65, \\'cloud\\': 100, \\'feelslike_c\\': 16.7, \\'feelslike_f\\': 62.1, \\'vis_km\\': 16.0, \\'vis_miles\\': 9.0, \\'uv\\': 5.0, \\'gust_mph\\': 12.5, \\'gust_kph\\': 20.2}}\"}]', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'tool', 'name': 'tavily_search_results_json', 'id': '0d5dab31-5ff8-4ae2-a560-bc4bcba7c9d7', 'tool_call_id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}]}\n",
|
||||
"{'messages': [{'content': 'what's the weather in la', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'human', 'name': None, 'id': 'faa15565-8823-4aa1-87af-e21b40526fae', 'example': False}, {'content': [{'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g', 'input': {'query': 'weather in los angeles'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}], 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'ai', 'name': None, 'id': 'run-3fe1db7a-6b8d-4d83-ba07-8657190ad811', 'example': False, 'tool_calls': [{'name': 'tavily_search_results_json', 'args': {'query': 'weather in los angeles'}, 'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}], 'invalid_tool_calls': []}, {'content': '[{\"url\": \"https://www.weatherapi.com/\", \"content\": \"{\\'location\\': {\\'name\\': \\'Los Angeles\\', \\'region\\': \\'California\\', \\'country\\': \\'United States of America\\', \\'lat\\': 34.05, \\'lon\\': -118.24, \\'tz_id\\': \\'America/Los_Angeles\\', \\'localtime_epoch\\': 1716310320, \\'localtime\\': \\'2024-05-21 9:52\\'}, \\'current\\': {\\'last_updated_epoch\\': 1716309900, \\'last_updated\\': \\'2024-05-21 09:45\\', \\'temp_c\\': 16.7, \\'temp_f\\': 62.1, \\'is_day\\': 1, \\'condition\\': {\\'text\\': \\'Overcast\\', \\'icon\\': \\'//cdn.weatherapi.com/weather/64x64/day/122.png\\', \\'code\\': 1009}, \\'wind_mph\\': 8.1, \\'wind_kph\\': 13.0, \\'wind_degree\\': 250, \\'wind_dir\\': \\'WSW\\', \\'pressure_mb\\': 1015.0, \\'pressure_in\\': 29.97, \\'precip_mm\\': 0.0, \\'precip_in\\': 0.0, \\'humidity\\': 65, \\'cloud\\': 100, \\'feelslike_c\\': 16.7, \\'feelslike_f\\': 62.1, \\'vis_km\\': 16.0, \\'vis_miles\\': 9.0, \\'uv\\': 5.0, \\'gust_mph\\': 12.5, \\'gust_kph\\': 20.2}}\"}]', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'tool', 'name': 'tavily_search_results_json', 'id': '0d5dab31-5ff8-4ae2-a560-bc4bcba7c9d7', 'tool_call_id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}]}\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"Receiving new event of type: values...\n",
|
||||
"{'messages': [{'content': 'whats the weather in la', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'human', 'name': None, 'id': 'faa15565-8823-4aa1-87af-e21b40526fae', 'example': False}, {'content': [{'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g', 'input': {'query': 'weather in los angeles'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}], 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'ai', 'name': None, 'id': 'run-3fe1db7a-6b8d-4d83-ba07-8657190ad811', 'example': False, 'tool_calls': [{'name': 'tavily_search_results_json', 'args': {'query': 'weather in los angeles'}, 'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}], 'invalid_tool_calls': []}, {'content': '[{\"url\": \"https://www.weatherapi.com/\", \"content\": \"{\\'location\\': {\\'name\\': \\'Los Angeles\\', \\'region\\': \\'California\\', \\'country\\': \\'United States of America\\', \\'lat\\': 34.05, \\'lon\\': -118.24, \\'tz_id\\': \\'America/Los_Angeles\\', \\'localtime_epoch\\': 1716310320, \\'localtime\\': \\'2024-05-21 9:52\\'}, \\'current\\': {\\'last_updated_epoch\\': 1716309900, \\'last_updated\\': \\'2024-05-21 09:45\\', \\'temp_c\\': 16.7, \\'temp_f\\': 62.1, \\'is_day\\': 1, \\'condition\\': {\\'text\\': \\'Overcast\\', \\'icon\\': \\'//cdn.weatherapi.com/weather/64x64/day/122.png\\', \\'code\\': 1009}, \\'wind_mph\\': 8.1, \\'wind_kph\\': 13.0, \\'wind_degree\\': 250, \\'wind_dir\\': \\'WSW\\', \\'pressure_mb\\': 1015.0, \\'pressure_in\\': 29.97, \\'precip_mm\\': 0.0, \\'precip_in\\': 0.0, \\'humidity\\': 65, \\'cloud\\': 100, \\'feelslike_c\\': 16.7, \\'feelslike_f\\': 62.1, \\'vis_km\\': 16.0, \\'vis_miles\\': 9.0, \\'uv\\': 5.0, \\'gust_mph\\': 12.5, \\'gust_kph\\': 20.2}}\"}]', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'tool', 'name': 'tavily_search_results_json', 'id': '0d5dab31-5ff8-4ae2-a560-bc4bcba7c9d7', 'tool_call_id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}, {'content': 'Based on the weather API results, the current weather in Los Angeles is overcast with a temperature of around 62°F (17°C). There are light winds from the west-southwest around 8-13 mph. The humidity is 65% and visibility is good at 9 miles. Overall, mild spring weather conditions in LA.', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'ai', 'name': None, 'id': 'run-4d6d4c23-5aad-4042-b0d9-19407a9e08e3', 'example': False, 'tool_calls': [], 'invalid_tool_calls': []}]}\n",
|
||||
"{'messages': [{'content': 'what's the weather in la', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'human', 'name': None, 'id': 'faa15565-8823-4aa1-87af-e21b40526fae', 'example': False}, {'content': [{'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g', 'input': {'query': 'weather in los angeles'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}], 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'ai', 'name': None, 'id': 'run-3fe1db7a-6b8d-4d83-ba07-8657190ad811', 'example': False, 'tool_calls': [{'name': 'tavily_search_results_json', 'args': {'query': 'weather in los angeles'}, 'id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}], 'invalid_tool_calls': []}, {'content': '[{\"url\": \"https://www.weatherapi.com/\", \"content\": \"{\\'location\\': {\\'name\\': \\'Los Angeles\\', \\'region\\': \\'California\\', \\'country\\': \\'United States of America\\', \\'lat\\': 34.05, \\'lon\\': -118.24, \\'tz_id\\': \\'America/Los_Angeles\\', \\'localtime_epoch\\': 1716310320, \\'localtime\\': \\'2024-05-21 9:52\\'}, \\'current\\': {\\'last_updated_epoch\\': 1716309900, \\'last_updated\\': \\'2024-05-21 09:45\\', \\'temp_c\\': 16.7, \\'temp_f\\': 62.1, \\'is_day\\': 1, \\'condition\\': {\\'text\\': \\'Overcast\\', \\'icon\\': \\'//cdn.weatherapi.com/weather/64x64/day/122.png\\', \\'code\\': 1009}, \\'wind_mph\\': 8.1, \\'wind_kph\\': 13.0, \\'wind_degree\\': 250, \\'wind_dir\\': \\'WSW\\', \\'pressure_mb\\': 1015.0, \\'pressure_in\\': 29.97, \\'precip_mm\\': 0.0, \\'precip_in\\': 0.0, \\'humidity\\': 65, \\'cloud\\': 100, \\'feelslike_c\\': 16.7, \\'feelslike_f\\': 62.1, \\'vis_km\\': 16.0, \\'vis_miles\\': 9.0, \\'uv\\': 5.0, \\'gust_mph\\': 12.5, \\'gust_kph\\': 20.2}}\"}]', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'tool', 'name': 'tavily_search_results_json', 'id': '0d5dab31-5ff8-4ae2-a560-bc4bcba7c9d7', 'tool_call_id': 'toolu_01E5mSaZWm5rWJnCqmt63v4g'}, {'content': 'Based on the weather API results, the current weather in Los Angeles is overcast with a temperature of around 62°F (17°C). There are light winds from the west-southwest around 8-13 mph. The humidity is 65% and visibility is good at 9 miles. Overall, mild spring weather conditions in LA.', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'ai', 'name': None, 'id': 'run-4d6d4c23-5aad-4042-b0d9-19407a9e08e3', 'example': False, 'tool_calls': [], 'invalid_tool_calls': []}]}\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
@@ -137,7 +137,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in la\"}]}\n",
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in la\"}]}\n",
|
||||
"thread = await client.threads.create()\n",
|
||||
"async for chunk in client.runs.stream(thread['thread_id'], assistant['assistant_id'], input=input):\n",
|
||||
" print(f\"Receiving new event of type: {chunk.event}...\")\n",
|
||||
@@ -160,7 +160,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"whats the weather in la\"}]}\n",
|
||||
"input = {\"messages\": [{\"role\": \"human\", \"content\": \"what's the weather in la\"}]}\n",
|
||||
"thread = await client.threads.create()\n",
|
||||
"final_answer = None\n",
|
||||
"async for chunk in client.runs.stream(thread['thread_id'], assistant['assistant_id'], input=input):\n",
|
||||
@@ -177,7 +177,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"{'messages': [{'content': 'whats the weather in la',\n",
|
||||
"{'messages': [{'content': 'what's the weather in la',\n",
|
||||
" 'additional_kwargs': {},\n",
|
||||
" 'response_metadata': {},\n",
|
||||
" 'type': 'human',\n",
|
||||
|
||||
Reference in New Issue
Block a user