{"library":"mypy-boto3-sagemaker-runtime","title":"mypy-boto3-sagemaker-runtime Type Stubs","description":"This package provides type annotations for the `boto3` SageMaker Runtime service, generated by `mypy-boto3-builder`. It ensures type safety and autocompletion for `boto3.client('sagemaker-runtime')` operations in your Python projects. The library is actively maintained, with frequent releases that align closely with `boto3` and `botocore` updates.","language":"python","status":"active","last_verified":"Thu May 14","install":{"commands":["pip install mypy-boto3-sagemaker-runtime boto3 mypy"],"cli":null},"imports":["from mypy_boto3_sagemaker_runtime.client import SagemakerRuntimeClient","from mypy_boto3_sagemaker_runtime.type_defs import InvokeEndpointInputRequestTypeDef","from mypy_boto3_sagemaker_runtime.type_defs import InvokeEndpointOutputTypeDef"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import boto3\nfrom mypy_boto3_sagemaker_runtime.client import SagemakerRuntimeClient\nfrom mypy_boto3_sagemaker_runtime.type_defs import InvokeEndpointOutputTypeDef\nimport os\n\n# Get a type-hinted SageMaker Runtime client\nclient: SagemakerRuntimeClient = boto3.client(\"sagemaker-runtime\")\n\n# Example: Invoke a SageMaker endpoint\n# For a real use case, replace 'your-endpoint-name' with an actual endpoint\n# and 'application/json' with the correct ContentType for your model.\nendpoint_name = os.environ.get(\"SAGEMAKER_ENDPOINT_NAME\", \"your-endpoint-name\")\ncontent_type = \"application/json\"\nbody = b'{\"instances\": [[1.0, 2.0, 3.0]]}' # Example JSON payload\n\ntry:\n    # The response object is type-hinted by InvokeEndpointOutputTypeDef\n    response: InvokeEndpointOutputTypeDef = client.invoke_endpoint(\n        EndpointName=endpoint_name,\n        ContentType=content_type,\n        Body=body\n    )\n\n    # The 'Body' key in the response is a StreamingBody object\n    response_body = response['Body'].read().decode('utf-8')\n    print(f\"Successfully invoked endpoint '{endpoint_name}'.\")\n    print(f\"Response Status Code: {response['ResponseMetadata']['HTTPStatusCode']}\")\n    print(f\"Response Body: {response_body}\")\n\nexcept client.exceptions.ValidationError as e:\n    print(f\"Validation error: {e}\")\n    print(\"Please ensure 'SAGEMAKER_ENDPOINT_NAME' environment variable is set to a valid endpoint, and 'Body' matches its expected format.\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")\n    print(\"This might happen if the endpoint does not exist or credentials are not configured.\")","lang":"python","description":"Demonstrates how to obtain a type-hinted SageMaker Runtime client and use it to invoke an endpoint. It highlights the use of `SagemakerRuntimeClient` for the client and `InvokeEndpointOutputTypeDef` for the operation's response, ensuring type safety throughout the interaction.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-14","installed_version":"1.43.0","pypi_latest":"1.43.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":50,"avg_install_s":5.8,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"114.6M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":6.3,"import_time_s":null,"mem_mb":null,"disk_size":"113M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"120.7M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":5.7,"import_time_s":null,"mem_mb":null,"disk_size":"119M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"112.4M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":5.3,"import_time_s":null,"mem_mb":null,"disk_size":"111M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"112.3M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":5,"import_time_s":null,"mem_mb":null,"disk_size":"111M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"106.1M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":6.8,"import_time_s":null,"mem_mb":null,"disk_size":"105M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"mypy-boto3-sagemaker-runtime","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}