@aws-sdk/client-sagemaker-inference-router-runtime 0.0.0-stage → 3.1171.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +194 -2
- package/dist-cjs/index.js +643 -0
- package/dist-es/SageMakerInferenceRouterRuntime.js +11 -0
- package/dist-es/SageMakerInferenceRouterRuntimeClient.js +47 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +40 -0
- package/dist-es/commandBuilder.js +6 -0
- package/dist-es/commands/InvokeInferenceRouterAsyncCommand.js +4 -0
- package/dist-es/commands/InvokeInferenceRouterCommand.js +4 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/endpoint/EndpointParameters.js +13 -0
- package/dist-es/endpoint/bdd.js +48 -0
- package/dist-es/endpoint/endpointResolver.js +14 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +8 -0
- package/dist-es/models/SageMakerInferenceRouterRuntimeServiceException.js +9 -0
- package/dist-es/models/errors.js +149 -0
- package/dist-es/models/models_0.js +1 -0
- package/dist-es/runtimeConfig.browser.js +29 -0
- package/dist-es/runtimeConfig.js +44 -0
- package/dist-es/runtimeConfig.native.js +9 -0
- package/dist-es/runtimeConfig.shared.js +40 -0
- package/dist-es/runtimeExtensions.js +9 -0
- package/dist-es/schemas/schemas_0.js +157 -0
- package/dist-types/SageMakerInferenceRouterRuntime.d.ts +30 -0
- package/dist-types/SageMakerInferenceRouterRuntimeClient.d.ts +189 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/dist-types/commandBuilder.d.ts +18 -0
- package/dist-types/commands/InvokeInferenceRouterAsyncCommand.d.ts +101 -0
- package/dist-types/commands/InvokeInferenceRouterCommand.d.ts +142 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +50 -0
- package/dist-types/endpoint/bdd.d.ts +2 -0
- package/dist-types/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/extensionConfiguration.d.ts +9 -0
- package/dist-types/index.d.ts +16 -0
- package/dist-types/models/SageMakerInferenceRouterRuntimeServiceException.d.ts +15 -0
- package/dist-types/models/errors.d.ts +186 -0
- package/dist-types/models/models_0.d.ts +160 -0
- package/dist-types/runtimeConfig.browser.d.ts +57 -0
- package/dist-types/runtimeConfig.d.ts +58 -0
- package/dist-types/runtimeConfig.native.d.ts +56 -0
- package/dist-types/runtimeConfig.shared.d.ts +28 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/schemas/schemas_0.d.ts +24 -0
- package/dist-types/ts3.4/SageMakerInferenceRouterRuntime.d.ts +47 -0
- package/dist-types/ts3.4/SageMakerInferenceRouterRuntimeClient.d.ts +117 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +27 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +43 -0
- package/dist-types/ts3.4/commandBuilder.d.ts +40 -0
- package/dist-types/ts3.4/commands/InvokeInferenceRouterAsyncCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/InvokeInferenceRouterCommand.d.ts +52 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/endpoint/bdd.d.ts +2 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +10 -0
- package/dist-types/ts3.4/index.d.ts +11 -0
- package/dist-types/ts3.4/models/SageMakerInferenceRouterRuntimeServiceException.d.ts +10 -0
- package/dist-types/ts3.4/models/errors.d.ts +75 -0
- package/dist-types/ts3.4/models/models_0.d.ts +36 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +93 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +96 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +97 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +31 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/dist-types/ts3.4/schemas/schemas_0.d.ts +19 -0
- package/package.json +67 -4
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Uint8ArrayBlobAdapter } from "@smithy/core/serde";
|
|
2
|
+
import type { BlobPayloadInputTypes, MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
+
import type { InvokeInferenceRouterInput, InvokeInferenceRouterOutput } from "../models/models_0";
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type { __MetadataBearer };
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export type InvokeInferenceRouterCommandInputType = Omit<InvokeInferenceRouterInput, "Body"> & {
|
|
12
|
+
Body: BlobPayloadInputTypes;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*
|
|
17
|
+
* The input for {@link InvokeInferenceRouterCommand}.
|
|
18
|
+
*/
|
|
19
|
+
export interface InvokeInferenceRouterCommandInput extends InvokeInferenceRouterCommandInputType {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export type InvokeInferenceRouterCommandOutputType = Omit<InvokeInferenceRouterOutput, "Body"> & {
|
|
25
|
+
Body?: Uint8ArrayBlobAdapter;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @public
|
|
29
|
+
*
|
|
30
|
+
* The output of {@link InvokeInferenceRouterCommand}.
|
|
31
|
+
*/
|
|
32
|
+
export interface InvokeInferenceRouterCommandOutput extends InvokeInferenceRouterCommandOutputType, __MetadataBearer {
|
|
33
|
+
}
|
|
34
|
+
declare const InvokeInferenceRouterCommand_base: {
|
|
35
|
+
new (input: InvokeInferenceRouterCommandInput): import("@smithy/core/client").CommandImpl<InvokeInferenceRouterCommandInput, InvokeInferenceRouterCommandOutput, import("..").SageMakerInferenceRouterRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
36
|
+
new (input: InvokeInferenceRouterCommandInput): import("@smithy/core/client").CommandImpl<InvokeInferenceRouterCommandInput, InvokeInferenceRouterCommandOutput, import("..").SageMakerInferenceRouterRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
37
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* <p>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.</p> <p>The following limits apply:</p> <ul> <li> <p>The maximum request payload is 6 MB. A request with a larger body fails with HTTP status code 413.</p> </li> <li> <p>Your model has up to 60 seconds for each attempt, the same limit as <code>InvokeEndpoint</code>. If your account has a higher model execution timeout for <code>InvokeEndpoint</code>, it doesn't apply through an inference router. For models that take longer, use <code>InvokeInferenceRouterAsync</code>.</p> </li> </ul> <p>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.</p> <p>The caller needs permission to invoke the inference router and every destination of the routing target. For information about permissions, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/inference-router.html">Route requests across Regions with inference routers</a>.</p>
|
|
41
|
+
* @example
|
|
42
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
43
|
+
* ```javascript
|
|
44
|
+
* import { SageMakerInferenceRouterRuntimeClient, InvokeInferenceRouterCommand } from "@aws-sdk/client-sagemaker-inference-router-runtime"; // ES Modules import
|
|
45
|
+
* // const { SageMakerInferenceRouterRuntimeClient, InvokeInferenceRouterCommand } = require("@aws-sdk/client-sagemaker-inference-router-runtime"); // CommonJS import
|
|
46
|
+
* // import type { SageMakerInferenceRouterRuntimeClientConfig } from "@aws-sdk/client-sagemaker-inference-router-runtime";
|
|
47
|
+
* const config = {}; // type is SageMakerInferenceRouterRuntimeClientConfig
|
|
48
|
+
* const client = new SageMakerInferenceRouterRuntimeClient(config);
|
|
49
|
+
* const input = { // InvokeInferenceRouterInput
|
|
50
|
+
* InferenceRouterName: "STRING_VALUE", // required
|
|
51
|
+
* RoutingTargetName: "STRING_VALUE", // required
|
|
52
|
+
* ContentType: "STRING_VALUE",
|
|
53
|
+
* Accept: "STRING_VALUE",
|
|
54
|
+
* InferenceId: "STRING_VALUE",
|
|
55
|
+
* PrefixAwareId: "STRING_VALUE",
|
|
56
|
+
* CustomAttributes: "STRING_VALUE",
|
|
57
|
+
* Body: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required
|
|
58
|
+
* };
|
|
59
|
+
* const command = new InvokeInferenceRouterCommand(input);
|
|
60
|
+
* const response = await client.send(command);
|
|
61
|
+
* // { // InvokeInferenceRouterOutput
|
|
62
|
+
* // Body: new Uint8Array(),
|
|
63
|
+
* // ContentType: "STRING_VALUE",
|
|
64
|
+
* // InvokedRoutedResourceArn: "STRING_VALUE",
|
|
65
|
+
* // RoutingReason: "STRING_VALUE",
|
|
66
|
+
* // InvokedProductionVariant: "STRING_VALUE",
|
|
67
|
+
* // CustomAttributes: "STRING_VALUE",
|
|
68
|
+
* // };
|
|
69
|
+
*
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @param InvokeInferenceRouterCommandInput - {@link InvokeInferenceRouterCommandInput}
|
|
73
|
+
* @returns {@link InvokeInferenceRouterCommandOutput}
|
|
74
|
+
* @see {@link InvokeInferenceRouterCommandInput} for command's `input` shape.
|
|
75
|
+
* @see {@link InvokeInferenceRouterCommandOutput} for command's `response` shape.
|
|
76
|
+
* @see {@link SageMakerInferenceRouterRuntimeClientResolvedConfig | config} for SageMakerInferenceRouterRuntimeClient's `config` shape.
|
|
77
|
+
*
|
|
78
|
+
* @throws {@link AccessDeniedException} (client fault)
|
|
79
|
+
* <p>You don't have permission to perform this action. Check that the caller is allowed to invoke the inference router and every destination of the routing target.</p>
|
|
80
|
+
*
|
|
81
|
+
* @throws {@link InternalDependencyException} (server fault)
|
|
82
|
+
* <p>The request failed because of an error in an internal dependency. Retry the request with exponential backoff.</p>
|
|
83
|
+
*
|
|
84
|
+
* @throws {@link InternalFailure} (server fault)
|
|
85
|
+
* <p>An internal error occurred. Retry the request with exponential backoff. The Amazon Web Services SDKs and the Amazon Web Services CLI do this by default.</p>
|
|
86
|
+
*
|
|
87
|
+
* @throws {@link ModelError} (client fault)
|
|
88
|
+
* <p>The model in the destination that served the request returned an error. Check <code>OriginalStatusCode</code>, <code>OriginalMessage</code>, and the destination's logs in Amazon CloudWatch.</p>
|
|
89
|
+
*
|
|
90
|
+
* @throws {@link ModelNotReadyException} (client fault)
|
|
91
|
+
* <p>The destination isn't ready to serve the model, for example because an inference component has no copies. Retry the request later.</p>
|
|
92
|
+
*
|
|
93
|
+
* @throws {@link RequestTimeoutException} (client fault)
|
|
94
|
+
* <p>The inference router didn't receive the complete request within 300 seconds of accepting it, for example because of a very slow upload. Retry the request.</p>
|
|
95
|
+
*
|
|
96
|
+
* @throws {@link ServiceUnavailableException} (server fault)
|
|
97
|
+
* <p>The service is temporarily unavailable. For example, no destination of the routing target could serve the request, or a destination didn't respond. Retry the request with exponential backoff. The Amazon Web Services SDKs and the Amazon Web Services CLI do this by default.</p>
|
|
98
|
+
*
|
|
99
|
+
* @throws {@link ThrottlingException} (client fault)
|
|
100
|
+
* <p>The request was denied because you exceeded the request rate for the inference router, or because a destination throttled the request. Retry the request with exponential backoff.</p>
|
|
101
|
+
*
|
|
102
|
+
* @throws {@link ValidationException} (client fault)
|
|
103
|
+
* <p>The request isn't valid. Check the inference router name, the routing target name, and the request parameters, and then try again.</p>
|
|
104
|
+
*
|
|
105
|
+
* @throws {@link SageMakerInferenceRouterRuntimeServiceException}
|
|
106
|
+
* <p>Base exception class for all service exceptions from SageMakerInferenceRouterRuntime service.</p>
|
|
107
|
+
*
|
|
108
|
+
*
|
|
109
|
+
* @example Invoke an inference router
|
|
110
|
+
* ```javascript
|
|
111
|
+
* // The following example sends a JSON request to the my-target routing target of the my-router inference router. The response shows that a destination in the router's Region served the request.
|
|
112
|
+
* const input = {
|
|
113
|
+
* Body: `{"instances": [[1.0, 2.0, 5.0]]}`,
|
|
114
|
+
* ContentType: "application/json",
|
|
115
|
+
* InferenceRouterName: "my-router",
|
|
116
|
+
* RoutingTargetName: "my-target"
|
|
117
|
+
* };
|
|
118
|
+
* const command = new InvokeInferenceRouterCommand(input);
|
|
119
|
+
* const response = await client.send(command);
|
|
120
|
+
* /* response is
|
|
121
|
+
* {
|
|
122
|
+
* ContentType: "application/json",
|
|
123
|
+
* RoutingReason: "local-preferred"
|
|
124
|
+
* }
|
|
125
|
+
* *\/
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
export declare class InvokeInferenceRouterCommand extends InvokeInferenceRouterCommand_base {
|
|
131
|
+
/** @internal type navigation helper, not in runtime. */
|
|
132
|
+
protected static __types: {
|
|
133
|
+
api: {
|
|
134
|
+
input: InvokeInferenceRouterInput;
|
|
135
|
+
output: InvokeInferenceRouterOutput;
|
|
136
|
+
};
|
|
137
|
+
sdk: {
|
|
138
|
+
input: InvokeInferenceRouterCommandInput;
|
|
139
|
+
output: InvokeInferenceRouterCommandOutput;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export interface ClientInputEndpointParameters {
|
|
6
|
+
useDualstackEndpoint?: boolean | undefined | Provider<boolean | undefined>;
|
|
7
|
+
useFipsEndpoint?: boolean | undefined | Provider<boolean | undefined>;
|
|
8
|
+
endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;
|
|
9
|
+
region?: string | undefined | Provider<string | undefined>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export type ClientResolvedEndpointParameters = Omit<ClientInputEndpointParameters, "endpoint"> & {
|
|
15
|
+
defaultSigningName: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare const resolveClientEndpointParameters: <T>(options: T & ClientInputEndpointParameters) => T & ClientResolvedEndpointParameters;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare const commonParams: {
|
|
25
|
+
readonly UseFIPS: {
|
|
26
|
+
readonly type: "builtInParams";
|
|
27
|
+
readonly name: "useFipsEndpoint";
|
|
28
|
+
};
|
|
29
|
+
readonly Endpoint: {
|
|
30
|
+
readonly type: "builtInParams";
|
|
31
|
+
readonly name: "endpoint";
|
|
32
|
+
};
|
|
33
|
+
readonly Region: {
|
|
34
|
+
readonly type: "builtInParams";
|
|
35
|
+
readonly name: "region";
|
|
36
|
+
};
|
|
37
|
+
readonly UseDualStack: {
|
|
38
|
+
readonly type: "builtInParams";
|
|
39
|
+
readonly name: "useDualstackEndpoint";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export interface EndpointParameters extends __EndpointParameters {
|
|
46
|
+
UseDualStack?: boolean | undefined;
|
|
47
|
+
UseFIPS?: boolean | undefined;
|
|
48
|
+
Endpoint?: string | undefined;
|
|
49
|
+
Region?: string | undefined;
|
|
50
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EndpointV2, Logger } from "@smithy/types";
|
|
2
|
+
import type { EndpointParameters } from "./EndpointParameters";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare const defaultEndpointResolver: (endpointParams: EndpointParameters, context?: {
|
|
7
|
+
logger?: Logger;
|
|
8
|
+
}) => EndpointV2;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
|
|
2
|
+
import type { HttpHandlerExtensionConfiguration } from "@smithy/core/protocols";
|
|
3
|
+
import type { DefaultExtensionConfiguration } from "@smithy/types";
|
|
4
|
+
import type { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface SageMakerInferenceRouterRuntimeExtensionConfiguration extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, AwsRegionExtensionConfiguration, HttpAuthExtensionConfiguration {
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <p>Amazon SageMaker Inference Router Runtime is the runtime API for Amazon SageMaker AI inference routers. An inference router sends each request that you make to one of the destinations of a routing target. A destination is a SageMaker AI endpoint or inference component, in your account or in another account, in the router's Amazon Web Services Region or in another Region in the same Amazon Web Services partition. The router chooses a healthy destination with capacity, and prefers destinations in its own Region.</p> <p>Use <code>InvokeInferenceRouter</code> to get an inference in real time. Use <code>InvokeInferenceRouterAsync</code> to submit a request whose input and response are stored in Amazon S3.</p> <p>The inference router runtime endpoint supports HTTP/1.1 only. HTTP/2 isn't supported. If you use the Amazon Web Services SDKs or the Amazon Web Services CLI, you don't need to change anything.</p>
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export * from "./SageMakerInferenceRouterRuntimeClient";
|
|
7
|
+
export * from "./SageMakerInferenceRouterRuntime";
|
|
8
|
+
export type { ClientInputEndpointParameters } from "./endpoint/EndpointParameters";
|
|
9
|
+
export type { RuntimeExtension } from "./runtimeExtensions";
|
|
10
|
+
export type { SageMakerInferenceRouterRuntimeExtensionConfiguration } from "./extensionConfiguration";
|
|
11
|
+
export * from "./commands";
|
|
12
|
+
export { Command as $Command } from "@smithy/core/client";
|
|
13
|
+
export * from "./schemas/schemas_0";
|
|
14
|
+
export * from "./models/errors";
|
|
15
|
+
export * from "./models/models_0";
|
|
16
|
+
export { SageMakerInferenceRouterRuntimeServiceException } from "./models/SageMakerInferenceRouterRuntimeServiceException";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ServiceExceptionOptions as __ServiceExceptionOptions, ServiceException as __ServiceException } from "@smithy/core/client";
|
|
2
|
+
export type { __ServiceExceptionOptions };
|
|
3
|
+
export { __ServiceException };
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*
|
|
7
|
+
* Base exception class for all service exceptions from SageMakerInferenceRouterRuntime service.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SageMakerInferenceRouterRuntimeServiceException extends __ServiceException {
|
|
10
|
+
static readonly shapeId: string;
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
constructor(options: __ServiceExceptionOptions);
|
|
15
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { ExceptionOptionType as __ExceptionOptionType } from "@smithy/core/client";
|
|
2
|
+
import { SageMakerInferenceRouterRuntimeServiceException as __BaseException } from "./SageMakerInferenceRouterRuntimeServiceException";
|
|
3
|
+
/**
|
|
4
|
+
* <p>You don't have permission to perform this action. Check that the caller is allowed to invoke the inference router and every destination of the routing target.</p>
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare class AccessDeniedException extends __BaseException {
|
|
8
|
+
static readonly shapeId: string;
|
|
9
|
+
readonly name: "AccessDeniedException";
|
|
10
|
+
readonly $fault: "client";
|
|
11
|
+
/**
|
|
12
|
+
* <p>A message that describes the error.</p>
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
Message?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
constructor(opts: __ExceptionOptionType<AccessDeniedException, __BaseException>);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* <p>The request failed because of an error in an internal dependency. Retry the request with exponential backoff.</p>
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare class InternalDependencyException extends __BaseException {
|
|
26
|
+
static readonly shapeId: string;
|
|
27
|
+
readonly name: "InternalDependencyException";
|
|
28
|
+
readonly $fault: "server";
|
|
29
|
+
/**
|
|
30
|
+
* <p>A message that describes the error.</p>
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
Message?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
constructor(opts: __ExceptionOptionType<InternalDependencyException, __BaseException>);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* <p>An internal error occurred. Retry the request with exponential backoff. The Amazon Web Services SDKs and the Amazon Web Services CLI do this by default.</p>
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export declare class InternalFailure extends __BaseException {
|
|
44
|
+
static readonly shapeId: string;
|
|
45
|
+
readonly name: "InternalFailure";
|
|
46
|
+
readonly $fault: "server";
|
|
47
|
+
/**
|
|
48
|
+
* <p>A message that describes the error.</p>
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
Message?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
constructor(opts: __ExceptionOptionType<InternalFailure, __BaseException>);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* <p>The model in the destination that served the request returned an error. Check <code>OriginalStatusCode</code>, <code>OriginalMessage</code>, and the destination's logs in Amazon CloudWatch.</p>
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export declare class ModelError extends __BaseException {
|
|
62
|
+
static readonly shapeId: string;
|
|
63
|
+
readonly name: "ModelError";
|
|
64
|
+
readonly $fault: "client";
|
|
65
|
+
/**
|
|
66
|
+
* <p>A message that describes the error.</p>
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
Message?: string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* <p>The HTTP status code that the model container returned.</p>
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
OriginalStatusCode?: number | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* <p>The error message that the model container returned.</p>
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
OriginalMessage?: string | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* <p>The Amazon Resource Name (ARN) of the Amazon CloudWatch log stream for the destination that served the request.</p>
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
LogStreamArn?: string | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
constructor(opts: __ExceptionOptionType<ModelError, __BaseException>);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* <p>The destination isn't ready to serve the model, for example because an inference component has no copies. Retry the request later.</p>
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
export declare class ModelNotReadyException extends __BaseException {
|
|
95
|
+
static readonly shapeId: string;
|
|
96
|
+
readonly name: "ModelNotReadyException";
|
|
97
|
+
readonly $fault: "client";
|
|
98
|
+
$retryable: {
|
|
99
|
+
throttling: boolean;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* <p>A message that describes the error.</p>
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
Message?: string | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
constructor(opts: __ExceptionOptionType<ModelNotReadyException, __BaseException>);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* <p>The inference router didn't receive the complete request within 300 seconds of accepting it, for example because of a very slow upload. Retry the request.</p>
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
export declare class RequestTimeoutException extends __BaseException {
|
|
116
|
+
static readonly shapeId: string;
|
|
117
|
+
readonly name: "RequestTimeoutException";
|
|
118
|
+
readonly $fault: "client";
|
|
119
|
+
$retryable: {};
|
|
120
|
+
/**
|
|
121
|
+
* <p>A message that describes the error.</p>
|
|
122
|
+
* @public
|
|
123
|
+
*/
|
|
124
|
+
Message?: string | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
constructor(opts: __ExceptionOptionType<RequestTimeoutException, __BaseException>);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* <p>The service is temporarily unavailable. For example, no destination of the routing target could serve the request, or a destination didn't respond. Retry the request with exponential backoff. The Amazon Web Services SDKs and the Amazon Web Services CLI do this by default.</p>
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
export declare class ServiceUnavailableException extends __BaseException {
|
|
135
|
+
static readonly shapeId: string;
|
|
136
|
+
readonly name: "ServiceUnavailableException";
|
|
137
|
+
readonly $fault: "server";
|
|
138
|
+
/**
|
|
139
|
+
* <p>A message that describes the error.</p>
|
|
140
|
+
* @public
|
|
141
|
+
*/
|
|
142
|
+
Message?: string | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
constructor(opts: __ExceptionOptionType<ServiceUnavailableException, __BaseException>);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* <p>The request was denied because you exceeded the request rate for the inference router, or because a destination throttled the request. Retry the request with exponential backoff.</p>
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
export declare class ThrottlingException extends __BaseException {
|
|
153
|
+
static readonly shapeId: string;
|
|
154
|
+
readonly name: "ThrottlingException";
|
|
155
|
+
readonly $fault: "client";
|
|
156
|
+
$retryable: {
|
|
157
|
+
throttling: boolean;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* <p>A message that describes the error.</p>
|
|
161
|
+
* @public
|
|
162
|
+
*/
|
|
163
|
+
Message?: string | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* <p>The request isn't valid. Check the inference router name, the routing target name, and the request parameters, and then try again.</p>
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
export declare class ValidationException extends __BaseException {
|
|
174
|
+
static readonly shapeId: string;
|
|
175
|
+
readonly name: "ValidationException";
|
|
176
|
+
readonly $fault: "client";
|
|
177
|
+
/**
|
|
178
|
+
* <p>A message that describes the error.</p>
|
|
179
|
+
* @public
|
|
180
|
+
*/
|
|
181
|
+
Message?: string | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* @internal
|
|
184
|
+
*/
|
|
185
|
+
constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>);
|
|
186
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
*/
|
|
4
|
+
export interface InvokeInferenceRouterInput {
|
|
5
|
+
/**
|
|
6
|
+
* <p>The name of the inference router to invoke.</p>
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
InferenceRouterName: string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* <p>The name of the routing target in the inference router. The routing target lists the destinations that can serve the request.</p>
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
RoutingTargetName: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* <p>The MIME type of the input data in the request body. The router passes it to the destination.</p>
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
ContentType?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* <p>The MIME type that you want for the inference response. The router passes it to the destination.</p>
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
Accept?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* <p>An identifier for the inference request. The router passes it to the destination.</p>
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
InferenceId?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* <p>An optional, stable identifier that serves as a routing hint for prefix-aware routing. The router passes it to the destination that serves the request. Within that destination, requests with the same prefix and the same identifier go to the same instance. If requests from different applications might have the same prompt prefix, set a different identifier for each application to differentiate their routing decisions.</p> <p>Applies only to destination endpoints configured with a <code>RoutingStrategy</code> of <code>PREFIX_AWARE</code>.</p>
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
PrefixAwareId?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* <p>Provides additional information about the inference request. The value is an opaque string that the router passes, unchanged, to the model container of the destination that serves the request. The value can contain up to 1,024 visible US-ASCII characters.</p>
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
CustomAttributes?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* <p>The input data for the inference, in the format that your model expects. The body can't be empty.</p>
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
Body: Uint8Array | undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export interface InvokeInferenceRouterOutput {
|
|
50
|
+
/**
|
|
51
|
+
* <p>The inference that the model returned.</p>
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
Body?: Uint8Array | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* <p>The MIME type of the inference returned in the response body.</p>
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
ContentType?: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* <p>The Amazon Resource Name (ARN) of the endpoint or inference component that served the request.</p>
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
InvokedRoutedResourceArn?: string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* <p>The reason that the router chose the destination that served the request. Possible values:</p> <ul> <li> <p> <code>local-preferred</code> – The destination is a healthy destination in the router's Region.</p> </li> <li> <p> <code>capacity-available</code> – No destination in the router's Region could take the request, and two or more destinations in other Regions could.</p> </li> <li> <p> <code>only-healthy</code> – No destination in the router's Region could take the request, and exactly one destination in another Region could.</p> </li> <li> <p> <code>failover</code> – The router moved the request away from destinations in its Region because they were overloaded or returning errors. You also see this value when the router can't assess destination health, and when no destination is healthy and the router tries one anyway.</p> </li> </ul>
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
RoutingReason?: string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* <p>The production variant of the destination endpoint that served the request.</p>
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
InvokedProductionVariant?: string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* <p>Provides additional information in the response about the inference. This is the value that the model container of the destination returned, unchanged.</p>
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
CustomAttributes?: string | undefined;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
export interface InvokeInferenceRouterAsyncInput {
|
|
85
|
+
/**
|
|
86
|
+
* <p>The name of the inference router to invoke.</p>
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
InferenceRouterName: string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* <p>The name of the routing target in the inference router. The routing target must be configured for asynchronous inference.</p>
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
RoutingTargetName: string | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* <p>The MIME type of the input data in Amazon S3. The router passes it to the destination.</p>
|
|
97
|
+
* @public
|
|
98
|
+
*/
|
|
99
|
+
ContentType?: string | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* <p>The MIME type that you want for the inference response. The router passes it to the destination.</p>
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
Accept?: string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* <p>Provides additional information about the inference request. The value is an opaque string that the router passes, unchanged, to the model container of the destination that serves the request. The value can contain up to 1,024 visible US-ASCII characters.</p>
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
CustomAttributes?: string | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* <p>An identifier for the inference request. If you don't provide one, SageMaker AI generates one and returns it in the response.</p>
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
InferenceId?: string | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* <p>The Amazon S3 URI of the object that contains the input data for the inference. The bucket must be in the inference router's Amazon Web Services Region and owned by the router's account. The destination endpoint's execution role reads the object, and the destination's asynchronous inference limits apply to it.</p>
|
|
117
|
+
* @public
|
|
118
|
+
*/
|
|
119
|
+
InputLocation: string | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* <p>The path extension that is appended to the routing target's Amazon S3 output path where the inference response is stored.</p>
|
|
122
|
+
* @public
|
|
123
|
+
*/
|
|
124
|
+
S3OutputPathExtension?: string | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* <p>The file name of the inference response stored in Amazon S3. If you don't provide one, SageMaker AI generates one.</p>
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
Filename?: string | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* <p>The time to live of the request, in seconds, measured from when the router accepts it. If no destination starts the request in this time, the request fails. The default is 21,600 seconds (6 hours).</p>
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
RequestTTLSeconds?: number | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* <p>The maximum time, in seconds, that a destination can spend processing the request before the request is marked as expired. The default is 900 seconds (15 minutes).</p>
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
InvocationTimeoutSeconds?: number | undefined;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
144
|
+
export interface InvokeInferenceRouterAsyncOutput {
|
|
145
|
+
/**
|
|
146
|
+
* <p>The identifier for the inference request. This is the <code>InferenceId</code> that you provided, or the one that SageMaker AI generated.</p>
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
149
|
+
InferenceId?: string | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* <p>The Amazon S3 URI where the inference response is written. The location doesn't change if the router moves the request to another destination.</p>
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
154
|
+
OutputLocation?: string | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* <p>The Amazon S3 URI where the failure details are written if the inference fails.</p>
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
159
|
+
FailureLocation?: string | undefined;
|
|
160
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FetchHttpHandler as RequestHandler } from "@smithy/fetch-http-handler";
|
|
2
|
+
import type { SageMakerInferenceRouterRuntimeClientConfig } from "./SageMakerInferenceRouterRuntimeClient";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare const getRuntimeConfig: (config: SageMakerInferenceRouterRuntimeClientConfig) => {
|
|
7
|
+
cacheMiddleware?: boolean;
|
|
8
|
+
endpoint?: ((string | import("@smithy/types").Endpoint | import("@smithy/types").EndpointV2 | import("@smithy/types").Provider<import("@smithy/types").Endpoint> | import("@smithy/types").Provider<import("@smithy/types").EndpointV2>) & (string | import("@smithy/types").Endpoint | import("@smithy/types").EndpointV2 | import("@smithy/types").Provider<string> | import("@smithy/types").Provider<import("@smithy/types").Endpoint> | import("@smithy/types").Provider<import("@smithy/types").EndpointV2>)) | undefined;
|
|
9
|
+
tls?: boolean;
|
|
10
|
+
ignoreConfiguredEndpointUrls?: boolean;
|
|
11
|
+
serviceConfiguredEndpoint?: never;
|
|
12
|
+
customUserAgent?: string | import("@smithy/types").UserAgent;
|
|
13
|
+
userAgentAppId?: string | undefined | import("@smithy/types").Provider<string | undefined>;
|
|
14
|
+
retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2;
|
|
15
|
+
credentials?: import("@smithy/types").AwsCredentialIdentity | import("@smithy/types").AwsCredentialIdentityProvider;
|
|
16
|
+
signer?: import("@smithy/types").RequestSigner | ((authScheme?: import("@smithy/types").AuthScheme) => Promise<import("@smithy/types").RequestSigner>);
|
|
17
|
+
signingEscapePath?: boolean;
|
|
18
|
+
systemClockOffset?: number;
|
|
19
|
+
signingRegion?: string;
|
|
20
|
+
signerConstructor?: new (options: import("@smithy/signature-v4").SignatureV4Init & import("@smithy/signature-v4").SignatureV4CryptoInit) => import("@smithy/types").RequestSigner;
|
|
21
|
+
disableClockSkewCorrection?: boolean | import("@smithy/types").Provider<boolean>;
|
|
22
|
+
authSchemePreference?: string[] | import("@smithy/types").Provider<string[]>;
|
|
23
|
+
apiVersion: string;
|
|
24
|
+
base64Decoder: import("@smithy/types").Decoder;
|
|
25
|
+
base64Encoder: (_input: Uint8Array | string) => string;
|
|
26
|
+
disableHostPrefix: boolean;
|
|
27
|
+
endpointProvider: (params: import("./endpoint/EndpointParameters").EndpointParameters, context?: {
|
|
28
|
+
logger?: import("@smithy/types").Logger;
|
|
29
|
+
}) => import("@smithy/types").EndpointV2;
|
|
30
|
+
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
31
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").SageMakerInferenceRouterRuntimeHttpAuthSchemeProvider;
|
|
32
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
33
|
+
logger: import("@smithy/types").Logger;
|
|
34
|
+
protocol: import("@smithy/types").$ClientProtocol<any, any> | import("@smithy/types").$ClientProtocolCtor<any, any> | typeof import("@aws-sdk/core/protocols").AwsRestJsonProtocol;
|
|
35
|
+
protocolSettings: {
|
|
36
|
+
[setting: string]: unknown;
|
|
37
|
+
defaultNamespace?: string;
|
|
38
|
+
};
|
|
39
|
+
serviceId: string;
|
|
40
|
+
sha256: import("@smithy/types").HashConstructor;
|
|
41
|
+
urlParser: import("@smithy/types").UrlParser;
|
|
42
|
+
utf8Decoder: import("@smithy/types").Decoder;
|
|
43
|
+
utf8Encoder: (input: Uint8Array | string) => string;
|
|
44
|
+
profile?: string;
|
|
45
|
+
runtime: string;
|
|
46
|
+
defaultsMode: import("@smithy/types").Provider<import("@smithy/core/client").ResolvedDefaultsMode>;
|
|
47
|
+
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
48
|
+
credentialDefaultProvider: ((input: any) => import("@smithy/types").AwsCredentialIdentityProvider) | ((_: unknown) => () => Promise<import("@smithy/types").AwsCredentialIdentity>);
|
|
49
|
+
defaultUserAgentProvider: (config?: import("@aws-sdk/core/client").PreviouslyResolved) => Promise<import("@smithy/types").UserAgent>;
|
|
50
|
+
maxAttempts: number | import("@smithy/types").Provider<number>;
|
|
51
|
+
region: string | import("@smithy/types").Provider<any>;
|
|
52
|
+
requestHandler: RequestHandler | import("@smithy/core/protocols").HttpHandler<any>;
|
|
53
|
+
retryMode: string | import("@smithy/types").Provider<string>;
|
|
54
|
+
streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
|
|
55
|
+
useDualstackEndpoint: boolean | (() => Promise<boolean>);
|
|
56
|
+
useFipsEndpoint: boolean | (() => Promise<boolean>);
|
|
57
|
+
};
|