diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index dfe78790..431b7678 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -779817ed8d63031f5ea761fbd25ee84f38feec0d \ No newline at end of file +05a10af4ed43566968119b43605f0a7fecbe780f \ No newline at end of file diff --git a/databricks/sdk/credentials_provider.py b/databricks/sdk/credentials_provider.py index e91e37af..c20464d5 100644 --- a/databricks/sdk/credentials_provider.py +++ b/databricks/sdk/credentials_provider.py @@ -167,6 +167,7 @@ def oauth_service_principal(cfg: 'Config') -> Optional[CredentialsProvider]: oidc = cfg.oidc_endpoints if oidc is None: return None + token_source = ClientCredentials(client_id=cfg.client_id, client_secret=cfg.client_secret, token_url=oidc.token_endpoint, @@ -210,16 +211,22 @@ def external_browser(cfg: 'Config') -> Optional[CredentialsProvider]: credentials = token_cache.load() if credentials: # Force a refresh in case the loaded credentials are expired. - credentials.token() - else: - oauth_client = OAuthClient(oidc_endpoints=oidc_endpoints, - client_id=client_id, - redirect_url=redirect_url, - client_secret=client_secret) - consent = oauth_client.initiate_consent() - if not consent: - return None - credentials = consent.launch_external_browser() + # If the refresh fails, rather than throw exception we will initiate a new OAuth login flow. + try: + credentials.token() + return credentials(cfg) + # TODO: we should ideally use more specific exceptions. + except Exception as e: + logger.warning(f'Failed to refresh cached token: {e}. Initiating new OAuth login flow') + + oauth_client = OAuthClient(oidc_endpoints=oidc_endpoints, + client_id=client_id, + redirect_url=redirect_url, + client_secret=client_secret) + consent = oauth_client.initiate_consent() + if not consent: + return None + credentials = consent.launch_external_browser() token_cache.save(credentials) return credentials(cfg) diff --git a/databricks/sdk/mixins/open_ai_client.py b/databricks/sdk/mixins/open_ai_client.py index a8682712..5f971311 100644 --- a/databricks/sdk/mixins/open_ai_client.py +++ b/databricks/sdk/mixins/open_ai_client.py @@ -1,4 +1,9 @@ -from databricks.sdk.service.serving import ServingEndpointsAPI +import json as js +from typing import Dict, Optional + +from databricks.sdk.service.serving import (ExternalFunctionRequestHttpMethod, + ExternalFunctionResponse, + ServingEndpointsAPI) class ServingEndpointsExt(ServingEndpointsAPI): @@ -50,3 +55,37 @@ def get_langchain_chat_open_ai_client(self, model): openai_api_base=self._api._cfg.host + "/serving-endpoints", api_key="no-token", # Passing in a placeholder to pass validations, this will not be used http_client=self._get_authorized_http_client()) + + def http_request(self, + conn: str, + method: ExternalFunctionRequestHttpMethod, + path: str, + *, + headers: Optional[Dict[str, str]] = None, + json: Optional[Dict[str, str]] = None, + params: Optional[Dict[str, str]] = None) -> ExternalFunctionResponse: + """Make external services call using the credentials stored in UC Connection. + **NOTE:** Experimental: This API may change or be removed in a future release without warning. + :param conn: str + The connection name to use. This is required to identify the external connection. + :param method: :class:`ExternalFunctionRequestHttpMethod` + The HTTP method to use (e.g., 'GET', 'POST'). This is required. + :param path: str + The relative path for the API endpoint. This is required. + :param headers: Dict[str,str] (optional) + Additional headers for the request. If not provided, only auth headers from connections would be + passed. + :param json: Dict[str,str] (optional) + JSON payload for the request. + :param params: Dict[str,str] (optional) + Query parameters for the request. + :returns: :class:`ExternalFunctionResponse` + """ + + return super.http_request(connection_name=conn, + method=method, + path=path, + headers=js.dumps(headers), + json=js.dumps(json), + params=js.dumps(params), + ) diff --git a/databricks/sdk/service/cleanrooms.py b/databricks/sdk/service/cleanrooms.py index 393c68a0..20d57527 100755 --- a/databricks/sdk/service/cleanrooms.py +++ b/databricks/sdk/service/cleanrooms.py @@ -312,6 +312,7 @@ def from_dict(cls, d: Dict[str, any]) -> CleanRoomAssetNotebook: class CleanRoomAssetStatusEnum(Enum): ACTIVE = 'ACTIVE' + PENDING = 'PENDING' PERMISSION_DENIED = 'PERMISSION_DENIED' @@ -443,7 +444,7 @@ def from_dict(cls, d: Dict[str, any]) -> CleanRoomAssetVolumeLocalDetails: class CleanRoomCollaborator: """Publicly visible clean room collaborator.""" - collaborator_alias: Optional[str] = None + collaborator_alias: str """Collaborator alias specified by the clean room creator. It is unique across all collaborators of this clean room, and used to derive multiple values internally such as catalog alias and clean room name for single metastore clean rooms. It should follow [UC securable naming requirements]. diff --git a/databricks/sdk/service/files.py b/databricks/sdk/service/files.py index 07cdaea5..99c25229 100755 --- a/databricks/sdk/service/files.py +++ b/databricks/sdk/service/files.py @@ -925,9 +925,12 @@ class FilesAPI: /Volumes/<catalog_name>/<schema_name>/<volume_name>/<path_to_file>. The Files API has two distinct endpoints, one for working with files (`/fs/files`) and another one for - working with directories (`/fs/directories`). Both endpoints, use the standard HTTP methods GET, HEAD, - PUT, and DELETE to manage files and directories specified using their URI path. The path is always - absolute. + working with directories (`/fs/directories`). Both endpoints use the standard HTTP methods GET, HEAD, PUT, + and DELETE to manage files and directories specified using their URI path. The path is always absolute. + + Some Files API client features are currently experimental. To enable them, set + `enable_experimental_files_api_client = True` in your configuration profile or use the environment + variable `DATABRICKS_ENABLE_EXPERIMENTAL_FILES_API_CLIENT=True`. [Unity Catalog volumes]: https://docs.databricks.com/en/connect/unity-catalog/volumes.html""" diff --git a/databricks/sdk/service/jobs.py b/databricks/sdk/service/jobs.py index c5fdb839..dd4bc807 100755 --- a/databricks/sdk/service/jobs.py +++ b/databricks/sdk/service/jobs.py @@ -443,6 +443,7 @@ class CleanRoomTaskRunLifeCycleState(Enum): PENDING = 'PENDING' QUEUED = 'QUEUED' RUNNING = 'RUNNING' + RUN_LIFE_CYCLE_STATE_UNSPECIFIED = 'RUN_LIFE_CYCLE_STATE_UNSPECIFIED' SKIPPED = 'SKIPPED' TERMINATED = 'TERMINATED' TERMINATING = 'TERMINATING' @@ -459,6 +460,7 @@ class CleanRoomTaskRunResultState(Enum): EXCLUDED = 'EXCLUDED' FAILED = 'FAILED' MAXIMUM_CONCURRENT_RUNS_REACHED = 'MAXIMUM_CONCURRENT_RUNS_REACHED' + RUN_RESULT_STATE_UNSPECIFIED = 'RUN_RESULT_STATE_UNSPECIFIED' SUCCESS = 'SUCCESS' SUCCESS_WITH_FAILURES = 'SUCCESS_WITH_FAILURES' TIMEDOUT = 'TIMEDOUT' @@ -541,6 +543,42 @@ def from_dict(cls, d: Dict[str, any]) -> CleanRoomsNotebookTask: notebook_name=d.get('notebook_name', None)) +@dataclass +class CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput: + clean_room_job_run_state: Optional[CleanRoomTaskRunState] = None + """The run state of the clean rooms notebook task.""" + + notebook_output: Optional[NotebookOutput] = None + """The notebook output for the clean room run""" + + output_schema_info: Optional[OutputSchemaInfo] = None + """Information on how to access the output schema for the clean room run""" + + def as_dict(self) -> dict: + """Serializes the CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.clean_room_job_run_state: + body['clean_room_job_run_state'] = self.clean_room_job_run_state.as_dict() + if self.notebook_output: body['notebook_output'] = self.notebook_output.as_dict() + if self.output_schema_info: body['output_schema_info'] = self.output_schema_info.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput into a shallow dictionary of its immediate attributes.""" + body = {} + if self.clean_room_job_run_state: body['clean_room_job_run_state'] = self.clean_room_job_run_state + if self.notebook_output: body['notebook_output'] = self.notebook_output + if self.output_schema_info: body['output_schema_info'] = self.output_schema_info + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput: + """Deserializes the CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput from a dictionary.""" + return cls(clean_room_job_run_state=_from_dict(d, 'clean_room_job_run_state', CleanRoomTaskRunState), + notebook_output=_from_dict(d, 'notebook_output', NotebookOutput), + output_schema_info=_from_dict(d, 'output_schema_info', OutputSchemaInfo)) + + @dataclass class ClusterInstance: cluster_id: Optional[str] = None @@ -2914,6 +2952,42 @@ def from_dict(cls, d: Dict[str, any]) -> NotebookTask: warehouse_id=d.get('warehouse_id', None)) +@dataclass +class OutputSchemaInfo: + """Stores the catalog name, schema name, and the output schema expiration time for the clean room + run.""" + + catalog_name: Optional[str] = None + + expiration_time: Optional[int] = None + """The expiration time for the output schema as a Unix timestamp in milliseconds.""" + + schema_name: Optional[str] = None + + def as_dict(self) -> dict: + """Serializes the OutputSchemaInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.catalog_name is not None: body['catalog_name'] = self.catalog_name + if self.expiration_time is not None: body['expiration_time'] = self.expiration_time + if self.schema_name is not None: body['schema_name'] = self.schema_name + return body + + def as_shallow_dict(self) -> dict: + """Serializes the OutputSchemaInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.catalog_name is not None: body['catalog_name'] = self.catalog_name + if self.expiration_time is not None: body['expiration_time'] = self.expiration_time + if self.schema_name is not None: body['schema_name'] = self.schema_name + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> OutputSchemaInfo: + """Deserializes the OutputSchemaInfo from a dictionary.""" + return cls(catalog_name=d.get('catalog_name', None), + expiration_time=d.get('expiration_time', None), + schema_name=d.get('schema_name', None)) + + class PauseStatus(Enum): PAUSED = 'PAUSED' @@ -4415,6 +4489,9 @@ def from_dict(cls, d: Dict[str, any]) -> RunNowResponse: class RunOutput: """Run output was retrieved successfully.""" + clean_rooms_notebook_output: Optional[CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput] = None + """The output of a clean rooms notebook task, if available""" + dbt_output: Optional[DbtOutput] = None """The output of a dbt task, if available.""" @@ -4459,6 +4536,8 @@ class RunOutput: def as_dict(self) -> dict: """Serializes the RunOutput into a dictionary suitable for use as a JSON request body.""" body = {} + if self.clean_rooms_notebook_output: + body['clean_rooms_notebook_output'] = self.clean_rooms_notebook_output.as_dict() if self.dbt_output: body['dbt_output'] = self.dbt_output.as_dict() if self.error is not None: body['error'] = self.error if self.error_trace is not None: body['error_trace'] = self.error_trace @@ -4474,6 +4553,8 @@ def as_dict(self) -> dict: def as_shallow_dict(self) -> dict: """Serializes the RunOutput into a shallow dictionary of its immediate attributes.""" body = {} + if self.clean_rooms_notebook_output: + body['clean_rooms_notebook_output'] = self.clean_rooms_notebook_output if self.dbt_output: body['dbt_output'] = self.dbt_output if self.error is not None: body['error'] = self.error if self.error_trace is not None: body['error_trace'] = self.error_trace @@ -4489,7 +4570,9 @@ def as_shallow_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, any]) -> RunOutput: """Deserializes the RunOutput from a dictionary.""" - return cls(dbt_output=_from_dict(d, 'dbt_output', DbtOutput), + return cls(clean_rooms_notebook_output=_from_dict(d, 'clean_rooms_notebook_output', + CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput), + dbt_output=_from_dict(d, 'dbt_output', DbtOutput), error=d.get('error', None), error_trace=d.get('error_trace', None), info=d.get('info', None), diff --git a/databricks/sdk/service/oauth2.py b/databricks/sdk/service/oauth2.py index 1aac8bc1..dc51cd45 100755 --- a/databricks/sdk/service/oauth2.py +++ b/databricks/sdk/service/oauth2.py @@ -791,6 +791,10 @@ class UpdateCustomAppIntegration: redirect_urls: Optional[List[str]] = None """List of OAuth redirect urls to be updated in the custom OAuth app integration""" + scopes: Optional[List[str]] = None + """List of OAuth scopes to be updated in the custom OAuth app integration, similar to redirect URIs + this will fully replace the existing values instead of appending""" + token_access_policy: Optional[TokenAccessPolicy] = None """Token access policy to be updated in the custom OAuth app integration""" @@ -799,6 +803,7 @@ def as_dict(self) -> dict: body = {} if self.integration_id is not None: body['integration_id'] = self.integration_id if self.redirect_urls: body['redirect_urls'] = [v for v in self.redirect_urls] + if self.scopes: body['scopes'] = [v for v in self.scopes] if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict() return body @@ -807,6 +812,7 @@ def as_shallow_dict(self) -> dict: body = {} if self.integration_id is not None: body['integration_id'] = self.integration_id if self.redirect_urls: body['redirect_urls'] = self.redirect_urls + if self.scopes: body['scopes'] = self.scopes if self.token_access_policy: body['token_access_policy'] = self.token_access_policy return body @@ -815,6 +821,7 @@ def from_dict(cls, d: Dict[str, any]) -> UpdateCustomAppIntegration: """Deserializes the UpdateCustomAppIntegration from a dictionary.""" return cls(integration_id=d.get('integration_id', None), redirect_urls=d.get('redirect_urls', None), + scopes=d.get('scopes', None), token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy)) @@ -1165,6 +1172,7 @@ def update(self, integration_id: str, *, redirect_urls: Optional[List[str]] = None, + scopes: Optional[List[str]] = None, token_access_policy: Optional[TokenAccessPolicy] = None): """Updates Custom OAuth App Integration. @@ -1174,6 +1182,9 @@ def update(self, :param integration_id: str :param redirect_urls: List[str] (optional) List of OAuth redirect urls to be updated in the custom OAuth app integration + :param scopes: List[str] (optional) + List of OAuth scopes to be updated in the custom OAuth app integration, similar to redirect URIs + this will fully replace the existing values instead of appending :param token_access_policy: :class:`TokenAccessPolicy` (optional) Token access policy to be updated in the custom OAuth app integration @@ -1181,6 +1192,7 @@ def update(self, """ body = {} if redirect_urls is not None: body['redirect_urls'] = [v for v in redirect_urls] + if scopes is not None: body['scopes'] = [v for v in scopes] if token_access_policy is not None: body['token_access_policy'] = token_access_policy.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/service/serving.py index 1ada305c..971e3fd7 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -145,11 +145,8 @@ def from_dict(cls, d: Dict[str, any]) -> AiGatewayGuardrailParameters: @dataclass class AiGatewayGuardrailPiiBehavior: - behavior: AiGatewayGuardrailPiiBehaviorBehavior - """Behavior for PII filter. Currently only 'BLOCK' is supported. If 'BLOCK' is set for the input - guardrail and the request contains PII, the request is not sent to the model server and 400 - status code is returned; if 'BLOCK' is set for the output guardrail and the model response - contains PII, the PII info in the response is redacted and 400 status code is returned.""" + behavior: Optional[AiGatewayGuardrailPiiBehaviorBehavior] = None + """Configuration for input guardrail filters.""" def as_dict(self) -> dict: """Serializes the AiGatewayGuardrailPiiBehavior into a dictionary suitable for use as a JSON request body.""" @@ -170,10 +167,6 @@ def from_dict(cls, d: Dict[str, any]) -> AiGatewayGuardrailPiiBehavior: class AiGatewayGuardrailPiiBehaviorBehavior(Enum): - """Behavior for PII filter. Currently only 'BLOCK' is supported. If 'BLOCK' is set for the input - guardrail and the request contains PII, the request is not sent to the model server and 400 - status code is returned; if 'BLOCK' is set for the output guardrail and the model response - contains PII, the PII info in the response is redacted and 400 status code is returned.""" BLOCK = 'BLOCK' NONE = 'NONE' @@ -289,15 +282,12 @@ def from_dict(cls, d: Dict[str, any]) -> AiGatewayRateLimit: class AiGatewayRateLimitKey(Enum): - """Key field for a rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' - being the default if not specified.""" ENDPOINT = 'endpoint' USER = 'user' class AiGatewayRateLimitRenewalPeriod(Enum): - """Renewal period field for a rate limit. Currently, only 'minute' is supported.""" MINUTE = 'minute' @@ -336,9 +326,9 @@ class AmazonBedrockConfig: aws_access_key_id: Optional[str] = None """The Databricks secret key reference for an AWS access key ID with permissions to interact with - Bedrock services. If you prefer to paste your API key directly, see `aws_access_key_id`. You - must provide an API key using one of the following fields: `aws_access_key_id` or - `aws_access_key_id_plaintext`.""" + Bedrock services. If you prefer to paste your API key directly, see + `aws_access_key_id_plaintext`. You must provide an API key using one of the following fields: + `aws_access_key_id` or `aws_access_key_id_plaintext`.""" aws_access_key_id_plaintext: Optional[str] = None """An AWS access key ID with permissions to interact with Bedrock services provided as a plaintext @@ -396,8 +386,6 @@ def from_dict(cls, d: Dict[str, any]) -> AmazonBedrockConfig: class AmazonBedrockConfigBedrockProvider(Enum): - """The underlying provider in Amazon Bedrock. Supported values (case insensitive) include: - Anthropic, Cohere, AI21Labs, Amazon.""" AI21LABS = 'ai21labs' AMAZON = 'amazon' @@ -487,18 +475,21 @@ def from_dict(cls, d: Dict[str, any]) -> AutoCaptureConfigInput: @dataclass class AutoCaptureConfigOutput: catalog_name: Optional[str] = None - """The name of the catalog in Unity Catalog.""" + """The name of the catalog in Unity Catalog. NOTE: On update, you cannot change the catalog name if + the inference table is already enabled.""" enabled: Optional[bool] = None """Indicates whether the inference table is enabled.""" schema_name: Optional[str] = None - """The name of the schema in Unity Catalog.""" + """The name of the schema in Unity Catalog. NOTE: On update, you cannot change the schema name if + the inference table is already enabled.""" state: Optional[AutoCaptureState] = None table_name_prefix: Optional[str] = None - """The prefix of the table in Unity Catalog.""" + """The prefix of the table in Unity Catalog. NOTE: On update, you cannot change the prefix name if + the inference table is already enabled.""" def as_dict(self) -> dict: """Serializes the AutoCaptureConfigOutput into a dictionary suitable for use as a JSON request body.""" @@ -663,8 +654,8 @@ class CreateServingEndpoint: """The core config of the serving endpoint.""" ai_gateway: Optional[AiGatewayConfig] = None - """The AI Gateway configuration for the serving endpoint. NOTE: only external model endpoints are - supported as of now.""" + """The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned + throughput endpoints are currently supported.""" rate_limits: Optional[List[RateLimit]] = None """Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI @@ -711,6 +702,8 @@ def from_dict(cls, d: Dict[str, any]) -> CreateServingEndpoint: @dataclass class DataPlaneInfo: + """Details necessary to query this object's API through the DataPlane APIs.""" + authorization_details: Optional[str] = None """Authorization details as a string.""" @@ -879,21 +872,22 @@ class EmbeddingsV1ResponseEmbeddingElementObject(Enum): class EndpointCoreConfigInput: auto_capture_config: Optional[AutoCaptureConfigInput] = None """Configuration for Inference Tables which automatically logs requests and responses to Unity - Catalog.""" + Catalog. Note: this field is deprecated for creating new provisioned throughput endpoints, or + updating existing provisioned throughput endpoints that never have inference table configured; + in these cases please use AI Gateway to manage inference tables.""" name: Optional[str] = None """The name of the serving endpoint to update. This field is required.""" served_entities: Optional[List[ServedEntityInput]] = None - """A list of served entities for the endpoint to serve. A serving endpoint can have up to 15 served - entities.""" + """The list of served entities under the serving endpoint config.""" served_models: Optional[List[ServedModelInput]] = None - """(Deprecated, use served_entities instead) A list of served models for the endpoint to serve. A - serving endpoint can have up to 15 served models.""" + """(Deprecated, use served_entities instead) The list of served models under the serving endpoint + config.""" traffic_config: Optional[TrafficConfig] = None - """The traffic config defining how invocations to the serving endpoint should be routed.""" + """The traffic configuration associated with the serving endpoint config.""" def as_dict(self) -> dict: """Serializes the EndpointCoreConfigInput into a dictionary suitable for use as a JSON request body.""" @@ -929,7 +923,9 @@ def from_dict(cls, d: Dict[str, any]) -> EndpointCoreConfigInput: class EndpointCoreConfigOutput: auto_capture_config: Optional[AutoCaptureConfigOutput] = None """Configuration for Inference Tables which automatically logs requests and responses to Unity - Catalog.""" + Catalog. Note: this field is deprecated for creating new provisioned throughput endpoints, or + updating existing provisioned throughput endpoints that never have inference table configured; + in these cases please use AI Gateway to manage inference tables.""" config_version: Optional[int] = None """The config version that the serving endpoint is currently serving.""" @@ -1008,7 +1004,9 @@ def from_dict(cls, d: Dict[str, any]) -> EndpointCoreConfigSummary: class EndpointPendingConfig: auto_capture_config: Optional[AutoCaptureConfigOutput] = None """Configuration for Inference Tables which automatically logs requests and responses to Unity - Catalog.""" + Catalog. Note: this field is deprecated for creating new provisioned throughput endpoints, or + updating existing provisioned throughput endpoints that never have inference table configured; + in these cases please use AI Gateway to manage inference tables.""" config_version: Optional[int] = None """The config version that the serving endpoint is currently serving.""" @@ -1094,10 +1092,6 @@ def from_dict(cls, d: Dict[str, any]) -> EndpointState: class EndpointStateConfigUpdate(Enum): - """The state of an endpoint's config update. This informs the user if the pending_config is in - progress, if the update failed, or if there is no update in progress. Note that if the - endpoint's config_update state value is IN_PROGRESS, another update can not be made until the - update completes or fails.""" IN_PROGRESS = 'IN_PROGRESS' NOT_UPDATING = 'NOT_UPDATING' @@ -1106,9 +1100,6 @@ class EndpointStateConfigUpdate(Enum): class EndpointStateReady(Enum): - """The state of an endpoint, indicating whether or not the endpoint is queryable. An endpoint is - READY if all of the served entities in its active configuration are ready. If any of the - actively served entities are in a non-ready state, the endpoint state will be NOT_READY.""" NOT_READY = 'NOT_READY' READY = 'READY' @@ -1142,6 +1133,28 @@ def from_dict(cls, d: Dict[str, any]) -> EndpointTag: return cls(key=d.get('key', None), value=d.get('value', None)) +@dataclass +class EndpointTags: + tags: Optional[List[EndpointTag]] = None + + def as_dict(self) -> dict: + """Serializes the EndpointTags into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.tags: body['tags'] = [v.as_dict() for v in self.tags] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the EndpointTags into a shallow dictionary of its immediate attributes.""" + body = {} + if self.tags: body['tags'] = self.tags + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> EndpointTags: + """Deserializes the EndpointTags from a dictionary.""" + return cls(tags=_repeated_dict(d, 'tags', EndpointTag)) + + @dataclass class ExportMetricsResponse: contents: Optional[BinaryIO] = None @@ -1164,12 +1177,105 @@ def from_dict(cls, d: Dict[str, any]) -> ExportMetricsResponse: return cls(contents=d.get('contents', None)) +@dataclass +class ExternalFunctionRequest: + """Simple Proto message for testing""" + + connection_name: str + """The connection name to use. This is required to identify the external connection.""" + + method: ExternalFunctionRequestHttpMethod + """The HTTP method to use (e.g., 'GET', 'POST').""" + + path: str + """The relative path for the API endpoint. This is required.""" + + headers: Optional[str] = None + """Additional headers for the request. If not provided, only auth headers from connections would be + passed.""" + + json: Optional[str] = None + """The JSON payload to send in the request body.""" + + params: Optional[str] = None + """Query parameters for the request.""" + + def as_dict(self) -> dict: + """Serializes the ExternalFunctionRequest into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.connection_name is not None: body['connection_name'] = self.connection_name + if self.headers is not None: body['headers'] = self.headers + if self.json is not None: body['json'] = self.json + if self.method is not None: body['method'] = self.method.value + if self.params is not None: body['params'] = self.params + if self.path is not None: body['path'] = self.path + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ExternalFunctionRequest into a shallow dictionary of its immediate attributes.""" + body = {} + if self.connection_name is not None: body['connection_name'] = self.connection_name + if self.headers is not None: body['headers'] = self.headers + if self.json is not None: body['json'] = self.json + if self.method is not None: body['method'] = self.method + if self.params is not None: body['params'] = self.params + if self.path is not None: body['path'] = self.path + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> ExternalFunctionRequest: + """Deserializes the ExternalFunctionRequest from a dictionary.""" + return cls(connection_name=d.get('connection_name', None), + headers=d.get('headers', None), + json=d.get('json', None), + method=_enum(d, 'method', ExternalFunctionRequestHttpMethod), + params=d.get('params', None), + path=d.get('path', None)) + + +class ExternalFunctionRequestHttpMethod(Enum): + + DELETE = 'DELETE' + GET = 'GET' + PATCH = 'PATCH' + POST = 'POST' + PUT = 'PUT' + + +@dataclass +class ExternalFunctionResponse: + status_code: Optional[int] = None + """The HTTP status code of the response""" + + text: Optional[str] = None + """The content of the response""" + + def as_dict(self) -> dict: + """Serializes the ExternalFunctionResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.status_code is not None: body['status_code'] = self.status_code + if self.text is not None: body['text'] = self.text + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ExternalFunctionResponse into a shallow dictionary of its immediate attributes.""" + body = {} + if self.status_code is not None: body['status_code'] = self.status_code + if self.text is not None: body['text'] = self.text + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> ExternalFunctionResponse: + """Deserializes the ExternalFunctionResponse from a dictionary.""" + return cls(status_code=d.get('status_code', None), text=d.get('text', None)) + + @dataclass class ExternalModel: provider: ExternalModelProvider """The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', 'databricks-model-serving', - 'google-cloud-vertex-ai', 'openai', and 'palm'.",""" + 'google-cloud-vertex-ai', 'openai', and 'palm'.""" name: str """The name of the external model.""" @@ -1256,9 +1362,6 @@ def from_dict(cls, d: Dict[str, any]) -> ExternalModel: class ExternalModelProvider(Enum): - """The name of the provider for the external model. Currently, the supported providers are - 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', 'databricks-model-serving', - 'google-cloud-vertex-ai', 'openai', and 'palm'.",""" AI21LABS = 'ai21labs' AMAZON_BEDROCK = 'amazon-bedrock' @@ -1307,17 +1410,16 @@ def from_dict(cls, d: Dict[str, any]) -> ExternalModelUsageElement: @dataclass class FoundationModel: + """All fields are not sensitive as they are hard-coded in the system and made available to + customers.""" + description: Optional[str] = None - """The description of the foundation model.""" display_name: Optional[str] = None - """The display name of the foundation model.""" docs: Optional[str] = None - """The URL to the documentation of the foundation model.""" name: Optional[str] = None - """The name of the foundation model.""" def as_dict(self) -> dict: """Serializes the FoundationModel into a dictionary suitable for use as a JSON request body.""" @@ -1348,23 +1450,24 @@ def from_dict(cls, d: Dict[str, any]) -> FoundationModel: @dataclass class GetOpenApiResponse: - """The response is an OpenAPI spec in JSON format that typically includes fields like openapi, - info, servers and paths, etc.""" + contents: Optional[BinaryIO] = None def as_dict(self) -> dict: """Serializes the GetOpenApiResponse into a dictionary suitable for use as a JSON request body.""" body = {} + if self.contents: body['contents'] = self.contents return body def as_shallow_dict(self) -> dict: """Serializes the GetOpenApiResponse into a shallow dictionary of its immediate attributes.""" body = {} + if self.contents: body['contents'] = self.contents return body @classmethod def from_dict(cls, d: Dict[str, any]) -> GetOpenApiResponse: """Deserializes the GetOpenApiResponse from a dictionary.""" - return cls() + return cls(contents=d.get('contents', None)) @dataclass @@ -1393,13 +1496,23 @@ def from_dict(cls, d: Dict[str, any]) -> GetServingEndpointPermissionLevelsRespo @dataclass class GoogleCloudVertexAiConfig: + project_id: str + """This is the Google Cloud project id that the service account is associated with.""" + + region: str + """This is the region for the Google Cloud Vertex AI Service. See [supported regions] for more + details. Some models are only available in specific regions. + + [supported regions]: https://cloud.google.com/vertex-ai/docs/general/locations""" + private_key: Optional[str] = None """The Databricks secret key reference for a private key for the service account which has access to the Google Cloud Vertex AI Service. See [Best practices for managing service account keys]. If you prefer to paste your API key directly, see `private_key_plaintext`. You must provide an API key using one of the following fields: `private_key` or `private_key_plaintext` - [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys""" + [Best practices for managing service account keys]: + https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys""" private_key_plaintext: Optional[str] = None """The private key for the service account which has access to the Google Cloud Vertex AI Service @@ -1407,16 +1520,8 @@ class GoogleCloudVertexAiConfig: prefer to reference your key using Databricks Secrets, see `private_key`. You must provide an API key using one of the following fields: `private_key` or `private_key_plaintext`. - [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys""" - - project_id: Optional[str] = None - """This is the Google Cloud project id that the service account is associated with.""" - - region: Optional[str] = None - """This is the region for the Google Cloud Vertex AI Service. See [supported regions] for more - details. Some models are only available in specific regions. - - [supported regions]: https://cloud.google.com/vertex-ai/docs/general/locations""" + [Best practices for managing service account keys]: + https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys""" def as_dict(self) -> dict: """Serializes the GoogleCloudVertexAiConfig into a dictionary suitable for use as a JSON request body.""" @@ -1470,6 +1575,9 @@ def from_dict(cls, d: Dict[str, any]) -> ListEndpointsResponse: @dataclass class ModelDataPlaneInfo: + """A representation of all DataPlaneInfo for operations that can be done on a model through Data + Plane APIs.""" + query_info: Optional[DataPlaneInfo] = None """Information required to query DataPlane API 'query' endpoint.""" @@ -1493,6 +1601,8 @@ def from_dict(cls, d: Dict[str, any]) -> ModelDataPlaneInfo: @dataclass class OpenAiConfig: + """Configs needed to create an OpenAI model route.""" + microsoft_entra_client_id: Optional[str] = None """This field is only required for Azure AD OpenAI and is the Microsoft Entra Client ID.""" @@ -1678,13 +1788,10 @@ def from_dict(cls, d: Dict[str, any]) -> PatchServingEndpointTags: @dataclass class PayloadTable: name: Optional[str] = None - """The name of the payload table.""" status: Optional[str] = None - """The status of the payload table.""" status_message: Optional[str] = None - """The status message of the payload table.""" def as_dict(self) -> dict: """Serializes the PayloadTable into a dictionary suitable for use as a JSON request body.""" @@ -1710,6 +1817,57 @@ def from_dict(cls, d: Dict[str, any]) -> PayloadTable: status_message=d.get('status_message', None)) +@dataclass +class PutAiGatewayRequest: + guardrails: Optional[AiGatewayGuardrails] = None + """Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and + responses.""" + + inference_table_config: Optional[AiGatewayInferenceTableConfig] = None + """Configuration for payload logging using inference tables. Use these tables to monitor and audit + data being sent to and received from model APIs and to improve model quality.""" + + name: Optional[str] = None + """The name of the serving endpoint whose AI Gateway is being updated. This field is required.""" + + rate_limits: Optional[List[AiGatewayRateLimit]] = None + """Configuration for rate limits which can be set to limit endpoint traffic.""" + + usage_tracking_config: Optional[AiGatewayUsageTrackingConfig] = None + """Configuration to enable usage tracking using system tables. These tables allow you to monitor + operational usage on endpoints and their associated costs.""" + + def as_dict(self) -> dict: + """Serializes the PutAiGatewayRequest into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.guardrails: body['guardrails'] = self.guardrails.as_dict() + if self.inference_table_config: body['inference_table_config'] = self.inference_table_config.as_dict() + if self.name is not None: body['name'] = self.name + if self.rate_limits: body['rate_limits'] = [v.as_dict() for v in self.rate_limits] + if self.usage_tracking_config: body['usage_tracking_config'] = self.usage_tracking_config.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the PutAiGatewayRequest into a shallow dictionary of its immediate attributes.""" + body = {} + if self.guardrails: body['guardrails'] = self.guardrails + if self.inference_table_config: body['inference_table_config'] = self.inference_table_config + if self.name is not None: body['name'] = self.name + if self.rate_limits: body['rate_limits'] = self.rate_limits + if self.usage_tracking_config: body['usage_tracking_config'] = self.usage_tracking_config + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> PutAiGatewayRequest: + """Deserializes the PutAiGatewayRequest from a dictionary.""" + return cls(guardrails=_from_dict(d, 'guardrails', AiGatewayGuardrails), + inference_table_config=_from_dict(d, 'inference_table_config', + AiGatewayInferenceTableConfig), + name=d.get('name', None), + rate_limits=_repeated_dict(d, 'rate_limits', AiGatewayRateLimit), + usage_tracking_config=_from_dict(d, 'usage_tracking_config', AiGatewayUsageTrackingConfig)) + + @dataclass class PutAiGatewayResponse: guardrails: Optional[AiGatewayGuardrails] = None @@ -1718,7 +1876,7 @@ class PutAiGatewayResponse: inference_table_config: Optional[AiGatewayInferenceTableConfig] = None """Configuration for payload logging using inference tables. Use these tables to monitor and audit - data being sent to and received from model APIs and to improve model quality .""" + data being sent to and received from model APIs and to improve model quality.""" rate_limits: Optional[List[AiGatewayRateLimit]] = None """Configuration for rate limits which can be set to limit endpoint traffic.""" @@ -1755,6 +1913,34 @@ def from_dict(cls, d: Dict[str, any]) -> PutAiGatewayResponse: usage_tracking_config=_from_dict(d, 'usage_tracking_config', AiGatewayUsageTrackingConfig)) +@dataclass +class PutRequest: + name: Optional[str] = None + """The name of the serving endpoint whose rate limits are being updated. This field is required.""" + + rate_limits: Optional[List[RateLimit]] = None + """The list of endpoint rate limits.""" + + def as_dict(self) -> dict: + """Serializes the PutRequest into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.name is not None: body['name'] = self.name + if self.rate_limits: body['rate_limits'] = [v.as_dict() for v in self.rate_limits] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the PutRequest into a shallow dictionary of its immediate attributes.""" + body = {} + if self.name is not None: body['name'] = self.name + if self.rate_limits: body['rate_limits'] = self.rate_limits + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> PutRequest: + """Deserializes the PutRequest from a dictionary.""" + return cls(name=d.get('name', None), rate_limits=_repeated_dict(d, 'rate_limits', RateLimit)) + + @dataclass class PutResponse: rate_limits: Optional[List[RateLimit]] = None @@ -2020,15 +2206,12 @@ def from_dict(cls, d: Dict[str, any]) -> RateLimit: class RateLimitKey(Enum): - """Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are - supported, with 'endpoint' being the default if not specified.""" ENDPOINT = 'endpoint' USER = 'user' class RateLimitRenewalPeriod(Enum): - """Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported.""" MINUTE = 'minute' @@ -2069,11 +2252,9 @@ class ServedEntityInput: """The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the object should be given in the form of - __catalog_name__.__schema_name__.__model_name__.""" + **catalog_name.schema_name.model_name**.""" entity_version: Optional[str] = None - """The version of the model in Databricks Model Registry to be served or empty if the entity is a - FEATURE_SPEC.""" environment_vars: Optional[Dict[str, str]] = None """An object containing a set of optional, user-specified environment variable key-value pairs used @@ -2102,7 +2283,7 @@ class ServedEntityInput: """The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if - not specified for other entities, it defaults to -.""" + not specified for other entities, it defaults to entity_name-entity_version.""" scale_to_zero_enabled: Optional[bool] = None """Whether the compute resources for the served entity should scale down to zero.""" @@ -2115,13 +2296,13 @@ class ServedEntityInput: scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0.""" - workload_type: Optional[str] = None + workload_type: Optional[ServingModelWorkloadType] = None """The workload type of the served entity. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types]. - [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types""" + [GPU types]: https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types""" def as_dict(self) -> dict: """Serializes the ServedEntityInput into a dictionary suitable for use as a JSON request body.""" @@ -2138,7 +2319,7 @@ def as_dict(self) -> dict: if self.name is not None: body['name'] = self.name if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled if self.workload_size is not None: body['workload_size'] = self.workload_size - if self.workload_type is not None: body['workload_type'] = self.workload_type + if self.workload_type is not None: body['workload_type'] = self.workload_type.value return body def as_shallow_dict(self) -> dict: @@ -2172,26 +2353,22 @@ def from_dict(cls, d: Dict[str, any]) -> ServedEntityInput: name=d.get('name', None), scale_to_zero_enabled=d.get('scale_to_zero_enabled', None), workload_size=d.get('workload_size', None), - workload_type=d.get('workload_type', None)) + workload_type=_enum(d, 'workload_type', ServingModelWorkloadType)) @dataclass class ServedEntityOutput: creation_timestamp: Optional[int] = None - """The creation timestamp of the served entity in Unix time.""" creator: Optional[str] = None - """The email of the user who created the served entity.""" entity_name: Optional[str] = None - """The name of the entity served. The entity may be a model in the Databricks Model Registry, a - model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC - object, the full name of the object is given in the form of - __catalog_name__.__schema_name__.__model_name__.""" + """The name of the entity to be served. The entity may be a model in the Databricks Model Registry, + a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC + object, the full name of the object should be given in the form of + **catalog_name.schema_name.model_name**.""" entity_version: Optional[str] = None - """The version of the served entity in Databricks Model Registry or empty if the entity is a - FEATURE_SPEC.""" environment_vars: Optional[Dict[str, str]] = None """An object containing a set of optional, user-specified environment variable key-value pairs used @@ -2200,14 +2377,16 @@ class ServedEntityOutput: "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}`""" external_model: Optional[ExternalModel] = None - """The external model that is served. NOTE: Only one of external_model, foundation_model, and - (entity_name, entity_version, workload_size, workload_type, and scale_to_zero_enabled) is - returned based on the endpoint type.""" + """The external model to be served. NOTE: Only one of external_model and (entity_name, + entity_version, workload_size, workload_type, and scale_to_zero_enabled) can be specified with + the latter set being used for custom model serving for a Databricks registered model. For an + existing endpoint with external_model, it cannot be updated to an endpoint without + external_model. If the endpoint is created without external_model, users cannot update it to add + external_model later. The task type of all external models within an endpoint must be the same.""" foundation_model: Optional[FoundationModel] = None - """The foundation model that is served. NOTE: Only one of foundation_model, external_model, and - (entity_name, entity_version, workload_size, workload_type, and scale_to_zero_enabled) is - returned based on the endpoint type.""" + """All fields are not sensitive as they are hard-coded in the system and made available to + customers.""" instance_profile_arn: Optional[str] = None """ARN of the instance profile that the served entity uses to access AWS resources.""" @@ -2219,13 +2398,15 @@ class ServedEntityOutput: """The minimum tokens per second that the endpoint can scale down to.""" name: Optional[str] = None - """The name of the served entity.""" + """The name of a served entity. It must be unique across an endpoint. A served entity name can + consist of alphanumeric characters, dashes, and underscores. If not specified for an external + model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if + not specified for other entities, it defaults to entity_name-entity_version.""" scale_to_zero_enabled: Optional[bool] = None """Whether the compute resources for the served entity should scale down to zero.""" state: Optional[ServedModelState] = None - """Information corresponding to the state of the served entity.""" workload_size: Optional[str] = None """The workload size of the served entity. The workload size corresponds to a range of provisioned @@ -2233,15 +2414,15 @@ class ServedEntityOutput: process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size - will be 0.""" + is 0.""" - workload_type: Optional[str] = None + workload_type: Optional[ServingModelWorkloadType] = None """The workload type of the served entity. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types]. - [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types""" + [GPU types]: https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types""" def as_dict(self) -> dict: """Serializes the ServedEntityOutput into a dictionary suitable for use as a JSON request body.""" @@ -2262,7 +2443,7 @@ def as_dict(self) -> dict: if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled if self.state: body['state'] = self.state.as_dict() if self.workload_size is not None: body['workload_size'] = self.workload_size - if self.workload_type is not None: body['workload_type'] = self.workload_type + if self.workload_type is not None: body['workload_type'] = self.workload_type.value return body def as_shallow_dict(self) -> dict: @@ -2304,31 +2485,22 @@ def from_dict(cls, d: Dict[str, any]) -> ServedEntityOutput: scale_to_zero_enabled=d.get('scale_to_zero_enabled', None), state=_from_dict(d, 'state', ServedModelState), workload_size=d.get('workload_size', None), - workload_type=d.get('workload_type', None)) + workload_type=_enum(d, 'workload_type', ServingModelWorkloadType)) @dataclass class ServedEntitySpec: entity_name: Optional[str] = None - """The name of the entity served. The entity may be a model in the Databricks Model Registry, a - model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC - object, the full name of the object is given in the form of - __catalog_name__.__schema_name__.__model_name__.""" entity_version: Optional[str] = None - """The version of the served entity in Databricks Model Registry or empty if the entity is a - FEATURE_SPEC.""" external_model: Optional[ExternalModel] = None - """The external model that is served. NOTE: Only one of external_model, foundation_model, and - (entity_name, entity_version) is returned based on the endpoint type.""" foundation_model: Optional[FoundationModel] = None - """The foundation model that is served. NOTE: Only one of foundation_model, external_model, and - (entity_name, entity_version) is returned based on the endpoint type.""" + """All fields are not sensitive as they are hard-coded in the system and made available to + customers.""" name: Optional[str] = None - """The name of the served entity.""" def as_dict(self) -> dict: """Serializes the ServedEntitySpec into a dictionary suitable for use as a JSON request body.""" @@ -2362,24 +2534,21 @@ def from_dict(cls, d: Dict[str, any]) -> ServedEntitySpec: @dataclass class ServedModelInput: + scale_to_zero_enabled: bool + """Whether the compute resources for the served entity should scale down to zero.""" + model_name: str - """The name of the model in Databricks Model Registry to be served or if the model resides in Unity - Catalog, the full name of model, in the form of __catalog_name__.__schema_name__.__model_name__.""" model_version: str - """The version of the model in Databricks Model Registry or Unity Catalog to be served.""" - - scale_to_zero_enabled: bool - """Whether the compute resources for the served model should scale down to zero.""" environment_vars: Optional[Dict[str, str]] = None """An object containing a set of optional, user-specified environment variable key-value pairs used - for serving this model. Note: this is an experimental feature and subject to change. Example - model environment variables that refer to Databricks secrets: `{"OPENAI_API_KEY": + for serving this entity. Note: this is an experimental feature and subject to change. Example + entity environment variables that refer to Databricks secrets: `{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}`""" instance_profile_arn: Optional[str] = None - """ARN of the instance profile that the served model will use to access AWS resources.""" + """ARN of the instance profile that the served entity uses to access AWS resources.""" max_provisioned_throughput: Optional[int] = None """The maximum tokens per second that the endpoint can scale up to.""" @@ -2388,25 +2557,26 @@ class ServedModelInput: """The minimum tokens per second that the endpoint can scale down to.""" name: Optional[str] = None - """The name of a served model. It must be unique across an endpoint. If not specified, this field - will default to -. A served model name can consist of alphanumeric - characters, dashes, and underscores.""" + """The name of a served entity. It must be unique across an endpoint. A served entity name can + consist of alphanumeric characters, dashes, and underscores. If not specified for an external + model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if + not specified for other entities, it defaults to entity_name-entity_version.""" workload_size: Optional[ServedModelInputWorkloadSize] = None - """The workload size of the served model. The workload size corresponds to a range of provisioned - concurrency that the compute will autoscale between. A single unit of provisioned concurrency - can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned - concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned - concurrency). If scale-to-zero is enabled, the lower bound of the provisioned concurrency for - each workload size will be 0.""" + """The workload size of the served entity. The workload size corresponds to a range of provisioned + concurrency that the compute autoscales between. A single unit of provisioned concurrency can + process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), + "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). If + scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size + is 0.""" workload_type: Optional[ServedModelInputWorkloadType] = None - """The workload type of the served model. The workload type selects which type of compute to use in - the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU + """The workload type of the served entity. The workload type selects which type of compute to use + in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types]. - [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types""" + [GPU types]: https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types""" def as_dict(self) -> dict: """Serializes the ServedModelInput into a dictionary suitable for use as a JSON request body.""" @@ -2458,12 +2628,6 @@ def from_dict(cls, d: Dict[str, any]) -> ServedModelInput: class ServedModelInputWorkloadSize(Enum): - """The workload size of the served model. The workload size corresponds to a range of provisioned - concurrency that the compute will autoscale between. A single unit of provisioned concurrency - can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned - concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned - concurrency). If scale-to-zero is enabled, the lower bound of the provisioned concurrency for - each workload size will be 0.""" LARGE = 'Large' MEDIUM = 'Medium' @@ -2471,12 +2635,6 @@ class ServedModelInputWorkloadSize(Enum): class ServedModelInputWorkloadType(Enum): - """The workload type of the served model. The workload type selects which type of compute to use in - the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU - acceleration is available by selecting workload types like GPU_SMALL and others. See the - available [GPU types]. - - [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types""" CPU = 'CPU' GPU_LARGE = 'GPU_LARGE' @@ -2488,51 +2646,48 @@ class ServedModelInputWorkloadType(Enum): @dataclass class ServedModelOutput: creation_timestamp: Optional[int] = None - """The creation timestamp of the served model in Unix time.""" creator: Optional[str] = None - """The email of the user who created the served model.""" environment_vars: Optional[Dict[str, str]] = None """An object containing a set of optional, user-specified environment variable key-value pairs used - for serving this model. Note: this is an experimental feature and subject to change. Example - model environment variables that refer to Databricks secrets: `{"OPENAI_API_KEY": + for serving this entity. Note: this is an experimental feature and subject to change. Example + entity environment variables that refer to Databricks secrets: `{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}`""" instance_profile_arn: Optional[str] = None - """ARN of the instance profile that the served model will use to access AWS resources.""" + """ARN of the instance profile that the served entity uses to access AWS resources.""" model_name: Optional[str] = None - """The name of the model in Databricks Model Registry or the full name of the model in Unity - Catalog.""" model_version: Optional[str] = None - """The version of the model in Databricks Model Registry or Unity Catalog to be served.""" name: Optional[str] = None - """The name of the served model.""" + """The name of a served entity. It must be unique across an endpoint. A served entity name can + consist of alphanumeric characters, dashes, and underscores. If not specified for an external + model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if + not specified for other entities, it defaults to entity_name-entity_version.""" scale_to_zero_enabled: Optional[bool] = None - """Whether the compute resources for the Served Model should scale down to zero.""" + """Whether the compute resources for the served entity should scale down to zero.""" state: Optional[ServedModelState] = None - """Information corresponding to the state of the Served Model.""" workload_size: Optional[str] = None - """The workload size of the served model. The workload size corresponds to a range of provisioned - concurrency that the compute will autoscale between. A single unit of provisioned concurrency - can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned - concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned - concurrency). If scale-to-zero is enabled, the lower bound of the provisioned concurrency for - each workload size will be 0.""" - - workload_type: Optional[str] = None - """The workload type of the served model. The workload type selects which type of compute to use in - the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU + """The workload size of the served entity. The workload size corresponds to a range of provisioned + concurrency that the compute autoscales between. A single unit of provisioned concurrency can + process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), + "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). If + scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size + is 0.""" + + workload_type: Optional[ServingModelWorkloadType] = None + """The workload type of the served entity. The workload type selects which type of compute to use + in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types]. - [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types""" + [GPU types]: https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types""" def as_dict(self) -> dict: """Serializes the ServedModelOutput into a dictionary suitable for use as a JSON request body.""" @@ -2547,7 +2702,7 @@ def as_dict(self) -> dict: if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled if self.state: body['state'] = self.state.as_dict() if self.workload_size is not None: body['workload_size'] = self.workload_size - if self.workload_type is not None: body['workload_type'] = self.workload_type + if self.workload_type is not None: body['workload_type'] = self.workload_type.value return body def as_shallow_dict(self) -> dict: @@ -2579,20 +2734,18 @@ def from_dict(cls, d: Dict[str, any]) -> ServedModelOutput: scale_to_zero_enabled=d.get('scale_to_zero_enabled', None), state=_from_dict(d, 'state', ServedModelState), workload_size=d.get('workload_size', None), - workload_type=d.get('workload_type', None)) + workload_type=_enum(d, 'workload_type', ServingModelWorkloadType)) @dataclass class ServedModelSpec: model_name: Optional[str] = None - """The name of the model in Databricks Model Registry or the full name of the model in Unity - Catalog.""" + """Only one of model_name and entity_name should be populated""" model_version: Optional[str] = None - """The version of the model in Databricks Model Registry or Unity Catalog to be served.""" + """Only one of model_version and entity_version should be populated""" name: Optional[str] = None - """The name of the served model.""" def as_dict(self) -> dict: """Serializes the ServedModelSpec into a dictionary suitable for use as a JSON request body.""" @@ -2621,18 +2774,8 @@ def from_dict(cls, d: Dict[str, any]) -> ServedModelSpec: @dataclass class ServedModelState: deployment: Optional[ServedModelStateDeployment] = None - """The state of the served entity deployment. DEPLOYMENT_CREATING indicates that the served entity - is not ready yet because the deployment is still being created (i.e container image is building, - model server is deploying for the first time, etc.). DEPLOYMENT_RECOVERING indicates that the - served entity was previously in a ready state but no longer is and is attempting to recover. - DEPLOYMENT_READY indicates that the served entity is ready to receive traffic. DEPLOYMENT_FAILED - indicates that there was an error trying to bring up the served entity (e.g container image - build failed, the model server failed to start due to a model loading error, etc.) - DEPLOYMENT_ABORTED indicates that the deployment was terminated likely due to a failure in - bringing up another served entity under the same endpoint and config version.""" deployment_state_message: Optional[str] = None - """More information about the state of the served entity, if available.""" def as_dict(self) -> dict: """Serializes the ServedModelState into a dictionary suitable for use as a JSON request body.""" @@ -2658,15 +2801,6 @@ def from_dict(cls, d: Dict[str, any]) -> ServedModelState: class ServedModelStateDeployment(Enum): - """The state of the served entity deployment. DEPLOYMENT_CREATING indicates that the served entity - is not ready yet because the deployment is still being created (i.e container image is building, - model server is deploying for the first time, etc.). DEPLOYMENT_RECOVERING indicates that the - served entity was previously in a ready state but no longer is and is attempting to recover. - DEPLOYMENT_READY indicates that the served entity is ready to receive traffic. DEPLOYMENT_FAILED - indicates that there was an error trying to bring up the served entity (e.g container image - build failed, the model server failed to start due to a model loading error, etc.) - DEPLOYMENT_ABORTED indicates that the deployment was terminated likely due to a failure in - bringing up another served entity under the same endpoint and config version.""" ABORTED = 'DEPLOYMENT_ABORTED' CREATING = 'DEPLOYMENT_CREATING' @@ -2701,8 +2835,8 @@ def from_dict(cls, d: Dict[str, any]) -> ServerLogsResponse: @dataclass class ServingEndpoint: ai_gateway: Optional[AiGatewayConfig] = None - """The AI Gateway configuration for the serving endpoint. NOTE: Only external model endpoints are - currently supported.""" + """The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned + throughput endpoints are currently supported.""" config: Optional[EndpointCoreConfigSummary] = None """The config that is currently being served by the endpoint.""" @@ -2714,8 +2848,7 @@ class ServingEndpoint: """The email of the user who created the serving endpoint.""" id: Optional[str] = None - """System-generated ID of the endpoint. This is used to refer to the endpoint in the Permissions - API""" + """System-generated ID of the endpoint, included to be used by the Permissions API.""" last_updated_timestamp: Optional[int] = None """The timestamp when the endpoint was last updated by a user in Unix time.""" @@ -2874,8 +3007,8 @@ def from_dict(cls, d: Dict[str, any]) -> ServingEndpointAccessControlResponse: @dataclass class ServingEndpointDetailed: ai_gateway: Optional[AiGatewayConfig] = None - """The AI Gateway configuration for the serving endpoint. NOTE: Only external model endpoints are - currently supported.""" + """The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned + throughput endpoints are currently supported.""" config: Optional[EndpointCoreConfigOutput] = None """The config that is currently being served by the endpoint.""" @@ -2983,7 +3116,6 @@ def from_dict(cls, d: Dict[str, any]) -> ServingEndpointDetailed: class ServingEndpointDetailedPermissionLevel(Enum): - """The permission level of the principal making the request.""" CAN_MANAGE = 'CAN_MANAGE' CAN_QUERY = 'CAN_QUERY' @@ -3123,6 +3255,15 @@ def from_dict(cls, d: Dict[str, any]) -> ServingEndpointPermissionsRequest: serving_endpoint_id=d.get('serving_endpoint_id', None)) +class ServingModelWorkloadType(Enum): + + CPU = 'CPU' + GPU_LARGE = 'GPU_LARGE' + GPU_MEDIUM = 'GPU_MEDIUM' + GPU_SMALL = 'GPU_SMALL' + MULTIGPU_MEDIUM = 'MULTIGPU_MEDIUM' + + @dataclass class TrafficConfig: routes: Optional[List[Route]] = None @@ -3276,8 +3417,8 @@ def create(self, :param config: :class:`EndpointCoreConfigInput` The core config of the serving endpoint. :param ai_gateway: :class:`AiGatewayConfig` (optional) - The AI Gateway configuration for the serving endpoint. NOTE: only external model endpoints are - supported as of now. + The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned + throughput endpoints are currently supported. :param rate_limits: List[:class:`RateLimit`] (optional) Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI Gateway to manage rate limits. @@ -3325,7 +3466,6 @@ def delete(self, name: str): """Delete a serving endpoint. :param name: str - The name of the serving endpoint. This field is required. """ @@ -3367,7 +3507,7 @@ def get(self, name: str) -> ServingEndpointDetailed: res = self._api.do('GET', f'/api/2.0/serving-endpoints/{name}', headers=headers) return ServingEndpointDetailed.from_dict(res) - def get_open_api(self, name: str): + def get_open_api(self, name: str) -> GetOpenApiResponse: """Get the schema for a serving endpoint. Get the query schema of the serving endpoint in OpenAPI format. The schema contains information for @@ -3376,12 +3516,13 @@ def get_open_api(self, name: str): :param name: str The name of the serving endpoint that the served model belongs to. This field is required. - + :returns: :class:`GetOpenApiResponse` """ - headers = {'Accept': 'application/json', } + headers = {'Accept': 'text/plain', } - self._api.do('GET', f'/api/2.0/serving-endpoints/{name}/openapi', headers=headers) + res = self._api.do('GET', f'/api/2.0/serving-endpoints/{name}/openapi', headers=headers, raw=True) + return GetOpenApiResponse.from_dict(res) def get_permission_levels(self, serving_endpoint_id: str) -> GetServingEndpointPermissionLevelsResponse: """Get serving endpoint permission levels. @@ -3420,6 +3561,44 @@ def get_permissions(self, serving_endpoint_id: str) -> ServingEndpointPermission headers=headers) return ServingEndpointPermissions.from_dict(res) + def http_request(self, + connection_name: str, + method: ExternalFunctionRequestHttpMethod, + path: str, + *, + headers: Optional[str] = None, + json: Optional[str] = None, + params: Optional[str] = None) -> ExternalFunctionResponse: + """Make external services call using the credentials stored in UC Connection. + + :param connection_name: str + The connection name to use. This is required to identify the external connection. + :param method: :class:`ExternalFunctionRequestHttpMethod` + The HTTP method to use (e.g., 'GET', 'POST'). + :param path: str + The relative path for the API endpoint. This is required. + :param headers: str (optional) + Additional headers for the request. If not provided, only auth headers from connections would be + passed. + :param json: str (optional) + The JSON payload to send in the request body. + :param params: str (optional) + Query parameters for the request. + + :returns: :class:`ExternalFunctionResponse` + """ + body = {} + if connection_name is not None: body['connection_name'] = connection_name + if headers is not None: body['headers'] = headers + if json is not None: body['json'] = json + if method is not None: body['method'] = method.value + if params is not None: body['params'] = params + if path is not None: body['path'] = path + headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + + res = self._api.do('POST', '/api/2.0/external-function', body=body, headers=headers) + return ExternalFunctionResponse.from_dict(res) + def list(self) -> Iterator[ServingEndpoint]: """Get all serving endpoints. @@ -3456,7 +3635,7 @@ def patch(self, name: str, *, add_tags: Optional[List[EndpointTag]] = None, - delete_tags: Optional[List[str]] = None) -> Iterator[EndpointTag]: + delete_tags: Optional[List[str]] = None) -> EndpointTags: """Update tags of a serving endpoint. Used to batch add and delete tags from a serving endpoint with a single API call. @@ -3468,7 +3647,7 @@ def patch(self, :param delete_tags: List[str] (optional) List of tag keys to delete - :returns: Iterator over :class:`EndpointTag` + :returns: :class:`EndpointTags` """ body = {} if add_tags is not None: body['add_tags'] = [v.as_dict() for v in add_tags] @@ -3476,7 +3655,7 @@ def patch(self, headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } res = self._api.do('PATCH', f'/api/2.0/serving-endpoints/{name}/tags', body=body, headers=headers) - return [EndpointTag.from_dict(v) for v in res] + return EndpointTags.from_dict(res) def put(self, name: str, *, rate_limits: Optional[List[RateLimit]] = None) -> PutResponse: """Update rate limits of a serving endpoint. @@ -3511,8 +3690,8 @@ def put_ai_gateway( usage_tracking_config: Optional[AiGatewayUsageTrackingConfig] = None) -> PutAiGatewayResponse: """Update AI Gateway of a serving endpoint. - Used to update the AI Gateway of a serving endpoint. NOTE: Only external model endpoints are currently - supported. + Used to update the AI Gateway of a serving endpoint. NOTE: Only external model and provisioned + throughput endpoints are currently supported. :param name: str The name of the serving endpoint whose AI Gateway is being updated. This field is required. @@ -3672,14 +3851,16 @@ def update_config(self, The name of the serving endpoint to update. This field is required. :param auto_capture_config: :class:`AutoCaptureConfigInput` (optional) Configuration for Inference Tables which automatically logs requests and responses to Unity Catalog. + Note: this field is deprecated for creating new provisioned throughput endpoints, or updating + existing provisioned throughput endpoints that never have inference table configured; in these cases + please use AI Gateway to manage inference tables. :param served_entities: List[:class:`ServedEntityInput`] (optional) - A list of served entities for the endpoint to serve. A serving endpoint can have up to 15 served - entities. + The list of served entities under the serving endpoint config. :param served_models: List[:class:`ServedModelInput`] (optional) - (Deprecated, use served_entities instead) A list of served models for the endpoint to serve. A - serving endpoint can have up to 15 served models. + (Deprecated, use served_entities instead) The list of served models under the serving endpoint + config. :param traffic_config: :class:`TrafficConfig` (optional) - The traffic config defining how invocations to the serving endpoint should be routed. + The traffic configuration associated with the serving endpoint config. :returns: Long-running operation waiter for :class:`ServingEndpointDetailed`. diff --git a/docs/account/oauth2/custom_app_integration.rst b/docs/account/oauth2/custom_app_integration.rst index 4192b210..9868a288 100644 --- a/docs/account/oauth2/custom_app_integration.rst +++ b/docs/account/oauth2/custom_app_integration.rst @@ -67,7 +67,7 @@ :returns: Iterator over :class:`GetCustomAppIntegrationOutput` - .. py:method:: update(integration_id: str [, redirect_urls: Optional[List[str]], token_access_policy: Optional[TokenAccessPolicy]]) + .. py:method:: update(integration_id: str [, redirect_urls: Optional[List[str]], scopes: Optional[List[str]], token_access_policy: Optional[TokenAccessPolicy]]) Updates Custom OAuth App Integration. @@ -77,6 +77,9 @@ :param integration_id: str :param redirect_urls: List[str] (optional) List of OAuth redirect urls to be updated in the custom OAuth app integration + :param scopes: List[str] (optional) + List of OAuth scopes to be updated in the custom OAuth app integration, similar to redirect URIs + this will fully replace the existing values instead of appending :param token_access_policy: :class:`TokenAccessPolicy` (optional) Token access policy to be updated in the custom OAuth app integration diff --git a/docs/account/oauth2/federation_policy.rst b/docs/account/oauth2/federation_policy.rst index 4bee8675..c95bf563 100644 --- a/docs/account/oauth2/federation_policy.rst +++ b/docs/account/oauth2/federation_policy.rst @@ -51,7 +51,8 @@ :param policy: :class:`FederationPolicy` (optional) :param policy_id: str (optional) - The identifier for the federation policy. If unspecified, the id will be assigned by Databricks. + The identifier for the federation policy. The identifier must contain only lowercase alphanumeric + characters, numbers, hyphens, and slashes. If unspecified, the id will be assigned by Databricks. :returns: :class:`FederationPolicy` @@ -61,6 +62,7 @@ Delete account federation policy. :param policy_id: str + The identifier for the federation policy. @@ -70,6 +72,7 @@ Get account federation policy. :param policy_id: str + The identifier for the federation policy. :returns: :class:`FederationPolicy` @@ -84,16 +87,19 @@ :returns: Iterator over :class:`FederationPolicy` - .. py:method:: update(policy_id: str, update_mask: str [, policy: Optional[FederationPolicy]]) -> FederationPolicy + .. py:method:: update(policy_id: str [, policy: Optional[FederationPolicy], update_mask: Optional[str]]) -> FederationPolicy Update account federation policy. :param policy_id: str - :param update_mask: str - Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the - setting payload will be updated. The field mask needs to be supplied as single string. To specify - multiple fields in the field mask, use comma as the separator (no space). + The identifier for the federation policy. :param policy: :class:`FederationPolicy` (optional) + :param update_mask: str (optional) + The field mask specifies which fields of the policy to update. To specify multiple fields in the + field mask, use comma as the separator (no space). The special value '*' indicates that all fields + should be updated (full replacement). If unspecified, all fields that are set in the policy provided + in the update request will overwrite the corresponding fields in the existing policy. Example value: + 'description,oidc_policy.audiences'. :returns: :class:`FederationPolicy` \ No newline at end of file diff --git a/docs/account/oauth2/service_principal_federation_policy.rst b/docs/account/oauth2/service_principal_federation_policy.rst index e4293c5f..2e0577ba 100644 --- a/docs/account/oauth2/service_principal_federation_policy.rst +++ b/docs/account/oauth2/service_principal_federation_policy.rst @@ -53,7 +53,8 @@ The service principal id for the federation policy. :param policy: :class:`FederationPolicy` (optional) :param policy_id: str (optional) - The identifier for the federation policy. If unspecified, the id will be assigned by Databricks. + The identifier for the federation policy. The identifier must contain only lowercase alphanumeric + characters, numbers, hyphens, and slashes. If unspecified, the id will be assigned by Databricks. :returns: :class:`FederationPolicy` @@ -65,6 +66,7 @@ :param service_principal_id: int The service principal id for the federation policy. :param policy_id: str + The identifier for the federation policy. @@ -76,6 +78,7 @@ :param service_principal_id: int The service principal id for the federation policy. :param policy_id: str + The identifier for the federation policy. :returns: :class:`FederationPolicy` @@ -92,18 +95,21 @@ :returns: Iterator over :class:`FederationPolicy` - .. py:method:: update(service_principal_id: int, policy_id: str, update_mask: str [, policy: Optional[FederationPolicy]]) -> FederationPolicy + .. py:method:: update(service_principal_id: int, policy_id: str [, policy: Optional[FederationPolicy], update_mask: Optional[str]]) -> FederationPolicy Update service principal federation policy. :param service_principal_id: int The service principal id for the federation policy. :param policy_id: str - :param update_mask: str - Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the - setting payload will be updated. The field mask needs to be supplied as single string. To specify - multiple fields in the field mask, use comma as the separator (no space). + The identifier for the federation policy. :param policy: :class:`FederationPolicy` (optional) + :param update_mask: str (optional) + The field mask specifies which fields of the policy to update. To specify multiple fields in the + field mask, use comma as the separator (no space). The special value '*' indicates that all fields + should be updated (full replacement). If unspecified, all fields that are set in the policy provided + in the update request will overwrite the corresponding fields in the existing policy. Example value: + 'description,oidc_policy.audiences'. :returns: :class:`FederationPolicy` \ No newline at end of file diff --git a/docs/dbdataclasses/catalog.rst b/docs/dbdataclasses/catalog.rst index 84f3c986..d1e89277 100644 --- a/docs/dbdataclasses/catalog.rst +++ b/docs/dbdataclasses/catalog.rst @@ -1242,6 +1242,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: ACTIVE :value: "ACTIVE" + .. py:attribute:: DEGRADED + :value: "DEGRADED" + .. py:attribute:: DELETING :value: "DELETING" diff --git a/docs/dbdataclasses/cleanrooms.rst b/docs/dbdataclasses/cleanrooms.rst index 762c454b..85ec9825 100644 --- a/docs/dbdataclasses/cleanrooms.rst +++ b/docs/dbdataclasses/cleanrooms.rst @@ -54,6 +54,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: ACTIVE :value: "ACTIVE" + .. py:attribute:: PENDING + :value: "PENDING" + .. py:attribute:: PERMISSION_DENIED :value: "PERMISSION_DENIED" diff --git a/docs/dbdataclasses/jobs.rst b/docs/dbdataclasses/jobs.rst index cbb4059a..3996fa51 100644 --- a/docs/dbdataclasses/jobs.rst +++ b/docs/dbdataclasses/jobs.rst @@ -47,6 +47,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: RUNNING :value: "RUNNING" + .. py:attribute:: RUN_LIFE_CYCLE_STATE_UNSPECIFIED + :value: "RUN_LIFE_CYCLE_STATE_UNSPECIFIED" + .. py:attribute:: SKIPPED :value: "SKIPPED" @@ -81,6 +84,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: MAXIMUM_CONCURRENT_RUNS_REACHED :value: "MAXIMUM_CONCURRENT_RUNS_REACHED" + .. py:attribute:: RUN_RESULT_STATE_UNSPECIFIED + :value: "RUN_RESULT_STATE_UNSPECIFIED" + .. py:attribute:: SUCCESS :value: "SUCCESS" @@ -107,6 +113,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput + :members: + :undoc-members: + .. autoclass:: ClusterInstance :members: :undoc-members: @@ -448,6 +458,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: OutputSchemaInfo + :members: + :undoc-members: + .. py:class:: PauseStatus .. py:attribute:: PAUSED diff --git a/docs/dbdataclasses/oauth2.rst b/docs/dbdataclasses/oauth2.rst index 70e09ab0..10202e55 100644 --- a/docs/dbdataclasses/oauth2.rst +++ b/docs/dbdataclasses/oauth2.rst @@ -24,10 +24,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: -.. autoclass:: DataPlaneInfo - :members: - :undoc-members: - .. autoclass:: DeleteCustomAppIntegrationOutput :members: :undoc-members: diff --git a/docs/dbdataclasses/pipelines.rst b/docs/dbdataclasses/pipelines.rst index f82cd73c..903cb52f 100644 --- a/docs/dbdataclasses/pipelines.rst +++ b/docs/dbdataclasses/pipelines.rst @@ -20,6 +20,31 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. py:class:: DayOfWeek + + Days of week in which the restart is allowed to happen (within a five-hour window starting at start_hour). If not specified all days of the week will be used. + + .. py:attribute:: FRIDAY + :value: "FRIDAY" + + .. py:attribute:: MONDAY + :value: "MONDAY" + + .. py:attribute:: SATURDAY + :value: "SATURDAY" + + .. py:attribute:: SUNDAY + :value: "SUNDAY" + + .. py:attribute:: THURSDAY + :value: "THURSDAY" + + .. py:attribute:: TUESDAY + :value: "TUESDAY" + + .. py:attribute:: WEDNESDAY + :value: "WEDNESDAY" + .. autoclass:: DeletePipelineResponse :members: :undoc-members: @@ -273,30 +298,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: -.. py:class:: RestartWindowDaysOfWeek - - Days of week in which the restart is allowed to happen (within a five-hour window starting at start_hour). If not specified all days of the week will be used. - - .. py:attribute:: FRIDAY - :value: "FRIDAY" - - .. py:attribute:: MONDAY - :value: "MONDAY" - - .. py:attribute:: SATURDAY - :value: "SATURDAY" - - .. py:attribute:: SUNDAY - :value: "SUNDAY" - - .. py:attribute:: THURSDAY - :value: "THURSDAY" - - .. py:attribute:: TUESDAY - :value: "TUESDAY" - - .. py:attribute:: WEDNESDAY - :value: "WEDNESDAY" +.. autoclass:: RunAs + :members: + :undoc-members: .. autoclass:: SchemaSpec :members: diff --git a/docs/dbdataclasses/serving.rst b/docs/dbdataclasses/serving.rst index 3deefc87..af4772f7 100644 --- a/docs/dbdataclasses/serving.rst +++ b/docs/dbdataclasses/serving.rst @@ -22,8 +22,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: AiGatewayGuardrailPiiBehaviorBehavior - Behavior for PII filter. Currently only 'BLOCK' is supported. If 'BLOCK' is set for the input guardrail and the request contains PII, the request is not sent to the model server and 400 status code is returned; if 'BLOCK' is set for the output guardrail and the model response contains PII, the PII info in the response is redacted and 400 status code is returned. - .. py:attribute:: BLOCK :value: "BLOCK" @@ -44,8 +42,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: AiGatewayRateLimitKey - Key field for a rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified. - .. py:attribute:: ENDPOINT :value: "ENDPOINT" @@ -54,8 +50,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: AiGatewayRateLimitRenewalPeriod - Renewal period field for a rate limit. Currently, only 'minute' is supported. - .. py:attribute:: MINUTE :value: "MINUTE" @@ -69,8 +63,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: AmazonBedrockConfigBedrockProvider - The underlying provider in Amazon Bedrock. Supported values (case insensitive) include: Anthropic, Cohere, AI21Labs, Amazon. - .. py:attribute:: AI21LABS :value: "AI21LABS" @@ -128,6 +120,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: DataPlaneInfo + :members: + :undoc-members: + .. autoclass:: DatabricksModelServingConfig :members: :undoc-members: @@ -173,8 +169,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: EndpointStateConfigUpdate - The state of an endpoint's config update. This informs the user if the pending_config is in progress, if the update failed, or if there is no update in progress. Note that if the endpoint's config_update state value is IN_PROGRESS, another update can not be made until the update completes or fails. - .. py:attribute:: IN_PROGRESS :value: "IN_PROGRESS" @@ -189,8 +183,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: EndpointStateReady - The state of an endpoint, indicating whether or not the endpoint is queryable. An endpoint is READY if all of the served entities in its active configuration are ready. If any of the actively served entities are in a non-ready state, the endpoint state will be NOT_READY. - .. py:attribute:: NOT_READY :value: "NOT_READY" @@ -201,18 +193,45 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: EndpointTags + :members: + :undoc-members: + .. autoclass:: ExportMetricsResponse :members: :undoc-members: +.. autoclass:: ExternalFunctionRequest + :members: + :undoc-members: + +.. py:class:: ExternalFunctionRequestHttpMethod + + .. py:attribute:: DELETE + :value: "DELETE" + + .. py:attribute:: GET + :value: "GET" + + .. py:attribute:: PATCH + :value: "PATCH" + + .. py:attribute:: POST + :value: "POST" + + .. py:attribute:: PUT + :value: "PUT" + +.. autoclass:: ExternalFunctionResponse + :members: + :undoc-members: + .. autoclass:: ExternalModel :members: :undoc-members: .. py:class:: ExternalModelProvider - The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', and 'palm'.", - .. py:attribute:: AI21LABS :value: "AI21LABS" @@ -281,10 +300,18 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: PutAiGatewayRequest + :members: + :undoc-members: + .. autoclass:: PutAiGatewayResponse :members: :undoc-members: +.. autoclass:: PutRequest + :members: + :undoc-members: + .. autoclass:: PutResponse :members: :undoc-members: @@ -316,8 +343,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: RateLimitKey - Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified. - .. py:attribute:: ENDPOINT :value: "ENDPOINT" @@ -326,8 +351,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: RateLimitRenewalPeriod - Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported. - .. py:attribute:: MINUTE :value: "MINUTE" @@ -353,8 +376,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: ServedModelInputWorkloadSize - The workload size of the served model. The workload size corresponds to a range of provisioned concurrency that the compute will autoscale between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size will be 0. - .. py:attribute:: LARGE :value: "LARGE" @@ -366,9 +387,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: ServedModelInputWorkloadType - The workload type of the served model. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types]. - [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - .. py:attribute:: CPU :value: "CPU" @@ -398,8 +416,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: ServedModelStateDeployment - The state of the served entity deployment. DEPLOYMENT_CREATING indicates that the served entity is not ready yet because the deployment is still being created (i.e container image is building, model server is deploying for the first time, etc.). DEPLOYMENT_RECOVERING indicates that the served entity was previously in a ready state but no longer is and is attempting to recover. DEPLOYMENT_READY indicates that the served entity is ready to receive traffic. DEPLOYMENT_FAILED indicates that there was an error trying to bring up the served entity (e.g container image build failed, the model server failed to start due to a model loading error, etc.) DEPLOYMENT_ABORTED indicates that the deployment was terminated likely due to a failure in bringing up another served entity under the same endpoint and config version. - .. py:attribute:: ABORTED :value: "ABORTED" @@ -437,8 +453,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: ServingEndpointDetailedPermissionLevel - The permission level of the principal making the request. - .. py:attribute:: CAN_MANAGE :value: "CAN_MANAGE" @@ -477,6 +491,23 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. py:class:: ServingModelWorkloadType + + .. py:attribute:: CPU + :value: "CPU" + + .. py:attribute:: GPU_LARGE + :value: "GPU_LARGE" + + .. py:attribute:: GPU_MEDIUM + :value: "GPU_MEDIUM" + + .. py:attribute:: GPU_SMALL + :value: "GPU_SMALL" + + .. py:attribute:: MULTIGPU_MEDIUM + :value: "MULTIGPU_MEDIUM" + .. autoclass:: TrafficConfig :members: :undoc-members: diff --git a/docs/workspace/apps/apps.rst b/docs/workspace/apps/apps.rst index 40791a14..af7229f3 100644 --- a/docs/workspace/apps/apps.rst +++ b/docs/workspace/apps/apps.rst @@ -7,20 +7,22 @@ Apps run directly on a customer’s Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on. - .. py:method:: create( [, app: Optional[App]]) -> Wait[App] + .. py:method:: create( [, app: Optional[App], no_compute: Optional[bool]]) -> Wait[App] Create an app. Creates a new app. :param app: :class:`App` (optional) + :param no_compute: bool (optional) + If true, the app will not be started after creation. :returns: Long-running operation waiter for :class:`App`. See :method:wait_get_app_active for more details. - .. py:method:: create_and_wait( [, app: Optional[App], timeout: datetime.timedelta = 0:20:00]) -> App + .. py:method:: create_and_wait( [, app: Optional[App], no_compute: Optional[bool], timeout: datetime.timedelta = 0:20:00]) -> App .. py:method:: delete(name: str) -> App diff --git a/docs/workspace/files/files.rst b/docs/workspace/files/files.rst index f1bd7031..0151fcce 100644 --- a/docs/workspace/files/files.rst +++ b/docs/workspace/files/files.rst @@ -13,9 +13,12 @@ /Volumes/<catalog_name>/<schema_name>/<volume_name>/<path_to_file>. The Files API has two distinct endpoints, one for working with files (`/fs/files`) and another one for - working with directories (`/fs/directories`). Both endpoints, use the standard HTTP methods GET, HEAD, - PUT, and DELETE to manage files and directories specified using their URI path. The path is always - absolute. + working with directories (`/fs/directories`). Both endpoints use the standard HTTP methods GET, HEAD, PUT, + and DELETE to manage files and directories specified using their URI path. The path is always absolute. + + Some Files API client features are currently experimental. To enable them, set + `enable_experimental_files_api_client = True` in your configuration profile or use the environment + variable `DATABRICKS_ENABLE_EXPERIMENTAL_FILES_API_CLIENT=True`. [Unity Catalog volumes]: https://docs.databricks.com/en/connect/unity-catalog/volumes.html diff --git a/docs/workspace/jobs/jobs.rst b/docs/workspace/jobs/jobs.rst index b7d677f0..49bebe60 100644 --- a/docs/workspace/jobs/jobs.rst +++ b/docs/workspace/jobs/jobs.rst @@ -1,5 +1,5 @@ -``w.jobs``: Jobs -================ +``w.jobs``: Jobs (latest) +========================= .. currentmodule:: databricks.sdk.service.jobs .. py:class:: JobsExt @@ -199,6 +199,7 @@ :param job_clusters: List[:class:`JobCluster`] (optional) A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings. + If more than 100 job clusters are available, you can paginate through them using :method:jobs/get. :param max_concurrent_runs: int (optional) An optional maximum allowed number of concurrent runs of the job. Set this value if you want to be able to execute multiple runs of the same job concurrently. This is useful for example if you @@ -230,7 +231,9 @@ clusters, and are subject to the same limitations as cluster tags. A maximum of 25 tags can be added to the job. :param tasks: List[:class:`Task`] (optional) - A list of task specifications to be executed by this job. + A list of task specifications to be executed by this job. If more than 100 tasks are available, you + can paginate through them using :method:jobs/get. Use the `next_page_token` field at the object root + to determine if more results are available. :param timeout_seconds: int (optional) An optional timeout applied to each run of this job. A value of `0` means no timeout. :param trigger: :class:`TriggerSettings` (optional) @@ -315,7 +318,7 @@ :returns: :class:`ExportRunOutput` - .. py:method:: get(job_id: int) -> Job + .. py:method:: get(job_id: int [, page_token: Optional[str]]) -> Job Usage: @@ -351,8 +354,16 @@ Retrieves the details for a single job. + In Jobs API 2.2, requests for a single job support pagination of `tasks` and `job_clusters` when + either exceeds 100 elements. Use the `next_page_token` field to check for more results and pass its + value as the `page_token` in subsequent requests. Arrays with fewer than 100 elements in a page will + be empty on later pages. + :param job_id: int The canonical identifier of the job to retrieve information about. This field is required. + :param page_token: str (optional) + Use `next_page_token` returned from the previous GetJob to request the next page of the job's + sub-resources. :returns: :class:`Job` @@ -516,7 +527,8 @@ Retrieves a list of jobs. :param expand_tasks: bool (optional) - Whether to include task and cluster details in the response. + Whether to include task and cluster details in the response. Note that in API 2.2, only the first + 100 elements will be shown. Use :method:jobs/get to paginate through all tasks and clusters. :param limit: int (optional) The number of jobs to return. This value must be greater than 0 and less or equal to 100. The default value is 20. @@ -578,7 +590,8 @@ If completed_only is `true`, only completed runs are included in the results; otherwise, lists both active and completed runs. This field cannot be `true` when active_only is `true`. :param expand_tasks: bool (optional) - Whether to include task and cluster details in the response. + Whether to include task and cluster details in the response. Note that in API 2.2, only the first + 100 elements will be shown. Use :method:jobs/getrun to paginate through all tasks and clusters. :param job_id: int (optional) The job for which to list runs. If omitted, the Jobs service lists runs from all jobs. :param limit: int (optional) diff --git a/docs/workspace/pipelines/pipelines.rst b/docs/workspace/pipelines/pipelines.rst index 1ba87574..ec31991e 100644 --- a/docs/workspace/pipelines/pipelines.rst +++ b/docs/workspace/pipelines/pipelines.rst @@ -15,7 +15,7 @@ also enforce data quality with Delta Live Tables expectations. Expectations allow you to define expected data quality and specify how to handle records that fail those expectations. - .. py:method:: create( [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], dry_run: Optional[bool], edition: Optional[str], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], target: Optional[str], trigger: Optional[PipelineTrigger]]) -> CreatePipelineResponse + .. py:method:: create( [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], dry_run: Optional[bool], edition: Optional[str], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], target: Optional[str], trigger: Optional[PipelineTrigger]]) -> CreatePipelineResponse Usage: @@ -95,6 +95,12 @@ Whether Photon is enabled for this pipeline. :param restart_window: :class:`RestartWindow` (optional) Restart window of this pipeline. + :param run_as: :class:`RunAs` (optional) + Write-only setting, available only in Create/Update calls. Specifies the user or service principal + that the pipeline runs as. If not specified, the pipeline runs as the user who created the pipeline. + + Only `user_name` or `service_principal_name` can be specified. If both are specified, an error is + thrown. :param schema: str (optional) The default schema (database) where tables are read from or published to. The presence of this field implies that the pipeline is in direct publishing mode. @@ -379,7 +385,7 @@ .. py:method:: stop_and_wait(pipeline_id: str, timeout: datetime.timedelta = 0:20:00) -> GetPipelineResponse - .. py:method:: update(pipeline_id: str [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], edition: Optional[str], expected_last_modified: Optional[int], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], target: Optional[str], trigger: Optional[PipelineTrigger]]) + .. py:method:: update(pipeline_id: str [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], edition: Optional[str], expected_last_modified: Optional[int], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], target: Optional[str], trigger: Optional[PipelineTrigger]]) Usage: @@ -475,6 +481,12 @@ Whether Photon is enabled for this pipeline. :param restart_window: :class:`RestartWindow` (optional) Restart window of this pipeline. + :param run_as: :class:`RunAs` (optional) + Write-only setting, available only in Create/Update calls. Specifies the user or service principal + that the pipeline runs as. If not specified, the pipeline runs as the user who created the pipeline. + + Only `user_name` or `service_principal_name` can be specified. If both are specified, an error is + thrown. :param schema: str (optional) The default schema (database) where tables are read from or published to. The presence of this field implies that the pipeline is in direct publishing mode. diff --git a/docs/workspace/serving/serving_endpoints.rst b/docs/workspace/serving/serving_endpoints.rst index 430a1318..c0cd774a 100644 --- a/docs/workspace/serving/serving_endpoints.rst +++ b/docs/workspace/serving/serving_endpoints.rst @@ -39,8 +39,8 @@ :param config: :class:`EndpointCoreConfigInput` The core config of the serving endpoint. :param ai_gateway: :class:`AiGatewayConfig` (optional) - The AI Gateway configuration for the serving endpoint. NOTE: only external model endpoints are - supported as of now. + The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned + throughput endpoints are currently supported. :param rate_limits: List[:class:`RateLimit`] (optional) Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI Gateway to manage rate limits. @@ -62,7 +62,6 @@ Delete a serving endpoint. :param name: str - The name of the serving endpoint. This field is required. @@ -98,7 +97,7 @@ .. py:method:: get_open_ai_client() - .. py:method:: get_open_api(name: str) + .. py:method:: get_open_api(name: str) -> GetOpenApiResponse Get the schema for a serving endpoint. @@ -108,7 +107,7 @@ :param name: str The name of the serving endpoint that the served model belongs to. This field is required. - + :returns: :class:`GetOpenApiResponse` .. py:method:: get_permission_levels(serving_endpoint_id: str) -> GetServingEndpointPermissionLevelsResponse @@ -136,6 +135,27 @@ :returns: :class:`ServingEndpointPermissions` + .. py:method:: http_request(connection_name: str, method: ExternalFunctionRequestHttpMethod, path: str [, headers: Optional[str], json: Optional[str], params: Optional[str]]) -> ExternalFunctionResponse + + Make external services call using the credentials stored in UC Connection. + + :param connection_name: str + The connection name to use. This is required to identify the external connection. + :param method: :class:`ExternalFunctionRequestHttpMethod` + The HTTP method to use (e.g., 'GET', 'POST'). + :param path: str + The relative path for the API endpoint. This is required. + :param headers: str (optional) + Additional headers for the request. If not provided, only auth headers from connections would be + passed. + :param json: str (optional) + The JSON payload to send in the request body. + :param params: str (optional) + Query parameters for the request. + + :returns: :class:`ExternalFunctionResponse` + + .. py:method:: list() -> Iterator[ServingEndpoint] Get all serving endpoints. @@ -157,7 +177,7 @@ :returns: :class:`ServerLogsResponse` - .. py:method:: patch(name: str [, add_tags: Optional[List[EndpointTag]], delete_tags: Optional[List[str]]]) -> Iterator[EndpointTag] + .. py:method:: patch(name: str [, add_tags: Optional[List[EndpointTag]], delete_tags: Optional[List[str]]]) -> EndpointTags Update tags of a serving endpoint. @@ -170,7 +190,7 @@ :param delete_tags: List[str] (optional) List of tag keys to delete - :returns: Iterator over :class:`EndpointTag` + :returns: :class:`EndpointTags` .. py:method:: put(name: str [, rate_limits: Optional[List[RateLimit]]]) -> PutResponse @@ -192,8 +212,8 @@ Update AI Gateway of a serving endpoint. - Used to update the AI Gateway of a serving endpoint. NOTE: Only external model endpoints are currently - supported. + Used to update the AI Gateway of a serving endpoint. NOTE: Only external model and provisioned + throughput endpoints are currently supported. :param name: str The name of the serving endpoint whose AI Gateway is being updated. This field is required. @@ -288,14 +308,16 @@ The name of the serving endpoint to update. This field is required. :param auto_capture_config: :class:`AutoCaptureConfigInput` (optional) Configuration for Inference Tables which automatically logs requests and responses to Unity Catalog. + Note: this field is deprecated for creating new provisioned throughput endpoints, or updating + existing provisioned throughput endpoints that never have inference table configured; in these cases + please use AI Gateway to manage inference tables. :param served_entities: List[:class:`ServedEntityInput`] (optional) - A list of served entities for the endpoint to serve. A serving endpoint can have up to 15 served - entities. + The list of served entities under the serving endpoint config. :param served_models: List[:class:`ServedModelInput`] (optional) - (Deprecated, use served_entities instead) A list of served models for the endpoint to serve. A - serving endpoint can have up to 15 served models. + (Deprecated, use served_entities instead) The list of served models under the serving endpoint + config. :param traffic_config: :class:`TrafficConfig` (optional) - The traffic config defining how invocations to the serving endpoint should be routed. + The traffic configuration associated with the serving endpoint config. :returns: Long-running operation waiter for :class:`ServingEndpointDetailed`.