Skip to content

Latest commit

 

History

History
1162 lines (654 loc) · 78.4 KB

File metadata and controls

1162 lines (654 loc) · 78.4 KB

Changelog

1.46.0 (2025-10-21)

Features

  • Add enable_enhanced_civic_answers in GenerationConfig (6c1dae7)
  • Support custom httpx clients (694a6bd)
  • Support jailbreak in HarmCategory and BlockedReason (011e218)

Bug Fixes

  • Remove bytes for Gemini Developer API before sending a video for Veo Video Extension async (9ccc6ce)

Documentation

  • Regenerate docs for 1.45.0 (9b7632d)
  • Update README with Gempix example (nano-banana) (ac2bc42)

1.45.0 (2025-10-15)

Features

  • Add support for Python 3.14. (f0083a2)

Bug Fixes

  • Keys in Live API tool responses are incorrectly re-cased (57a4765)

1.44.0 (2025-10-15)

Features

  • Support fully override base_url and raw model name when none of the project, locations, api_key are configured (160997e)
  • Support video extension for Veo on Gemini Developer API (341ea77)

Bug Fixes

  • Avoid potential dual import confusion in type assert (9cc4a72)

Documentation

1.43.0 (2025-10-10)

Features

  • Enable Google Maps tool for Genai. (dc77a1d)
  • Support enableWidget feature in GoogleMaps (1737f72)
  • Support Gemini batch inline request's metadata and add test coverage to safety setting (7dcc969)

Documentation

  • Regenerate updated Python docs (e6989a3)

1.42.0 (2025-10-08)

Features

  • Add labels field to Imagen configs (cdba4c9)
  • Add utility methods for creating FunctionResponsePart and creating FunctionResponse Part with FunctionResponseParts (72c92d8)
  • Enable Ingredients to Video and Advanced Controls for Veo on Gemini Developer API (Early Access Program) (9c02a07)

Bug Fixes

  • Avoid potential dual import for content type assertion (83d7973)
  • Increase READ_BUFFER_SIZE in _api_client.py for streaming large chunks in new model (981bba7)
  • Make t_part and t_content conform to their type annotations: they now handle FileDict correctly and t_contents handles PartUnionDict correctly. (0933632)

1.41.0 (2025-10-02)

Features

  • Add NO_IMAGE enum value to FinishReason (3877044)
  • Add thinking_config for live (0fa183c)

Bug Fixes

  • Fix validation for image_config (efaa574)

Documentation

  • Regenerate updated Python docs (53e7bd8)

1.40.0 (2025-10-01)

Features

  • Add ImageConfig to GenerateContentConfig (88088df)
  • Expose session id in Live API (1692f23)
  • Rename ComputerUse tool (early access) (aaac8d8)

Bug Fixes

  • Resolve potential mem leak on deletion of Client when using async (538c755)
  • Resolve unclosed client session warning. (043a392)

1.39.1 (2025-09-26)

Bug Fixes

  • Unbreak client closed errors when using vertexai session service (a0882bd)

Documentation

  • Regenerate updated Python docs (4343332)

1.39.0 (2025-09-25)

Features

  • Add FunctionResponsePart & ToolComputerUse.excludedPredefinedFunctions (aa7e3c2)
  • Allow custom headers in file upload requests. (1aad1e9)
  • Support explicitly closing the client and context manager (f982dfb)
  • Support Imagen 4 Ingredients on Vertex (1fe3bec)

Bug Fixes

  • Expose JOB_STATE_RUNNING and JOB_STATE_EXPIRED for Gemini Batches states (739f72d)
  • Fix AFC logging (249f1af)
  • Fix Max Depth repr for containers (dict, list, ...) (6ef3db8)
  • Initialization of pre_tuned_model_checkpoint_id from tuning config. (1d3d28a)
  • Remove unclosed client session message when sharing aiohttp ClientSession (8cee513)

1.38.0 (2025-09-16)

Features

  • Add 'turn_complete_reason' and 'waiting_for_input' fields. (c1f57a5)

Bug Fixes

  • Skip aiohttp related tests when package is not installed (50badf6)

Documentation

  • Regenerate docs for 1.37.0 (1631b2e)

1.37.0 (2025-09-16)

Features

  • Add VideoGenerationMaskMode enum for Veo 2 Editing (3d73cc5)

Bug Fixes

  • Handle single-element list responses in error details. (2629fb4)
  • Reuse aiohttp ClientSession for sharing connection pool (d866313)

Documentation

  • Add uv package installation command to README (09a8bee)

1.36.0 (2025-09-10)

Features

  • Add labels to create tuning job config (a6a2988)

Bug Fixes

  • Fix the return type of generate_content_stream. (28c735f)
  • Fix the return type of generate_content_stream. (ebc7180)

Documentation

  • Regenerate docs for 1.35.0 (aa2f97b)

1.35.0 (2025-09-09)

Features

  • Support Veo 2 Editing on Vertex (effb53a)

Bug Fixes

  • Enable id field in FunctionCall for Vertex AI. (717c1b0)

1.34.0 (2025-09-09)

Features

  • [Python] Implement async embedding batches for MLDev. (468d529)
  • Generate the function_call class's converters (77d1d40)

1.33.0 (2025-09-02)

Features

  • Add resolution field for Gemini Developer API Veo 3 generation (cd2620c)
  • Add the response body for generateContent (e032208)

Bug Fixes

  • Defer asyncio.Lock initialization in _api_client.py. (c6a6c70)
  • Return genai.types.Image, not PIL.Image (67611ed)

Documentation

  • Refactor/update docstrings for Imagen and Veo (214d017)
  • Regenerate docs for 1.32.0 (637b490)

1.32.0 (2025-08-27)

Features

  • Add sdkHttpResponse.headers to *Delete responses. (0101d47)
  • Add add_watermark field for recontext_image (Virtual Try-On, Product Recontext) (0428877)
  • Add GenerateContentResponse.parts, Part.as_image(), and Blob.as_image() (75c0955)
  • Add output_gcs_uri to Imagen upscale_image (3fecf29)
  • Add VALIDATED mode into FunctionCallingConfigMode (f6bf934)
  • Add VideoGenerationReferenceType enum for generate_videos (cd53aff)
  • Support GenerateVideosSource for Veo GenerateVideos (a6c2bb7)
  • Support tunings.cancel in the genai SDK for Python, Java, JS, and Go (ffd8b06)

Documentation

  • Fix typo in README (0cef3e6)
  • Prompt and schema fix for json schema sample (6efd242)
  • Regenerate docs for 1.31.0 (51903d4)
  • Update TokensInfo docstring (921afa1)
  • Updating Imagen 4 code snippet (630262b)
  • Updating Veo model to Veo 3 and adding instruction to edit images using the native image-out model (codegen instructions). (b34a5c6)

1.31.0 (2025-08-18)

Features

  • Support Imagen image segmentation on Vertex (a3c46f5)
  • Support Veo 2 Reference Images to Video Generation on Vertex (3712351)

Bug Fixes

  • Fix the bug to support Gemini Batch inlined requests system instruction (3abf441)

1.30.0 (2025-08-13)

Features

  • Add evaluation support to Vertex tuning (95293eb)
  • Enable continuous fine-tuning on a pre-tuned model in the SDK. (72dc46b)
  • Support document name in grounding metadata (5f6746d)
  • Support exclude_domains in Google Search and Enterprise Web Search (7e4ec28)

Bug Fixes

  • Prevent NameError from being thrown when has_aiohttp is False (13a487d)

Documentation

  • Docs for 1.29 (3e39e63)
  • Document that property descriptions are not automatically-handled. (d7cb114)
  • Fix example format. (da225f3)

1.29.0 (2025-08-06)

Features

  • Add image_size field for Gemini Developer API Imagen 4 generation (f1852e6)
  • Add Lyria enum for music generation mode for vocalization (30c0676)
  • Allow methods in batch to return headers in sdk_http_response by default (80fb4e3)
  • Enable more types in FunctionDeclaration schema (76e9b13)
  • Enable responseId for Gemini Developer API (a57f7d9)
  • Support image recontext on Vertex (8a45746)
  • Support new enum types for UrlRetrievalStatus (13815b8)

Bug Fixes

  • Harden the response parsing logic in generate_content_stream (c4466d3)

Documentation

  • Fix code block formatting in codegen_instructions.md (f62fdac)
  • Regenerate docs for 1.28.0 (bcef0a6)

1.28.0 (2025-07-30)

Features

  • Add images quick accessor to GenerateImagesResponse (2e43d91)
  • Allow methods in models to return headers in sdk_http_response by default. (fa6675a)
  • Allow methods in tuning to return headers in sdk_http_response by default (dd19971)
  • Define StringDict type alias for better readability (0f4613f)
  • Increase buffer size to read response body from HTTP client (ae2d790)
  • Support retry configuration at request level (417e655)

Bug Fixes

  • Allow empty proj/location and api key when overriding base_url (79f7bfc)
  • Retry async when seeing aiohttp ClientConnectorError, ClientOSError, ServerDisconnectedError (b0d18de)

1.27.0 (2025-07-22)

Features

  • Add image_size field for Vertex Imagen 4 generation (df52660)
  • Return headers for list method in all modules. (dd3df9b)

Documentation

  • Copy improvements and minor changes to instructions. (235ee99)
  • Update batches and tunings doc (97a3494)
  • Update extra_body docstring (633eca3)

1.26.0 (2025-07-16)

Features

  • Add addWatermark parameter to the edit image configuration. (a5b1545)
  • Adding codegen instructions to guide LLMs to generate code with the Google GenAI SDK (d82634b)

Bug Fixes

  • live: Enhance security by moving api key from query parameters to header (d78add3)

Documentation

  • Update generated video resolution config docstring (d06254c)

1.25.0 (2025-07-09)

Features

  • Add new languages for Imagen 4 prompt language (cbd643e)
  • Make t_schema in Gemini API reusable from Genai Procesors. (922eaf5)

Bug Fixes

  • Improve code dependency to make types more self-contained (7d0a7d8)
  • python: Fix response.parse when response_json_schema is provided. (babb01f)

Documentation

  • Add extra_body example to README.md (0b077bf)
  • Mention both API-key environment variables. (50fff0c)
  • Regenerate docs for 1.24.0 (fe7ed6d)

1.24.0 (2025-07-01)

Features

  • Support Batches delete (5d0a4e6)
  • Support different media input in Vertex Live API (8b0a703)

Bug Fixes

  • Force httpx if the client was instantiated with an httpx.AsyncBaseTransport (4851590)
  • Retry on exception instead of a status code (fc78107)

Documentation

  • Add I2V and V2V generate_videos examples in Python README file (858f738)
  • Regenerate docs for 1.23.0 (4273da2)

1.23.0 (2025-06-27)

Features

  • Enable Vertex Multimodal Dataset as input to supervised fine-tuning. (15cf810)

Bug Fixes

  • Broken async stream when using aiohttp (231b4c1)

Documentation

  • Add hint for base64 string (70eb9c1)
  • Add mcp example in README (81d3831)
  • Regenerate docs for 1.22.0 (6f7f223)

1.22.0 (2025-06-25)

Features

  • Add compressionQuality enum for generate_videos (b132387)
  • Add enhance_input_image and image_preservation_factor fields for upscale_image (cdcd4f5)
  • Allow users to access headers for generateContent method and generateContentStream (80c8964)
  • Expose the responseJsonSchema in GenerateContentConfig (714452f)
  • Improve repr for pydantic objects. (80ab054)
  • Support Batches create/get/list/cancel in Gemini Developer API (5ab8a56)
  • Support IntEnums when processing JSON schemas (6cc2bdb)

Bug Fixes

  • Keep chunk content history when thought summaries are enabled in the stream response (91e7246)
  • The send_client_content function with Blob input. (8491e4c)

Documentation

  • Improve generate images documentation (15b2144)
  • Update description of thinking_budget. (7c2ae32)

1.21.1 (2025-06-19)

Bug Fixes

  • Re-raise exception during retries (d6a223c)

Documentation

  • Regenerate docs for 1.21.0 (feaf5fe)

1.21.0 (2025-06-18)

Features

  • Add retries to http client (aed2f48)
  • Enable json schema for controlled output and function declaration. (624c8e7)
  • Support extra_body in HttpOptions (273c9b8)

Bug Fixes

  • Update aiohttp client's SSL handling and configure trust_env by default to match httpx (462dd3e)

Documentation

  • Add instructions to use the aiohttp options for faster async performance and client_args/async_client_args in HttpOptions (0820ed6)
  • Add proxy instruction (f90af49)
  • Regenerate docs for 1.20.0 (66f198a)

1.20.0 (2025-06-11)

Features

  • Add datastore_spec field for VertexAISearch (a26d998)
  • Add support for Veo frame interpolation and video extension (1648dda)
  • Add Video.from_file() support in Python SDK (7eb5b07)
  • RAG - Introducing context storing for Gemini Live API. (c00c4a9)
  • Use aiohttp in async APIs to lower latency if aiohttp is installed, otherwise use default httpx in async APIs (2f448bc)

Bug Fixes

  • chats: Relax the constraint on chat turns (046fa87)
  • Make function calls asynchronous in subsequent AFC calls (3e429a0)

Documentation

  • Generate docs for 1.19.0 (4df9230)

1.19.0 (2025-06-04)

Features

  • Add enhance_prompt field for Gemini Developer API generate_videos (92ca562)
  • Add FunctionResponse.from_mcp_response() convenience function for parsing MCP responses to send to subsequent model calls. (e1b980d)
  • Enable url_context for Vertex (99551c9)
  • python: Support GEMINI_API_KEY as environment variable for setting API key. (ae2392c)

Bug Fixes

  • Enable FunctionDeclaration parser when future is imported (589b520)

1.18.0 (2025-05-30)

Features

  • Adding thought_signature field to the Part to store the signature for thoughts. (303f906)
  • Include UNEXPECTED_TOOL_CALL enum value to FinishReason for Vertex AI APIs. (ccbc66e)
  • Support ephemeral auth tokens as API keys for live connections in Python. (db1d7ee)

Bug Fixes

  • Ignore struct types when performing forward compatibility field filtering (7024011)

⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • Removed live_ephemeral_connect, ephemeral auth tokens can now be used as API keys (db1d7ee)
  • Rename LiveEphemeralParameters to LiveConnectConstraints. (6719faf)

1.17.0 (2025-05-28)

⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • Remove unsupported Lyria enum for music generation mode

Features

  • Add generate_audio field for private testing of video generation (c2bccf3)
  • Send automatic function calling None responses as NULL to the model (8446e3d)
  • Support API keys for live in VertexAI mode (5b5a750)
  • Support new fields in FileData, GenerationConfig, GroundingChunkRetrievedContext, RetrievalConfig, Schema, TuningJob, VertexAISearch, (b07c549)

Documentation

Miscellaneous Chores

  • Remove unsupported Lyria enum for music generation mode (98ff507)

1.16.1 (2025-05-20)

Bug Fixes

  • Fix broken tool use in generate content. (bad81ad)

1.16.0 (2025-05-19)

Features

  • Add time range filter to Google Search Tool (b79c414)
  • Add basic support for async function calling. (6258dad)
  • Add Files module with Files.upload, .get and .delete (f4dd629)
  • Add live proactivity_audio and enable_affective_dialog (778d6a2)
  • Add Lyria Realtime music generation support for Python (e746417)
  • Add Lyria Realtime Music Types (18d2407)
  • Add MCP telemetry usage to Python SDK. (0bc6ab5)
  • Add multi-speaker voice config (1d73827)
  • Add support for lat/long in search. (50ddf98)
  • Add support for MCP in Python SDK. (dcd7819)
  • Add support for MCP in Python SDK. (3f531c3)
  • Add telemetry headers for synchronous calls with MCP (638c7f4)
  • Add Video FPS, and enable start/end_offset for MLDev (bfaa1df)
  • Raises an error when there are duplicate tool names. (301c699)
  • Support customer-managed encryption key in cached content (e951337)
  • Support ephemeral token creation in Python (141d540)
  • Support models.get/delete/update in Java (aeaadf8)
  • Support Url Context Retrieval tool (cbd1ea6)
  • Support using ephemeral token in Live session connection in Python (141d540)

Bug Fixes

  • Clone config when parsing for MCP tools (5feeb60)
  • Fix imports if mcp is not installed (e46eb05)
  • Live tools (032d1fe)
  • Prevent MCP label from being appended multiple times if they already exist (974ba07)
  • Typo in error message. (9a45bfd)
  • Update parse_config_for_mcp_tools to remove the deep copy of the config and filter tools (d4dd2bb)
  • Use inspect.cleandoc on function docstrings in generate_function_declaration. (bc664d9)

Documentation

  • Add docs for enum fields (2634e01)
  • Regenerate docs for 1.15.0 (a3fc532)

Miscellaneous Chores

  • Fix Lyria method name for JS, update parameters type (0a5d68d)
  • Release 1.16.0 (181d5b7)

1.15.0 (2025-05-13)

Features

  • Support display_name for Blob class when calling Vertex AI (266da4a)
  • Support tuning checkpoints (26a87ea)
  • Typo fixes in a few files. (b9c9e32)

Bug Fixes

  • Improve thread safety for sync requests (fixes #775) (d88b8d4)

Documentation

  • Improve docs for response_mime_type and response_schema. Relate to #297 (832b715)
  • Regenerate docs for 1.14.0 (32808f3)

1.14.0 (2025-05-07)

Features

  • Add Tool.enterprise_web_search field (731c5a3)
  • Add support for Grounding with Google Maps (1efc057)
  • Enable input transcription for Gemini API. (157b16b)

Bug Fixes

  • Add retry logic for missing x-goog-upload-status header for python (5bb70fc)
  • Fix resource warning raised by unclosed httpx client (a3a6d34)
  • Raise ValueError when 'x-goog-upload-status' header is not present in file upload response (dfdea36)

Documentation

  • Regenerate docs for 1.13.0 (5269212)

1.13.0 (2025-04-30)

Features

  • Add models.delete and models.update to manage tuned models (53a3282)
  • Add support for live grounding metadata (b904cba)
  • Make min_property, max_property, min_length, max_length, example, patter fields available for Schema class when calling Gemini API (52919cb)
  • Support setting the default base URL in clients via set_default_base_urls() (2b82d72)
  • Support using the passed credentials in AsyncLive::connect (#738) (568cfd2)

Bug Fixes

  • Do not raise error for default field in Schema for Gemini API calls (1d3d1c9)
  • Set propertyOrdering when schema is specified as dict or types.Schema. (48eebe0)

Documentation

  • Add a link for where to find the Google Cloud project id, API key and location (916bd6e)

1.12.0 (2025-04-23)

Features

  • Add additional realtime input fields (bef6385)
  • Add py.typed so MyPy interprets this as a typed library (b137b4d)
  • Automatically determine mime_type for Part.from_uri (b9d3be1)
  • Generate _live_converters.py (d526a08)
  • Introduce from_json_schema classmethod to Schema class to allow conversion from JSONSchema class object to Schema class object (899fa1a)
  • Support default field in Schema when users call Gemini API (1e56add)

Documentation

  • Regenerate docs for 1.11.0 (473bf4b)

1.11.0 (2025-04-16)

Features

  • Add support for model_selection_config to GenerateContentConfig (fdb0662)
  • Introduce json_schema quick accessor in Schema class to convert Google's Schema class into JSONSchema class. (6e55222)
  • Support audio transcription in Vertex Live API (9678aba)
  • Support configuring the underlying httpx client by allowing the caller to pass client arguments via HttpOptions. (5130e0a)
  • Support RealtimeInputConfig, and language_code in SpeechConfig in python (807f098)
  • Support user passing in async function to async generate_content and async generate_content_stream for automatic function calling (33d190a)
  • Update VertexRagStore (c4558e5)

Bug Fixes

  • Get SSL_CERT_FILE or SSL_CERT_DIR environment variables for proper SSL handshake in API client. They are not automatically retrieved in httpx (5782a5f)
  • Update tests to use the pro 2.5 model gemini-2.5-pro-preview-03-25 (fde4a8a)

1.10.0 (2025-04-09)

⚠ BREAKING CHANGES

  • remove Part.from_video_metadata

Features

  • Add adapter size 2 for Gemini 2.0 Tuning (959df89)
  • Add domain to Web GroundingChunk (9a75d48)
  • Add session resumption. (6e80ae7)
  • Add thinking_budget to ThinkingConfig for Gemini Thinking Models (71863e0)
  • Add traffic type to GenerateContentResponseUsageMetadata (925f983)
  • Add transcription support for MLDev (c0a1b5c)
  • Add types for configurable speech detection (ae4ecee)
  • Add types to support continuous sessions with a sliding window (7099e1e)
  • Add UsageMetadata to LiveServerMessage (018846a)
  • Added support for Context Window Compression (e5c646c)
  • Populate X-Server-Timeout header when a request timeout is set. (2af7b67)
  • Remove experimental warnings for generate_videos and operations (fa6007a)
  • Remove experimental warnings from live api. (007d1b1)
  • Support media resolution (ef64f8a)

Bug Fixes

  • Remove Part.from_video_metadata (c0947ab)
  • Upload file should support timeout (in milliseconds) configuration from http_options per request or from client (5f3e895)

Miscellaneous Chores

1.9.0 (2025-04-01)

Features

  • Add specialized send methods to the live api (9c4e4dc)
  • Expose generation_complete, input/output_transcription & input/output_audio_transcription to SDK for Vertex Live API (e5685ad)
  • Merge GenerationConfig into LiveConnectConfig (d22535e)

Bug Fixes

  • Make response arg in APIError class constructor optional. #572 (7b3f4a4)

Documentation

1.8.0 (2025-03-26)

Features

  • Add engine to VertexAISearch (21f0394)
  • Add IMAGE_SAFTY enum value to FinishReason (3a65fb0)
  • Add MediaModalities for ModalityTokenCount (fb2509c)
  • Add Veo 2 generate_videos support in Go SDK (55b2923)
  • Allow title property to be sent to Gemini API. Gemini API now supports the title property, so it's ok to pass this onto both Vertex and Gemini API. (f2f92a7)
  • chats: Allow user to create chat session with list of ContentDict (43c5379), closes #467
  • Move set event loop into try except logic when setting auth lock (d04b6a6)
  • Save prompt safety attributes in dedicated field for generate_images (e5bbb0e)
  • Support new UsageMetadata fields (122cdc8)

Bug Fixes

  • Improve logging for response.parsed (fixes #455) (64012dd)
  • Schema transformer logic fix. (f64bcba)
  • Set event loop before asyncio.Lock() to ensure threading safety (be2d9c6)
  • Surface complete error details from backend (38f5beb)
  • chats: Raise error when types.Content is passed to send_message() to correctly adhere to type annotation. To migrate code previously passing content = types.Content(...) to send_message(), pass content.parts instead.

Documentation

  • Log warning to users that Part.from_video_metadata will be deprecated. (2d12f54)

1.7.0 (2025-03-18)

Features

  • Bump up the websockets version for proxy support (b996c4b)
  • Leverage httpx connection pooling and avoid instantiation of httpx.Client or httpx.AsyncClient for each call (2ac5129)

Bug Fixes

  • chats: Fix duplicate history when appending AFC history (e4b1d8a)
  • chats: Raise error when types.Content is passed to send_message() to correctly adhere to type annotation. To migrate code previously passing content = types.Content(...) to send_message(), pass content.parts instead.
  • Fix incorrect casing of upload status and url headers in Files API. httpx.Response returns 'x-goog-upload-status', but we were checking for 'X-Goog-Upload-Status'. Also clean up upload_file and download_file requests. (2ac5129)

Documentation

  • Use consistent terminology for Gemini Developer API and Vertex AI (7f1cc22)

1.5.0 (2025-03-07)

Features

  • Determine mime_type from local images (5e84ddc)
  • Enable generate_videos for Gemini Developer API (4a242f6)
  • Enable image to video for generate_videos (787354b)
  • Expand files.download to work on Video and GeneratedVideo objects (8d4d6fd)
  • Support asynchronously upload and download files using httpx (498c01d)

Bug Fixes

  • Fix incorrect unit for timeout_in_seconds in HttpOptions. (a9be9a2)
  • Fix Video.show() when uri and video_bytes are provided (3477c40)

1.4.0 (2025-03-05)

Features

  • Add response_id and create_time to GenerateContentResponse (b46ed36)
  • Allow non-content types in generate_content (cbaaf4a)
  • Enable Live API initial connect to accept functions directly, in addition to just FunctionDeclaration (91b1d3e)
  • Enable minItem, maxItem, nullable for Schema type when calling Gemini API. (867ce70)
  • Implement get history to return comprehensive or curated chat history (92deda1)
  • Support aspect ratio for edit_image (5423a58)

Bug Fixes

  • Allow user do batch generate content when passing a list of strings (cbaaf4a)
  • Fix chats.send_message_stream curated history (bcf2be0)
  • Log warn instead of raise error for GenerateContentResponse.text quick accessor when there are mixed part types (55a0638)
  • Remove the keyword parameter requirement for UserContent and ModelContent (0cc292f)

1.3.0 (2025-02-24)

Features

  • Add generate_videos (Veo 2) support for Python (e9e2be7)
  • Add sdk logger instance (fixes #278) (cf281b5)
  • Introduce response.executable_code and response.code_execution_result quick accessors for GenerateContentResponse class (3725ddf)
  • Introduce UserContent and ModelContent to facilitate easier content creation (c8cfef8)
  • Native async client support using httpx (c38da8d)
  • Provide a public property for determining the module backend. (8e561de)

Bug Fixes

  • Enable sending empty input to Live API as turn complete (99a5510)
  • Fix automatic function calling warning message logic. (b99da95)
  • Fix duplicate get_function_response_parts in (async) generate_content_stream and ensure chunk isn't empty before get_function_response_parts (d4193e6)
  • Properly handle empty json response with headers for list models (859ebc3)

Documentation

  • Add docs for error handling (#317) (6e1cb82)
  • Add instruction on how to disable automatic function calling. (f8b12d5)
  • Regenerate docs for 1.2.0 (30a3493)
  • Remove negative_prompt from image samples (fixes #339) (81e18f0)
  • Update docs for models modules (d96bba2)

1.2.0 (2025-02-12)

Features

  • Enable Media resolution for Gemini API. (6cdf61d)
  • Support property_ordering in response_schema (fixes #236) (01b15e3)

Bug Fixes

  • Default to list base models for async models list (d3226b7)
  • Remove Type import from types.py that get's shadowed by API Type type. (fixes #310) (78f58c3)
  • Use typing_extensions.TypedDict for TypedDict types (fixes #189) (996562a)

Documentation

  • Client initialization using environmental variables. (e4c2ffc)
  • Fix File.expiration_time description (fixes #318) (729f619)
  • Fix files.upload docs to use 'file' instead of 'path' (fixes #306) (2b35d0c)

1.1.0 (2025-02-10)

Features

  • Add support for typing.Literal in response_schema (fixes #264) (384c4eb)
  • Allow converting a function into FunctionDeclaration with api option (408e28f)
  • Support generate content config for each chat turn (ca19100)
  • Tuning - Tuning.tune for Gemini API no longer blocks until the tuning operation is resolved (fcf8888)

Bug Fixes

  • Remove duplicate function invocations and ensure automatic function calling can be disabled in generate_content_stream (0958fbe)
  • Response_schema generation for pydantic fields with type Optional[list] and Optional[MyBaseModel] now work correctly (fixes #246) (8330561)
  • Support dict response_schema with 'any_of' key (75f5056)
  • Common - Do not fail when server returns unknown enum values on Python <3.11 (843d86d)

Documentation

  • Add docs on how to structure contents (fixes #274) (da356cb)
  • Regenerate docs for 1.0 (fbee816)
  • Update model names in README, fix function calling example (11c0274)

1.0.0 (2025-02-05)

⚠ BREAKING CHANGES

  • Remove deprecated field: deprecated_response_payload

Features

  • Add labels for GenerateContent requests (3e3b82d)
  • Add Union support to response_schema (eedf4f1)
  • Support automatic function calling in models.generate_content_stream and send_message_stream, sync and async mode (7c9f8b5)

Bug Fixes

  • Avoid false test failure by skipping incompatible test case for python 3.13 (7f10e55)
  • Default to list base models (instead of tuned models) (ef48f0d)
  • Handle pydantic model type recognition gracefully for python 3.9 and 3.10 (4a38fdf)
  • Raise error when Gemini API response_schema has 'default' or 'anyof' fields (c50bca0)
  • Remove redundant contents in Automatic Function Calling history (5510595)
  • Remove unsupported parameter from Gemini API (f8addb5)

Documentation

  • Remove experimental classification from description. (b14ac57)
  • Remove thoughts examples and update tests (af3b339)
  • Update documentation on how to set api version using genai client (6fd4425)
  • Update instruction on function calling experience in ANY mode. (451cf98)

Code Refactoring

  • Remove deprecated field: deprecated_response_payload (197fa46)

0.8.0 (2025-01-30)

⚠ BREAKING CHANGES

  • Rename files.upload argument to "file" instead of "path".

Features

  • Add enhanced_prompt to GeneratedImage class (76c810b)
  • Added Operation and PredictOperation (internal module) (309dd26)
  • Support global endpoint natively in Vertex (f4530b0)
  • Support unknown enum values (da448b3)

Bug Fixes

  • Streaming in Vertex AI Express (ff78b7b)

Documentation

  • Correct generate content with uploaded file example (8cea052)

Miscellaneous Chores

  • Rename files.upload argument to "file" instead of "path". (f68aa1f)

0.7.0 (2025-01-28)

⚠ BREAKING CHANGES

  • Remove skip_project_and_location_in_path from async models.list
  • remove "tuning.distill"
  • Change asynchronous streaming output to an awaitable async iterator for client.aio.models.generate_content_stream and client.aio.chat.send_message_stream
  • Remove pillow as a required dependency
  • rename batches.list method signature.
  • make Part, FunctionDeclaration, Image, and GenerateContentResponse classmethods argument keyword only
  • Remove skip_project_and_location_in_path from HttpOption
  • Renamed FunctionDeclaration class functions to reflect the fact that they work off of the Callable type not just functions.
  • Moved the HttpOptions class into types.py, by making it autogenerated. This causes the following breaking change:
  • rename generate_image() to generate_images(), rename GenerateImageConfig to GenerateImagesConfig, rename GenerateImageResponse to GenerateImagesResponse, rename GenerateImageParameters to GenerateImagesParameters

Features

  • [genai-modules][models] Add HttpOptions to all method configs for models. (76fdde7)
  • Add support for enhance_prompt to model.generate_image (d09e14e)
  • Added support for the new HttpOptions class in the per request options overrides. (ad57025)
  • Change asynchronous streaming output to an awaitable async iterator for client.aio.models.generate_content_stream and client.aio.chat.send_message_stream (0c124eb)
  • Enable enum support in the GenerateContentConfig.response_schema (fe82e10)
  • Handle a wider variety of response_schemas - primitives and nested lists. (24fffea)
  • Images - Added Image.mime_type (71a8f1d)
  • Make Part, FunctionDeclaration, Image, and GenerateContentResponse classmethods argument keyword only (b58f4e0)
  • Remove skip_project_and_location_in_path from async models.list (d788626)
  • Remove skip_project_and_location_in_path from HttpOption (a1c0435)
  • Support GenerateContentResponse.parsed to return Enum (e214211)
  • Validate enum value for different backend endpoint. (97bb958)

Bug Fixes

  • Add required key to nested fields in function declaration schemas (c7dba47)
  • Fix pydantic list support in Python 3.9 and 3.10 (fixes #52) (81150b3)
  • Handle nullable types in pydantic classes (fixes #62) (773e1c0)
  • Support parameterized generics Union type in automatic function calling parameters (fixes #22) (04475ab)

Documentation

  • Add examples & tests for thinking model (59e2763)
  • Correct usage (0c546de)
  • Document experimental state of the live module. (115ac47)
  • Fix Blob type docstring. (7f38e55)
  • Remove repeated docstring for interrupted in docs (230cfbc)
  • Remove the word "class" in docstring and sync Live types docstring up-to-date (7fa3ef3)
  • Update supported model parameter format for generate_content (a5c3a1c)

Code Refactoring

  • Moved the HttpOptions class into types.py, by making it autogenerated. This causes the following breaking change: (ad57025)
  • Remove "tuning.distill" (ca8cd5e)
  • Remove pillow as a required dependency (8ccdf2e)
  • Rename batches.list method signature. (aa7c071)
  • Rename generate_image() to generate_images(), rename GenerateImageConfig to GenerateImagesConfig, rename GenerateImageResponse to GenerateImagesResponse, rename GenerateImageParameters to GenerateImagesParameters (65d7bf5)
  • Renamed FunctionDeclaration class functions to reflect the fact that they work off of the Callable type not just functions. (0e4a003)

0.6.0 (2025-01-21)

Features

  • Add support for audio_timestamp to types.GenerateContentConfig (fixes #132) (116395b)
  • Add support for case insensitive enum types. (fixes #11) (252f302)
  • Add support for class methods in the Tools for the GenerateContent Function (5afa6bb)
  • Add ThinkingConfig to generate content config. (c23c42c)
  • Implement client.files.download (a034b77)
  • Support BytesIO when uploading files (4b490dc)
  • Support lists in response_schema (8ed933d)
  • Usability change to simplify generate content with uploaded files (5c372ae)

Bug Fixes

  • Fix count_tokens system_instruction and tools config (056eaba)
  • Fix models.list() with empty tuned models (75409f1)
  • Fixed the bytes type handling (the base64.urlsafe_bencode error) (1bc161d)
  • Project and location are required when using client in Vertex AI mode. (d5859fa)

Documentation

  • Add project description to README. (384f413)
  • Update formatting in README.md (d33fb37)
  • Update models.list doc and code examples to include list base models (f2e0c43)
  • Tool use example in docs (87fe5b0)
  • Tool use example in README.md (87fe5b0)

0.5.0 (2025-01-13)

Features

  • Support API keys for VertexAI mode generate_content (0e4b0e5)
  • Support list models to return base models (0f713f1)
  • Support parsing 'interrupted' field in Live Python SDK. (eab2c4a)
  • Use ser_json_byte val_json_bytes in bytes type public interface (1176e43)

Bug Fixes

Documentation

  • Correct description of path parameter that only path-like object is supported (336498b)

0.4.0 (2025-01-08)

⚠ BREAKING CHANGES

  • Make Imagen upscale_factor a required argument, make upscale config optional

Features

  • ApiClient - support timeout in HttpOptions (b22286f)
  • Enable response_logprobs and logprobs for Google AI (5586f3d)
  • Support function_calls quick accessor in GenerateContentResponse class (81b8a23)

Bug Fixes

  • Change string type to int type (5c15243)
  • FunctionCallCancellation ids type. (b0e46b7)
  • Gracefully catch error if streamed json does not meet schema validation (fixes #14) (f494432)
  • Update RealtimeClientLiveMessage realtime content parameter field. (4340939)

Documentation

  • Add readme example for Chats module (830f0f5)
  • Fix typo in code document (f9243e8)
  • Fix typo in CONTRIBUTING.md (3e42644)

Code Refactoring

  • Make Imagen upscale_factor a required argument, make upscale config optional (b06629f)

0.3.0 (2024-12-17)

BREAKING CHANGES

  • contents must be passed to CreateCachedContentConfig instead as a parameter to create_cached_content.

Features

  • Add support for Pydantic default value in Automatic Function Calling.
  • Add support for thought.
  • Add support for streaming chat.