aws-sdk-bedrockruntime 1.8.0 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,34 +14,222 @@ module Aws::BedrockRuntime
14
14
  include Seahorse::Model
15
15
 
16
16
  AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
17
+ AnyToolChoice = Shapes::StructureShape.new(name: 'AnyToolChoice')
18
+ AutoToolChoice = Shapes::StructureShape.new(name: 'AutoToolChoice')
17
19
  Body = Shapes::BlobShape.new(name: 'Body')
20
+ ContentBlock = Shapes::UnionShape.new(name: 'ContentBlock')
21
+ ContentBlockDelta = Shapes::UnionShape.new(name: 'ContentBlockDelta')
22
+ ContentBlockDeltaEvent = Shapes::StructureShape.new(name: 'ContentBlockDeltaEvent')
23
+ ContentBlockStart = Shapes::UnionShape.new(name: 'ContentBlockStart')
24
+ ContentBlockStartEvent = Shapes::StructureShape.new(name: 'ContentBlockStartEvent')
25
+ ContentBlockStopEvent = Shapes::StructureShape.new(name: 'ContentBlockStopEvent')
26
+ ContentBlocks = Shapes::ListShape.new(name: 'ContentBlocks')
27
+ ConversationRole = Shapes::StringShape.new(name: 'ConversationRole')
28
+ ConversationalModelId = Shapes::StringShape.new(name: 'ConversationalModelId')
29
+ ConverseMetrics = Shapes::StructureShape.new(name: 'ConverseMetrics')
30
+ ConverseOutput = Shapes::UnionShape.new(name: 'ConverseOutput')
31
+ ConverseRequest = Shapes::StructureShape.new(name: 'ConverseRequest')
32
+ ConverseRequestAdditionalModelResponseFieldPathsList = Shapes::ListShape.new(name: 'ConverseRequestAdditionalModelResponseFieldPathsList')
33
+ ConverseRequestAdditionalModelResponseFieldPathsListMemberString = Shapes::StringShape.new(name: 'ConverseRequestAdditionalModelResponseFieldPathsListMemberString')
34
+ ConverseResponse = Shapes::StructureShape.new(name: 'ConverseResponse')
35
+ ConverseStreamMetadataEvent = Shapes::StructureShape.new(name: 'ConverseStreamMetadataEvent')
36
+ ConverseStreamMetrics = Shapes::StructureShape.new(name: 'ConverseStreamMetrics')
37
+ ConverseStreamOutput = Shapes::StructureShape.new(name: 'ConverseStreamOutput')
38
+ ConverseStreamRequest = Shapes::StructureShape.new(name: 'ConverseStreamRequest')
39
+ ConverseStreamRequestAdditionalModelResponseFieldPathsList = Shapes::ListShape.new(name: 'ConverseStreamRequestAdditionalModelResponseFieldPathsList')
40
+ ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString = Shapes::StringShape.new(name: 'ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString')
41
+ ConverseStreamResponse = Shapes::StructureShape.new(name: 'ConverseStreamResponse')
42
+ Document = Shapes::DocumentShape.new(name: 'Document', document: true)
18
43
  GuardrailIdentifier = Shapes::StringShape.new(name: 'GuardrailIdentifier')
19
44
  GuardrailVersion = Shapes::StringShape.new(name: 'GuardrailVersion')
45
+ ImageBlock = Shapes::StructureShape.new(name: 'ImageBlock')
46
+ ImageFormat = Shapes::StringShape.new(name: 'ImageFormat')
47
+ ImageSource = Shapes::UnionShape.new(name: 'ImageSource')
48
+ ImageSourceBytesBlob = Shapes::BlobShape.new(name: 'ImageSourceBytesBlob')
49
+ InferenceConfiguration = Shapes::StructureShape.new(name: 'InferenceConfiguration')
50
+ InferenceConfigurationMaxTokensInteger = Shapes::IntegerShape.new(name: 'InferenceConfigurationMaxTokensInteger')
51
+ InferenceConfigurationStopSequencesList = Shapes::ListShape.new(name: 'InferenceConfigurationStopSequencesList')
52
+ InferenceConfigurationTemperatureFloat = Shapes::FloatShape.new(name: 'InferenceConfigurationTemperatureFloat')
53
+ InferenceConfigurationTopPFloat = Shapes::FloatShape.new(name: 'InferenceConfigurationTopPFloat')
20
54
  InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
21
55
  InvokeModelIdentifier = Shapes::StringShape.new(name: 'InvokeModelIdentifier')
22
56
  InvokeModelRequest = Shapes::StructureShape.new(name: 'InvokeModelRequest')
23
57
  InvokeModelResponse = Shapes::StructureShape.new(name: 'InvokeModelResponse')
24
58
  InvokeModelWithResponseStreamRequest = Shapes::StructureShape.new(name: 'InvokeModelWithResponseStreamRequest')
25
59
  InvokeModelWithResponseStreamResponse = Shapes::StructureShape.new(name: 'InvokeModelWithResponseStreamResponse')
60
+ Long = Shapes::IntegerShape.new(name: 'Long')
61
+ Message = Shapes::StructureShape.new(name: 'Message')
62
+ MessageStartEvent = Shapes::StructureShape.new(name: 'MessageStartEvent')
63
+ MessageStopEvent = Shapes::StructureShape.new(name: 'MessageStopEvent')
64
+ Messages = Shapes::ListShape.new(name: 'Messages')
26
65
  MimeType = Shapes::StringShape.new(name: 'MimeType')
27
66
  ModelErrorException = Shapes::StructureShape.new(name: 'ModelErrorException')
28
67
  ModelNotReadyException = Shapes::StructureShape.new(name: 'ModelNotReadyException')
29
68
  ModelStreamErrorException = Shapes::StructureShape.new(name: 'ModelStreamErrorException')
30
69
  ModelTimeoutException = Shapes::StructureShape.new(name: 'ModelTimeoutException')
31
70
  NonBlankString = Shapes::StringShape.new(name: 'NonBlankString')
71
+ NonEmptyString = Shapes::StringShape.new(name: 'NonEmptyString')
72
+ NonNegativeInteger = Shapes::IntegerShape.new(name: 'NonNegativeInteger')
32
73
  PartBody = Shapes::BlobShape.new(name: 'PartBody')
33
74
  PayloadPart = Shapes::StructureShape.new(name: 'PayloadPart')
34
75
  ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
35
76
  ResponseStream = Shapes::StructureShape.new(name: 'ResponseStream')
36
77
  ServiceQuotaExceededException = Shapes::StructureShape.new(name: 'ServiceQuotaExceededException')
78
+ SpecificToolChoice = Shapes::StructureShape.new(name: 'SpecificToolChoice')
37
79
  StatusCode = Shapes::IntegerShape.new(name: 'StatusCode')
80
+ StopReason = Shapes::StringShape.new(name: 'StopReason')
81
+ String = Shapes::StringShape.new(name: 'String')
82
+ SystemContentBlock = Shapes::UnionShape.new(name: 'SystemContentBlock')
83
+ SystemContentBlocks = Shapes::ListShape.new(name: 'SystemContentBlocks')
38
84
  ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
85
+ TokenUsage = Shapes::StructureShape.new(name: 'TokenUsage')
86
+ TokenUsageInputTokensInteger = Shapes::IntegerShape.new(name: 'TokenUsageInputTokensInteger')
87
+ TokenUsageOutputTokensInteger = Shapes::IntegerShape.new(name: 'TokenUsageOutputTokensInteger')
88
+ TokenUsageTotalTokensInteger = Shapes::IntegerShape.new(name: 'TokenUsageTotalTokensInteger')
89
+ Tool = Shapes::UnionShape.new(name: 'Tool')
90
+ ToolChoice = Shapes::UnionShape.new(name: 'ToolChoice')
91
+ ToolConfiguration = Shapes::StructureShape.new(name: 'ToolConfiguration')
92
+ ToolConfigurationToolsList = Shapes::ListShape.new(name: 'ToolConfigurationToolsList')
93
+ ToolInputSchema = Shapes::UnionShape.new(name: 'ToolInputSchema')
94
+ ToolName = Shapes::StringShape.new(name: 'ToolName')
95
+ ToolResultBlock = Shapes::StructureShape.new(name: 'ToolResultBlock')
96
+ ToolResultContentBlock = Shapes::UnionShape.new(name: 'ToolResultContentBlock')
97
+ ToolResultContentBlocks = Shapes::ListShape.new(name: 'ToolResultContentBlocks')
98
+ ToolResultStatus = Shapes::StringShape.new(name: 'ToolResultStatus')
99
+ ToolSpecification = Shapes::StructureShape.new(name: 'ToolSpecification')
100
+ ToolUseBlock = Shapes::StructureShape.new(name: 'ToolUseBlock')
101
+ ToolUseBlockDelta = Shapes::StructureShape.new(name: 'ToolUseBlockDelta')
102
+ ToolUseBlockStart = Shapes::StructureShape.new(name: 'ToolUseBlockStart')
103
+ ToolUseId = Shapes::StringShape.new(name: 'ToolUseId')
39
104
  Trace = Shapes::StringShape.new(name: 'Trace')
40
105
  ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
41
106
 
42
107
  AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
43
108
  AccessDeniedException.struct_class = Types::AccessDeniedException
44
109
 
110
+ AnyToolChoice.struct_class = Types::AnyToolChoice
111
+
112
+ AutoToolChoice.struct_class = Types::AutoToolChoice
113
+
114
+ ContentBlock.add_member(:text, Shapes::ShapeRef.new(shape: String, location_name: "text"))
115
+ ContentBlock.add_member(:image, Shapes::ShapeRef.new(shape: ImageBlock, location_name: "image"))
116
+ ContentBlock.add_member(:tool_use, Shapes::ShapeRef.new(shape: ToolUseBlock, location_name: "toolUse"))
117
+ ContentBlock.add_member(:tool_result, Shapes::ShapeRef.new(shape: ToolResultBlock, location_name: "toolResult"))
118
+ ContentBlock.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
119
+ ContentBlock.add_member_subclass(:text, Types::ContentBlock::Text)
120
+ ContentBlock.add_member_subclass(:image, Types::ContentBlock::Image)
121
+ ContentBlock.add_member_subclass(:tool_use, Types::ContentBlock::ToolUse)
122
+ ContentBlock.add_member_subclass(:tool_result, Types::ContentBlock::ToolResult)
123
+ ContentBlock.add_member_subclass(:unknown, Types::ContentBlock::Unknown)
124
+ ContentBlock.struct_class = Types::ContentBlock
125
+
126
+ ContentBlockDelta.add_member(:text, Shapes::ShapeRef.new(shape: String, location_name: "text"))
127
+ ContentBlockDelta.add_member(:tool_use, Shapes::ShapeRef.new(shape: ToolUseBlockDelta, location_name: "toolUse"))
128
+ ContentBlockDelta.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
129
+ ContentBlockDelta.add_member_subclass(:text, Types::ContentBlockDelta::Text)
130
+ ContentBlockDelta.add_member_subclass(:tool_use, Types::ContentBlockDelta::ToolUse)
131
+ ContentBlockDelta.add_member_subclass(:unknown, Types::ContentBlockDelta::Unknown)
132
+ ContentBlockDelta.struct_class = Types::ContentBlockDelta
133
+
134
+ ContentBlockDeltaEvent.add_member(:delta, Shapes::ShapeRef.new(shape: ContentBlockDelta, required: true, location_name: "delta"))
135
+ ContentBlockDeltaEvent.add_member(:content_block_index, Shapes::ShapeRef.new(shape: NonNegativeInteger, required: true, location_name: "contentBlockIndex"))
136
+ ContentBlockDeltaEvent.struct_class = Types::ContentBlockDeltaEvent
137
+
138
+ ContentBlockStart.add_member(:tool_use, Shapes::ShapeRef.new(shape: ToolUseBlockStart, location_name: "toolUse"))
139
+ ContentBlockStart.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
140
+ ContentBlockStart.add_member_subclass(:tool_use, Types::ContentBlockStart::ToolUse)
141
+ ContentBlockStart.add_member_subclass(:unknown, Types::ContentBlockStart::Unknown)
142
+ ContentBlockStart.struct_class = Types::ContentBlockStart
143
+
144
+ ContentBlockStartEvent.add_member(:start, Shapes::ShapeRef.new(shape: ContentBlockStart, required: true, location_name: "start"))
145
+ ContentBlockStartEvent.add_member(:content_block_index, Shapes::ShapeRef.new(shape: NonNegativeInteger, required: true, location_name: "contentBlockIndex"))
146
+ ContentBlockStartEvent.struct_class = Types::ContentBlockStartEvent
147
+
148
+ ContentBlockStopEvent.add_member(:content_block_index, Shapes::ShapeRef.new(shape: NonNegativeInteger, required: true, location_name: "contentBlockIndex"))
149
+ ContentBlockStopEvent.struct_class = Types::ContentBlockStopEvent
150
+
151
+ ContentBlocks.member = Shapes::ShapeRef.new(shape: ContentBlock)
152
+
153
+ ConverseMetrics.add_member(:latency_ms, Shapes::ShapeRef.new(shape: Long, required: true, location_name: "latencyMs"))
154
+ ConverseMetrics.struct_class = Types::ConverseMetrics
155
+
156
+ ConverseOutput.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "message"))
157
+ ConverseOutput.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
158
+ ConverseOutput.add_member_subclass(:message, Types::ConverseOutput::Message)
159
+ ConverseOutput.add_member_subclass(:unknown, Types::ConverseOutput::Unknown)
160
+ ConverseOutput.struct_class = Types::ConverseOutput
161
+
162
+ ConverseRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: ConversationalModelId, required: true, location: "uri", location_name: "modelId"))
163
+ ConverseRequest.add_member(:messages, Shapes::ShapeRef.new(shape: Messages, required: true, location_name: "messages"))
164
+ ConverseRequest.add_member(:system, Shapes::ShapeRef.new(shape: SystemContentBlocks, location_name: "system"))
165
+ ConverseRequest.add_member(:inference_config, Shapes::ShapeRef.new(shape: InferenceConfiguration, location_name: "inferenceConfig"))
166
+ ConverseRequest.add_member(:tool_config, Shapes::ShapeRef.new(shape: ToolConfiguration, location_name: "toolConfig"))
167
+ ConverseRequest.add_member(:additional_model_request_fields, Shapes::ShapeRef.new(shape: Document, location_name: "additionalModelRequestFields"))
168
+ ConverseRequest.add_member(:additional_model_response_field_paths, Shapes::ShapeRef.new(shape: ConverseRequestAdditionalModelResponseFieldPathsList, location_name: "additionalModelResponseFieldPaths"))
169
+ ConverseRequest.struct_class = Types::ConverseRequest
170
+
171
+ ConverseRequestAdditionalModelResponseFieldPathsList.member = Shapes::ShapeRef.new(shape: ConverseRequestAdditionalModelResponseFieldPathsListMemberString)
172
+
173
+ ConverseResponse.add_member(:output, Shapes::ShapeRef.new(shape: ConverseOutput, required: true, location_name: "output"))
174
+ ConverseResponse.add_member(:stop_reason, Shapes::ShapeRef.new(shape: StopReason, required: true, location_name: "stopReason"))
175
+ ConverseResponse.add_member(:usage, Shapes::ShapeRef.new(shape: TokenUsage, required: true, location_name: "usage"))
176
+ ConverseResponse.add_member(:metrics, Shapes::ShapeRef.new(shape: ConverseMetrics, required: true, location_name: "metrics"))
177
+ ConverseResponse.add_member(:additional_model_response_fields, Shapes::ShapeRef.new(shape: Document, location_name: "additionalModelResponseFields"))
178
+ ConverseResponse.struct_class = Types::ConverseResponse
179
+
180
+ ConverseStreamMetadataEvent.add_member(:usage, Shapes::ShapeRef.new(shape: TokenUsage, required: true, location_name: "usage"))
181
+ ConverseStreamMetadataEvent.add_member(:metrics, Shapes::ShapeRef.new(shape: ConverseStreamMetrics, required: true, location_name: "metrics"))
182
+ ConverseStreamMetadataEvent.struct_class = Types::ConverseStreamMetadataEvent
183
+
184
+ ConverseStreamMetrics.add_member(:latency_ms, Shapes::ShapeRef.new(shape: Long, required: true, location_name: "latencyMs"))
185
+ ConverseStreamMetrics.struct_class = Types::ConverseStreamMetrics
186
+
187
+ ConverseStreamOutput.add_member(:message_start, Shapes::ShapeRef.new(shape: MessageStartEvent, event: true, location_name: "messageStart"))
188
+ ConverseStreamOutput.add_member(:content_block_start, Shapes::ShapeRef.new(shape: ContentBlockStartEvent, event: true, location_name: "contentBlockStart"))
189
+ ConverseStreamOutput.add_member(:content_block_delta, Shapes::ShapeRef.new(shape: ContentBlockDeltaEvent, event: true, location_name: "contentBlockDelta"))
190
+ ConverseStreamOutput.add_member(:content_block_stop, Shapes::ShapeRef.new(shape: ContentBlockStopEvent, event: true, location_name: "contentBlockStop"))
191
+ ConverseStreamOutput.add_member(:message_stop, Shapes::ShapeRef.new(shape: MessageStopEvent, event: true, location_name: "messageStop"))
192
+ ConverseStreamOutput.add_member(:metadata, Shapes::ShapeRef.new(shape: ConverseStreamMetadataEvent, event: true, location_name: "metadata"))
193
+ ConverseStreamOutput.add_member(:internal_server_exception, Shapes::ShapeRef.new(shape: InternalServerException, location_name: "internalServerException"))
194
+ ConverseStreamOutput.add_member(:model_stream_error_exception, Shapes::ShapeRef.new(shape: ModelStreamErrorException, location_name: "modelStreamErrorException"))
195
+ ConverseStreamOutput.add_member(:validation_exception, Shapes::ShapeRef.new(shape: ValidationException, location_name: "validationException"))
196
+ ConverseStreamOutput.add_member(:throttling_exception, Shapes::ShapeRef.new(shape: ThrottlingException, location_name: "throttlingException"))
197
+ ConverseStreamOutput.struct_class = Types::ConverseStreamOutput
198
+
199
+ ConverseStreamRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: ConversationalModelId, required: true, location: "uri", location_name: "modelId"))
200
+ ConverseStreamRequest.add_member(:messages, Shapes::ShapeRef.new(shape: Messages, required: true, location_name: "messages"))
201
+ ConverseStreamRequest.add_member(:system, Shapes::ShapeRef.new(shape: SystemContentBlocks, location_name: "system"))
202
+ ConverseStreamRequest.add_member(:inference_config, Shapes::ShapeRef.new(shape: InferenceConfiguration, location_name: "inferenceConfig"))
203
+ ConverseStreamRequest.add_member(:tool_config, Shapes::ShapeRef.new(shape: ToolConfiguration, location_name: "toolConfig"))
204
+ ConverseStreamRequest.add_member(:additional_model_request_fields, Shapes::ShapeRef.new(shape: Document, location_name: "additionalModelRequestFields"))
205
+ ConverseStreamRequest.add_member(:additional_model_response_field_paths, Shapes::ShapeRef.new(shape: ConverseStreamRequestAdditionalModelResponseFieldPathsList, location_name: "additionalModelResponseFieldPaths"))
206
+ ConverseStreamRequest.struct_class = Types::ConverseStreamRequest
207
+
208
+ ConverseStreamRequestAdditionalModelResponseFieldPathsList.member = Shapes::ShapeRef.new(shape: ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString)
209
+
210
+ ConverseStreamResponse.add_member(:stream, Shapes::ShapeRef.new(shape: ConverseStreamOutput, eventstream: true, location_name: "stream"))
211
+ ConverseStreamResponse.struct_class = Types::ConverseStreamResponse
212
+ ConverseStreamResponse[:payload] = :stream
213
+ ConverseStreamResponse[:payload_member] = ConverseStreamResponse.member(:stream)
214
+
215
+ ImageBlock.add_member(:format, Shapes::ShapeRef.new(shape: ImageFormat, required: true, location_name: "format"))
216
+ ImageBlock.add_member(:source, Shapes::ShapeRef.new(shape: ImageSource, required: true, location_name: "source"))
217
+ ImageBlock.struct_class = Types::ImageBlock
218
+
219
+ ImageSource.add_member(:bytes, Shapes::ShapeRef.new(shape: ImageSourceBytesBlob, location_name: "bytes"))
220
+ ImageSource.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
221
+ ImageSource.add_member_subclass(:bytes, Types::ImageSource::Bytes)
222
+ ImageSource.add_member_subclass(:unknown, Types::ImageSource::Unknown)
223
+ ImageSource.struct_class = Types::ImageSource
224
+
225
+ InferenceConfiguration.add_member(:max_tokens, Shapes::ShapeRef.new(shape: InferenceConfigurationMaxTokensInteger, location_name: "maxTokens"))
226
+ InferenceConfiguration.add_member(:temperature, Shapes::ShapeRef.new(shape: InferenceConfigurationTemperatureFloat, location_name: "temperature"))
227
+ InferenceConfiguration.add_member(:top_p, Shapes::ShapeRef.new(shape: InferenceConfigurationTopPFloat, location_name: "topP"))
228
+ InferenceConfiguration.add_member(:stop_sequences, Shapes::ShapeRef.new(shape: InferenceConfigurationStopSequencesList, location_name: "stopSequences"))
229
+ InferenceConfiguration.struct_class = Types::InferenceConfiguration
230
+
231
+ InferenceConfigurationStopSequencesList.member = Shapes::ShapeRef.new(shape: NonEmptyString)
232
+
45
233
  InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
46
234
  InternalServerException.struct_class = Types::InternalServerException
47
235
 
@@ -79,6 +267,19 @@ module Aws::BedrockRuntime
79
267
  InvokeModelWithResponseStreamResponse[:payload] = :body
80
268
  InvokeModelWithResponseStreamResponse[:payload_member] = InvokeModelWithResponseStreamResponse.member(:body)
81
269
 
270
+ Message.add_member(:role, Shapes::ShapeRef.new(shape: ConversationRole, required: true, location_name: "role"))
271
+ Message.add_member(:content, Shapes::ShapeRef.new(shape: ContentBlocks, required: true, location_name: "content"))
272
+ Message.struct_class = Types::Message
273
+
274
+ MessageStartEvent.add_member(:role, Shapes::ShapeRef.new(shape: ConversationRole, required: true, location_name: "role"))
275
+ MessageStartEvent.struct_class = Types::MessageStartEvent
276
+
277
+ MessageStopEvent.add_member(:stop_reason, Shapes::ShapeRef.new(shape: StopReason, required: true, location_name: "stopReason"))
278
+ MessageStopEvent.add_member(:additional_model_response_fields, Shapes::ShapeRef.new(shape: Document, location_name: "additionalModelResponseFields"))
279
+ MessageStopEvent.struct_class = Types::MessageStopEvent
280
+
281
+ Messages.member = Shapes::ShapeRef.new(shape: Message)
282
+
82
283
  ModelErrorException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
83
284
  ModelErrorException.add_member(:original_status_code, Shapes::ShapeRef.new(shape: StatusCode, location_name: "originalStatusCode"))
84
285
  ModelErrorException.add_member(:resource_name, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "resourceName"))
@@ -112,9 +313,87 @@ module Aws::BedrockRuntime
112
313
  ServiceQuotaExceededException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
113
314
  ServiceQuotaExceededException.struct_class = Types::ServiceQuotaExceededException
114
315
 
316
+ SpecificToolChoice.add_member(:name, Shapes::ShapeRef.new(shape: ToolName, required: true, location_name: "name"))
317
+ SpecificToolChoice.struct_class = Types::SpecificToolChoice
318
+
319
+ SystemContentBlock.add_member(:text, Shapes::ShapeRef.new(shape: NonEmptyString, location_name: "text"))
320
+ SystemContentBlock.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
321
+ SystemContentBlock.add_member_subclass(:text, Types::SystemContentBlock::Text)
322
+ SystemContentBlock.add_member_subclass(:unknown, Types::SystemContentBlock::Unknown)
323
+ SystemContentBlock.struct_class = Types::SystemContentBlock
324
+
325
+ SystemContentBlocks.member = Shapes::ShapeRef.new(shape: SystemContentBlock)
326
+
115
327
  ThrottlingException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
116
328
  ThrottlingException.struct_class = Types::ThrottlingException
117
329
 
330
+ TokenUsage.add_member(:input_tokens, Shapes::ShapeRef.new(shape: TokenUsageInputTokensInteger, required: true, location_name: "inputTokens"))
331
+ TokenUsage.add_member(:output_tokens, Shapes::ShapeRef.new(shape: TokenUsageOutputTokensInteger, required: true, location_name: "outputTokens"))
332
+ TokenUsage.add_member(:total_tokens, Shapes::ShapeRef.new(shape: TokenUsageTotalTokensInteger, required: true, location_name: "totalTokens"))
333
+ TokenUsage.struct_class = Types::TokenUsage
334
+
335
+ Tool.add_member(:tool_spec, Shapes::ShapeRef.new(shape: ToolSpecification, location_name: "toolSpec"))
336
+ Tool.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
337
+ Tool.add_member_subclass(:tool_spec, Types::Tool::ToolSpec)
338
+ Tool.add_member_subclass(:unknown, Types::Tool::Unknown)
339
+ Tool.struct_class = Types::Tool
340
+
341
+ ToolChoice.add_member(:auto, Shapes::ShapeRef.new(shape: AutoToolChoice, location_name: "auto"))
342
+ ToolChoice.add_member(:any, Shapes::ShapeRef.new(shape: AnyToolChoice, location_name: "any"))
343
+ ToolChoice.add_member(:tool, Shapes::ShapeRef.new(shape: SpecificToolChoice, location_name: "tool"))
344
+ ToolChoice.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
345
+ ToolChoice.add_member_subclass(:auto, Types::ToolChoice::Auto)
346
+ ToolChoice.add_member_subclass(:any, Types::ToolChoice::Any)
347
+ ToolChoice.add_member_subclass(:tool, Types::ToolChoice::Tool)
348
+ ToolChoice.add_member_subclass(:unknown, Types::ToolChoice::Unknown)
349
+ ToolChoice.struct_class = Types::ToolChoice
350
+
351
+ ToolConfiguration.add_member(:tools, Shapes::ShapeRef.new(shape: ToolConfigurationToolsList, required: true, location_name: "tools"))
352
+ ToolConfiguration.add_member(:tool_choice, Shapes::ShapeRef.new(shape: ToolChoice, location_name: "toolChoice"))
353
+ ToolConfiguration.struct_class = Types::ToolConfiguration
354
+
355
+ ToolConfigurationToolsList.member = Shapes::ShapeRef.new(shape: Tool)
356
+
357
+ ToolInputSchema.add_member(:json, Shapes::ShapeRef.new(shape: Document, location_name: "json"))
358
+ ToolInputSchema.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
359
+ ToolInputSchema.add_member_subclass(:json, Types::ToolInputSchema::Json)
360
+ ToolInputSchema.add_member_subclass(:unknown, Types::ToolInputSchema::Unknown)
361
+ ToolInputSchema.struct_class = Types::ToolInputSchema
362
+
363
+ ToolResultBlock.add_member(:tool_use_id, Shapes::ShapeRef.new(shape: ToolUseId, required: true, location_name: "toolUseId"))
364
+ ToolResultBlock.add_member(:content, Shapes::ShapeRef.new(shape: ToolResultContentBlocks, required: true, location_name: "content"))
365
+ ToolResultBlock.add_member(:status, Shapes::ShapeRef.new(shape: ToolResultStatus, location_name: "status"))
366
+ ToolResultBlock.struct_class = Types::ToolResultBlock
367
+
368
+ ToolResultContentBlock.add_member(:json, Shapes::ShapeRef.new(shape: Document, location_name: "json"))
369
+ ToolResultContentBlock.add_member(:text, Shapes::ShapeRef.new(shape: String, location_name: "text"))
370
+ ToolResultContentBlock.add_member(:image, Shapes::ShapeRef.new(shape: ImageBlock, location_name: "image"))
371
+ ToolResultContentBlock.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
372
+ ToolResultContentBlock.add_member_subclass(:json, Types::ToolResultContentBlock::Json)
373
+ ToolResultContentBlock.add_member_subclass(:text, Types::ToolResultContentBlock::Text)
374
+ ToolResultContentBlock.add_member_subclass(:image, Types::ToolResultContentBlock::Image)
375
+ ToolResultContentBlock.add_member_subclass(:unknown, Types::ToolResultContentBlock::Unknown)
376
+ ToolResultContentBlock.struct_class = Types::ToolResultContentBlock
377
+
378
+ ToolResultContentBlocks.member = Shapes::ShapeRef.new(shape: ToolResultContentBlock)
379
+
380
+ ToolSpecification.add_member(:name, Shapes::ShapeRef.new(shape: ToolName, required: true, location_name: "name"))
381
+ ToolSpecification.add_member(:description, Shapes::ShapeRef.new(shape: NonEmptyString, location_name: "description"))
382
+ ToolSpecification.add_member(:input_schema, Shapes::ShapeRef.new(shape: ToolInputSchema, required: true, location_name: "inputSchema"))
383
+ ToolSpecification.struct_class = Types::ToolSpecification
384
+
385
+ ToolUseBlock.add_member(:tool_use_id, Shapes::ShapeRef.new(shape: ToolUseId, required: true, location_name: "toolUseId"))
386
+ ToolUseBlock.add_member(:name, Shapes::ShapeRef.new(shape: ToolName, required: true, location_name: "name"))
387
+ ToolUseBlock.add_member(:input, Shapes::ShapeRef.new(shape: Document, required: true, location_name: "input"))
388
+ ToolUseBlock.struct_class = Types::ToolUseBlock
389
+
390
+ ToolUseBlockDelta.add_member(:input, Shapes::ShapeRef.new(shape: String, required: true, location_name: "input"))
391
+ ToolUseBlockDelta.struct_class = Types::ToolUseBlockDelta
392
+
393
+ ToolUseBlockStart.add_member(:tool_use_id, Shapes::ShapeRef.new(shape: ToolUseId, required: true, location_name: "toolUseId"))
394
+ ToolUseBlockStart.add_member(:name, Shapes::ShapeRef.new(shape: ToolName, required: true, location_name: "name"))
395
+ ToolUseBlockStart.struct_class = Types::ToolUseBlockStart
396
+
118
397
  ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
119
398
  ValidationException.struct_class = Types::ValidationException
120
399
 
@@ -136,6 +415,38 @@ module Aws::BedrockRuntime
136
415
  "uid" => "bedrock-runtime-2023-09-30",
137
416
  }
138
417
 
418
+ api.add_operation(:converse, Seahorse::Model::Operation.new.tap do |o|
419
+ o.name = "Converse"
420
+ o.http_method = "POST"
421
+ o.http_request_uri = "/model/{modelId}/converse"
422
+ o.input = Shapes::ShapeRef.new(shape: ConverseRequest)
423
+ o.output = Shapes::ShapeRef.new(shape: ConverseResponse)
424
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
425
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
426
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
427
+ o.errors << Shapes::ShapeRef.new(shape: ModelTimeoutException)
428
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
429
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
430
+ o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
431
+ o.errors << Shapes::ShapeRef.new(shape: ModelErrorException)
432
+ end)
433
+
434
+ api.add_operation(:converse_stream, Seahorse::Model::Operation.new.tap do |o|
435
+ o.name = "ConverseStream"
436
+ o.http_method = "POST"
437
+ o.http_request_uri = "/model/{modelId}/converse-stream"
438
+ o.input = Shapes::ShapeRef.new(shape: ConverseStreamRequest)
439
+ o.output = Shapes::ShapeRef.new(shape: ConverseStreamResponse)
440
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
441
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
442
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
443
+ o.errors << Shapes::ShapeRef.new(shape: ModelTimeoutException)
444
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
445
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
446
+ o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
447
+ o.errors << Shapes::ShapeRef.new(shape: ModelErrorException)
448
+ end)
449
+
139
450
  api.add_operation(:invoke_model, Seahorse::Model::Operation.new.tap do |o|
140
451
  o.name = "InvokeModel"
141
452
  o.http_method = "POST"
@@ -12,6 +12,34 @@ module Aws::BedrockRuntime
12
12
  # @api private
13
13
  module Endpoints
14
14
 
15
+ class Converse
16
+ def self.build(context)
17
+ unless context.config.regional_endpoint
18
+ endpoint = context.config.endpoint.to_s
19
+ end
20
+ Aws::BedrockRuntime::EndpointParameters.new(
21
+ region: context.config.region,
22
+ use_dual_stack: context.config.use_dualstack_endpoint,
23
+ use_fips: context.config.use_fips_endpoint,
24
+ endpoint: endpoint,
25
+ )
26
+ end
27
+ end
28
+
29
+ class ConverseStream
30
+ def self.build(context)
31
+ unless context.config.regional_endpoint
32
+ endpoint = context.config.endpoint.to_s
33
+ end
34
+ Aws::BedrockRuntime::EndpointParameters.new(
35
+ region: context.config.region,
36
+ use_dual_stack: context.config.use_dualstack_endpoint,
37
+ use_fips: context.config.use_fips_endpoint,
38
+ endpoint: endpoint,
39
+ )
40
+ end
41
+ end
42
+
15
43
  class InvokeModel
16
44
  def self.build(context)
17
45
  unless context.config.regional_endpoint
@@ -9,6 +9,85 @@
9
9
 
10
10
  module Aws::BedrockRuntime
11
11
  module EventStreams
12
+ class ConverseStreamOutput
13
+
14
+ def initialize
15
+ @event_emitter = Aws::EventEmitter.new
16
+ end
17
+
18
+ def on_message_start_event(&block)
19
+ @event_emitter.on(:message_start, block) if block_given?
20
+ end
21
+
22
+ def on_content_block_start_event(&block)
23
+ @event_emitter.on(:content_block_start, block) if block_given?
24
+ end
25
+
26
+ def on_content_block_delta_event(&block)
27
+ @event_emitter.on(:content_block_delta, block) if block_given?
28
+ end
29
+
30
+ def on_content_block_stop_event(&block)
31
+ @event_emitter.on(:content_block_stop, block) if block_given?
32
+ end
33
+
34
+ def on_message_stop_event(&block)
35
+ @event_emitter.on(:message_stop, block) if block_given?
36
+ end
37
+
38
+ def on_metadata_event(&block)
39
+ @event_emitter.on(:metadata, block) if block_given?
40
+ end
41
+
42
+ def on_internal_server_exception_event(&block)
43
+ @event_emitter.on(:internal_server_exception, block) if block_given?
44
+ end
45
+
46
+ def on_model_stream_error_exception_event(&block)
47
+ @event_emitter.on(:model_stream_error_exception, block) if block_given?
48
+ end
49
+
50
+ def on_validation_exception_event(&block)
51
+ @event_emitter.on(:validation_exception, block) if block_given?
52
+ end
53
+
54
+ def on_throttling_exception_event(&block)
55
+ @event_emitter.on(:throttling_exception, block) if block_given?
56
+ end
57
+
58
+ def on_error_event(&block)
59
+ @event_emitter.on(:error, block) if block_given?
60
+ end
61
+
62
+ def on_initial_response_event(&block)
63
+ @event_emitter.on(:initial_response, block) if block_given?
64
+ end
65
+
66
+ def on_unknown_event(&block)
67
+ @event_emitter.on(:unknown_event, block) if block_given?
68
+ end
69
+
70
+ def on_event(&block)
71
+ on_message_start_event(&block)
72
+ on_content_block_start_event(&block)
73
+ on_content_block_delta_event(&block)
74
+ on_content_block_stop_event(&block)
75
+ on_message_stop_event(&block)
76
+ on_metadata_event(&block)
77
+ on_internal_server_exception_event(&block)
78
+ on_model_stream_error_exception_event(&block)
79
+ on_validation_exception_event(&block)
80
+ on_throttling_exception_event(&block)
81
+ on_error_event(&block)
82
+ on_initial_response_event(&block)
83
+ on_unknown_event(&block)
84
+ end
85
+
86
+ # @api private
87
+ # @return Aws::EventEmitter
88
+ attr_reader :event_emitter
89
+
90
+ end
12
91
  class ResponseStream
13
92
 
14
93
  def initialize
@@ -58,6 +58,10 @@ module Aws::BedrockRuntime
58
58
 
59
59
  def parameters_for_operation(context)
60
60
  case context.operation_name
61
+ when :converse
62
+ Aws::BedrockRuntime::Endpoints::Converse.build(context)
63
+ when :converse_stream
64
+ Aws::BedrockRuntime::Endpoints::ConverseStream.build(context)
61
65
  when :invoke_model
62
66
  Aws::BedrockRuntime::Endpoints::InvokeModel.build(context)
63
67
  when :invoke_model_with_response_stream