diff --git a/google/genai/client.py b/google/genai/client.py index 8680a2b74..08483c01a 100644 --- a/google/genai/client.py +++ b/google/genai/client.py @@ -49,6 +49,7 @@ from ._interactions.resources import AsyncInteractionsResource as AsyncNextGenInteractionsResource, InteractionsResource as NextGenInteractionsResource from ._interactions.resources import WebhooksResource, AsyncWebhooksResource _interactions_experimental_warned = False +_webhooks_preview_warned = False class AsyncGeminiNextGenAPIClientAdapter(_interactions.AsyncGeminiNextGenAPIClientAdapter): """Adapter for the Gemini NextGen API Client.""" @@ -202,6 +203,14 @@ def interactions(self) -> AsyncNextGenInteractionsResource: @property def webhooks(self) -> AsyncWebhooksResource: + global _webhooks_preview_warned + if not _webhooks_preview_warned: + _webhooks_preview_warned = True + warnings.warn( + 'Webhooks usage is preview and may change in future versions.', + category=UserWarning, + stacklevel=1, + ) return self._nextgen_client.webhooks @property @@ -553,6 +562,14 @@ def interactions(self) -> NextGenInteractionsResource: @property def webhooks(self) -> WebhooksResource: + global _webhooks_preview_warned + if not _webhooks_preview_warned: + _webhooks_preview_warned = True + warnings.warn( + 'Webhooks usage is preview and may change in future versions.', + category=UserWarning, + stacklevel=1, + ) return self._nextgen_client.webhooks @property