Skip to content

Commit

Permalink
Remove function calling code in different section
Browse files Browse the repository at this point in the history
  • Loading branch information
holtskinner committed Jan 17, 2025
1 parent 71ab044 commit 718b0ec
Showing 1 changed file with 0 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,53 +319,6 @@
" display(Markdown(f\"**Response >** {''.join(response)}\"))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "a715adea5343"
},
"outputs": [],
"source": [
"get_current_weather = FunctionDeclaration(\n",
" name=\"get_current_weather\",\n",
" description=\"Get current weather in the given location\",\n",
" parameters={\n",
" \"type\": \"OBJECT\",\n",
" \"properties\": {\n",
" \"location\": {\n",
" \"type\": \"STRING\",\n",
" },\n",
" },\n",
" },\n",
")\n",
"\n",
"config = LiveConnectConfig(\n",
" response_modalities=[\"TEXT\"],\n",
" tools=[get_current_weather],\n",
")\n",
"\n",
"async with client.aio.live.connect(\n",
" model=MODEL_ID,\n",
" config=config,\n",
") as session:\n",
" text_input = \"Get the current weather in Santa Clara, San Jose and Mountain View\"\n",
" display(Markdown(f\"**Input:** {text_input}\"))\n",
"\n",
" await session.send(input=text_input, end_of_turn=True)\n",
"\n",
" response = []\n",
"\n",
" async for message in session.receive():\n",
" print(message)\n",
" if message.text:\n",
" response.append(message.text)\n",
" if message.tool_call:\n",
" print(message.function_response)\n",
"\n",
" display(Markdown(f\"**Response >** {''.join(response)}\"))"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down

0 comments on commit 718b0ec

Please sign in to comment.