Temporal-aware interactions resource shim.
TemporalAsyncInteractions exposes the same surface as google-genai's AsyncClient.interactions resource, but each operation is dispatched through a Temporal activity holding the real genai.Client on the worker. The Interactions API does not go through BaseApiClient — it uses a vendored, Stainless-generated HTTP client that the TemporalApiClient shim never sees — so each operation is routed as a whole through an activity instead.
The shim depends only on the public google.genai.interactions surface (types plus client.aio.interactions on the worker), not on google-genai internals, so it is unaffected by regeneration of the vendored client.
| Class | |
Interactions resource shim that routes calls through activities. |
| Class | _ |
Async stream over interaction events already drained in an activity. |
| Function | _deserialize |
Rehydrate a dict returned by an activity into its public genai model. |
| Function | _pop |
Pop a per-call timeout kwarg and apply it to the activity config. |
| Constant | _DEFAULT |
Undocumented |
| Constant | _SSE |
Undocumented |
Rehydrate a dict returned by an activity into its public genai model.
InteractionSSEEvent is deserialized through its TypeAdapter, which dispatches the discriminated union (and nested unions) and tolerates the sparse nested payloads the API legitimately emits (e.g. an interaction.created event carrying an Interaction with just id and object). Plain models use model_validate, which recurses nested models (e.g. AgentListResponse.agents into Agent) and resolves aliases; the SDK's optional fields keep it tolerant of the minimal objects the API returns. Both paths are pure functions, safe to run in the workflow on every replay.