Skip to content

Commit

Permalink
Update notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhu committed Oct 5, 2024
1 parent c2f069c commit 4e06442
Showing 1 changed file with 37 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -29,7 +29,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -42,18 +42,43 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "ToolUseAssistantAgent.__init__() got an unexpected keyword argument 'tool_schema'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[3], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m assistant \u001b[38;5;241m=\u001b[39m \u001b[43mToolUseAssistantAgent\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mWeather_Assistant\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 3\u001b[0m \u001b[43m \u001b[49m\u001b[43mmodel_client\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mOpenAIChatCompletionClient\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmodel\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mgpt-4o-mini\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 4\u001b[0m \u001b[43m \u001b[49m\u001b[43mtool_schema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[43mget_weather_tool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 5\u001b[0m \u001b[43m)\u001b[49m\n\u001b[1;32m 6\u001b[0m team \u001b[38;5;241m=\u001b[39m RoundRobinGroupChat([assistant], tools\u001b[38;5;241m=\u001b[39m[get_weather_tool])\n\u001b[1;32m 7\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m team\u001b[38;5;241m.\u001b[39mrun(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWhat\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124ms the weather in New York?\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"\u001b[0;31mTypeError\u001b[0m: ToolUseAssistantAgent.__init__() got an unexpected keyword argument 'tool_schema'"
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"--------------------------------------------------------------------------- \n",
"\u001b[91m[2024-10-04T17:59:55.737430]:\u001b[0m\n",
"\n",
"What's the weather in New York?\n",
"From: user"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"--------------------------------------------------------------------------- \n",
"\u001b[91m[2024-10-04T17:59:56.310787], Weather_Assistant:\u001b[0m\n",
"\n",
"[FunctionCall(id='call_zxmdHPEQ1QMd2NwvYUSgxxDV', arguments='{\"city\":\"New York\"}', name='get_weather')]\n",
"From: Weather_Assistant\n",
"--------------------------------------------------------------------------- \n",
"\u001b[91m[2024-10-04T17:59:56.312084], tool_agent_for_Weather_Assistant:\u001b[0m\n",
"\n",
"[FunctionExecutionResult(content='Sunny', call_id='call_zxmdHPEQ1QMd2NwvYUSgxxDV')]\n",
"From: tool_agent_for_Weather_Assistant\n",
"--------------------------------------------------------------------------- \n",
"\u001b[91m[2024-10-04T17:59:56.767874], Weather_Assistant:\u001b[0m\n",
"\n",
"The weather in New York is sunny. \n",
"\n",
"TERMINATE\n",
"From: Weather_Assistant"
]
}
],
Expand All @@ -65,7 +90,7 @@
")\n",
"team = RoundRobinGroupChat([assistant])\n",
"result = await team.run(\"What's the weather in New York?\")\n",
"print(result)"
"# print(result)"
]
}
],
Expand Down

0 comments on commit 4e06442

Please sign in to comment.