aws-sdk-bedrockruntime 1.28.0 → 1.44.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +80 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-bedrockruntime/async_client.rb +626 -0
- data/lib/aws-sdk-bedrockruntime/client.rb +754 -135
- data/lib/aws-sdk-bedrockruntime/client_api.rb +374 -7
- data/lib/aws-sdk-bedrockruntime/endpoint_provider.rb +13 -17
- data/lib/aws-sdk-bedrockruntime/errors.rb +16 -0
- data/lib/aws-sdk-bedrockruntime/event_streams.rb +87 -0
- data/lib/aws-sdk-bedrockruntime/types.rb +1168 -113
- data/lib/aws-sdk-bedrockruntime.rb +2 -1
- data/sig/client.rbs +210 -13
- data/sig/errors.rbs +3 -0
- data/sig/resource.rbs +2 -0
- data/sig/types.rbs +322 -16
- metadata +5 -4
@@ -10,40 +10,36 @@
|
|
10
10
|
module Aws::BedrockRuntime
|
11
11
|
class EndpointProvider
|
12
12
|
def resolve_endpoint(parameters)
|
13
|
-
|
14
|
-
|
15
|
-
use_fips = parameters.use_fips
|
16
|
-
endpoint = parameters.endpoint
|
17
|
-
if Aws::Endpoints::Matchers.set?(endpoint)
|
18
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
13
|
+
if Aws::Endpoints::Matchers.set?(parameters.endpoint)
|
14
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
|
19
15
|
raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
|
20
16
|
end
|
21
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
17
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
22
18
|
raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
|
23
19
|
end
|
24
|
-
return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
|
20
|
+
return Aws::Endpoints::Endpoint.new(url: parameters.endpoint, headers: {}, properties: {})
|
25
21
|
end
|
26
|
-
if Aws::Endpoints::Matchers.set?(region)
|
27
|
-
if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
|
28
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
22
|
+
if Aws::Endpoints::Matchers.set?(parameters.region)
|
23
|
+
if (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
|
24
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
29
25
|
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
30
|
-
return Aws::Endpoints::Endpoint.new(url: "https://bedrock-runtime-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
26
|
+
return Aws::Endpoints::Endpoint.new(url: "https://bedrock-runtime-fips.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
31
27
|
end
|
32
28
|
raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
|
33
29
|
end
|
34
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
30
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
|
35
31
|
if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
|
36
|
-
return Aws::Endpoints::Endpoint.new(url: "https://bedrock-runtime-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
32
|
+
return Aws::Endpoints::Endpoint.new(url: "https://bedrock-runtime-fips.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
37
33
|
end
|
38
34
|
raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
|
39
35
|
end
|
40
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
36
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
41
37
|
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
42
|
-
return Aws::Endpoints::Endpoint.new(url: "https://bedrock-runtime.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
38
|
+
return Aws::Endpoints::Endpoint.new(url: "https://bedrock-runtime.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
43
39
|
end
|
44
40
|
raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
|
45
41
|
end
|
46
|
-
return Aws::Endpoints::Endpoint.new(url: "https://bedrock-runtime.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
42
|
+
return Aws::Endpoints::Endpoint.new(url: "https://bedrock-runtime.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
47
43
|
end
|
48
44
|
end
|
49
45
|
raise ArgumentError, "Invalid Configuration: Missing Region"
|
@@ -28,6 +28,7 @@ module Aws::BedrockRuntime
|
|
28
28
|
#
|
29
29
|
# ## Error Classes
|
30
30
|
# * {AccessDeniedException}
|
31
|
+
# * {ConflictException}
|
31
32
|
# * {InternalServerException}
|
32
33
|
# * {ModelErrorException}
|
33
34
|
# * {ModelNotReadyException}
|
@@ -60,6 +61,21 @@ module Aws::BedrockRuntime
|
|
60
61
|
end
|
61
62
|
end
|
62
63
|
|
64
|
+
class ConflictException < ServiceError
|
65
|
+
|
66
|
+
# @param [Seahorse::Client::RequestContext] context
|
67
|
+
# @param [String] message
|
68
|
+
# @param [Aws::BedrockRuntime::Types::ConflictException] data
|
69
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
70
|
+
super(context, message, data)
|
71
|
+
end
|
72
|
+
|
73
|
+
# @return [String]
|
74
|
+
def message
|
75
|
+
@message || @data[:message]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
63
79
|
class InternalServerException < ServiceError
|
64
80
|
|
65
81
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -9,6 +9,29 @@
|
|
9
9
|
|
10
10
|
module Aws::BedrockRuntime
|
11
11
|
module EventStreams
|
12
|
+
class InvokeModelWithBidirectionalStreamInput
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
@event_emitter = Aws::EventEmitter.new
|
16
|
+
end
|
17
|
+
|
18
|
+
# @option params [String, StringIO, File] :bytes
|
19
|
+
# The audio content for the bidirectional input.
|
20
|
+
#
|
21
|
+
def signal_chunk_event(params = {})
|
22
|
+
@event_emitter.emit(:chunk, params)
|
23
|
+
end
|
24
|
+
|
25
|
+
def signal_end_stream
|
26
|
+
@event_emitter.emit(:end_stream, {})
|
27
|
+
end
|
28
|
+
|
29
|
+
# @api private
|
30
|
+
# @return Aws::EventEmitter
|
31
|
+
attr_reader :event_emitter
|
32
|
+
|
33
|
+
end
|
34
|
+
|
12
35
|
class ConverseStreamOutput
|
13
36
|
|
14
37
|
def initialize
|
@@ -92,6 +115,70 @@ module Aws::BedrockRuntime
|
|
92
115
|
# @return Aws::EventEmitter
|
93
116
|
attr_reader :event_emitter
|
94
117
|
|
118
|
+
end
|
119
|
+
class InvokeModelWithBidirectionalStreamOutput
|
120
|
+
|
121
|
+
def initialize
|
122
|
+
@event_emitter = Aws::EventEmitter.new
|
123
|
+
end
|
124
|
+
|
125
|
+
def on_chunk_event(&block)
|
126
|
+
@event_emitter.on(:chunk, block) if block_given?
|
127
|
+
end
|
128
|
+
|
129
|
+
def on_internal_server_exception_event(&block)
|
130
|
+
@event_emitter.on(:internal_server_exception, block) if block_given?
|
131
|
+
end
|
132
|
+
|
133
|
+
def on_model_stream_error_exception_event(&block)
|
134
|
+
@event_emitter.on(:model_stream_error_exception, block) if block_given?
|
135
|
+
end
|
136
|
+
|
137
|
+
def on_validation_exception_event(&block)
|
138
|
+
@event_emitter.on(:validation_exception, block) if block_given?
|
139
|
+
end
|
140
|
+
|
141
|
+
def on_throttling_exception_event(&block)
|
142
|
+
@event_emitter.on(:throttling_exception, block) if block_given?
|
143
|
+
end
|
144
|
+
|
145
|
+
def on_model_timeout_exception_event(&block)
|
146
|
+
@event_emitter.on(:model_timeout_exception, block) if block_given?
|
147
|
+
end
|
148
|
+
|
149
|
+
def on_service_unavailable_exception_event(&block)
|
150
|
+
@event_emitter.on(:service_unavailable_exception, block) if block_given?
|
151
|
+
end
|
152
|
+
|
153
|
+
def on_error_event(&block)
|
154
|
+
@event_emitter.on(:error, block) if block_given?
|
155
|
+
end
|
156
|
+
|
157
|
+
def on_initial_response_event(&block)
|
158
|
+
@event_emitter.on(:initial_response, block) if block_given?
|
159
|
+
end
|
160
|
+
|
161
|
+
def on_unknown_event(&block)
|
162
|
+
@event_emitter.on(:unknown_event, block) if block_given?
|
163
|
+
end
|
164
|
+
|
165
|
+
def on_event(&block)
|
166
|
+
on_chunk_event(&block)
|
167
|
+
on_internal_server_exception_event(&block)
|
168
|
+
on_model_stream_error_exception_event(&block)
|
169
|
+
on_validation_exception_event(&block)
|
170
|
+
on_throttling_exception_event(&block)
|
171
|
+
on_model_timeout_exception_event(&block)
|
172
|
+
on_service_unavailable_exception_event(&block)
|
173
|
+
on_error_event(&block)
|
174
|
+
on_initial_response_event(&block)
|
175
|
+
on_unknown_event(&block)
|
176
|
+
end
|
177
|
+
|
178
|
+
# @api private
|
179
|
+
# @return Aws::EventEmitter
|
180
|
+
attr_reader :event_emitter
|
181
|
+
|
95
182
|
end
|
96
183
|
class ResponseStream
|
97
184
|
|