Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/conversation/chat-ap…
Browse files Browse the repository at this point in the history
…p/npm_and_yarn-c75642544e
  • Loading branch information
holtskinner authored Jan 22, 2025
2 parents 38f3e70 + d837a46 commit 5d57947
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions gemini/getting-started/intro_gemini_2_0_flash.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"id": "qgdSpVmDbdQ9"
},
Expand All @@ -242,6 +242,7 @@
" Retrieval,\n",
" SafetySetting,\n",
" Tool,\n",
" ToolCodeExecution,\n",
" VertexAISearch,\n",
")"
]
Expand All @@ -261,7 +262,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"id": "UCgUOv4nSWhc"
},
Expand All @@ -278,7 +279,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {
"id": "zpIPG_YhSjaw"
},
Expand Down Expand Up @@ -309,7 +310,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {
"id": "-coEslfWPrxo"
},
Expand Down Expand Up @@ -1174,14 +1175,19 @@
" Args:\n",
" location: The city and state, e.g. San Francisco, CA\n",
" \"\"\"\n",
" import random\n",
"\n",
" return random.choice([\"sunny\", \"raining\", \"snowing\", \"fog\"])\n",
" weather_map: dict[str, str] = {\n",
" \"Boston, MA\": \"snowing\",\n",
" \"San Francisco, CA\": \"foggy\",\n",
" \"Seattle, WA\": \"raining\",\n",
" \"Austin, TX\": \"hot\",\n",
" \"Chicago, IL\": \"windy\",\n",
" }\n",
" return weather_map.get(location, \"unknown\")\n",
"\n",
"\n",
"response = client.models.generate_content(\n",
" model=MODEL_ID,\n",
" contents=\"What is the weather like in Boston?\",\n",
" contents=\"What is the weather like in Austin?\",\n",
" config=GenerateContentConfig(\n",
" tools=[get_current_weather],\n",
" temperature=0,\n",
Expand Down Expand Up @@ -1260,7 +1266,7 @@
},
"outputs": [],
"source": [
"code_execution_tool = Tool(code_execution={})\n",
"code_execution_tool = Tool(code_execution=ToolCodeExecution())\n",
"\n",
"response = client.models.generate_content(\n",
" model=MODEL_ID,\n",
Expand Down

0 comments on commit 5d57947

Please sign in to comment.