Skip to content

Commit 8153626

Browse files
wanlin31copybara-github
authored andcommitted
fix: Add preview warnings for webhooks API access.
PiperOrigin-RevId: 899310186
1 parent 3f36ca1 commit 8153626

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

google/genai/client.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from ._interactions.resources import AsyncInteractionsResource as AsyncNextGenInteractionsResource, InteractionsResource as NextGenInteractionsResource
5050
from ._interactions.resources import WebhooksResource, AsyncWebhooksResource
5151
_interactions_experimental_warned = False
52+
_webhooks_preview_warned = False
5253

5354
class AsyncGeminiNextGenAPIClientAdapter(_interactions.AsyncGeminiNextGenAPIClientAdapter):
5455
"""Adapter for the Gemini NextGen API Client."""
@@ -202,6 +203,14 @@ def interactions(self) -> AsyncNextGenInteractionsResource:
202203

203204
@property
204205
def webhooks(self) -> AsyncWebhooksResource:
206+
global _webhooks_preview_warned
207+
if not _webhooks_preview_warned:
208+
_webhooks_preview_warned = True
209+
warnings.warn(
210+
'Webhooks usage is preview and may change in future versions.',
211+
category=UserWarning,
212+
stacklevel=1,
213+
)
205214
return self._nextgen_client.webhooks
206215

207216
@property
@@ -553,6 +562,14 @@ def interactions(self) -> NextGenInteractionsResource:
553562

554563
@property
555564
def webhooks(self) -> WebhooksResource:
565+
global _webhooks_preview_warned
566+
if not _webhooks_preview_warned:
567+
_webhooks_preview_warned = True
568+
warnings.warn(
569+
'Webhooks usage is preview and may change in future versions.',
570+
category=UserWarning,
571+
stacklevel=1,
572+
)
556573
return self._nextgen_client.webhooks
557574

558575
@property

0 commit comments

Comments
 (0)