Class: Aws::SageMakerInferenceRouterRuntime::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::SageMakerInferenceRouterRuntime::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-sagemakerinferencerouterruntime/lib/aws-sdk-sagemakerinferencerouterruntime/client.rb
Overview
An API client for SageMakerInferenceRouterRuntime. To construct a client, you need to configure a :region and :credentials.
client = Aws::SageMakerInferenceRouterRuntime::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
API Operations collapse
-
#invoke_inference_router(params = {}) ⇒ Types::InvokeInferenceRouterOutput
Sends a real-time inference request to an inference router.
-
#invoke_inference_router_async(params = {}) ⇒ Types::InvokeInferenceRouterAsyncOutput
Submits an asynchronous inference request to an inference router.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
Methods included from ClientStubs
#api_requests, #stub_data, #stub_responses
Methods inherited from Seahorse::Client::Base
add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
479 480 481 |
# File 'gems/aws-sdk-sagemakerinferencerouterruntime/lib/aws-sdk-sagemakerinferencerouterruntime/client.rb', line 479 def initialize(*args) super end |
Instance Method Details
#invoke_inference_router(params = {}) ⇒ Types::InvokeInferenceRouterOutput
Sends a real-time inference request to an inference router. In the request, you name the routing target, and the router sends the request to one of the routing target's destinations. The response includes the destination that served the request and the reason that the router chose it.
The following limits apply:
The maximum request payload is 6 MB. A request with a larger body fails with HTTP status code 413.
Your model has up to 60 seconds for each attempt, the same limit as
InvokeEndpoint. If your account has a higher model execution timeout forInvokeEndpoint, it doesn't apply through an inference router. For models that take longer, useInvokeInferenceRouterAsync.
If a destination returns an error that the router can retry, such as a throttling error, before your model produces a response, the router retries the request once on another destination. A request that times out on a destination isn't retried. Because a request can make two attempts, set your client read timeout to at least 170 seconds.
The caller needs permission to invoke the inference router and every destination of the routing target. For information about permissions, see Route requests across Regions with inference routers.
611 612 613 614 |
# File 'gems/aws-sdk-sagemakerinferencerouterruntime/lib/aws-sdk-sagemakerinferencerouterruntime/client.rb', line 611 def invoke_inference_router(params = {}, = {}) req = build_request(:invoke_inference_router, params) req.send_request() end |
#invoke_inference_router_async(params = {}) ⇒ Types::InvokeInferenceRouterAsyncOutput
Submits an asynchronous inference request to an inference router. Before you call this operation, upload the input data to Amazon S3 in the router's Amazon Web Services Region. The router returns as soon as it accepts the request, and sends the request to one of the destinations of the routing target. The destination reads the input from Amazon S3, and the inference response is written to the Amazon S3 output path that the routing target specifies.
If a destination doesn't start the request within the routing
target's MaxTimeInBacklogSeconds, the router moves the request to
another destination. After your model starts processing the request,
the request doesn't move. If no destination can take the request
before RequestTTLSeconds runs out, or every destination has been
tried, the router writes a failure object to the FailureLocation and
publishes a notification to the routing target's error topic, if one
is configured.
For information about the permissions that the caller and each destination need, see Send asynchronous requests through an inference router.
723 724 725 726 |
# File 'gems/aws-sdk-sagemakerinferencerouterruntime/lib/aws-sdk-sagemakerinferencerouterruntime/client.rb', line 723 def invoke_inference_router_async(params = {}, = {}) req = build_request(:invoke_inference_router_async, params) req.send_request() end |