Skip to content

Commit 8940ffb

Browse files
Merge branch 'main' into fix/mcp-boolean-additional-properties
2 parents 71f39c8 + 610059b commit 8940ffb

19 files changed

Lines changed: 1204 additions & 7 deletions

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [2.4.0](https://github.com/googleapis/python-genai/compare/v2.3.0...v2.4.0) (2026-05-17)
4+
5+
6+
### Features
7+
8+
* Support Agent and Environment APIs. ([ef20d6b](https://github.com/googleapis/python-genai/commit/ef20d6ba54a183280c046a4346c125168d5f8a95))
9+
10+
11+
### Bug Fixes
12+
13+
* Output_text for turns that don't end with text. ([2afdeff](https://github.com/googleapis/python-genai/commit/2afdefff90f3fb4f98075a18c99d44b9e722dde6))
14+
* Pass max_line_length to readline() to prevent LineTooLong on large SSE lines with MTLS. ([0e8f7bb](https://github.com/googleapis/python-genai/commit/0e8f7bbe1a6b9700f6cd6265851114c315a4a72a))
15+
316
## [2.3.0](https://github.com/googleapis/python-genai/compare/v2.2.0...v2.3.0) (2026-05-15)
417

518

google/genai/_interactions/_client.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
from ._client_adapter import GeminiNextGenAPIClientAdapter, AsyncGeminiNextGenAPIClientAdapter
5050

5151
if TYPE_CHECKING:
52-
from .resources import webhooks, interactions
52+
from .resources import agents, webhooks, interactions
53+
from .resources.agents import AgentsResource, AsyncAgentsResource
5354
from .resources.webhooks import WebhooksResource, AsyncWebhooksResource
5455
from .resources.interactions import InteractionsResource, AsyncInteractionsResource
5556

@@ -140,6 +141,12 @@ def webhooks(self) -> WebhooksResource:
140141

141142
return WebhooksResource(self)
142143

144+
@cached_property
145+
def agents(self) -> AgentsResource:
146+
from .resources.agents import AgentsResource
147+
148+
return AgentsResource(self)
149+
143150
@cached_property
144151
def with_raw_response(self) -> GeminiNextGenAPIClientWithRawResponse:
145152
return GeminiNextGenAPIClientWithRawResponse(self)
@@ -368,6 +375,12 @@ def webhooks(self) -> AsyncWebhooksResource:
368375

369376
return AsyncWebhooksResource(self)
370377

378+
@cached_property
379+
def agents(self) -> AsyncAgentsResource:
380+
from .resources.agents import AsyncAgentsResource
381+
382+
return AsyncAgentsResource(self)
383+
371384
@cached_property
372385
def with_raw_response(self) -> AsyncGeminiNextGenAPIClientWithRawResponse:
373386
return AsyncGeminiNextGenAPIClientWithRawResponse(self)
@@ -539,6 +552,12 @@ def webhooks(self) -> webhooks.WebhooksResourceWithRawResponse:
539552

540553
return WebhooksResourceWithRawResponse(self._client.webhooks)
541554

555+
@cached_property
556+
def agents(self) -> agents.AgentsResourceWithRawResponse:
557+
from .resources.agents import AgentsResourceWithRawResponse
558+
559+
return AgentsResourceWithRawResponse(self._client.agents)
560+
542561

543562
class AsyncGeminiNextGenAPIClientWithRawResponse:
544563
_client: AsyncGeminiNextGenAPIClient
@@ -558,6 +577,12 @@ def webhooks(self) -> webhooks.AsyncWebhooksResourceWithRawResponse:
558577

559578
return AsyncWebhooksResourceWithRawResponse(self._client.webhooks)
560579

580+
@cached_property
581+
def agents(self) -> agents.AsyncAgentsResourceWithRawResponse:
582+
from .resources.agents import AsyncAgentsResourceWithRawResponse
583+
584+
return AsyncAgentsResourceWithRawResponse(self._client.agents)
585+
561586

562587
class GeminiNextGenAPIClientWithStreamedResponse:
563588
_client: GeminiNextGenAPIClient
@@ -577,6 +602,12 @@ def webhooks(self) -> webhooks.WebhooksResourceWithStreamingResponse:
577602

578603
return WebhooksResourceWithStreamingResponse(self._client.webhooks)
579604

605+
@cached_property
606+
def agents(self) -> agents.AgentsResourceWithStreamingResponse:
607+
from .resources.agents import AgentsResourceWithStreamingResponse
608+
609+
return AgentsResourceWithStreamingResponse(self._client.agents)
610+
580611

581612
class AsyncGeminiNextGenAPIClientWithStreamedResponse:
582613
_client: AsyncGeminiNextGenAPIClient
@@ -596,6 +627,12 @@ def webhooks(self) -> webhooks.AsyncWebhooksResourceWithStreamingResponse:
596627

597628
return AsyncWebhooksResourceWithStreamingResponse(self._client.webhooks)
598629

630+
@cached_property
631+
def agents(self) -> agents.AsyncAgentsResourceWithStreamingResponse:
632+
from .resources.agents import AsyncAgentsResourceWithStreamingResponse
633+
634+
return AsyncAgentsResourceWithStreamingResponse(self._client.agents)
635+
599636

600637
Client = GeminiNextGenAPIClient
601638

google/genai/_interactions/_exceptions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ def __init__(self, *, message: str = "Connection error.", request: httpx.Request
8888

8989
class APITimeoutError(APIConnectionError):
9090
def __init__(self, request: httpx.Request) -> None:
91-
super().__init__(message="Request timed out.", request=request)
92-
91+
super().__init__(message="Request timed out. This is a client-side timeout. You can increase the timeout by setting the `timeout` argument on your request or in the client http options.", request=request)
9392

9493
class BadRequestError(APIStatusError):
9594
status_code: Literal[400] = 400 # pyright: ignore[reportIncompatibleVariableOverride]

google/genai/_interactions/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515

1616
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1717

18+
from .agents import (
19+
AgentsResource,
20+
AsyncAgentsResource,
21+
AgentsResourceWithRawResponse,
22+
AsyncAgentsResourceWithRawResponse,
23+
AgentsResourceWithStreamingResponse,
24+
AsyncAgentsResourceWithStreamingResponse,
25+
)
1826
from .webhooks import (
1927
WebhooksResource,
2028
AsyncWebhooksResource,
@@ -45,4 +53,10 @@
4553
"AsyncWebhooksResourceWithRawResponse",
4654
"WebhooksResourceWithStreamingResponse",
4755
"AsyncWebhooksResourceWithStreamingResponse",
56+
"AgentsResource",
57+
"AsyncAgentsResource",
58+
"AgentsResourceWithRawResponse",
59+
"AsyncAgentsResourceWithRawResponse",
60+
"AgentsResourceWithStreamingResponse",
61+
"AsyncAgentsResourceWithStreamingResponse",
4862
]

0 commit comments

Comments
 (0)