Skip to content
Open
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
3 changes: 2 additions & 1 deletion google/genai/_interactions/_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class APIError(GeminiNextGenAPIClientError):
body: object | None
"""The API response body.

If the API responded with a valid JSON structure then this property will be the decoded result.
If the API responded with a valid JSON structure then this property will be the
decoded result.

If it isn't a valid JSON structure then this will be the raw response.

Expand Down
82 changes: 48 additions & 34 deletions google/genai/_interactions/resources/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -167,8 +167,8 @@ def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -228,8 +228,8 @@ def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -293,8 +293,8 @@ def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -356,8 +356,8 @@ def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -496,7 +496,8 @@ def cancel(
) -> Interaction:
"""Cancels an interaction by id.

This only applies to background interactions that are still running.
This only applies to background interactions that
are still running.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -537,10 +538,12 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Interaction:
"""
Retrieves the full details of a single interaction based on its `Interaction.id`.
Retrieves the full details of a single interaction based on its
`Interaction.id`.

Args:
last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the
event marked by the event id. Can only be used if `stream` is true.

stream: If set to true, the generated content will be streamed incrementally.

Expand Down Expand Up @@ -570,12 +573,14 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Stream[InteractionSSEEvent]:
"""
Retrieves the full details of a single interaction based on its `Interaction.id`.
Retrieves the full details of a single interaction based on its
`Interaction.id`.

Args:
stream: If set to true, the generated content will be streamed incrementally.

last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the
event marked by the event id. Can only be used if `stream` is true.

extra_headers: Send extra headers

Expand Down Expand Up @@ -603,12 +608,14 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Interaction | Stream[InteractionSSEEvent]:
"""
Retrieves the full details of a single interaction based on its `Interaction.id`.
Retrieves the full details of a single interaction based on its
`Interaction.id`.

Args:
stream: If set to true, the generated content will be streamed incrementally.

last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the
event marked by the event id. Can only be used if `stream` is true.

extra_headers: Send extra headers

Expand Down Expand Up @@ -719,8 +726,8 @@ async def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -784,8 +791,8 @@ async def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -845,8 +852,8 @@ async def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -910,8 +917,8 @@ async def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -973,8 +980,8 @@ async def create(

previous_interaction_id: The ID of the previous interaction, if any.

response_format: Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
response_format: Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.

response_mime_type: The mime type of the response. This is required if response_format is set.

Expand Down Expand Up @@ -1113,7 +1120,8 @@ async def cancel(
) -> Interaction:
"""Cancels an interaction by id.

This only applies to background interactions that are still running.
This only applies to background interactions that
are still running.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -1154,10 +1162,12 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Interaction:
"""
Retrieves the full details of a single interaction based on its `Interaction.id`.
Retrieves the full details of a single interaction based on its
`Interaction.id`.

Args:
last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the
event marked by the event id. Can only be used if `stream` is true.

stream: If set to true, the generated content will be streamed incrementally.

Expand Down Expand Up @@ -1187,12 +1197,14 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncStream[InteractionSSEEvent]:
"""
Retrieves the full details of a single interaction based on its `Interaction.id`.
Retrieves the full details of a single interaction based on its
`Interaction.id`.

Args:
stream: If set to true, the generated content will be streamed incrementally.

last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the
event marked by the event id. Can only be used if `stream` is true.

extra_headers: Send extra headers

Expand Down Expand Up @@ -1220,12 +1232,14 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Interaction | AsyncStream[InteractionSSEEvent]:
"""
Retrieves the full details of a single interaction based on its `Interaction.id`.
Retrieves the full details of a single interaction based on its
`Interaction.id`.

Args:
stream: If set to true, the generated content will be streamed incrementally.

last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
last_event_id: Optional. If set, resumes the interaction stream from the next chunk after the
event marked by the event id. Can only be used if `stream` is true.

extra_headers: Send extra headers

Expand Down
3 changes: 1 addition & 2 deletions google/genai/_interactions/types/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class Annotation(BaseModel):
source: Optional[str] = None
"""Source attributed for a portion of the text.

Could be a URL, title, or
other identifier.
Could be a URL, title, or other identifier.
"""

start_index: Optional[int] = None
Expand Down
3 changes: 1 addition & 2 deletions google/genai/_interactions/types/annotation_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class AnnotationParam(TypedDict, total=False):
source: str
"""Source attributed for a portion of the text.

Could be a URL, title, or
other identifier.
Could be a URL, title, or other identifier.
"""

start_index: int
Expand Down
8 changes: 4 additions & 4 deletions google/genai/_interactions/types/interaction_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class BaseCreateModelInteractionParams(TypedDict, total=False):

response_format: object
"""
Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.
"""

response_mime_type: str
Expand Down Expand Up @@ -141,8 +141,8 @@ class BaseCreateAgentInteractionParams(TypedDict, total=False):

response_format: object
"""
Enforces that the generated response is a JSON object that complies with
the JSON schema specified in this field.
Enforces that the generated response is a JSON object that complies with the
JSON schema specified in this field.
"""

response_mime_type: str
Expand Down
3 changes: 2 additions & 1 deletion google/genai/_interactions/types/interaction_get_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class InteractionGetParamsBase(TypedDict, total=False):
last_event_id: str
"""Optional.

If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
If set, resumes the interaction stream from the next chunk after the event
marked by the event id. Can only be used if `stream` is true.
"""


Expand Down
5 changes: 1 addition & 4 deletions google/genai/_interactions/types/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ class MCPServer(BaseModel):
"""The name of the MCPServer."""

url: Optional[str] = None
"""
The full URL for the MCPServer endpoint.
Example: "https://api.example.com/mcp"
"""
"""The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp" """


class FileSearch(BaseModel):
Expand Down
5 changes: 1 addition & 4 deletions google/genai/_interactions/types/tool_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ class MCPServer(TypedDict, total=False):
"""The name of the MCPServer."""

url: str
"""
The full URL for the MCPServer endpoint.
Example: "https://api.example.com/mcp"
"""
"""The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp" """


class FileSearch(TypedDict, total=False):
Expand Down
6 changes: 1 addition & 5 deletions google/genai/_interactions/types/turn.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,4 @@ class Turn(BaseModel):
"""The content of the turn."""

role: Optional[str] = None
"""The originator of this turn.

Must be user for input or model for
model output.
"""
"""The originator of this turn. Must be user for input or model for model output."""
6 changes: 1 addition & 5 deletions google/genai/_interactions/types/turn_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@ class TurnParam(TypedDict, total=False):
"""The content of the turn."""

role: str
"""The originator of this turn.

Must be user for input or model for
model output.
"""
"""The originator of this turn. Must be user for input or model for model output."""