Releases: googleapis/python-genai
Releases · googleapis/python-genai
v1.9.0
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
Documentation
- Docstring improvements (77f5356)
v1.8.0
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 tosend_message()
to correctly adhere to type annotation. To migrate code previously passingcontent = types.Content(...)
tosend_message()
, passcontent.parts
instead.(7fb2c7e)
Documentation
- Log warning to users that Part.from_video_metadata will be deprecated. (2d12f54)
v1.7.0
1.7.0 (2025-03-18)
Features
- Bump up the websockets version (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 tosend_message()
to correctly adhere to type annotation. To migrate code previously passingcontent = types.Content(...)
tosend_message()
, passcontent.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)
v1.6.0
1.6.0 (2025-03-13)
Features
- Add base steps to EditImageConfig (9ddfbcd)
- Enable union type for Schema when calling Gemini API, enable required field when doing automatic function calling for Gemini API. (891d736)
- Migrate sync client to use httpx (d0bf03b)
- Support returned safety attributes for generate_images (98b5709)
Bug Fixes
- Correctly import typing.typeguard in python 3.9 (4dcaf99)
- Fix the missing learning_rate_multiplier in CreateTuningJobConfig conversion. (0bd0a5e)
- Fix video.show() to display video (dab1a4f)
- Remove unsupported parameter negative_prompt from Gemini API generate_images (5f3333e)
- Resolve issue where pre-release versions of dependencies are installed (6559a1a)
Documentation
v1.5.0
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
v1.4.0
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)
v1.3.0
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
v1.2.0
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
v1.1.0
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
v1.0.0
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)