79366990

Date: 2025-01-18 10:50:56
Score: 1
Natty:
Report link

I think they are not the same as Gemini 1.5

Please try

from google import genai
from google.genai.types import Tool, GenerateContentConfig, GoogleSearch

google_search_tool = Tool(
    google_search = GoogleSearch()
)

response = client.models.generate_content(
    model=model_id,
    contents="When is the next total solar eclipse in the United States?",
    config=GenerateContentConfig(
        tools=[google_search_tool],
        response_modalities=["TEXT"],
    )
)

for each in response.candidates[0].content.parts:
    print(each.text)

This is updated reference document.

https://cloud.google.com/vertex-ai/generative-ai/docs/gemini-v2

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Willy Suppawit