Skip to content

Commit 6719faf

Browse files
MarkDaoustcopybara-github
authored andcommitted
Fix: Rename LiveEphemeralParameters to LiveConnectConstraints.
PiperOrigin-RevId: 765364230
1 parent 303f906 commit 6719faf

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

google/genai/_tokens_converters.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ def _LiveConnectConfig_to_vertex(
15991599
return to_object
16001600

16011601

1602-
def _LiveEphemeralParameters_to_mldev(
1602+
def _LiveConnectConstraints_to_mldev(
16031603
api_client: BaseApiClient,
16041604
from_object: Union[dict[str, Any], object],
16051605
parent_object: Optional[dict[str, Any]] = None,
@@ -1624,7 +1624,7 @@ def _LiveEphemeralParameters_to_mldev(
16241624
return to_object
16251625

16261626

1627-
def _LiveEphemeralParameters_to_vertex(
1627+
def _LiveConnectConstraints_to_vertex(
16281628
api_client: BaseApiClient,
16291629
from_object: Union[dict[str, Any], object],
16301630
parent_object: Optional[dict[str, Any]] = None,
@@ -1659,13 +1659,13 @@ def _CreateAuthTokenConfig_to_mldev(
16591659
if getv(from_object, ['uses']) is not None:
16601660
setv(parent_object, ['uses'], getv(from_object, ['uses']))
16611661

1662-
if getv(from_object, ['live_ephemeral_parameters']) is not None:
1662+
if getv(from_object, ['live_connect_constraints']) is not None:
16631663
setv(
16641664
parent_object,
16651665
['bidiGenerateContentSetup'],
1666-
_LiveEphemeralParameters_to_mldev(
1666+
_LiveConnectConstraints_to_mldev(
16671667
api_client,
1668-
getv(from_object, ['live_ephemeral_parameters']),
1668+
getv(from_object, ['live_connect_constraints']),
16691669
to_object,
16701670
),
16711671
)
@@ -1698,9 +1698,9 @@ def _CreateAuthTokenConfig_to_vertex(
16981698
if getv(from_object, ['uses']) is not None:
16991699
raise ValueError('uses parameter is not supported in Vertex AI.')
17001700

1701-
if getv(from_object, ['live_ephemeral_parameters']) is not None:
1701+
if getv(from_object, ['live_connect_constraints']) is not None:
17021702
raise ValueError(
1703-
'live_ephemeral_parameters parameter is not supported in Vertex AI.'
1703+
'live_connect_constraints parameter is not supported in Vertex AI.'
17041704
)
17051705

17061706
if getv(from_object, ['lock_additional_fields']) is not None:

google/genai/tests/tokens/test_create.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
config={
4343
'http_options': {'api_version': 'v1alpha'},
4444
'uses': 2,
45-
'live_ephemeral_parameters': {
45+
'live_connect_constraints': {
4646
'model': _MODEL,
4747
'config': {
4848
'response_modalities': ['TEXT'],
@@ -60,7 +60,7 @@
6060
config={
6161
'http_options': {'api_version': 'v1alpha'},
6262
'uses': 2,
63-
'live_ephemeral_parameters': {
63+
'live_connect_constraints': {
6464
'model': _MODEL,
6565
'config': {
6666
'response_modalities': ['TEXT'],
@@ -79,7 +79,7 @@
7979
config={
8080
'http_options': {'api_version': 'v1alpha'},
8181
'uses': 2,
82-
'live_ephemeral_parameters': {
82+
'live_connect_constraints': {
8383
'model': _MODEL,
8484
'config': {
8585
'response_modalities': ['TEXT'],
@@ -98,7 +98,7 @@
9898
config={
9999
'http_options': {'api_version': 'v1alpha'},
100100
'uses': 2,
101-
'live_ephemeral_parameters': {
101+
'live_connect_constraints': {
102102
'model': _MODEL,
103103
'config': {
104104
'response_modalities': ['TEXT'],
@@ -128,7 +128,7 @@
128128
config={
129129
'http_options': {'api_version': 'v1alpha'},
130130
'lock_additional_fields': ['output_audio_transcription'],
131-
'live_ephemeral_parameters': {},
131+
'live_connect_constraints': {},
132132
},
133133
),
134134
exception_if_vertex='only supported in the Gemini Developer client',

google/genai/types.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12501,8 +12501,8 @@ class AuthTokenDict(TypedDict, total=False):
1250112501
AuthTokenOrDict = Union[AuthToken, AuthTokenDict]
1250212502

1250312503

12504-
class LiveEphemeralParameters(_common.BaseModel):
12505-
"""Config for LiveEphemeralParameters for Auth Token creation."""
12504+
class LiveConnectConstraints(_common.BaseModel):
12505+
"""Config for LiveConnectConstraints for Auth Token creation."""
1250612506

1250712507
model: Optional[str] = Field(
1250812508
default=None,
@@ -12516,8 +12516,8 @@ class LiveEphemeralParameters(_common.BaseModel):
1251612516
)
1251712517

1251812518

12519-
class LiveEphemeralParametersDict(TypedDict, total=False):
12520-
"""Config for LiveEphemeralParameters for Auth Token creation."""
12519+
class LiveConnectConstraintsDict(TypedDict, total=False):
12520+
"""Config for LiveConnectConstraints for Auth Token creation."""
1252112521

1252212522
model: Optional[str]
1252312523
"""ID of the model to configure in the ephemeral token for Live API.
@@ -12528,8 +12528,8 @@ class LiveEphemeralParametersDict(TypedDict, total=False):
1252812528
"""Configuration specific to Live API connections created using this token."""
1252912529

1253012530

12531-
LiveEphemeralParametersOrDict = Union[
12532-
LiveEphemeralParameters, LiveEphemeralParametersDict
12531+
LiveConnectConstraintsOrDict = Union[
12532+
LiveConnectConstraints, LiveConnectConstraintsDict
1253312533
]
1253412534

1253512535

@@ -12562,7 +12562,7 @@ class CreateAuthTokenConfig(_common.BaseModel):
1256212562
then no limit is applied. Default is 1. Resuming a Live API session does
1256312563
not count as a use.""",
1256412564
)
12565-
live_ephemeral_parameters: Optional[LiveEphemeralParameters] = Field(
12565+
live_connect_constraints: Optional[LiveConnectConstraints] = Field(
1256612566
default=None,
1256712567
description="""Configuration specific to Live API connections created using this token.""",
1256812568
)
@@ -12598,7 +12598,7 @@ class CreateAuthTokenConfigDict(TypedDict, total=False):
1259812598
then no limit is applied. Default is 1. Resuming a Live API session does
1259912599
not count as a use."""
1260012600

12601-
live_ephemeral_parameters: Optional[LiveEphemeralParametersDict]
12601+
live_connect_constraints: Optional[LiveConnectConstraintsDict]
1260212602
"""Configuration specific to Live API connections created using this token."""
1260312603

1260412604
lock_additional_fields: Optional[list[str]]

0 commit comments

Comments
 (0)