You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* <p>Invokes the specified Bedrock model to run inference using the input provided in the request body.
51
-
* You use InvokeModel to run inference for text models, image models, and embedding models.</p>
52
-
* <p>For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
53
-
* <p>For example requests, see Examples (after the Errors section).</p>
50
+
* <p>Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body.
51
+
* You use model inference to generate text, images, and embeddings.</p>
52
+
* <p>For example code, see <i>Invoke model code examples</i> in the <i>Amazon Bedrock User Guide</i>.
53
+
* </p>
54
+
* <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action.</p>
54
55
* @example
55
56
* Use a bare-bones client and the command you need to make an API call.
* <p>Invoke the specified Bedrock model to run inference using the input provided.
48
-
* Return the response in a stream.</p>
49
-
* <p>For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
50
-
* <p>For an example request and response, see Examples (after the Errors section).</p>
47
+
* <p>Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream.</p>
48
+
* <p>To see if a model supports streaming, call <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html">GetFoundationModel</a>
49
+
* and check the <code>responseStreamingSupported</code> field in the response.</p>
50
+
* <note>
51
+
* <p>The CLI doesn't support <code>InvokeModelWithResponseStream</code>.</p>
52
+
* </note>
53
+
* <p>For example code, see <i>Invoke model with streaming code
54
+
* example</i> in the <i>Amazon Bedrock User Guide</i>.
55
+
* </p>
56
+
* <p>This operation requires permissions to perform the <code>bedrock:InvokeModelWithResponseStream</code> action. </p>
51
57
* @example
52
58
* Use a bare-bones client and the command you need to make an API call.
@@ -43,12 +43,26 @@ export class InternalServerException extends __BaseException {
43
43
}
44
44
}
45
45
46
+
/**
47
+
* @public
48
+
* @enum
49
+
*/
50
+
exportconstTrace={
51
+
DISABLED: "DISABLED",
52
+
ENABLED: "ENABLED",
53
+
}asconst;
54
+
55
+
/**
56
+
* @public
57
+
*/
58
+
exporttypeTrace=(typeofTrace)[keyoftypeofTrace];
59
+
46
60
/**
47
61
* @public
48
62
*/
49
63
exportinterfaceInvokeModelRequest{
50
64
/**
51
-
* <p>Input data in the format specified in the content-type request header. To see the format and content of this field for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
65
+
* <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
* <p>The desired MIME type of the inference body in the response. The default value is
65
-
* <code>application/json</code>.</p>
78
+
* <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
66
79
* @public
67
80
*/
68
81
accept?: string;
69
82
70
83
/**
71
-
* <p>Identifier of the model. </p>
84
+
* <p>The unique identifier of the model to invoke to run inference.</p>
85
+
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
86
+
* <ul>
87
+
* <li>
88
+
* <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p>
89
+
* </li>
90
+
* <li>
91
+
* <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p>
92
+
* </li>
93
+
* <li>
94
+
* <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
95
+
* </li>
96
+
* </ul>
72
97
* @public
73
98
*/
74
99
modelId: string|undefined;
100
+
101
+
/**
102
+
* <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
103
+
* @public
104
+
*/
105
+
trace?: Trace;
106
+
107
+
/**
108
+
* <p>The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail is applied
109
+
* to the invocation.</p>
110
+
* <p>An error will be thrown in the following situations.</p>
111
+
* <ul>
112
+
* <li>
113
+
* <p>You don't provide a guardrail identifier but you specify the <code>amazon-bedrock-guardrailConfig</code> field in the request body.</p>
114
+
* </li>
115
+
* <li>
116
+
* <p>You enable the guardrail but the <code>contentType</code> isn't <code>application/json</code>.</p>
117
+
* </li>
118
+
* <li>
119
+
* <p>You provide a guardrail identifier, but <code>guardrailVersion</code> isn't specified.</p>
120
+
* </li>
121
+
* </ul>
122
+
* @public
123
+
*/
124
+
guardrailIdentifier?: string;
125
+
126
+
/**
127
+
* <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
128
+
* @public
129
+
*/
130
+
guardrailVersion?: string;
75
131
}
76
132
77
133
/**
78
134
* @public
79
135
*/
80
136
exportinterfaceInvokeModelResponse{
81
137
/**
82
-
* <p>Inference response from the model in the format specified in the content-type header field. To see the format and content of this field for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
138
+
* <p>Inference response from the model in the format specified in the <code>contentType</code> header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
83
139
* @public
84
140
*/
85
141
body: Uint8Array|undefined;
@@ -250,8 +306,7 @@ export class ValidationException extends __BaseException {
* <p>Inference input in the format specified by the
254
-
* content-type. To see the format and content of this field for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
309
+
* <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
* <p>Id of the model to invoke using the streaming request.</p>
329
+
* <p>The unique identifier of the model to invoke to run inference.</p>
330
+
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
331
+
* <ul>
332
+
* <li>
333
+
* <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p>
334
+
* </li>
335
+
* <li>
336
+
* <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p>
337
+
* </li>
338
+
* <li>
339
+
* <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
340
+
* </li>
341
+
* </ul>
275
342
* @public
276
343
*/
277
344
modelId: string|undefined;
345
+
346
+
/**
347
+
* <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
348
+
* @public
349
+
*/
350
+
trace?: Trace;
351
+
352
+
/**
353
+
* <p>The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail is applied
354
+
* to the invocation.</p>
355
+
* <p>An error is thrown in the following situations.</p>
356
+
* <ul>
357
+
* <li>
358
+
* <p>You don't provide a guardrail identifier but you specify the <code>amazon-bedrock-guardrailConfig</code> field in the request body.</p>
359
+
* </li>
360
+
* <li>
361
+
* <p>You enable the guardrail but the <code>contentType</code> isn't <code>application/json</code>.</p>
362
+
* </li>
363
+
* <li>
364
+
* <p>You provide a guardrail identifier, but <code>guardrailVersion</code> isn't specified.</p>
365
+
* </li>
366
+
* </ul>
367
+
* @public
368
+
*/
369
+
guardrailIdentifier?: string;
370
+
371
+
/**
372
+
* <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
* <p>Inference response from the model in the format specified by Content-Type. To see the format and content of this field for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
566
+
* <p>Inference response from the model in the format specified by the <code>contentType</code> header. To see the format and content of this field for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
0 commit comments