Skip to content

Commit

Permalink
chore: Update syntax for function calling/controlled generation in in…
Browse files Browse the repository at this point in the history
…tro to Gemini 2.0 notebook (#1621)
  • Loading branch information
holtskinner authored Jan 13, 2025
1 parent 954041c commit 10865c0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions gemini/getting-started/intro_gemini_2_0_flash.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
"source": [
"### Load the Gemini 2.0 Flash model\n",
"\n",
"To learn more about all [Gemini models on Vertex AI](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#gemini-models)."
"Learn more about all [Gemini models on Vertex AI](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#gemini-models)."
]
},
{
Expand Down Expand Up @@ -833,7 +833,8 @@
"\n",
"The Multimodal Live API is built on [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API).\n",
"\n",
"For more examples with the Multimodal Live API, refer to the [documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/multimodal-live)."
"For more examples with the Multimodal Live API, refer to the [documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/multimodal-live) or this notebook: [Getting Started with the Multimodal Live API using Gen AI SDK\n",
"](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/multimodal-live-api/intro_multimodal_live_api_genai_sdk.ipynb)."
]
},
{
Expand Down Expand Up @@ -886,7 +887,7 @@
"id": "nKai5CP_PGQF"
},
"source": [
"You can parse the response string as JSON."
"You can either parse the response string as JSON, or use the `parsed` field to get the response as an object or dictionary."
]
},
{
Expand All @@ -897,10 +898,8 @@
},
"outputs": [],
"source": [
"import json\n",
"\n",
"json_response = json.loads(response.text)\n",
"print(json.dumps(json_response, indent=2))"
"parsed_response: Recipe = response.parsed\n",
"print(parsed_response)"
]
},
{
Expand Down Expand Up @@ -965,7 +964,8 @@
" ),\n",
")\n",
"\n",
"print(response.text)"
"response_dict = response.parsed\n",
"print(response_dict)"
]
},
{
Expand Down Expand Up @@ -1229,7 +1229,7 @@
" ),\n",
")\n",
"\n",
"print(response.candidates[0].content.parts[0].function_call)"
"print(response.function_calls[0])"
]
},
{
Expand Down

0 comments on commit 10865c0

Please sign in to comment.