aws-sdk-bedrockruntime 1.44.0 → 1.46.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 +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-bedrockruntime/async_client.rb +134 -114
- data/lib/aws-sdk-bedrockruntime/client.rb +367 -315
- data/lib/aws-sdk-bedrockruntime/client_api.rb +4 -0
- data/lib/aws-sdk-bedrockruntime/types.rb +32 -2
- data/lib/aws-sdk-bedrockruntime.rb +1 -1
- data/sig/async_client.rbs +82 -0
- data/sig/client.rbs +40 -19
- data/sig/types.rbs +6 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51de9c1b5243a2585f78fd3f28fc41338438106c59ddbb9e9091f0417c91fa1e
|
4
|
+
data.tar.gz: 7269aee7d2cf3aab910e6ba757c9d5fa6befc4436d33a4c10354864398a80b55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f8bd8bad452e8eb9b46ac12a13fd54d19e524ff50908cd614eb7362355bab475f4429a1c6a9cd696a057b09be1224ab6f030dadd79831f0ec464679749bf07
|
7
|
+
data.tar.gz: df2b78ccf0956f31dffd0cb689605569763f7c2525c430723385698209a2234ee0ab25b596697e16b04096ebd9c5ccd0dfcac028caf59f6fa28913cebf3e7e19
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.46.0 (2025-04-28)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Feature - This release adds native h2 support for the bedrock runtime API, the support is only limited to SDKs that support h2 requests natively.
|
8
|
+
|
9
|
+
1.45.0 (2025-04-25)
|
10
|
+
------------------
|
11
|
+
|
12
|
+
* Feature - You can now reference images and documents stored in Amazon S3 when using InvokeModel and Converse APIs with Amazon Nova Lite and Nova Pro. This enables direct integration of S3-stored multimedia assets in your model requests without manual downloading or base64 encoding.
|
13
|
+
|
4
14
|
1.44.0 (2025-04-08)
|
5
15
|
------------------
|
6
16
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.46.0
|
@@ -10,32 +10,44 @@
|
|
10
10
|
begin
|
11
11
|
require 'http/2'
|
12
12
|
rescue LoadError; end
|
13
|
-
require 'aws-sdk-core/plugins/credentials_configuration
|
14
|
-
require 'aws-sdk-core/plugins/logging
|
15
|
-
require 'aws-sdk-core/plugins/param_converter
|
16
|
-
require 'aws-sdk-core/plugins/param_validator
|
17
|
-
require 'aws-sdk-core/plugins/user_agent
|
18
|
-
require 'aws-sdk-core/plugins/helpful_socket_errors
|
19
|
-
require 'aws-sdk-core/plugins/retry_errors
|
20
|
-
require 'aws-sdk-core/plugins/global_configuration
|
21
|
-
require 'aws-sdk-core/plugins/regional_endpoint
|
22
|
-
require 'aws-sdk-core/plugins/stub_responses
|
23
|
-
require 'aws-sdk-core/plugins/idempotency_token
|
24
|
-
require 'aws-sdk-core/plugins/invocation_id
|
25
|
-
require 'aws-sdk-core/plugins/jsonvalue_converter
|
26
|
-
require 'aws-sdk-core/plugins/http_checksum
|
27
|
-
require 'aws-sdk-core/plugins/checksum_algorithm
|
28
|
-
require 'aws-sdk-core/plugins/request_compression
|
29
|
-
require 'aws-sdk-core/plugins/defaults_mode
|
30
|
-
require 'aws-sdk-core/plugins/recursion_detection
|
31
|
-
require 'aws-sdk-core/plugins/telemetry
|
32
|
-
require 'aws-sdk-core/plugins/sign
|
33
|
-
require 'aws-sdk-core/plugins/protocols/rest_json
|
34
|
-
require 'aws-sdk-core/plugins/event_stream_configuration
|
13
|
+
require 'aws-sdk-core/plugins/credentials_configuration'
|
14
|
+
require 'aws-sdk-core/plugins/logging'
|
15
|
+
require 'aws-sdk-core/plugins/param_converter'
|
16
|
+
require 'aws-sdk-core/plugins/param_validator'
|
17
|
+
require 'aws-sdk-core/plugins/user_agent'
|
18
|
+
require 'aws-sdk-core/plugins/helpful_socket_errors'
|
19
|
+
require 'aws-sdk-core/plugins/retry_errors'
|
20
|
+
require 'aws-sdk-core/plugins/global_configuration'
|
21
|
+
require 'aws-sdk-core/plugins/regional_endpoint'
|
22
|
+
require 'aws-sdk-core/plugins/stub_responses'
|
23
|
+
require 'aws-sdk-core/plugins/idempotency_token'
|
24
|
+
require 'aws-sdk-core/plugins/invocation_id'
|
25
|
+
require 'aws-sdk-core/plugins/jsonvalue_converter'
|
26
|
+
require 'aws-sdk-core/plugins/http_checksum'
|
27
|
+
require 'aws-sdk-core/plugins/checksum_algorithm'
|
28
|
+
require 'aws-sdk-core/plugins/request_compression'
|
29
|
+
require 'aws-sdk-core/plugins/defaults_mode'
|
30
|
+
require 'aws-sdk-core/plugins/recursion_detection'
|
31
|
+
require 'aws-sdk-core/plugins/telemetry'
|
32
|
+
require 'aws-sdk-core/plugins/sign'
|
33
|
+
require 'aws-sdk-core/plugins/protocols/rest_json'
|
34
|
+
require 'aws-sdk-core/plugins/event_stream_configuration'
|
35
35
|
|
36
36
|
Aws::Plugins::GlobalConfiguration.add_identifier(:bedrockruntime)
|
37
37
|
|
38
38
|
module Aws::BedrockRuntime
|
39
|
+
# An API async client for BedrockRuntime. To construct an async client, you need to configure a `:region` and `:credentials`.
|
40
|
+
#
|
41
|
+
# async_client = Aws::BedrockRuntime::AsyncClient.new(
|
42
|
+
# region: region_name,
|
43
|
+
# credentials: credentials,
|
44
|
+
# # ...
|
45
|
+
# )
|
46
|
+
#
|
47
|
+
# For details on configuring region and credentials see
|
48
|
+
# the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
|
49
|
+
#
|
50
|
+
# See {#initialize} for a full list of supported configuration options.
|
39
51
|
class AsyncClient < Seahorse::Client::AsyncBase
|
40
52
|
|
41
53
|
include Aws::AsyncClientStubs
|
@@ -68,6 +80,13 @@ module Aws::BedrockRuntime
|
|
68
80
|
add_plugin(Aws::Plugins::EventStreamConfiguration)
|
69
81
|
add_plugin(Aws::BedrockRuntime::Plugins::Endpoints)
|
70
82
|
|
83
|
+
# @overload initialize(options)
|
84
|
+
# @param [Hash] options
|
85
|
+
#
|
86
|
+
# @option options [Array<Seahorse::Client::Plugin>] :plugins ([]])
|
87
|
+
# A list of plugins to apply to the client. Each plugin is either a
|
88
|
+
# class name or an instance of a plugin class.
|
89
|
+
#
|
71
90
|
# @option options [required, Aws::CredentialProvider] :credentials
|
72
91
|
# Your AWS credentials. This can be an instance of any one of the
|
73
92
|
# following classes:
|
@@ -406,103 +425,104 @@ module Aws::BedrockRuntime
|
|
406
425
|
# * {Types::InvokeModelWithBidirectionalStreamResponse#body #body} => Types::InvokeModelWithBidirectionalStreamOutput
|
407
426
|
#
|
408
427
|
# @example Bi-directional EventStream Operation Example
|
409
|
-
#
|
410
|
-
#
|
411
|
-
#
|
412
|
-
#
|
413
|
-
#
|
414
|
-
#
|
415
|
-
#
|
416
|
-
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
420
|
-
#
|
421
|
-
#
|
422
|
-
#
|
423
|
-
#
|
424
|
-
# out_stream.on_chunk_event do |event|
|
425
|
-
# event # => Aws::BedrockRuntime::Types::chunk
|
426
|
-
# end
|
427
|
-
# out_stream.on_internal_server_exception_event do |event|
|
428
|
-
# event # => Aws::BedrockRuntime::Types::internalServerException
|
429
|
-
# end
|
430
|
-
# out_stream.on_model_stream_error_exception_event do |event|
|
431
|
-
# event # => Aws::BedrockRuntime::Types::modelStreamErrorException
|
432
|
-
# end
|
433
|
-
# out_stream.on_validation_exception_event do |event|
|
434
|
-
# event # => Aws::BedrockRuntime::Types::validationException
|
435
|
-
# end
|
436
|
-
# out_stream.on_throttling_exception_event do |event|
|
437
|
-
# event # => Aws::BedrockRuntime::Types::throttlingException
|
438
|
-
# end
|
439
|
-
# out_stream.on_model_timeout_exception_event do |event|
|
440
|
-
# event # => Aws::BedrockRuntime::Types::modelTimeoutException
|
441
|
-
# end
|
442
|
-
# out_stream.on_service_unavailable_exception_event do |event|
|
443
|
-
# event # => Aws::BedrockRuntime::Types::serviceUnavailableException
|
444
|
-
# end
|
445
|
-
#
|
446
|
-
# end
|
447
|
-
# # => Aws::Seahorse::Client::AsyncResponse
|
448
|
-
#
|
449
|
-
# # signal events
|
450
|
-
# input_stream.signal_chunk_event( ... )
|
451
|
-
#
|
452
|
-
# # make sure to signal :end_stream at the end
|
453
|
-
# input_stream.signal_end_stream
|
454
|
-
#
|
455
|
-
# # wait until stream is closed before finalizing the sync response
|
456
|
-
# resp = async_resp.wait
|
457
|
-
# # Or close the stream and finalize sync response immediately
|
458
|
-
# # resp = async_resp.join!
|
459
|
-
#
|
460
|
-
# You can also provide an Aws::BedrockRuntime::EventStreams::InvokeModelWithBidirectionalStreamOutput object to register callbacks
|
461
|
-
# before initializing the request instead of processing from the request block.
|
462
|
-
#
|
463
|
-
# output_stream = Aws::BedrockRuntime::EventStreams::InvokeModelWithBidirectionalStreamOutput.new
|
464
|
-
# # register callbacks for output events
|
465
|
-
# output_stream.on_chunk_event do |event|
|
428
|
+
# # You can signal input events after the initial request is established. Events
|
429
|
+
# # will be sent to the stream immediately once the stream connection is
|
430
|
+
# # established successfully.
|
431
|
+
#
|
432
|
+
# # To signal events, you can call the #signal methods from an
|
433
|
+
# # Aws::BedrockRuntime::EventStreams::InvokeModelWithBidirectionalStreamInput object.
|
434
|
+
# # You must signal events before calling #wait or #join! on the async response.
|
435
|
+
# input_stream = Aws::BedrockRuntime::EventStreams::InvokeModelWithBidirectionalStreamInput.new
|
436
|
+
#
|
437
|
+
# async_resp = client.invoke_model_with_bidirectional_stream(
|
438
|
+
# # params input
|
439
|
+
# input_event_stream_handler: input_stream
|
440
|
+
# ) do |out_stream|
|
441
|
+
# # register callbacks for events
|
442
|
+
# out_stream.on_chunk_event do |event|
|
466
443
|
# event # => Aws::BedrockRuntime::Types::chunk
|
467
444
|
# end
|
468
|
-
#
|
445
|
+
# out_stream.on_internal_server_exception_event do |event|
|
469
446
|
# event # => Aws::BedrockRuntime::Types::internalServerException
|
470
447
|
# end
|
471
|
-
#
|
448
|
+
# out_stream.on_model_stream_error_exception_event do |event|
|
472
449
|
# event # => Aws::BedrockRuntime::Types::modelStreamErrorException
|
473
450
|
# end
|
474
|
-
#
|
451
|
+
# out_stream.on_validation_exception_event do |event|
|
475
452
|
# event # => Aws::BedrockRuntime::Types::validationException
|
476
453
|
# end
|
477
|
-
#
|
454
|
+
# out_stream.on_throttling_exception_event do |event|
|
478
455
|
# event # => Aws::BedrockRuntime::Types::throttlingException
|
479
456
|
# end
|
480
|
-
#
|
457
|
+
# out_stream.on_model_timeout_exception_event do |event|
|
481
458
|
# event # => Aws::BedrockRuntime::Types::modelTimeoutException
|
482
459
|
# end
|
483
|
-
#
|
460
|
+
# out_stream.on_service_unavailable_exception_event do |event|
|
484
461
|
# event # => Aws::BedrockRuntime::Types::serviceUnavailableException
|
485
462
|
# end
|
486
|
-
#
|
487
|
-
#
|
488
|
-
#
|
489
|
-
#
|
490
|
-
#
|
491
|
-
#
|
492
|
-
#
|
493
|
-
#
|
494
|
-
#
|
495
|
-
#
|
496
|
-
#
|
497
|
-
#
|
498
|
-
#
|
499
|
-
#
|
500
|
-
#
|
501
|
-
#
|
502
|
-
#
|
503
|
-
# You can also
|
504
|
-
#
|
505
|
-
#
|
463
|
+
# end
|
464
|
+
# # => Aws::Seahorse::Client::AsyncResponse
|
465
|
+
#
|
466
|
+
# # signal events
|
467
|
+
# input_stream.signal_chunk_event(
|
468
|
+
# # ...
|
469
|
+
# )
|
470
|
+
#
|
471
|
+
# # make sure to signal :end_stream at the end
|
472
|
+
# input_stream.signal_end_stream
|
473
|
+
#
|
474
|
+
# # wait until stream is closed before finalizing the sync response
|
475
|
+
# resp = async_resp.wait
|
476
|
+
#
|
477
|
+
# # Or close the stream and finalize sync response immediately
|
478
|
+
# resp = async_resp.join!
|
479
|
+
#
|
480
|
+
# # You can also provide an Aws::BedrockRuntime::EventStreams::InvokeModelWithBidirectionalStreamOutput object
|
481
|
+
# # to register callbacks before initializing the request instead of processing
|
482
|
+
# # from the request block.
|
483
|
+
# output_stream = Aws::BedrockRuntime::EventStreams::InvokeModelWithBidirectionalStreamOutput.new
|
484
|
+
#
|
485
|
+
# # register callbacks for output events
|
486
|
+
# output_stream.on_chunk_event do |event|
|
487
|
+
# event # => Aws::BedrockRuntime::Types::chunk
|
488
|
+
# end
|
489
|
+
# output_stream.on_internal_server_exception_event do |event|
|
490
|
+
# event # => Aws::BedrockRuntime::Types::internalServerException
|
491
|
+
# end
|
492
|
+
# output_stream.on_model_stream_error_exception_event do |event|
|
493
|
+
# event # => Aws::BedrockRuntime::Types::modelStreamErrorException
|
494
|
+
# end
|
495
|
+
# output_stream.on_validation_exception_event do |event|
|
496
|
+
# event # => Aws::BedrockRuntime::Types::validationException
|
497
|
+
# end
|
498
|
+
# output_stream.on_throttling_exception_event do |event|
|
499
|
+
# event # => Aws::BedrockRuntime::Types::throttlingException
|
500
|
+
# end
|
501
|
+
# output_stream.on_model_timeout_exception_event do |event|
|
502
|
+
# event # => Aws::BedrockRuntime::Types::modelTimeoutException
|
503
|
+
# end
|
504
|
+
# output_stream.on_service_unavailable_exception_event do |event|
|
505
|
+
# event # => Aws::BedrockRuntime::Types::serviceUnavailableException
|
506
|
+
# end
|
507
|
+
# output_stream.on_error_event do |event|
|
508
|
+
# # catch unmodeled error event in the stream
|
509
|
+
# raise event
|
510
|
+
# # => Aws::Errors::EventError
|
511
|
+
# # event.event_type => :error
|
512
|
+
# # event.error_code => String
|
513
|
+
# # event.error_message => String
|
514
|
+
# end
|
515
|
+
#
|
516
|
+
# async_resp = client.invoke_model_with_bidirectional_stream(
|
517
|
+
# # params input
|
518
|
+
# input_event_stream_handler: input_stream,
|
519
|
+
# output_event_stream_handler: output_stream
|
520
|
+
# )
|
521
|
+
# resp = async_resp.join!
|
522
|
+
#
|
523
|
+
# # You can also iterate through events after the response is complete.
|
524
|
+
# # Events are available at
|
525
|
+
# resp.body # => Enumerator
|
506
526
|
#
|
507
527
|
# @example Request syntax with placeholder values
|
508
528
|
#
|
@@ -517,31 +537,31 @@ module Aws::BedrockRuntime
|
|
517
537
|
#
|
518
538
|
# @example Response structure
|
519
539
|
#
|
520
|
-
# All events are available at resp.body:
|
540
|
+
# # All events are available at resp.body:
|
521
541
|
# resp.body #=> Enumerator
|
522
542
|
# resp.body.event_types #=> [:chunk, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception, :model_timeout_exception, :service_unavailable_exception]
|
523
543
|
#
|
524
|
-
# For :chunk event available at #on_chunk_event callback and response eventstream enumerator:
|
544
|
+
# # For :chunk event available at #on_chunk_event callback and response eventstream enumerator:
|
525
545
|
# event.bytes #=> String
|
526
546
|
#
|
527
|
-
# For :internal_server_exception event available at #on_internal_server_exception_event callback and response eventstream enumerator:
|
547
|
+
# # For :internal_server_exception event available at #on_internal_server_exception_event callback and response eventstream enumerator:
|
528
548
|
# event.message #=> String
|
529
549
|
#
|
530
|
-
# For :model_stream_error_exception event available at #on_model_stream_error_exception_event callback and response eventstream enumerator:
|
550
|
+
# # For :model_stream_error_exception event available at #on_model_stream_error_exception_event callback and response eventstream enumerator:
|
531
551
|
# event.message #=> String
|
532
552
|
# event.original_status_code #=> Integer
|
533
553
|
# event.original_message #=> String
|
534
554
|
#
|
535
|
-
# For :validation_exception event available at #on_validation_exception_event callback and response eventstream enumerator:
|
555
|
+
# # For :validation_exception event available at #on_validation_exception_event callback and response eventstream enumerator:
|
536
556
|
# event.message #=> String
|
537
557
|
#
|
538
|
-
# For :throttling_exception event available at #on_throttling_exception_event callback and response eventstream enumerator:
|
558
|
+
# # For :throttling_exception event available at #on_throttling_exception_event callback and response eventstream enumerator:
|
539
559
|
# event.message #=> String
|
540
560
|
#
|
541
|
-
# For :model_timeout_exception event available at #on_model_timeout_exception_event callback and response eventstream enumerator:
|
561
|
+
# # For :model_timeout_exception event available at #on_model_timeout_exception_event callback and response eventstream enumerator:
|
542
562
|
# event.message #=> String
|
543
563
|
#
|
544
|
-
# For :service_unavailable_exception event available at #on_service_unavailable_exception_event callback and response eventstream enumerator:
|
564
|
+
# # For :service_unavailable_exception event available at #on_service_unavailable_exception_event callback and response eventstream enumerator:
|
545
565
|
# event.message #=> String
|
546
566
|
#
|
547
567
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithBidirectionalStream AWS API Documentation
|
@@ -592,7 +612,7 @@ module Aws::BedrockRuntime
|
|
592
612
|
tracer: tracer
|
593
613
|
)
|
594
614
|
context[:gem_name] = 'aws-sdk-bedrockruntime'
|
595
|
-
context[:gem_version] = '1.
|
615
|
+
context[:gem_version] = '1.46.0'
|
596
616
|
Seahorse::Client::Request.new(handlers, context)
|
597
617
|
end
|
598
618
|
|