databricks-sdk 0.19.0__py3-none-any.whl → 0.20.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of databricks-sdk might be problematic. Click here for more details.

@@ -1581,6 +1581,7 @@ class CredentialsAPI:
1581
1581
  if aws_credentials is not None: body['aws_credentials'] = aws_credentials.as_dict()
1582
1582
  if credentials_name is not None: body['credentials_name'] = credentials_name
1583
1583
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1584
+
1584
1585
  res = self._api.do('POST',
1585
1586
  f'/api/2.0/accounts/{self._api.account_id}/credentials',
1586
1587
  body=body,
@@ -1600,6 +1601,7 @@ class CredentialsAPI:
1600
1601
  """
1601
1602
 
1602
1603
  headers = {'Accept': 'application/json', }
1604
+
1603
1605
  self._api.do('DELETE',
1604
1606
  f'/api/2.0/accounts/{self._api.account_id}/credentials/{credentials_id}',
1605
1607
  headers=headers)
@@ -1616,6 +1618,7 @@ class CredentialsAPI:
1616
1618
  """
1617
1619
 
1618
1620
  headers = {'Accept': 'application/json', }
1621
+
1619
1622
  res = self._api.do('GET',
1620
1623
  f'/api/2.0/accounts/{self._api.account_id}/credentials/{credentials_id}',
1621
1624
  headers=headers)
@@ -1630,6 +1633,7 @@ class CredentialsAPI:
1630
1633
  """
1631
1634
 
1632
1635
  headers = {'Accept': 'application/json', }
1636
+
1633
1637
  res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/credentials', headers=headers)
1634
1638
  return [Credential.from_dict(v) for v in res]
1635
1639
 
@@ -1685,6 +1689,7 @@ class EncryptionKeysAPI:
1685
1689
  if gcp_key_info is not None: body['gcp_key_info'] = gcp_key_info.as_dict()
1686
1690
  if use_cases is not None: body['use_cases'] = [v.value for v in use_cases]
1687
1691
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1692
+
1688
1693
  res = self._api.do('POST',
1689
1694
  f'/api/2.0/accounts/{self._api.account_id}/customer-managed-keys',
1690
1695
  body=body,
@@ -1704,6 +1709,7 @@ class EncryptionKeysAPI:
1704
1709
  """
1705
1710
 
1706
1711
  headers = {'Accept': 'application/json', }
1712
+
1707
1713
  self._api.do(
1708
1714
  'DELETE',
1709
1715
  f'/api/2.0/accounts/{self._api.account_id}/customer-managed-keys/{customer_managed_key_id}',
@@ -1732,6 +1738,7 @@ class EncryptionKeysAPI:
1732
1738
  """
1733
1739
 
1734
1740
  headers = {'Accept': 'application/json', }
1741
+
1735
1742
  res = self._api.do(
1736
1743
  'GET',
1737
1744
  f'/api/2.0/accounts/{self._api.account_id}/customer-managed-keys/{customer_managed_key_id}',
@@ -1756,6 +1763,7 @@ class EncryptionKeysAPI:
1756
1763
  """
1757
1764
 
1758
1765
  headers = {'Accept': 'application/json', }
1766
+
1759
1767
  res = self._api.do('GET',
1760
1768
  f'/api/2.0/accounts/{self._api.account_id}/customer-managed-keys',
1761
1769
  headers=headers)
@@ -1812,6 +1820,7 @@ class NetworksAPI:
1812
1820
  if vpc_endpoints is not None: body['vpc_endpoints'] = vpc_endpoints.as_dict()
1813
1821
  if vpc_id is not None: body['vpc_id'] = vpc_id
1814
1822
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1823
+
1815
1824
  res = self._api.do('POST',
1816
1825
  f'/api/2.0/accounts/{self._api.account_id}/networks',
1817
1826
  body=body,
@@ -1833,6 +1842,7 @@ class NetworksAPI:
1833
1842
  """
1834
1843
 
1835
1844
  headers = {'Accept': 'application/json', }
1845
+
1836
1846
  self._api.do('DELETE',
1837
1847
  f'/api/2.0/accounts/{self._api.account_id}/networks/{network_id}',
1838
1848
  headers=headers)
@@ -1849,6 +1859,7 @@ class NetworksAPI:
1849
1859
  """
1850
1860
 
1851
1861
  headers = {'Accept': 'application/json', }
1862
+
1852
1863
  res = self._api.do('GET',
1853
1864
  f'/api/2.0/accounts/{self._api.account_id}/networks/{network_id}',
1854
1865
  headers=headers)
@@ -1865,6 +1876,7 @@ class NetworksAPI:
1865
1876
  """
1866
1877
 
1867
1878
  headers = {'Accept': 'application/json', }
1879
+
1868
1880
  res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/networks', headers=headers)
1869
1881
  return [Network.from_dict(v) for v in res]
1870
1882
 
@@ -1936,6 +1948,7 @@ class PrivateAccessAPI:
1936
1948
  if public_access_enabled is not None: body['public_access_enabled'] = public_access_enabled
1937
1949
  if region is not None: body['region'] = region
1938
1950
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1951
+
1939
1952
  res = self._api.do('POST',
1940
1953
  f'/api/2.0/accounts/{self._api.account_id}/private-access-settings',
1941
1954
  body=body,
@@ -1960,6 +1973,7 @@ class PrivateAccessAPI:
1960
1973
  """
1961
1974
 
1962
1975
  headers = {'Accept': 'application/json', }
1976
+
1963
1977
  self._api.do(
1964
1978
  'DELETE',
1965
1979
  f'/api/2.0/accounts/{self._api.account_id}/private-access-settings/{private_access_settings_id}',
@@ -1983,6 +1997,7 @@ class PrivateAccessAPI:
1983
1997
  """
1984
1998
 
1985
1999
  headers = {'Accept': 'application/json', }
2000
+
1986
2001
  res = self._api.do(
1987
2002
  'GET',
1988
2003
  f'/api/2.0/accounts/{self._api.account_id}/private-access-settings/{private_access_settings_id}',
@@ -1998,6 +2013,7 @@ class PrivateAccessAPI:
1998
2013
  """
1999
2014
 
2000
2015
  headers = {'Accept': 'application/json', }
2016
+
2001
2017
  res = self._api.do('GET',
2002
2018
  f'/api/2.0/accounts/{self._api.account_id}/private-access-settings',
2003
2019
  headers=headers)
@@ -2072,6 +2088,7 @@ class PrivateAccessAPI:
2072
2088
  if public_access_enabled is not None: body['public_access_enabled'] = public_access_enabled
2073
2089
  if region is not None: body['region'] = region
2074
2090
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2091
+
2075
2092
  self._api.do(
2076
2093
  'PUT',
2077
2094
  f'/api/2.0/accounts/{self._api.account_id}/private-access-settings/{private_access_settings_id}',
@@ -2114,6 +2131,7 @@ class StorageAPI:
2114
2131
  if storage_configuration_name is not None:
2115
2132
  body['storage_configuration_name'] = storage_configuration_name
2116
2133
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2134
+
2117
2135
  res = self._api.do('POST',
2118
2136
  f'/api/2.0/accounts/{self._api.account_id}/storage-configurations',
2119
2137
  body=body,
@@ -2133,6 +2151,7 @@ class StorageAPI:
2133
2151
  """
2134
2152
 
2135
2153
  headers = {'Accept': 'application/json', }
2154
+
2136
2155
  self._api.do(
2137
2156
  'DELETE',
2138
2157
  f'/api/2.0/accounts/{self._api.account_id}/storage-configurations/{storage_configuration_id}',
@@ -2150,6 +2169,7 @@ class StorageAPI:
2150
2169
  """
2151
2170
 
2152
2171
  headers = {'Accept': 'application/json', }
2172
+
2153
2173
  res = self._api.do(
2154
2174
  'GET',
2155
2175
  f'/api/2.0/accounts/{self._api.account_id}/storage-configurations/{storage_configuration_id}',
@@ -2165,6 +2185,7 @@ class StorageAPI:
2165
2185
  """
2166
2186
 
2167
2187
  headers = {'Accept': 'application/json', }
2188
+
2168
2189
  res = self._api.do('GET',
2169
2190
  f'/api/2.0/accounts/{self._api.account_id}/storage-configurations',
2170
2191
  headers=headers)
@@ -2215,6 +2236,7 @@ class VpcEndpointsAPI:
2215
2236
  if region is not None: body['region'] = region
2216
2237
  if vpc_endpoint_name is not None: body['vpc_endpoint_name'] = vpc_endpoint_name
2217
2238
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2239
+
2218
2240
  res = self._api.do('POST',
2219
2241
  f'/api/2.0/accounts/{self._api.account_id}/vpc-endpoints',
2220
2242
  body=body,
@@ -2240,6 +2262,7 @@ class VpcEndpointsAPI:
2240
2262
  """
2241
2263
 
2242
2264
  headers = {'Accept': 'application/json', }
2265
+
2243
2266
  self._api.do('DELETE',
2244
2267
  f'/api/2.0/accounts/{self._api.account_id}/vpc-endpoints/{vpc_endpoint_id}',
2245
2268
  headers=headers)
@@ -2260,6 +2283,7 @@ class VpcEndpointsAPI:
2260
2283
  """
2261
2284
 
2262
2285
  headers = {'Accept': 'application/json', }
2286
+
2263
2287
  res = self._api.do('GET',
2264
2288
  f'/api/2.0/accounts/{self._api.account_id}/vpc-endpoints/{vpc_endpoint_id}',
2265
2289
  headers=headers)
@@ -2278,6 +2302,7 @@ class VpcEndpointsAPI:
2278
2302
  """
2279
2303
 
2280
2304
  headers = {'Accept': 'application/json', }
2305
+
2281
2306
  res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/vpc-endpoints', headers=headers)
2282
2307
  return [VpcEndpoint.from_dict(v) for v in res]
2283
2308
 
@@ -2466,6 +2491,7 @@ class WorkspacesAPI:
2466
2491
  body['storage_customer_managed_key_id'] = storage_customer_managed_key_id
2467
2492
  if workspace_name is not None: body['workspace_name'] = workspace_name
2468
2493
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2494
+
2469
2495
  op_response = self._api.do('POST',
2470
2496
  f'/api/2.0/accounts/{self._api.account_id}/workspaces',
2471
2497
  body=body,
@@ -2528,6 +2554,7 @@ class WorkspacesAPI:
2528
2554
  """
2529
2555
 
2530
2556
  headers = {'Accept': 'application/json', }
2557
+
2531
2558
  self._api.do('DELETE',
2532
2559
  f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}',
2533
2560
  headers=headers)
@@ -2555,6 +2582,7 @@ class WorkspacesAPI:
2555
2582
  """
2556
2583
 
2557
2584
  headers = {'Accept': 'application/json', }
2585
+
2558
2586
  res = self._api.do('GET',
2559
2587
  f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}',
2560
2588
  headers=headers)
@@ -2572,6 +2600,7 @@ class WorkspacesAPI:
2572
2600
  """
2573
2601
 
2574
2602
  headers = {'Accept': 'application/json', }
2603
+
2575
2604
  res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/workspaces', headers=headers)
2576
2605
  return [Workspace.from_dict(v) for v in res]
2577
2606
 
@@ -2726,6 +2755,7 @@ class WorkspacesAPI:
2726
2755
  if storage_customer_managed_key_id is not None:
2727
2756
  body['storage_customer_managed_key_id'] = storage_customer_managed_key_id
2728
2757
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2758
+
2729
2759
  self._api.do('PATCH',
2730
2760
  f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}',
2731
2761
  body=body,
@@ -764,52 +764,29 @@ class ExternalModel:
764
764
  task: str
765
765
  """The task type of the external model."""
766
766
 
767
- config: ExternalModelConfig
768
- """The config for the external model, which must match the provider."""
769
-
770
- def as_dict(self) -> dict:
771
- """Serializes the ExternalModel into a dictionary suitable for use as a JSON request body."""
772
- body = {}
773
- if self.config: body['config'] = self.config.as_dict()
774
- if self.name is not None: body['name'] = self.name
775
- if self.provider is not None: body['provider'] = self.provider.value
776
- if self.task is not None: body['task'] = self.task
777
- return body
778
-
779
- @classmethod
780
- def from_dict(cls, d: Dict[str, any]) -> ExternalModel:
781
- """Deserializes the ExternalModel from a dictionary."""
782
- return cls(config=_from_dict(d, 'config', ExternalModelConfig),
783
- name=d.get('name', None),
784
- provider=_enum(d, 'provider', ExternalModelProvider),
785
- task=d.get('task', None))
786
-
787
-
788
- @dataclass
789
- class ExternalModelConfig:
790
767
  ai21labs_config: Optional[Ai21LabsConfig] = None
791
- """AI21Labs Config"""
768
+ """AI21Labs Config. Only required if the provider is 'ai21labs'."""
792
769
 
793
770
  anthropic_config: Optional[AnthropicConfig] = None
794
- """Anthropic Config"""
771
+ """Anthropic Config. Only required if the provider is 'anthropic'."""
795
772
 
796
773
  aws_bedrock_config: Optional[AwsBedrockConfig] = None
797
- """AWS Bedrock Config"""
774
+ """AWS Bedrock Config. Only required if the provider is 'aws-bedrock'."""
798
775
 
799
776
  cohere_config: Optional[CohereConfig] = None
800
- """Cohere Config"""
777
+ """Cohere Config. Only required if the provider is 'cohere'."""
801
778
 
802
779
  databricks_model_serving_config: Optional[DatabricksModelServingConfig] = None
803
- """Databricks Model Serving Config"""
780
+ """Databricks Model Serving Config. Only required if the provider is 'databricks-model-serving'."""
804
781
 
805
782
  openai_config: Optional[OpenAiConfig] = None
806
- """OpenAI Config"""
783
+ """OpenAI Config. Only required if the provider is 'openai'."""
807
784
 
808
785
  palm_config: Optional[PaLmConfig] = None
809
- """PaLM Config"""
786
+ """PaLM Config. Only required if the provider is 'palm'."""
810
787
 
811
788
  def as_dict(self) -> dict:
812
- """Serializes the ExternalModelConfig into a dictionary suitable for use as a JSON request body."""
789
+ """Serializes the ExternalModel into a dictionary suitable for use as a JSON request body."""
813
790
  body = {}
814
791
  if self.ai21labs_config: body['ai21labs_config'] = self.ai21labs_config.as_dict()
815
792
  if self.anthropic_config: body['anthropic_config'] = self.anthropic_config.as_dict()
@@ -817,21 +794,27 @@ class ExternalModelConfig:
817
794
  if self.cohere_config: body['cohere_config'] = self.cohere_config.as_dict()
818
795
  if self.databricks_model_serving_config:
819
796
  body['databricks_model_serving_config'] = self.databricks_model_serving_config.as_dict()
797
+ if self.name is not None: body['name'] = self.name
820
798
  if self.openai_config: body['openai_config'] = self.openai_config.as_dict()
821
799
  if self.palm_config: body['palm_config'] = self.palm_config.as_dict()
800
+ if self.provider is not None: body['provider'] = self.provider.value
801
+ if self.task is not None: body['task'] = self.task
822
802
  return body
823
803
 
824
804
  @classmethod
825
- def from_dict(cls, d: Dict[str, any]) -> ExternalModelConfig:
826
- """Deserializes the ExternalModelConfig from a dictionary."""
805
+ def from_dict(cls, d: Dict[str, any]) -> ExternalModel:
806
+ """Deserializes the ExternalModel from a dictionary."""
827
807
  return cls(ai21labs_config=_from_dict(d, 'ai21labs_config', Ai21LabsConfig),
828
808
  anthropic_config=_from_dict(d, 'anthropic_config', AnthropicConfig),
829
809
  aws_bedrock_config=_from_dict(d, 'aws_bedrock_config', AwsBedrockConfig),
830
810
  cohere_config=_from_dict(d, 'cohere_config', CohereConfig),
831
811
  databricks_model_serving_config=_from_dict(d, 'databricks_model_serving_config',
832
812
  DatabricksModelServingConfig),
813
+ name=d.get('name', None),
833
814
  openai_config=_from_dict(d, 'openai_config', OpenAiConfig),
834
- palm_config=_from_dict(d, 'palm_config', PaLmConfig))
815
+ palm_config=_from_dict(d, 'palm_config', PaLmConfig),
816
+ provider=_enum(d, 'provider', ExternalModelProvider),
817
+ task=d.get('task', None))
835
818
 
836
819
 
837
820
  class ExternalModelProvider(Enum):
@@ -1272,6 +1255,10 @@ class QueryEndpointResponse:
1272
1255
  predictions: Optional[List[Any]] = None
1273
1256
  """The predictions returned by the serving endpoint."""
1274
1257
 
1258
+ served_model_name: Optional[str] = None
1259
+ """The name of the served model that served the request. This is useful when there are multiple
1260
+ models behind the same endpoint with traffic split."""
1261
+
1275
1262
  usage: Optional[ExternalModelUsageElement] = None
1276
1263
  """The usage object that may be returned by the __external/foundation model__ serving endpoint.
1277
1264
  This contains information about the number of tokens used in the prompt and response."""
@@ -1286,6 +1273,7 @@ class QueryEndpointResponse:
1286
1273
  if self.model is not None: body['model'] = self.model
1287
1274
  if self.object is not None: body['object'] = self.object.value
1288
1275
  if self.predictions: body['predictions'] = [v for v in self.predictions]
1276
+ if self.served_model_name is not None: body['served-model-name'] = self.served_model_name
1289
1277
  if self.usage: body['usage'] = self.usage.as_dict()
1290
1278
  return body
1291
1279
 
@@ -1299,6 +1287,7 @@ class QueryEndpointResponse:
1299
1287
  model=d.get('model', None),
1300
1288
  object=_enum(d, 'object', QueryEndpointResponseObject),
1301
1289
  predictions=d.get('predictions', None),
1290
+ served_model_name=d.get('served-model-name', None),
1302
1291
  usage=_from_dict(d, 'usage', ExternalModelUsageElement))
1303
1292
 
1304
1293
 
@@ -1406,6 +1395,12 @@ class ServedEntityInput:
1406
1395
  instance_profile_arn: Optional[str] = None
1407
1396
  """ARN of the instance profile that the served entity uses to access AWS resources."""
1408
1397
 
1398
+ max_provisioned_throughput: Optional[int] = None
1399
+ """The maximum tokens per second that the endpoint can scale up to."""
1400
+
1401
+ min_provisioned_throughput: Optional[int] = None
1402
+ """The minimum tokens per second that the endpoint can scale down to."""
1403
+
1409
1404
  name: Optional[str] = None
1410
1405
  """The name of a served entity. It must be unique across an endpoint. A served entity name can
1411
1406
  consist of alphanumeric characters, dashes, and underscores. If not specified for an external
@@ -1439,6 +1434,10 @@ class ServedEntityInput:
1439
1434
  if self.environment_vars: body['environment_vars'] = self.environment_vars
1440
1435
  if self.external_model: body['external_model'] = self.external_model.as_dict()
1441
1436
  if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn
1437
+ if self.max_provisioned_throughput is not None:
1438
+ body['max_provisioned_throughput'] = self.max_provisioned_throughput
1439
+ if self.min_provisioned_throughput is not None:
1440
+ body['min_provisioned_throughput'] = self.min_provisioned_throughput
1442
1441
  if self.name is not None: body['name'] = self.name
1443
1442
  if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled
1444
1443
  if self.workload_size is not None: body['workload_size'] = self.workload_size
@@ -1453,6 +1452,8 @@ class ServedEntityInput:
1453
1452
  environment_vars=d.get('environment_vars', None),
1454
1453
  external_model=_from_dict(d, 'external_model', ExternalModel),
1455
1454
  instance_profile_arn=d.get('instance_profile_arn', None),
1455
+ max_provisioned_throughput=d.get('max_provisioned_throughput', None),
1456
+ min_provisioned_throughput=d.get('min_provisioned_throughput', None),
1456
1457
  name=d.get('name', None),
1457
1458
  scale_to_zero_enabled=d.get('scale_to_zero_enabled', None),
1458
1459
  workload_size=d.get('workload_size', None),
@@ -1496,6 +1497,12 @@ class ServedEntityOutput:
1496
1497
  instance_profile_arn: Optional[str] = None
1497
1498
  """ARN of the instance profile that the served entity uses to access AWS resources."""
1498
1499
 
1500
+ max_provisioned_throughput: Optional[int] = None
1501
+ """The maximum tokens per second that the endpoint can scale up to."""
1502
+
1503
+ min_provisioned_throughput: Optional[int] = None
1504
+ """The minimum tokens per second that the endpoint can scale down to."""
1505
+
1499
1506
  name: Optional[str] = None
1500
1507
  """The name of the served entity."""
1501
1508
 
@@ -1532,6 +1539,10 @@ class ServedEntityOutput:
1532
1539
  if self.external_model: body['external_model'] = self.external_model.as_dict()
1533
1540
  if self.foundation_model: body['foundation_model'] = self.foundation_model.as_dict()
1534
1541
  if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn
1542
+ if self.max_provisioned_throughput is not None:
1543
+ body['max_provisioned_throughput'] = self.max_provisioned_throughput
1544
+ if self.min_provisioned_throughput is not None:
1545
+ body['min_provisioned_throughput'] = self.min_provisioned_throughput
1535
1546
  if self.name is not None: body['name'] = self.name
1536
1547
  if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled
1537
1548
  if self.state: body['state'] = self.state.as_dict()
@@ -1550,6 +1561,8 @@ class ServedEntityOutput:
1550
1561
  external_model=_from_dict(d, 'external_model', ExternalModel),
1551
1562
  foundation_model=_from_dict(d, 'foundation_model', FoundationModel),
1552
1563
  instance_profile_arn=d.get('instance_profile_arn', None),
1564
+ max_provisioned_throughput=d.get('max_provisioned_throughput', None),
1565
+ min_provisioned_throughput=d.get('min_provisioned_throughput', None),
1553
1566
  name=d.get('name', None),
1554
1567
  scale_to_zero_enabled=d.get('scale_to_zero_enabled', None),
1555
1568
  state=_from_dict(d, 'state', ServedModelState),
@@ -2258,6 +2271,7 @@ class AppsAPI:
2258
2271
  if manifest is not None: body['manifest'] = manifest.as_dict()
2259
2272
  if resources is not None: body['resources'] = resources
2260
2273
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2274
+
2261
2275
  res = self._api.do('POST', '/api/2.0/preview/apps/deployments', body=body, headers=headers)
2262
2276
  return DeploymentStatus.from_dict(res)
2263
2277
 
@@ -2273,6 +2287,7 @@ class AppsAPI:
2273
2287
  """
2274
2288
 
2275
2289
  headers = {'Accept': 'application/json', }
2290
+
2276
2291
  res = self._api.do('DELETE', f'/api/2.0/preview/apps/instances/{name}', headers=headers)
2277
2292
  return DeleteAppResponse.from_dict(res)
2278
2293
 
@@ -2288,6 +2303,7 @@ class AppsAPI:
2288
2303
  """
2289
2304
 
2290
2305
  headers = {'Accept': 'application/json', }
2306
+
2291
2307
  res = self._api.do('GET', f'/api/2.0/preview/apps/instances/{name}', headers=headers)
2292
2308
  return GetAppResponse.from_dict(res)
2293
2309
 
@@ -2310,6 +2326,7 @@ class AppsAPI:
2310
2326
  query = {}
2311
2327
  if include_app_log is not None: query['include_app_log'] = include_app_log
2312
2328
  headers = {'Accept': 'application/json', }
2329
+
2313
2330
  res = self._api.do('GET',
2314
2331
  f'/api/2.0/preview/apps/deployments/{deployment_id}',
2315
2332
  query=query,
@@ -2325,6 +2342,7 @@ class AppsAPI:
2325
2342
  """
2326
2343
 
2327
2344
  headers = {'Accept': 'application/json', }
2345
+
2328
2346
  res = self._api.do('GET', '/api/2.0/preview/apps/instances', headers=headers)
2329
2347
  return ListAppsResponse.from_dict(res)
2330
2348
 
@@ -2340,6 +2358,7 @@ class AppsAPI:
2340
2358
  """
2341
2359
 
2342
2360
  headers = {'Accept': 'application/json', }
2361
+
2343
2362
  res = self._api.do('GET', f'/api/2.0/preview/apps/{name}/events', headers=headers)
2344
2363
  return ListAppEventsResponse.from_dict(res)
2345
2364
 
@@ -2405,6 +2424,7 @@ class ServingEndpointsAPI:
2405
2424
  """
2406
2425
 
2407
2426
  headers = {'Accept': 'application/json', }
2427
+
2408
2428
  res = self._api.do('GET',
2409
2429
  f'/api/2.0/serving-endpoints/{name}/served-models/{served_model_name}/build-logs',
2410
2430
  headers=headers)
@@ -2439,6 +2459,7 @@ class ServingEndpointsAPI:
2439
2459
  if rate_limits is not None: body['rate_limits'] = [v.as_dict() for v in rate_limits]
2440
2460
  if tags is not None: body['tags'] = [v.as_dict() for v in tags]
2441
2461
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2462
+
2442
2463
  op_response = self._api.do('POST', '/api/2.0/serving-endpoints', body=body, headers=headers)
2443
2464
  return Wait(self.wait_get_serving_endpoint_not_updating,
2444
2465
  response=ServingEndpointDetailed.from_dict(op_response),
@@ -2465,6 +2486,7 @@ class ServingEndpointsAPI:
2465
2486
  """
2466
2487
 
2467
2488
  headers = {'Accept': 'application/json', }
2489
+
2468
2490
  self._api.do('DELETE', f'/api/2.0/serving-endpoints/{name}', headers=headers)
2469
2491
 
2470
2492
  def export_metrics(self, name: str):
@@ -2480,6 +2502,7 @@ class ServingEndpointsAPI:
2480
2502
  """
2481
2503
 
2482
2504
  headers = {}
2505
+
2483
2506
  self._api.do('GET', f'/api/2.0/serving-endpoints/{name}/metrics', headers=headers)
2484
2507
 
2485
2508
  def get(self, name: str) -> ServingEndpointDetailed:
@@ -2494,6 +2517,7 @@ class ServingEndpointsAPI:
2494
2517
  """
2495
2518
 
2496
2519
  headers = {'Accept': 'application/json', }
2520
+
2497
2521
  res = self._api.do('GET', f'/api/2.0/serving-endpoints/{name}', headers=headers)
2498
2522
  return ServingEndpointDetailed.from_dict(res)
2499
2523
 
@@ -2509,6 +2533,7 @@ class ServingEndpointsAPI:
2509
2533
  """
2510
2534
 
2511
2535
  headers = {'Accept': 'application/json', }
2536
+
2512
2537
  res = self._api.do('GET',
2513
2538
  f'/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}/permissionLevels',
2514
2539
  headers=headers)
@@ -2527,6 +2552,7 @@ class ServingEndpointsAPI:
2527
2552
  """
2528
2553
 
2529
2554
  headers = {'Accept': 'application/json', }
2555
+
2530
2556
  res = self._api.do('GET',
2531
2557
  f'/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}',
2532
2558
  headers=headers)
@@ -2539,6 +2565,7 @@ class ServingEndpointsAPI:
2539
2565
  """
2540
2566
 
2541
2567
  headers = {'Accept': 'application/json', }
2568
+
2542
2569
  json = self._api.do('GET', '/api/2.0/serving-endpoints', headers=headers)
2543
2570
  parsed = ListEndpointsResponse.from_dict(json).endpoints
2544
2571
  return parsed if parsed is not None else []
@@ -2557,6 +2584,7 @@ class ServingEndpointsAPI:
2557
2584
  """
2558
2585
 
2559
2586
  headers = {'Accept': 'application/json', }
2587
+
2560
2588
  res = self._api.do('GET',
2561
2589
  f'/api/2.0/serving-endpoints/{name}/served-models/{served_model_name}/logs',
2562
2590
  headers=headers)
@@ -2584,6 +2612,7 @@ class ServingEndpointsAPI:
2584
2612
  if add_tags is not None: body['add_tags'] = [v.as_dict() for v in add_tags]
2585
2613
  if delete_tags is not None: body['delete_tags'] = [v for v in delete_tags]
2586
2614
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2615
+
2587
2616
  res = self._api.do('PATCH', f'/api/2.0/serving-endpoints/{name}/tags', body=body, headers=headers)
2588
2617
  return [EndpointTag.from_dict(v) for v in res]
2589
2618
 
@@ -2603,6 +2632,7 @@ class ServingEndpointsAPI:
2603
2632
  body = {}
2604
2633
  if rate_limits is not None: body['rate_limits'] = [v.as_dict() for v in rate_limits]
2605
2634
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2635
+
2606
2636
  res = self._api.do('PUT',
2607
2637
  f'/api/2.0/serving-endpoints/{name}/rate-limits',
2608
2638
  body=body,
@@ -2688,7 +2718,12 @@ class ServingEndpointsAPI:
2688
2718
  if stream is not None: body['stream'] = stream
2689
2719
  if temperature is not None: body['temperature'] = temperature
2690
2720
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2691
- res = self._api.do('POST', f'/serving-endpoints/{name}/invocations', body=body, headers=headers)
2721
+ response_headers = ['served-model-name', ]
2722
+ res = self._api.do('POST',
2723
+ f'/serving-endpoints/{name}/invocations',
2724
+ body=body,
2725
+ headers=headers,
2726
+ response_headers=response_headers)
2692
2727
  return QueryEndpointResponse.from_dict(res)
2693
2728
 
2694
2729
  def set_permissions(
@@ -2712,6 +2747,7 @@ class ServingEndpointsAPI:
2712
2747
  if access_control_list is not None:
2713
2748
  body['access_control_list'] = [v.as_dict() for v in access_control_list]
2714
2749
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2750
+
2715
2751
  res = self._api.do('PUT',
2716
2752
  f'/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}',
2717
2753
  body=body,
@@ -2754,6 +2790,7 @@ class ServingEndpointsAPI:
2754
2790
  if served_models is not None: body['served_models'] = [v.as_dict() for v in served_models]
2755
2791
  if traffic_config is not None: body['traffic_config'] = traffic_config.as_dict()
2756
2792
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2793
+
2757
2794
  op_response = self._api.do('PUT',
2758
2795
  f'/api/2.0/serving-endpoints/{name}/config',
2759
2796
  body=body,
@@ -2798,6 +2835,7 @@ class ServingEndpointsAPI:
2798
2835
  if access_control_list is not None:
2799
2836
  body['access_control_list'] = [v.as_dict() for v in access_control_list]
2800
2837
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2838
+
2801
2839
  res = self._api.do('PATCH',
2802
2840
  f'/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}',
2803
2841
  body=body,