@@ -1754,6 +1754,7 @@ class GenerationConfig:
1754
1754
"""Parameters for the generation."""
1755
1755
1756
1756
Modality = gapic_content_types .GenerationConfig .Modality
1757
+ ModelConfig = gapic_content_types .GenerationConfig .ModelConfig
1757
1758
1758
1759
def __init__ (
1759
1760
self ,
@@ -1774,6 +1775,7 @@ def __init__(
1774
1775
logprobs : Optional [int ] = None ,
1775
1776
response_logprobs : Optional [bool ] = None ,
1776
1777
response_modalities : Optional [List ["GenerationConfig.Modality" ]] = None ,
1778
+ model_config : Optional ["GenerationConfig.ModelConfig" ] = None ,
1777
1779
):
1778
1780
r"""Constructs a GenerationConfig object.
1779
1781
@@ -1801,9 +1803,11 @@ def __init__(
1801
1803
response type, otherwise the behavior is undefined.
1802
1804
response_schema: Output response schema of the genreated candidate text.
1803
1805
audio_timestamp: If true, the timestamp of the audio will be included in the response.
1804
- routing_config: Model routing preference set in the request.
1806
+ routing_config: Model routing preference set in the request. This field is deprecated,
1807
+ please use model_config field instead for model optimizer requests.
1805
1808
logprobs: Logit probabilities.
1806
1809
reponse_logprobs: If true, export the logprobs results in response.
1810
+ model_config: Sets cost vs quality preference for model routing requests.
1807
1811
1808
1812
Usage:
1809
1813
@@ -1845,6 +1849,7 @@ def __init__(
1845
1849
logprobs = logprobs ,
1846
1850
response_logprobs = response_logprobs ,
1847
1851
response_modalities = response_modalities ,
1852
+ model_config = model_config ,
1848
1853
)
1849
1854
if routing_config is not None :
1850
1855
self ._raw_generation_config .routing_config = (
@@ -1879,6 +1884,7 @@ def __repr__(self) -> str:
1879
1884
1880
1885
class RoutingConfig :
1881
1886
r"""The configuration for model router requests.
1887
+ Deprecated, please use ModelConfig to set routing preference instead.
1882
1888
1883
1889
The routing config is either one of the two nested classes:
1884
1890
- AutoRoutingMode: Automated routing.
@@ -1913,6 +1919,11 @@ def __init__(
1913
1919
"GenerationConfig.RoutingConfig.ManualRoutingMode" ,
1914
1920
],
1915
1921
):
1922
+ _LOGGER = base .Logger (__name__ )
1923
+ _LOGGER .warning (
1924
+ "RoutingConfig is deprecated, please use ModelConfig to set routing preference instead."
1925
+ )
1926
+
1916
1927
if isinstance (routing_config , self .AutoRoutingMode ):
1917
1928
self ._gapic_routing_config = (
1918
1929
gapic_content_types .GenerationConfig .RoutingConfig (
0 commit comments