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
10 changes: 10 additions & 0 deletions google/genai/_gaos/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ def create_environment(
self,
*,
api_version: Optional[str] = None,
from_environment: Optional[str] = None,
network: Optional[
Union[
environments_createenvironmentrequest.CreateEnvironmentRequestNetworkUnion,
Expand All @@ -253,6 +254,9 @@ def create_environment(
r"""Creates an environment.

:param api_version: Which version of the API to use.
:param from_environment: Optional. The source environment to copy/fork from.
Format: `environments/{environment_id}` or `{environment_id}`.
When specified, `sources` and `env` must be empty.
:param network: Network configuration for the environment.
:param sources: Sources to be mounted into the environment.
:param extra_headers: Additional headers to set or replace on requests.
Expand All @@ -277,6 +281,7 @@ def create_environment(
request = models.CreateEnvironmentRequest(
api_version=api_version,
body=environments.CreateEnvironmentRequest(
from_environment=from_environment,
network=utils.get_pydantic_model(
network, Optional[environments.CreateEnvironmentRequestNetworkUnion]
),
Expand Down Expand Up @@ -1024,6 +1029,7 @@ async def create_environment(
self,
*,
api_version: Optional[str] = None,
from_environment: Optional[str] = None,
network: Optional[
Union[
environments_createenvironmentrequest.CreateEnvironmentRequestNetworkUnion,
Expand All @@ -1044,6 +1050,9 @@ async def create_environment(
r"""Creates an environment.

:param api_version: Which version of the API to use.
:param from_environment: Optional. The source environment to copy/fork from.
Format: `environments/{environment_id}` or `{environment_id}`.
When specified, `sources` and `env` must be empty.
:param network: Network configuration for the environment.
:param sources: Sources to be mounted into the environment.
:param extra_headers: Additional headers to set or replace on requests.
Expand All @@ -1068,6 +1077,7 @@ async def create_environment(
request = models.CreateEnvironmentRequest(
api_version=api_version,
body=environments.CreateEnvironmentRequest(
from_environment=from_environment,
network=utils.get_pydantic_model(
network, Optional[environments.CreateEnvironmentRequestNetworkUnion]
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
#
# pyformat: disable
# pylint: disable=bad-indentation

"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

Expand Down Expand Up @@ -53,6 +54,11 @@
class CreateEnvironmentRequestParam(TypedDict):
r"""Request for `CreateEnvironment`."""

from_environment: NotRequired[str]
r"""Optional. The source environment to copy/fork from.
Format: `environments/{environment_id}` or `{environment_id}`.
When specified, `sources` and `env` must be empty.
"""
network: NotRequired[CreateEnvironmentRequestNetworkUnionParam]
r"""Network configuration for the environment."""
sources: NotRequired[List[interactions_source.SourceParam]]
Expand All @@ -62,6 +68,12 @@ class CreateEnvironmentRequestParam(TypedDict):
class CreateEnvironmentRequest(BaseModel):
r"""Request for `CreateEnvironment`."""

from_environment: Optional[str] = None
r"""Optional. The source environment to copy/fork from.
Format: `environments/{environment_id}` or `{environment_id}`.
When specified, `sources` and `env` must be empty.
"""

network: Optional[CreateEnvironmentRequestNetworkUnion] = None
r"""Network configuration for the environment."""

Expand All @@ -70,7 +82,7 @@ class CreateEnvironmentRequest(BaseModel):

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["network", "sources"])
optional_fields = set(["from_environment", "network", "sources"])
serialized = handler(self)
m = {}

Expand Down
Loading