Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion google/genai/_interactions/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
from ._client_adapter import GeminiNextGenAPIClientAdapter, AsyncGeminiNextGenAPIClientAdapter

if TYPE_CHECKING:
from .resources import interactions
from .resources import webhooks, interactions
from .resources.webhooks import WebhooksResource, AsyncWebhooksResource
from .resources.interactions import InteractionsResource, AsyncInteractionsResource

__all__ = [
Expand Down Expand Up @@ -133,6 +134,12 @@ def interactions(self) -> InteractionsResource:

return InteractionsResource(self)

@cached_property
def webhooks(self) -> WebhooksResource:
from .resources.webhooks import WebhooksResource

return WebhooksResource(self)

@cached_property
def with_raw_response(self) -> GeminiNextGenAPIClientWithRawResponse:
return GeminiNextGenAPIClientWithRawResponse(self)
Expand Down Expand Up @@ -354,6 +361,12 @@ def interactions(self) -> AsyncInteractionsResource:

return AsyncInteractionsResource(self)

@cached_property
def webhooks(self) -> AsyncWebhooksResource:
from .resources.webhooks import AsyncWebhooksResource

return AsyncWebhooksResource(self)

@cached_property
def with_raw_response(self) -> AsyncGeminiNextGenAPIClientWithRawResponse:
return AsyncGeminiNextGenAPIClientWithRawResponse(self)
Expand Down Expand Up @@ -518,6 +531,12 @@ def interactions(self) -> interactions.InteractionsResourceWithRawResponse:

return InteractionsResourceWithRawResponse(self._client.interactions)

@cached_property
def webhooks(self) -> webhooks.WebhooksResourceWithRawResponse:
from .resources.webhooks import WebhooksResourceWithRawResponse

return WebhooksResourceWithRawResponse(self._client.webhooks)


class AsyncGeminiNextGenAPIClientWithRawResponse:
_client: AsyncGeminiNextGenAPIClient
Expand All @@ -531,6 +550,12 @@ def interactions(self) -> interactions.AsyncInteractionsResourceWithRawResponse:

return AsyncInteractionsResourceWithRawResponse(self._client.interactions)

@cached_property
def webhooks(self) -> webhooks.AsyncWebhooksResourceWithRawResponse:
from .resources.webhooks import AsyncWebhooksResourceWithRawResponse

return AsyncWebhooksResourceWithRawResponse(self._client.webhooks)


class GeminiNextGenAPIClientWithStreamedResponse:
_client: GeminiNextGenAPIClient
Expand All @@ -544,6 +569,12 @@ def interactions(self) -> interactions.InteractionsResourceWithStreamingResponse

return InteractionsResourceWithStreamingResponse(self._client.interactions)

@cached_property
def webhooks(self) -> webhooks.WebhooksResourceWithStreamingResponse:
from .resources.webhooks import WebhooksResourceWithStreamingResponse

return WebhooksResourceWithStreamingResponse(self._client.webhooks)


class AsyncGeminiNextGenAPIClientWithStreamedResponse:
_client: AsyncGeminiNextGenAPIClient
Expand All @@ -557,6 +588,12 @@ def interactions(self) -> interactions.AsyncInteractionsResourceWithStreamingRes

return AsyncInteractionsResourceWithStreamingResponse(self._client.interactions)

@cached_property
def webhooks(self) -> webhooks.AsyncWebhooksResourceWithStreamingResponse:
from .resources.webhooks import AsyncWebhooksResourceWithStreamingResponse

return AsyncWebhooksResourceWithStreamingResponse(self._client.webhooks)


Client = GeminiNextGenAPIClient

Expand Down
14 changes: 14 additions & 0 deletions google/genai/_interactions/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@

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

from .webhooks import (
WebhooksResource,
AsyncWebhooksResource,
WebhooksResourceWithRawResponse,
AsyncWebhooksResourceWithRawResponse,
WebhooksResourceWithStreamingResponse,
AsyncWebhooksResourceWithStreamingResponse,
)
from .interactions import (
InteractionsResource,
AsyncInteractionsResource,
Expand All @@ -31,4 +39,10 @@
"AsyncInteractionsResourceWithRawResponse",
"InteractionsResourceWithStreamingResponse",
"AsyncInteractionsResourceWithStreamingResponse",
"WebhooksResource",
"AsyncWebhooksResource",
"WebhooksResourceWithRawResponse",
"AsyncWebhooksResourceWithRawResponse",
"WebhooksResourceWithStreamingResponse",
"AsyncWebhooksResourceWithStreamingResponse",
]
45 changes: 45 additions & 0 deletions google/genai/_interactions/resources/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from ..types.tool_param import ToolParam
from ..types.interaction import Interaction
from ..types.model_param import ModelParam
from ..types.webhook_config_param import WebhookConfigParam
from ..types.interaction_sse_event import InteractionSSEEvent
from ..types.generation_config_param import GenerationConfigParam

Expand Down Expand Up @@ -82,6 +83,7 @@ def create(
stream: Literal[False] | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -120,6 +122,9 @@ def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -148,6 +153,7 @@ def create(
store: bool | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -186,6 +192,9 @@ def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -214,6 +223,7 @@ def create(
stream: Literal[False] | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -252,6 +262,9 @@ def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -280,6 +293,7 @@ def create(
store: bool | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -318,6 +332,9 @@ def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -346,6 +363,7 @@ def create(
store: bool | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -384,6 +402,9 @@ def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -412,6 +433,7 @@ def create(
stream: Literal[False] | Literal[True] | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]] | Omit = omit,
agent_config: interaction_create_params.AgentConfig | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -446,6 +468,7 @@ def create(
"stream": stream,
"system_instruction": system_instruction,
"tools": tools,
"webhook_config": webhook_config,
"agent": agent,
"agent_config": agent_config,
},
Expand Down Expand Up @@ -734,6 +757,7 @@ async def create(
stream: Literal[False] | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -772,6 +796,9 @@ async def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -800,6 +827,7 @@ async def create(
store: bool | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -838,6 +866,9 @@ async def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -866,6 +897,7 @@ async def create(
stream: Literal[False] | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -904,6 +936,9 @@ async def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -932,6 +967,7 @@ async def create(
store: bool | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -970,6 +1006,9 @@ async def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -998,6 +1037,7 @@ async def create(
store: bool | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -1036,6 +1076,9 @@ async def create(

tools: A list of tool declarations the model may call during interaction.

webhook_config: Optional. Webhook configuration for receiving notifications when the interaction
completes.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -1064,6 +1107,7 @@ async def create(
stream: Literal[False] | Literal[True] | Omit = omit,
system_instruction: str | Omit = omit,
tools: Iterable[ToolParam] | Omit = omit,
webhook_config: WebhookConfigParam | Omit = omit,
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]] | Omit = omit,
agent_config: interaction_create_params.AgentConfig | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -1098,6 +1142,7 @@ async def create(
"stream": stream,
"system_instruction": system_instruction,
"tools": tools,
"webhook_config": webhook_config,
"agent": agent,
"agent_config": agent_config,
},
Expand Down
Loading
Loading