Skip to content

Commit 7c44cdd

Browse files
google-genai-botcopybara-github
authored andcommitted
chore: sort 'properties' keys in OpenAPI schemas
PiperOrigin-RevId: 944186323
1 parent d2b19f6 commit 7c44cdd

88 files changed

Lines changed: 945 additions & 945 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

google/genai/_gaos/agents.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ def create(
4040
self,
4141
*,
4242
api_version: Optional[str] = None,
43-
id: Optional[str] = None,
4443
base_agent: Optional[str] = None,
45-
system_instruction: Optional[str] = None,
44+
base_environment: Optional[
45+
Union[agents_agent.BaseEnvironment, agents_agent.BaseEnvironmentParam]
46+
] = None,
4647
description: Optional[str] = None,
48+
id: Optional[str] = None,
49+
system_instruction: Optional[str] = None,
4750
tools: Optional[
4851
Union[
4952
Iterable[agents_agenttool.AgentTool],
5053
Iterable[agents_agenttool.AgentToolParam],
5154
]
5255
] = None,
53-
base_environment: Optional[
54-
Union[agents_agent.BaseEnvironment, agents_agent.BaseEnvironmentParam]
55-
] = None,
5656
extra_headers: Optional[Mapping[str, str]] = None,
5757
extra_query: Optional[Mapping[str, Any]] = None,
5858
extra_body: Optional[Mapping[str, Any]] = None,
@@ -61,12 +61,12 @@ def create(
6161
r"""Creates a new Agent (Typed version for SDK).
6262
6363
:param api_version: Which version of the API to use.
64-
:param id: The unique identifier for the agent.
6564
:param base_agent: The base agent to extend.
66-
:param system_instruction: System instruction for the agent.
65+
:param base_environment: The environment configuration for the agent.
6766
:param description: Agent description for developers to quickly read and understand.
67+
:param id: The unique identifier for the agent.
68+
:param system_instruction: System instruction for the agent.
6869
:param tools: The tools available to the agent.
69-
:param base_environment: The environment configuration for the agent.
7070
:param extra_headers: Additional headers to set or replace on requests.
7171
:param extra_query: Additional query parameters to append to requests.
7272
:param extra_body: Additional JSON object fields to merge into request bodies.
@@ -89,14 +89,14 @@ def create(
8989
request = models.CreateAgentRequest(
9090
api_version=api_version,
9191
body=agents.Agent(
92-
id=id,
9392
base_agent=base_agent,
94-
system_instruction=system_instruction,
95-
description=description,
96-
tools=utils.get_pydantic_model(tools, Optional[List[agents.AgentTool]]),
9793
base_environment=utils.get_pydantic_model(
9894
base_environment, Optional[agents.BaseEnvironment]
9995
),
96+
description=description,
97+
id=id,
98+
system_instruction=system_instruction,
99+
tools=utils.get_pydantic_model(tools, Optional[List[agents.AgentTool]]),
100100
),
101101
)
102102

@@ -815,19 +815,19 @@ async def create(
815815
self,
816816
*,
817817
api_version: Optional[str] = None,
818-
id: Optional[str] = None,
819818
base_agent: Optional[str] = None,
820-
system_instruction: Optional[str] = None,
819+
base_environment: Optional[
820+
Union[agents_agent.BaseEnvironment, agents_agent.BaseEnvironmentParam]
821+
] = None,
821822
description: Optional[str] = None,
823+
id: Optional[str] = None,
824+
system_instruction: Optional[str] = None,
822825
tools: Optional[
823826
Union[
824827
Iterable[agents_agenttool.AgentTool],
825828
Iterable[agents_agenttool.AgentToolParam],
826829
]
827830
] = None,
828-
base_environment: Optional[
829-
Union[agents_agent.BaseEnvironment, agents_agent.BaseEnvironmentParam]
830-
] = None,
831831
extra_headers: Optional[Mapping[str, str]] = None,
832832
extra_query: Optional[Mapping[str, Any]] = None,
833833
extra_body: Optional[Mapping[str, Any]] = None,
@@ -836,12 +836,12 @@ async def create(
836836
r"""Creates a new Agent (Typed version for SDK).
837837
838838
:param api_version: Which version of the API to use.
839-
:param id: The unique identifier for the agent.
840839
:param base_agent: The base agent to extend.
841-
:param system_instruction: System instruction for the agent.
840+
:param base_environment: The environment configuration for the agent.
842841
:param description: Agent description for developers to quickly read and understand.
842+
:param id: The unique identifier for the agent.
843+
:param system_instruction: System instruction for the agent.
843844
:param tools: The tools available to the agent.
844-
:param base_environment: The environment configuration for the agent.
845845
:param extra_headers: Additional headers to set or replace on requests.
846846
:param extra_query: Additional query parameters to append to requests.
847847
:param extra_body: Additional JSON object fields to merge into request bodies.
@@ -864,14 +864,14 @@ async def create(
864864
request = models.CreateAgentRequest(
865865
api_version=api_version,
866866
body=agents.Agent(
867-
id=id,
868867
base_agent=base_agent,
869-
system_instruction=system_instruction,
870-
description=description,
871-
tools=utils.get_pydantic_model(tools, Optional[List[agents.AgentTool]]),
872868
base_environment=utils.get_pydantic_model(
873869
base_environment, Optional[agents.BaseEnvironment]
874870
),
871+
description=description,
872+
id=id,
873+
system_instruction=system_instruction,
874+
tools=utils.get_pydantic_model(tools, Optional[List[agents.AgentTool]]),
875875
),
876876
)
877877

google/genai/_gaos/types/agents/agent.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ class AgentParam(TypedDict):
5050
}
5151
"""
5252

53-
id: NotRequired[str]
54-
r"""The unique identifier for the agent."""
5553
base_agent: NotRequired[str]
5654
r"""The base agent to extend."""
57-
system_instruction: NotRequired[str]
58-
r"""System instruction for the agent."""
55+
base_environment: NotRequired[BaseEnvironmentParam]
56+
r"""The environment configuration for the agent."""
5957
description: NotRequired[str]
6058
r"""Agent description for developers to quickly read and understand."""
59+
id: NotRequired[str]
60+
r"""The unique identifier for the agent."""
61+
system_instruction: NotRequired[str]
62+
r"""System instruction for the agent."""
6163
tools: NotRequired[List[AgentToolParam]]
6264
r"""The tools available to the agent."""
63-
base_environment: NotRequired[BaseEnvironmentParam]
64-
r"""The environment configuration for the agent."""
6565

6666

6767
class Agent(BaseModel):
@@ -77,34 +77,34 @@ class Agent(BaseModel):
7777
}
7878
"""
7979

80-
id: Optional[str] = None
81-
r"""The unique identifier for the agent."""
82-
8380
base_agent: Optional[str] = None
8481
r"""The base agent to extend."""
8582

86-
system_instruction: Optional[str] = None
87-
r"""System instruction for the agent."""
83+
base_environment: Optional[BaseEnvironment] = None
84+
r"""The environment configuration for the agent."""
8885

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

89+
id: Optional[str] = None
90+
r"""The unique identifier for the agent."""
91+
92+
system_instruction: Optional[str] = None
93+
r"""System instruction for the agent."""
94+
9295
tools: Optional[List[AgentTool]] = None
9396
r"""The tools available to the agent."""
9497

95-
base_environment: Optional[BaseEnvironment] = None
96-
r"""The environment configuration for the agent."""
97-
9898
@model_serializer(mode="wrap")
9999
def serialize_model(self, handler):
100100
optional_fields = set(
101101
[
102-
"id",
103102
"base_agent",
104-
"system_instruction",
103+
"base_environment",
105104
"description",
105+
"id",
106+
"system_instruction",
106107
"tools",
107-
"base_environment",
108108
]
109109
)
110110
serialized = handler(self)

google/genai/_gaos/types/interactions/argumentsdelta.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@
2727

2828

2929
class ArgumentsDeltaTypedDict(TypedDict):
30-
type: Literal["arguments_delta"]
3130
arguments: NotRequired[str]
31+
type: Literal["arguments_delta"]
3232

3333

3434
class ArgumentsDelta(BaseModel):
35+
arguments: Optional[str] = None
36+
3537
type: Annotated[
3638
Annotated[
3739
Literal["arguments_delta"],
@@ -40,8 +42,6 @@ class ArgumentsDelta(BaseModel):
4042
pydantic.Field(alias="type"),
4143
] = "arguments_delta"
4244

43-
arguments: Optional[str] = None
44-
4545
@model_serializer(mode="wrap")
4646
def serialize_model(self, handler):
4747
optional_fields = set(["arguments"])

google/genai/_gaos/types/interactions/audiocontent.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,45 +55,45 @@
5555
class AudioContentParam(TypedDict):
5656
r"""An audio content block."""
5757

58-
type: Literal["audio"]
58+
channels: NotRequired[int]
59+
r"""The number of audio channels."""
5960
data: NotRequired[Union[str, Base64FileInput]]
6061
r"""The audio content."""
61-
uri: NotRequired[str]
62-
r"""The URI of the audio."""
6362
mime_type: NotRequired[AudioContentMimeType]
6463
r"""The mime type of the audio."""
65-
channels: NotRequired[int]
66-
r"""The number of audio channels."""
6764
sample_rate: NotRequired[int]
6865
r"""The sample rate of the audio."""
66+
type: Literal["audio"]
67+
uri: NotRequired[str]
68+
r"""The URI of the audio."""
6969

7070

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

74-
type: Annotated[
75-
Annotated[Literal["audio"], AfterValidator(validate_const("audio"))],
76-
pydantic.Field(alias="type"),
77-
] = "audio"
74+
channels: Optional[int] = None
75+
r"""The number of audio channels."""
7876

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

82-
uri: Optional[str] = None
83-
r"""The URI of the audio."""
84-
8580
mime_type: Optional[AudioContentMimeType] = None
8681
r"""The mime type of the audio."""
8782

88-
channels: Optional[int] = None
89-
r"""The number of audio channels."""
90-
9183
sample_rate: Optional[int] = None
9284
r"""The sample rate of the audio."""
9385

86+
type: Annotated[
87+
Annotated[Literal["audio"], AfterValidator(validate_const("audio"))],
88+
pydantic.Field(alias="type"),
89+
] = "audio"
90+
91+
uri: Optional[str] = None
92+
r"""The URI of the audio."""
93+
9494
@model_serializer(mode="wrap")
9595
def serialize_model(self, handler):
96-
optional_fields = set(["data", "uri", "mime_type", "channels", "sample_rate"])
96+
optional_fields = set(["channels", "data", "mime_type", "sample_rate", "uri"])
9797
serialized = handler(self)
9898
m = {}
9999

google/genai/_gaos/types/interactions/audiodelta.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,24 @@
4646

4747

4848
class AudioDeltaTypedDict(TypedDict):
49-
type: Literal["audio"]
49+
channels: NotRequired[int]
50+
r"""The number of audio channels."""
5051
data: NotRequired[str]
51-
uri: NotRequired[str]
5252
mime_type: NotRequired[AudioDeltaMimeType]
5353
rate: NotRequired[int]
5454
r"""Deprecated. Use sample_rate instead. The value is ignored."""
5555
sample_rate: NotRequired[int]
5656
r"""The sample rate of the audio."""
57-
channels: NotRequired[int]
58-
r"""The number of audio channels."""
57+
type: Literal["audio"]
58+
uri: NotRequired[str]
5959

6060

6161
class AudioDelta(BaseModel):
62-
type: Annotated[
63-
Annotated[Literal["audio"], AfterValidator(validate_const("audio"))],
64-
pydantic.Field(alias="type"),
65-
] = "audio"
62+
channels: Optional[int] = None
63+
r"""The number of audio channels."""
6664

6765
data: Optional[str] = None
6866

69-
uri: Optional[str] = None
70-
7167
mime_type: Optional[AudioDeltaMimeType] = None
7268

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

84-
channels: Optional[int] = None
85-
r"""The number of audio channels."""
80+
type: Annotated[
81+
Annotated[Literal["audio"], AfterValidator(validate_const("audio"))],
82+
pydantic.Field(alias="type"),
83+
] = "audio"
84+
85+
uri: Optional[str] = None
8686

8787
@model_serializer(mode="wrap")
8888
def serialize_model(self, handler):
8989
optional_fields = set(
90-
["data", "uri", "mime_type", "rate", "sample_rate", "channels"]
90+
["channels", "data", "mime_type", "rate", "sample_rate", "uri"]
9191
)
9292
serialized = handler(self)
9393
m = {}

0 commit comments

Comments
 (0)