Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Gemini_2.0_for_developers.pdf

Mete Atamel
March 03, 2025
9

 Gemini_2.0_for_developers.pdf

Mete Atamel

March 03, 2025
Tweet

More Decks by Mete Atamel

Transcript

  1. gemini-2.0-flash A GA model on: • Gemini Developer API, on

    Google AI Studio • Gemini API, on Vertex AI Studio
  2. Performance Multimodal Live API Unified SDK Native Tool Use Native

    Image & Audio Output (preview) Spatial Understanding
  3. Enterprise Vertex AI Studio Google Cloud APIs cloud.google.com/vertex-ai Consumers Gemini

    gemini.google.com Developers Google AI Studio Google APIs aistudio.google.com ai.google.dev/gemini-api
  4. Gemini Flash 2.0 offers 2x the speed of Gemini 1.5

    Pro Stronger performance on multimodal, text, code, video, spatial understanding and reasoning
  5. Unified interface to Gemini 2.0 (and 1.5) • Gemini Developer

    API on Google AI Studio • Gemini API on Vertex AI The new Google Gen AI SDK
  6. Gemini Developer API on Google AI Studio client = genai.Client(

    api_key=your-gemini-api-key) response = client.models.generate_content( model="gemini-2.0-flash-001", contents="Why is the sky blue?")
  7. Gemini Developer API on Vertex AI client = genai.Client( vertexai=True,

    project=your-google-cloud-project, location="us-central1") response = client.models.generate_content( model="gemini-2.0-flash-001", contents="Why is the sky blue?")
  8. Google Search Tool Ground model responses in Google Search results

    For more accurate, up-to-date, and relevant responses
  9. Google Search Tool google_search_tool = Tool(google_search=GoogleSearch()) response = client.models.generate_content( model="gemini-2.0-flash-001",

    contents="How’s the weather like today in London?", config=GenerateContentConfig(tools=[google_search_tool]) )
  10. Code Execution Tool Model generates and runs Python code Useful

    for applications that benefit from code-based reasoning (e.g. solving equations)
  11. Code Execution Tool code_execution_tool = Tool(code_execution=ToolCodeExecution()) response = client.models.generate_content( model="gemini-2.0-flash-001",

    contents="What is the sum of the first 50 prime numbers?", config=GenerateContentConfig( tools=[code_execution_tool], temperature=0))
  12. Automatic Function Calling Submit a Python function for automatic function

    calling (instead of submitting an OpenAPI specification of the function)
  13. Automatic Function Calling def get_current_weather(location: str) -> str: """Example method.

    Returns the current weather. Args: location: The city and state, e.g. San Francisco, CA """ weather_map: dict[str, str] = { "Boston, MA": "snowing", "San Francisco, CA": "foggy", "Seattle, WA": "raining", "Austin, TX": "hot", "London, UK": "rainy and dark", } return weather_map.get(location, "unknown")
  14. Automatic Function Calling response = client.models.generate_content( model="gemini-2.0-flash-001", contents="What is the

    weather like in Austin?", config=GenerateContentConfig( tools=[get_current_weather], temperature=0))
  15. • Multimodality – model can see, hear, speak • Low-latency

    – for realtime interaction • Memory – model remembers the session • Tools – Function calling, code execution, and Google search Multimodal Live API–key capabilities
  16. Gemini 2.0 introduces native image generation and text-to-speech capabilities Enables

    image generation / editing and expressive storytelling Native Image & Audio Output (preview)