Class: Aws::BedrockRuntime::AsyncClient
- Inherits:
-
Seahorse::Client::AsyncBase
- Object
- Seahorse::Client::AsyncBase
- Aws::BedrockRuntime::AsyncClient
- Includes:
- AsyncClientStubs
- Defined in:
- lib/aws-sdk-bedrockruntime/async_client.rb,
sig/async_client.rbs
Overview
An API async client for BedrockRuntime. To construct an async client, you need to configure a :region and :credentials.
async_client = Aws::BedrockRuntime::AsyncClient.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Defined Under Namespace
Modules: _InvokeModelWithBidirectionalStreamResponseSuccess
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#invoke_model_with_bidirectional_stream(params = {}) ⇒ Types::InvokeModelWithBidirectionalStreamResponse
Invoke the specified Amazon Bedrock model to run inference using the bidirectional stream.
Class Method Summary collapse
- .errors_module ⇒ Object private
- .new ⇒ Object
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ AsyncClient
constructor
A new instance of AsyncClient.
Constructor Details
#initialize(options) ⇒ AsyncClient
Returns a new instance of AsyncClient.
405 406 407 408 409 410 |
# File 'lib/aws-sdk-bedrockruntime/async_client.rb', line 405 def initialize(*args) unless Kernel.const_defined?("HTTP2") raise "Must include http/2 gem to use AsyncClient instances." end super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
644 645 646 |
# File 'lib/aws-sdk-bedrockruntime/async_client.rb', line 644 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
647 648 649 |
# File 'lib/aws-sdk-bedrockruntime/async_client.rb', line 647 def errors_module Errors end |
.new ⇒ Object
14 |
# File 'sig/async_client.rbs', line 14
def self.new: (
|
Instance Method Details
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 |
# File 'lib/aws-sdk-bedrockruntime/async_client.rb', line 607 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::BedrockRuntime') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, http_response: Seahorse::Client::Http::AsyncResponse.new, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-bedrockruntime' context[:gem_version] = '1.82.0' Seahorse::Client::Request.new(handlers, context) end |
#invoke_model_with_bidirectional_stream(params = {}) ⇒ Types::InvokeModelWithBidirectionalStreamResponse
Invoke the specified Amazon Bedrock model to run inference using the bidirectional stream. The response is returned in a stream that remains open for 8 minutes. A single session can contain multiple prompts and responses from the model. The prompts to the model are provided as audio files and the model's responses are spoken back to the user and transcribed.
It is possible for users to interrupt the model's response with a new prompt, which will halt the response speech. The model will retain contextual awareness of the conversation while pivoting to respond to the new prompt.
75 |
# File 'sig/async_client.rbs', line 75
def invoke_model_with_bidirectional_stream: (
|