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
48 changes: 24 additions & 24 deletions google/genai/_gaos/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ def create(
self,
*,
api_version: Optional[str] = None,
id: Optional[str] = None,
base_agent: Optional[str] = None,
system_instruction: Optional[str] = None,
base_environment: Optional[
Union[agents_agent.BaseEnvironment, agents_agent.BaseEnvironmentParam]
] = None,
description: Optional[str] = None,
id: Optional[str] = None,
system_instruction: Optional[str] = None,
tools: Optional[
Union[
Iterable[agents_agenttool.AgentTool],
Iterable[agents_agenttool.AgentToolParam],
]
] = None,
base_environment: Optional[
Union[agents_agent.BaseEnvironment, agents_agent.BaseEnvironmentParam]
] = None,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
extra_body: Optional[Mapping[str, Any]] = None,
Expand All @@ -61,12 +61,12 @@ def create(
r"""Creates a new Agent (Typed version for SDK).

:param api_version: Which version of the API to use.
:param id: The unique identifier for the agent.
:param base_agent: The base agent to extend.
:param system_instruction: System instruction for the agent.
:param base_environment: The environment configuration for the agent.
:param description: Agent description for developers to quickly read and understand.
:param id: The unique identifier for the agent.
:param system_instruction: System instruction for the agent.
:param tools: The tools available to the agent.
:param base_environment: The environment configuration for the agent.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
:param extra_body: Additional JSON object fields to merge into request bodies.
Expand All @@ -89,14 +89,14 @@ def create(
request = models.CreateAgentRequest(
api_version=api_version,
body=agents.Agent(
id=id,
base_agent=base_agent,
system_instruction=system_instruction,
description=description,
tools=utils.get_pydantic_model(tools, Optional[List[agents.AgentTool]]),
base_environment=utils.get_pydantic_model(
base_environment, Optional[agents.BaseEnvironment]
),
description=description,
id=id,
system_instruction=system_instruction,
tools=utils.get_pydantic_model(tools, Optional[List[agents.AgentTool]]),
),
)

Expand Down Expand Up @@ -815,19 +815,19 @@ async def create(
self,
*,
api_version: Optional[str] = None,
id: Optional[str] = None,
base_agent: Optional[str] = None,
system_instruction: Optional[str] = None,
base_environment: Optional[
Union[agents_agent.BaseEnvironment, agents_agent.BaseEnvironmentParam]
] = None,
description: Optional[str] = None,
id: Optional[str] = None,
system_instruction: Optional[str] = None,
tools: Optional[
Union[
Iterable[agents_agenttool.AgentTool],
Iterable[agents_agenttool.AgentToolParam],
]
] = None,
base_environment: Optional[
Union[agents_agent.BaseEnvironment, agents_agent.BaseEnvironmentParam]
] = None,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
extra_body: Optional[Mapping[str, Any]] = None,
Expand All @@ -836,12 +836,12 @@ async def create(
r"""Creates a new Agent (Typed version for SDK).

:param api_version: Which version of the API to use.
:param id: The unique identifier for the agent.
:param base_agent: The base agent to extend.
:param system_instruction: System instruction for the agent.
:param base_environment: The environment configuration for the agent.
:param description: Agent description for developers to quickly read and understand.
:param id: The unique identifier for the agent.
:param system_instruction: System instruction for the agent.
:param tools: The tools available to the agent.
:param base_environment: The environment configuration for the agent.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
:param extra_body: Additional JSON object fields to merge into request bodies.
Expand All @@ -864,14 +864,14 @@ async def create(
request = models.CreateAgentRequest(
api_version=api_version,
body=agents.Agent(
id=id,
base_agent=base_agent,
system_instruction=system_instruction,
description=description,
tools=utils.get_pydantic_model(tools, Optional[List[agents.AgentTool]]),
base_environment=utils.get_pydantic_model(
base_environment, Optional[agents.BaseEnvironment]
),
description=description,
id=id,
system_instruction=system_instruction,
tools=utils.get_pydantic_model(tools, Optional[List[agents.AgentTool]]),
),
)

Expand Down
34 changes: 17 additions & 17 deletions google/genai/_gaos/types/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ class AgentParam(TypedDict):
}
"""

id: NotRequired[str]
r"""The unique identifier for the agent."""
base_agent: NotRequired[str]
r"""The base agent to extend."""
system_instruction: NotRequired[str]
r"""System instruction for the agent."""
base_environment: NotRequired[BaseEnvironmentParam]
r"""The environment configuration for the agent."""
description: NotRequired[str]
r"""Agent description for developers to quickly read and understand."""
id: NotRequired[str]
r"""The unique identifier for the agent."""
system_instruction: NotRequired[str]
r"""System instruction for the agent."""
tools: NotRequired[List[AgentToolParam]]
r"""The tools available to the agent."""
base_environment: NotRequired[BaseEnvironmentParam]
r"""The environment configuration for the agent."""


class Agent(BaseModel):
Expand All @@ -77,34 +77,34 @@ class Agent(BaseModel):
}
"""

id: Optional[str] = None
r"""The unique identifier for the agent."""

base_agent: Optional[str] = None
r"""The base agent to extend."""

system_instruction: Optional[str] = None
r"""System instruction for the agent."""
base_environment: Optional[BaseEnvironment] = None
r"""The environment configuration for the agent."""

description: Optional[str] = None
r"""Agent description for developers to quickly read and understand."""

id: Optional[str] = None
r"""The unique identifier for the agent."""

system_instruction: Optional[str] = None
r"""System instruction for the agent."""

tools: Optional[List[AgentTool]] = None
r"""The tools available to the agent."""

base_environment: Optional[BaseEnvironment] = None
r"""The environment configuration for the agent."""

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
[
"id",
"base_agent",
"system_instruction",
"base_environment",
"description",
"id",
"system_instruction",
"tools",
"base_environment",
]
)
serialized = handler(self)
Expand Down
6 changes: 3 additions & 3 deletions google/genai/_gaos/types/interactions/argumentsdelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@


class ArgumentsDeltaTypedDict(TypedDict):
type: Literal["arguments_delta"]
arguments: NotRequired[str]
type: Literal["arguments_delta"]


class ArgumentsDelta(BaseModel):
arguments: Optional[str] = None

type: Annotated[
Annotated[
Literal["arguments_delta"],
Expand All @@ -40,8 +42,6 @@ class ArgumentsDelta(BaseModel):
pydantic.Field(alias="type"),
] = "arguments_delta"

arguments: Optional[str] = None

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["arguments"])
Expand Down
32 changes: 16 additions & 16 deletions google/genai/_gaos/types/interactions/audiocontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,45 +55,45 @@
class AudioContentParam(TypedDict):
r"""An audio content block."""

type: Literal["audio"]
channels: NotRequired[int]
r"""The number of audio channels."""
data: NotRequired[Union[str, Base64FileInput]]
r"""The audio content."""
uri: NotRequired[str]
r"""The URI of the audio."""
mime_type: NotRequired[AudioContentMimeType]
r"""The mime type of the audio."""
channels: NotRequired[int]
r"""The number of audio channels."""
sample_rate: NotRequired[int]
r"""The sample rate of the audio."""
type: Literal["audio"]
uri: NotRequired[str]
r"""The URI of the audio."""


class AudioContent(BaseModel):
r"""An audio content block."""

type: Annotated[
Annotated[Literal["audio"], AfterValidator(validate_const("audio"))],
pydantic.Field(alias="type"),
] = "audio"
channels: Optional[int] = None
r"""The number of audio channels."""

data: Optional[Base64EncodedString] = None
r"""The audio content."""

uri: Optional[str] = None
r"""The URI of the audio."""

mime_type: Optional[AudioContentMimeType] = None
r"""The mime type of the audio."""

channels: Optional[int] = None
r"""The number of audio channels."""

sample_rate: Optional[int] = None
r"""The sample rate of the audio."""

type: Annotated[
Annotated[Literal["audio"], AfterValidator(validate_const("audio"))],
pydantic.Field(alias="type"),
] = "audio"

uri: Optional[str] = None
r"""The URI of the audio."""

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["data", "uri", "mime_type", "channels", "sample_rate"])
optional_fields = set(["channels", "data", "mime_type", "sample_rate", "uri"])
serialized = handler(self)
m = {}

Expand Down
26 changes: 13 additions & 13 deletions google/genai/_gaos/types/interactions/audiodelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,24 @@


class AudioDeltaTypedDict(TypedDict):
type: Literal["audio"]
channels: NotRequired[int]
r"""The number of audio channels."""
data: NotRequired[str]
uri: NotRequired[str]
mime_type: NotRequired[AudioDeltaMimeType]
rate: NotRequired[int]
r"""Deprecated. Use sample_rate instead. The value is ignored."""
sample_rate: NotRequired[int]
r"""The sample rate of the audio."""
channels: NotRequired[int]
r"""The number of audio channels."""
type: Literal["audio"]
uri: NotRequired[str]


class AudioDelta(BaseModel):
type: Annotated[
Annotated[Literal["audio"], AfterValidator(validate_const("audio"))],
pydantic.Field(alias="type"),
] = "audio"
channels: Optional[int] = None
r"""The number of audio channels."""

data: Optional[str] = None

uri: Optional[str] = None

mime_type: Optional[AudioDeltaMimeType] = None

rate: Annotated[
Expand All @@ -81,13 +77,17 @@ class AudioDelta(BaseModel):
sample_rate: Optional[int] = None
r"""The sample rate of the audio."""

channels: Optional[int] = None
r"""The number of audio channels."""
type: Annotated[
Annotated[Literal["audio"], AfterValidator(validate_const("audio"))],
pydantic.Field(alias="type"),
] = "audio"

uri: Optional[str] = None

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
["data", "uri", "mime_type", "rate", "sample_rate", "channels"]
["channels", "data", "mime_type", "rate", "sample_rate", "uri"]
)
serialized = handler(self)
m = {}
Expand Down
Loading
Loading