Class: Aws::BedrockAgentCore::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb

Overview

An API client for BedrockAgentCore. To construct a client, you need to configure a :region and :credentials.

client = Aws::BedrockAgentCore::Client.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.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :plugins (Array<Seahorse::Client::Plugin>) — default: []]

    A list of plugins to apply to the client. Each plugin is either a class name or an instance of a plugin class.

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::SharedCredentials - Used for loading static credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    • Aws::AssumeRoleWebIdentityCredentials - Used when you need to assume a role after providing credentials via the web.

    • Aws::SSOCredentials - Used for loading credentials from AWS SSO using an access token generated from aws login.

    • Aws::ProcessCredentials - Used for loading credentials from a process that outputs to stdout.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::ECSCredentials - Used for loading credentials from instances running in ECS.

    • Aws::CognitoIdentityCredentials - Used for loading credentials from the Cognito Identity service.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]
    • The :access_key_id, :secret_access_key, :session_token, and :account_id options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'], ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
    • ~/.aws/credentials
    • ~/.aws/config
    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentials or Aws::ECSCredentials to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED'] to true.
  • :region (required, String)

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :account_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :defaults_mode (String) — default: "legacy"

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_host_prefix_injection (Boolean) — default: false

    When true, the SDK will not prepend the modeled host prefix to the endpoint.

  • :disable_request_compression (Boolean) — default: false

    When set to 'true' the request body will not be compressed for supported operations.

  • :endpoint (String, URI::HTTPS, URI::HTTP)

    Normally you should not configure the :endpoint option directly. This is normally constructed from the :region option. Configuring :endpoint is normally reserved for connecting to test or custom endpoints. The endpoint should be a URI formatted like:

    'http://example.com'
    'https://example.com'
    'http://example.com:123'
    
  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to true, endpoint discovery will be enabled for operations when available.

  • :event_stream_handler (Proc)

    When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.

  • :ignore_configured_endpoint_urls (Boolean)

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :input_event_stream_handler (Proc)

    When an EventStream or Proc object is provided, it can be used for sending events for the event stream.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the :logger at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes.

  • :output_event_stream_handler (Proc)

    When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :request_checksum_calculation (String) — default: "when_supported"

    Determines when a checksum will be calculated for request payloads. Values are:

    • when_supported - (default) When set, a checksum will be calculated for all request payloads of operations modeled with the httpChecksum trait where requestChecksumRequired is true and/or a requestAlgorithmMember is modeled.
    • when_required - When set, a checksum will only be calculated for request payloads of operations modeled with the httpChecksum trait where requestChecksumRequired is true or where a requestAlgorithmMember is modeled and supplied.
  • :request_min_compression_size_bytes (Integer) — default: 10240

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :response_checksum_validation (String) — default: "when_supported"

    Determines when checksum validation will be performed on response payloads. Values are:

    • when_supported - (default) When set, checksum validation is performed on all response payloads of operations modeled with the httpChecksum trait where responseAlgorithms is modeled, except when no modeled checksum algorithms are supported.
    • when_required - When set, checksum validation is not performed on response payloads of operations unless the checksum algorithm is supported and the requestValidationModeMember member is set to ENABLED.
  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • adaptive - An experimental retry mode that includes all the functionality of standard mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :sdk_ua_app_id (String)

    A unique and opaque application ID that is appended to the User-Agent header as app/sdk_ua_app_id. It should have a maximum length of 50. This variable is sourced from environment variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.

  • :secret_access_key (String)
  • :session_token (String)
  • :sigv4a_signing_region_set (Array)

    A list of regions that should be signed with SigV4a signing. When not passed, a default :sigv4a_signing_region_set is searched for in the following locations:

    • Aws.config[:sigv4a_signing_region_set]
    • ENV['AWS_SIGV4A_SIGNING_REGION_SET']
    • ~/.aws/config
  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :telemetry_provider (Aws::Telemetry::TelemetryProviderBase) — default: Aws::Telemetry::NoOpTelemetryProvider

    Allows you to provide a telemetry provider, which is used to emit telemetry data. By default, uses NoOpTelemetryProvider which will not record or emit any telemetry data. The SDK supports the following telemetry providers:

    • OpenTelemetry (OTel) - To use the OTel provider, install and require the opentelemetry-sdk gem and then, pass in an instance of a Aws::Telemetry::OTelProvider for telemetry provider.
  • :token_provider (Aws::TokenProvider)

    A Bearer Token Provider. This can be an instance of any one of the following classes:

    • Aws::StaticTokenProvider - Used for configuring static, non-refreshing tokens.

    • Aws::SSOTokenProvider - Used for loading tokens from AWS SSO using an access token generated from aws login.

    When :token_provider is not configured directly, the Aws::TokenProviderChain will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean)

    When set to true, dualstack enabled endpoints (with .aws TLD) will be used if available.

  • :use_fips_endpoint (Boolean)

    When set to true, fips compatible endpoints will be used if available. When a fips region is used, the region is normalized and this config is set to true.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::BedrockAgentCore::EndpointProvider)

    The endpoint provider used to resolve endpoints. Any object that responds to #resolve_endpoint(parameters) where parameters is a Struct similar to Aws::BedrockAgentCore::EndpointParameters.

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_open_timeout (Float) — default: 15

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_read_timeout (Float) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_wire_trace (Boolean) — default: false

    When true, HTTP debug output will be sent to the :logger.

  • :on_chunk_received (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the response body is received. It provides three arguments: the chunk, the number of bytes received, and the total number of bytes in the response (or nil if the server did not send a content-length).

  • :on_chunk_sent (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the request body is sent. It provides three arguments: the chunk, the number of bytes read from the body, and the total number of bytes in the body.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_store (String)

    Sets the X509::Store to verify peer certificate.

  • :ssl_cert (OpenSSL::X509::Certificate)

    Sets a client certificate when creating http connections.

  • :ssl_key (OpenSSL::PKey)

    Sets a client key when creating http connections.

  • :ssl_timeout (Float)

    Sets the SSL timeout in seconds

  • :ssl_verify_peer (Boolean) — default: true

    When true, SSL peer certificates are verified when establishing a connection.



477
478
479
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 477

def initialize(*args)
  super
end

Instance Method Details

#create_event(params = {}) ⇒ Types::CreateEventOutput

Creates an event in a memory store. Events represent interactions or activities that occur within a session and are associated with specific actors.

To use this operation, you must have the genesismemory:CreateEvent permission.

This operation is subject to request rate limiting.

Examples:

Request syntax with placeholder values


resp = client.create_event({
  memory_id: "MemoryId", # required
  actor_id: "ActorId", # required
  session_id: "SessionId",
  event_timestamp: Time.now, # required
  payload: [ # required
    {
      conversational: {
        content: { # required
          text: "ContentTextString",
        },
        role: "ASSISTANT", # required, accepts ASSISTANT, USER, TOOL, OTHER
      },
      blob: {
      },
    },
  ],
  branch: {
    root_event_id: "EventId",
    name: "BranchName", # required
  },
  client_token: "String",
})

Response structure


resp.event.memory_id #=> String
resp.event.actor_id #=> String
resp.event.session_id #=> String
resp.event.event_id #=> String
resp.event.event_timestamp #=> Time
resp.event.payload #=> Array
resp.event.payload[0].conversational.content.text #=> String
resp.event.payload[0].conversational.role #=> String, one of "ASSISTANT", "USER", "TOOL", "OTHER"
resp.event.branch.root_event_id #=> String
resp.event.branch.name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store in which to create the event.

  • :actor_id (required, String)

    The identifier of the actor associated with this event. An actor represents an entity that participates in sessions and generates events.

  • :session_id (String)

    The identifier of the session in which this event occurs. A session represents a sequence of related events.

  • :event_timestamp (required, Time, DateTime, Date, Integer, String)

    The timestamp when the event occurred. If not specified, the current time is used.

  • :payload (required, Array<Types::PayloadType>)

    The content payload of the event. This can include conversational data or binary content.

  • :branch (Types::Branch)

    The branch information for this event. Branches allow for organizing events into different conversation threads or paths.

  • :client_token (String)

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, AgentCore ignores the request, but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



571
572
573
574
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 571

def create_event(params = {}, options = {})
  req = build_request(:create_event, params)
  req.send_request(options)
end

#delete_event(params = {}) ⇒ Types::DeleteEventOutput

Deletes an event from a memory store. When you delete an event, it is permanently removed.

To use this operation, you must have the genesismemory:DeleteEvent permission.

Examples:

Request syntax with placeholder values


resp = client.delete_event({
  memory_id: "MemoryId", # required
  session_id: "SessionId", # required
  event_id: "EventId", # required
  actor_id: "ActorId", # required
})

Response structure


resp.event_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store from which to delete the event.

  • :session_id (required, String)

    The identifier of the session containing the event to delete.

  • :event_id (required, String)

    The identifier of the event to delete.

  • :actor_id (required, String)

    The identifier of the actor associated with the event to delete.

Returns:

See Also:



615
616
617
618
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 615

def delete_event(params = {}, options = {})
  req = build_request(:delete_event, params)
  req.send_request(options)
end

#delete_memory_record(params = {}) ⇒ Types::DeleteMemoryRecordOutput

Deletes a memory record from a memory store. When you delete a memory record, it is permanently removed.

To use this operation, you must have the genesismemory:DeleteMemoryRecord permission.

Examples:

Request syntax with placeholder values


resp = client.delete_memory_record({
  memory_id: "MemoryId", # required
  memory_record_id: "String", # required
})

Response structure


resp.memory_record_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store from which to delete the memory record.

  • :memory_record_id (required, String)

    The identifier of the memory record to delete.

Returns:

See Also:



652
653
654
655
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 652

def delete_memory_record(params = {}, options = {})
  req = build_request(:delete_memory_record, params)
  req.send_request(options)
end

#get_browser_session(params = {}) ⇒ Types::GetBrowserSessionResponse

Retrieves detailed information about a specific browser session in Amazon Bedrock. This operation returns the session's configuration, current status, associated streams, and metadata.

To get a browser session, you must specify both the browser identifier and the session ID. The response includes information about the session's viewport configuration, timeout settings, and stream endpoints.

The following operations are related to GetBrowserSession:

Examples:

Request syntax with placeholder values


resp = client.get_browser_session({
  browser_identifier: "String", # required
  session_id: "BrowserSessionId", # required
})

Response structure


resp.browser_identifier #=> String
resp.session_id #=> String
resp.name #=> String
resp.created_at #=> Time
resp.view_port.width #=> Integer
resp.view_port.height #=> Integer
resp.session_timeout_seconds #=> Integer
resp.status #=> String, one of "READY", "TERMINATED"
resp.streams.automation_stream.stream_endpoint #=> String
resp.streams.automation_stream.stream_status #=> String, one of "ENABLED", "DISABLED"
resp.streams.live_view_stream.stream_endpoint #=> String
resp.session_replay_artifact #=> String
resp.last_updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :browser_identifier (required, String)

    The unique identifier of the browser associated with the session.

  • :session_id (required, String)

    The unique identifier of the browser session to retrieve.

Returns:

See Also:



726
727
728
729
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 726

def get_browser_session(params = {}, options = {})
  req = build_request(:get_browser_session, params)
  req.send_request(options)
end

#get_code_interpreter_session(params = {}) ⇒ Types::GetCodeInterpreterSessionResponse

Retrieves detailed information about a specific code interpreter session in Amazon Bedrock. This operation returns the session's configuration, current status, and metadata.

To get a code interpreter session, you must specify both the code interpreter identifier and the session ID. The response includes information about the session's timeout settings and current status.

The following operations are related to GetCodeInterpreterSession:

Examples:

Request syntax with placeholder values


resp = client.get_code_interpreter_session({
  code_interpreter_identifier: "String", # required
  session_id: "CodeInterpreterSessionId", # required
})

Response structure


resp.code_interpreter_identifier #=> String
resp.session_id #=> String
resp.name #=> String
resp.created_at #=> Time
resp.session_timeout_seconds #=> Integer
resp.status #=> String, one of "READY", "TERMINATED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_interpreter_identifier (required, String)

    The unique identifier of the code interpreter associated with the session.

  • :session_id (required, String)

    The unique identifier of the code interpreter session to retrieve.

Returns:

See Also:



789
790
791
792
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 789

def get_code_interpreter_session(params = {}, options = {})
  req = build_request(:get_code_interpreter_session, params)
  req.send_request(options)
end

#get_event(params = {}) ⇒ Types::GetEventOutput

Retrieves information about a specific event in a memory store.

To use this operation, you must have the genesismemory:GetEvent permission.

Examples:

Request syntax with placeholder values


resp = client.get_event({
  memory_id: "MemoryId", # required
  session_id: "SessionId", # required
  actor_id: "ActorId", # required
  event_id: "EventId", # required
})

Response structure


resp.event.memory_id #=> String
resp.event.actor_id #=> String
resp.event.session_id #=> String
resp.event.event_id #=> String
resp.event.event_timestamp #=> Time
resp.event.payload #=> Array
resp.event.payload[0].conversational.content.text #=> String
resp.event.payload[0].conversational.role #=> String, one of "ASSISTANT", "USER", "TOOL", "OTHER"
resp.event.branch.root_event_id #=> String
resp.event.branch.name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store containing the event.

  • :session_id (required, String)

    The identifier of the session containing the event.

  • :actor_id (required, String)

    The identifier of the actor associated with the event.

  • :event_id (required, String)

    The identifier of the event to retrieve.

Returns:

See Also:



841
842
843
844
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 841

def get_event(params = {}, options = {})
  req = build_request(:get_event, params)
  req.send_request(options)
end

#get_memory_record(params = {}) ⇒ Types::GetMemoryRecordOutput

Retrieves a specific memory record from a memory store.

To use this operation, you must have the genesismemory:GetMemoryRecord permission.

Examples:

Request syntax with placeholder values


resp = client.get_memory_record({
  memory_id: "MemoryId", # required
  memory_record_id: "String", # required
})

Response structure


resp.memory_record.memory_record_id #=> String
resp.memory_record.content.text #=> String
resp.memory_record.memory_strategy_id #=> String
resp.memory_record.namespaces #=> Array
resp.memory_record.namespaces[0] #=> String
resp.memory_record.created_at #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store containing the memory record.

  • :memory_record_id (required, String)

    The identifier of the memory record to retrieve.

Returns:

See Also:



881
882
883
884
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 881

def get_memory_record(params = {}, options = {})
  req = build_request(:get_memory_record, params)
  req.send_request(options)
end

#get_resource_api_key(params = {}) ⇒ Types::GetResourceApiKeyResponse

Retrieves an API Key associated with an API Key Credential Provider

Examples:

Request syntax with placeholder values


resp = client.get_resource_api_key({
  workload_identity_token: "WorkloadIdentityTokenType", # required
  resource_credential_provider_name: "CredentialProviderName", # required
})

Response structure


resp.api_key #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :workload_identity_token (required, String)

    The identity token of the workload you want to get the API Key of.

  • :resource_credential_provider_name (required, String)

    The credential provider name of the resource you are retrieving the API Key of.

Returns:

See Also:



914
915
916
917
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 914

def get_resource_api_key(params = {}, options = {})
  req = build_request(:get_resource_api_key, params)
  req.send_request(options)
end

#get_resource_oauth_2_token(params = {}) ⇒ Types::GetResourceOauth2TokenResponse

Reaturns the Oauth2Token of the provided resource

Examples:

Request syntax with placeholder values


resp = client.get_resource_oauth_2_token({
  workload_identity_token: "WorkloadIdentityTokenType", # required
  user_id: "UserIdType",
  resource_credential_provider_name: "CredentialProviderName", # required
  scopes: ["ScopeType"], # required
  oauth2_flow: "USER_FEDERATION", # required, accepts USER_FEDERATION, M2M
  resource_oauth_2_return_url: "ResourceOauth2ReturnUrlType",
  force_authentication: false,
  custom_parameters: {
    "CustomRequestKeyType" => "CustomRequestValueType",
  },
})

Response structure


resp.authorization_url #=> String
resp.access_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :workload_identity_token (required, String)

    The identity token of the workload you want to retrive the Oauth2 Token of.

  • :user_id (String)

    The user ID of the user you're retrieving the token on behalf of.

  • :resource_credential_provider_name (required, String)

    Reference to the credential provider

  • :scopes (required, Array<String>)

    The OAuth scopes requested

  • :oauth2_flow (required, String)

    The type of flow to be performed

  • :resource_oauth_2_return_url (String)

    Callback url to redirect after token retrieval completes. Should be one of the provideded urls during WorkloadIdentity creation

  • :force_authentication (Boolean)

    If true, always initiate a new 3LO flow

  • :custom_parameters (Hash<String,String>)

    Gives the ability to send extra/custom parameters to the resource credentials provider during the authorization process. Standard OAuth2 flow parameters will not be overriden.

Returns:

See Also:



978
979
980
981
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 978

def get_resource_oauth_2_token(params = {}, options = {})
  req = build_request(:get_resource_oauth_2_token, params)
  req.send_request(options)
end

#get_workload_access_token(params = {}) ⇒ Types::GetWorkloadAccessTokenResponse

Obtains an Workload access token for agentic workloads not acting on behalf of user.

Examples:

Request syntax with placeholder values


resp = client.get_workload_access_token({
  workload_name: "WorkloadIdentityNameType", # required
})

Response structure


resp.workload_access_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :workload_name (required, String)

    Unique identifier for the registered agent

Returns:

See Also:



1007
1008
1009
1010
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1007

def get_workload_access_token(params = {}, options = {})
  req = build_request(:get_workload_access_token, params)
  req.send_request(options)
end

#get_workload_access_token_for_jwt(params = {}) ⇒ Types::GetWorkloadAccessTokenForJWTResponse

Obtains an Workload access token for agentic workloads acting on behalf of user with JWT token

Examples:

Request syntax with placeholder values


resp = client.get_workload_access_token_for_jwt({
  workload_name: "WorkloadIdentityNameType", # required
  user_token: "UserTokenType", # required
})

Response structure


resp.workload_access_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :workload_name (required, String)

    Unique identifier for the registered agent

  • :user_token (required, String)

    OAuth2 token issued by the user's identity provider

Returns:

See Also:



1040
1041
1042
1043
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1040

def get_workload_access_token_for_jwt(params = {}, options = {})
  req = build_request(:get_workload_access_token_for_jwt, params)
  req.send_request(options)
end

#get_workload_access_token_for_user_id(params = {}) ⇒ Types::GetWorkloadAccessTokenForUserIdResponse

Obtains an Workload access token for agentic workloads acting on behalf of user with User Id.

Examples:

Request syntax with placeholder values


resp = client.get_workload_access_token_for_user_id({
  workload_name: "WorkloadIdentityNameType", # required
  user_id: "UserIdType", # required
})

Response structure


resp.workload_access_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :workload_name (required, String)

    The name of the worklaod you want to get the access token of.

  • :user_id (required, String)

    The user id of the user you are retrieving the access token for.

Returns:

See Also:



1073
1074
1075
1076
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1073

def get_workload_access_token_for_user_id(params = {}, options = {})
  req = build_request(:get_workload_access_token_for_user_id, params)
  req.send_request(options)
end

#invoke_agent_runtime(params = {}) ⇒ Types::InvokeAgentRuntimeResponse

Sends a request to an agent runtime in Amazon Bedrock and receives responses in real-time. The agent processes the request using the configured foundation model and any associated knowledge bases or action groups.

To invoke an agent runtime, you must specify the agent runtime ARN and provide a payload containing your request. You can optionally specify a qualifier to target a specific version or alias of the agent.

This operation supports streaming responses, allowing you to receive partial responses as they become available. We recommend using pagination to ensure that the operation returns quickly and successfully when processing large responses.

Examples:

Request syntax with placeholder values


resp = client.invoke_agent_runtime({
  content_type: "MimeType",
  accept: "MimeType",
  mcp_session_id: "StringType",
  runtime_session_id: "SessionType",
  mcp_protocol_version: "StringType",
  runtime_user_id: "StringType",
  trace_id: "InvokeAgentRuntimeRequestTraceIdString",
  trace_parent: "InvokeAgentRuntimeRequestTraceParentString",
  trace_state: "InvokeAgentRuntimeRequestTraceStateString",
  baggage: "InvokeAgentRuntimeRequestBaggageString",
  agent_runtime_arn: "String", # required
  qualifier: "String",
  payload: "data", # required
})

Response structure


resp.runtime_session_id #=> String
resp.mcp_session_id #=> String
resp.mcp_protocol_version #=> String
resp.trace_id #=> String
resp.trace_parent #=> String
resp.trace_state #=> String
resp.baggage #=> String
resp.content_type #=> String
resp.response #=> IO
resp.status_code #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :content_type (String)

    The MIME type of the input data in the payload. This tells the agent runtime how to interpret the payload data. Common values include application/json for JSON data.

  • :accept (String)

    The desired MIME type for the response from the agent runtime. This tells the agent runtime what format to use for the response data. Common values include application/json for JSON data.

  • :mcp_session_id (String)

    The identifier of the MCP session.

  • :runtime_session_id (String)

    The identifier of the runtime session.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :mcp_protocol_version (String)

    The version of the MCP protocol being used.

  • :runtime_user_id (String)

    The identifier of the runtime user.

  • :trace_id (String)

    The trace identifier for request tracking.

  • :trace_parent (String)

    The parent trace information for distributed tracing.

  • :trace_state (String)

    The trace state information for distributed tracing.

  • :baggage (String)

    Additional context information for distributed tracing.

  • :agent_runtime_arn (required, String)

    The Amazon Web Services Resource Name (ARN) of the agent runtime to invoke. The ARN uniquely identifies the agent runtime resource in Amazon Bedrock.

  • :qualifier (String)

    The qualifier to use for the agent runtime. This can be a version number or an alias name that points to a specific version. If not specified, Amazon Bedrock uses the default version of the agent runtime.

  • :payload (required, String, StringIO, File)

    The input data to send to the agent runtime. The format of this data depends on the specific agent configuration and must match the specified content type. For most agents, this is a JSON object containing the user's request.

Returns:

See Also:



1194
1195
1196
1197
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1194

def invoke_agent_runtime(params = {}, options = {}, &block)
  req = build_request(:invoke_agent_runtime, params)
  req.send_request(options, &block)
end

#invoke_code_interpreter(params = {}) ⇒ Types::InvokeCodeInterpreterResponse

Executes code within an active code interpreter session in Amazon Bedrock. This operation processes the provided code, runs it in a secure environment, and returns the execution results including output, errors, and generated visualizations.

To execute code, you must specify the code interpreter identifier, session ID, and the code to run in the arguments parameter. The operation returns a stream containing the execution results, which can include text output, error messages, and data visualizations.

This operation is subject to request rate limiting based on your account's service quotas.

The following operations are related to InvokeCodeInterpreter:

Examples:

EventStream Operation Example


# You can process the event once it arrives immediately, or wait until the
# full response is complete and iterate through the eventstream enumerator.

# To interact with event immediately, you need to register invoke_code_interpreter
# with callbacks. Callbacks can be registered for specific events or for all
# events, including error events.

# Callbacks can be passed into the `:event_stream_handler` option or within a
# block statement attached to the #invoke_code_interpreter call directly. Hybrid
# pattern of both is also supported.

# `:event_stream_handler` option takes in either a Proc object or
# Aws::BedrockAgentCore::EventStreams::CodeInterpreterStreamOutput object.

# Usage pattern a): Callbacks with a block attached to #invoke_code_interpreter
# Example for registering callbacks for all event types and an error event
client.invoke_code_interpreter(
  # params input
) do |stream|
  stream.on_error_event do |event|
    # catch unmodeled error event in the stream
    raise event
    # => Aws::Errors::EventError
    # event.event_type => :error
    # event.error_code => String
    # event.error_message => String
  end

  stream.on_event do |event|
    # process all events arrive
    puts event.event_type
    # ...
  end
end

# Usage pattern b): Pass in `:event_stream_handler` for #invoke_code_interpreter
#  1) Create a Aws::BedrockAgentCore::EventStreams::CodeInterpreterStreamOutput object
#  Example for registering callbacks with specific events

handler = Aws::BedrockAgentCore::EventStreams::CodeInterpreterStreamOutput.new
handler.on_result_event do |event|
  event # => Aws::BedrockAgentCore::Types::result
end
handler.on_access_denied_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::accessDeniedException
end
handler.on_conflict_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::conflictException
end
handler.on_internal_server_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::internalServerException
end
handler.on_resource_not_found_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::resourceNotFoundException
end
handler.on_service_quota_exceeded_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::serviceQuotaExceededException
end
handler.on_throttling_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::throttlingException
end
handler.on_validation_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::validationException
end

client.invoke_code_interpreter(
  # params inputs
  event_stream_handler: handler
)

#  2) Use a Ruby Proc object
#  Example for registering callbacks with specific events
handler = Proc.new do |stream|
  stream.on_result_event do |event|
    event # => Aws::BedrockAgentCore::Types::result
  end
  stream.on_access_denied_exception_event do |event|
    event # => Aws::BedrockAgentCore::Types::accessDeniedException
  end
  stream.on_conflict_exception_event do |event|
    event # => Aws::BedrockAgentCore::Types::conflictException
  end
  stream.on_internal_server_exception_event do |event|
    event # => Aws::BedrockAgentCore::Types::internalServerException
  end
  stream.on_resource_not_found_exception_event do |event|
    event # => Aws::BedrockAgentCore::Types::resourceNotFoundException
  end
  stream.on_service_quota_exceeded_exception_event do |event|
    event # => Aws::BedrockAgentCore::Types::serviceQuotaExceededException
  end
  stream.on_throttling_exception_event do |event|
    event # => Aws::BedrockAgentCore::Types::throttlingException
  end
  stream.on_validation_exception_event do |event|
    event # => Aws::BedrockAgentCore::Types::validationException
  end
end

client.invoke_code_interpreter(
  # params inputs
  event_stream_handler: handler
)

#  Usage pattern c): Hybrid pattern of a) and b)
handler = Aws::BedrockAgentCore::EventStreams::CodeInterpreterStreamOutput.new
handler.on_result_event do |event|
  event # => Aws::BedrockAgentCore::Types::result
end
handler.on_access_denied_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::accessDeniedException
end
handler.on_conflict_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::conflictException
end
handler.on_internal_server_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::internalServerException
end
handler.on_resource_not_found_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::resourceNotFoundException
end
handler.on_service_quota_exceeded_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::serviceQuotaExceededException
end
handler.on_throttling_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::throttlingException
end
handler.on_validation_exception_event do |event|
  event # => Aws::BedrockAgentCore::Types::validationException
end

client.invoke_code_interpreter(
  # params input
  event_stream_handler: handler
) do |stream|
  stream.on_error_event do |event|
    # catch unmodeled error event in the stream
    raise event
    # => Aws::Errors::EventError
    # event.event_type => :error
    # event.error_code => String
    # event.error_message => String
  end
end

# You can also iterate through events after the response complete.
# Events are available at
resp.stream # => Enumerator
# For parameter input example, please refer to following request syntax.

Request syntax with placeholder values


resp = client.invoke_code_interpreter({
  code_interpreter_identifier: "String", # required
  session_id: "CodeInterpreterSessionId",
  name: "executeCode", # required, accepts executeCode, executeCommand, readFiles, listFiles, removeFiles, writeFiles, startCommandExecution, getTask, stopTask
  arguments: {
    code: "MaxLenString",
    language: "python", # accepts python, javascript, typescript
    clear_context: false,
    command: "MaxLenString",
    path: "MaxLenString",
    paths: ["MaxLenString"],
    content: [
      {
        path: "MaxLenString", # required
        text: "MaxLenString",
        blob: "data",
      },
    ],
    directory_path: "MaxLenString",
    task_id: "MaxLenString",
  },
})

Response structure


resp.session_id #=> String
# All events are available at resp.stream:
resp.stream #=> Enumerator
resp.stream.event_types #=> [:result, :access_denied_exception, :conflict_exception, :internal_server_exception, :resource_not_found_exception, :service_quota_exceeded_exception, :throttling_exception, :validation_exception]

# For :result event available at #on_result_event callback and response eventstream enumerator:
event.content #=> Array
event.content[0].type #=> String, one of "text", "image", "resource", "resource_link"
event.content[0].text #=> String
event.content[0].data #=> String
event.content[0].mime_type #=> String
event.content[0].uri #=> String
event.content[0].name #=> String
event.content[0].description #=> String
event.content[0].size #=> Integer
event.content[0].resource.type #=> String, one of "text", "blob"
event.content[0].resource.uri #=> String
event.content[0].resource.mime_type #=> String
event.content[0].resource.text #=> String
event.content[0].resource.blob #=> String
event.structured_content.task_id #=> String
event.structured_content.task_status #=> String, one of "submitted", "working", "completed", "canceled", "failed"
event.structured_content.stdout #=> String
event.structured_content.stderr #=> String
event.structured_content.exit_code #=> Integer
event.structured_content.execution_time #=> Float
event.is_error #=> Boolean

# For :access_denied_exception event available at #on_access_denied_exception_event callback and response eventstream enumerator:
event.message #=> String

# For :conflict_exception event available at #on_conflict_exception_event callback and response eventstream enumerator:
event.message #=> String

# For :internal_server_exception event available at #on_internal_server_exception_event callback and response eventstream enumerator:
event.message #=> String

# For :resource_not_found_exception event available at #on_resource_not_found_exception_event callback and response eventstream enumerator:
event.message #=> String

# For :service_quota_exceeded_exception event available at #on_service_quota_exceeded_exception_event callback and response eventstream enumerator:
event.message #=> String

# For :throttling_exception event available at #on_throttling_exception_event callback and response eventstream enumerator:
event.message #=> String

# For :validation_exception event available at #on_validation_exception_event callback and response eventstream enumerator:
event.message #=> String
event.reason #=> String, one of "CannotParse", "FieldValidationFailed", "IdempotentParameterMismatchException", "EventInOtherSession", "ResourceConflict"
event.field_list #=> Array
event.field_list[0].name #=> String
event.field_list[0].message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_interpreter_identifier (required, String)

    The unique identifier of the code interpreter associated with the session. This must match the identifier used when creating the session with StartCodeInterpreterSession.

  • :session_id (String)

    The unique identifier of the code interpreter session to use. This must be an active session created with StartCodeInterpreterSession. If the session has expired or been stopped, the request will fail.

  • :name (required, String)

    The name of the code interpreter to invoke.

  • :arguments (Types::ToolArguments)

    The arguments for the code interpreter. This includes the code to execute and any additional parameters such as the programming language, whether to clear the execution context, and other execution options. The structure of this parameter depends on the specific code interpreter being used.

Yields:

  • (event_stream_handler)

Returns:

See Also:



1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1484

def invoke_code_interpreter(params = {}, options = {}, &block)
  params = params.dup
  event_stream_handler = case handler = params.delete(:event_stream_handler)
    when EventStreams::CodeInterpreterStreamOutput then handler
    when Proc then EventStreams::CodeInterpreterStreamOutput.new.tap(&handler)
    when nil then EventStreams::CodeInterpreterStreamOutput.new
    else
      msg = "expected :event_stream_handler to be a block or "\
            "instance of Aws::BedrockAgentCore::EventStreams::CodeInterpreterStreamOutput"\
            ", got `#{handler.inspect}` instead"
      raise ArgumentError, msg
    end

  yield(event_stream_handler) if block_given?

  req = build_request(:invoke_code_interpreter, params)

  req.context[:event_stream_handler] = event_stream_handler
  req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)

  req.send_request(options, &block)
end

#list_actors(params = {}) ⇒ Types::ListActorsOutput

Lists all actors in a memory store. We recommend using pagination to ensure that the operation returns quickly and successfully.

To use this operation, you must have the genesismemory:ListActors permission.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_actors({
  memory_id: "MemoryId", # required
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.actor_summaries #=> Array
resp.actor_summaries[0].actor_id #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store for which to list actors.

  • :max_results (Integer)

    The maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:



1550
1551
1552
1553
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1550

def list_actors(params = {}, options = {})
  req = build_request(:list_actors, params)
  req.send_request(options)
end

#list_browser_sessions(params = {}) ⇒ Types::ListBrowserSessionsResponse

Retrieves a list of browser sessions in Amazon Bedrock that match the specified criteria. This operation returns summary information about each session, including identifiers, status, and timestamps.

You can filter the results by browser identifier and session status. The operation supports pagination to handle large result sets efficiently.

We recommend using pagination to ensure that the operation returns quickly and successfully when retrieving large numbers of sessions.

The following operations are related to ListBrowserSessions:

Examples:

Request syntax with placeholder values


resp = client.list_browser_sessions({
  browser_identifier: "String", # required
  max_results: 1,
  next_token: "NextToken",
  status: "READY", # accepts READY, TERMINATED
})

Response structure


resp.items #=> Array
resp.items[0].browser_identifier #=> String
resp.items[0].session_id #=> String
resp.items[0].name #=> String
resp.items[0].status #=> String, one of "READY", "TERMINATED"
resp.items[0].created_at #=> Time
resp.items[0].last_updated_at #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :browser_identifier (required, String)

    The unique identifier of the browser to list sessions for. If specified, only sessions for this browser are returned. If not specified, sessions for all browsers are returned.

  • :max_results (Integer)

    The maximum number of results to return in a single call. The default value is 10. Valid values range from 1 to 100. To retrieve the remaining results, make another call with the returned nextToken value.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. If not specified, Amazon Bedrock returns the first page of results.

  • :status (String)

    The status of the browser sessions to list. Valid values include ACTIVE, STOPPING, and STOPPED. If not specified, sessions with any status are returned.

Returns:

See Also:



1628
1629
1630
1631
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1628

def list_browser_sessions(params = {}, options = {})
  req = build_request(:list_browser_sessions, params)
  req.send_request(options)
end

#list_code_interpreter_sessions(params = {}) ⇒ Types::ListCodeInterpreterSessionsResponse

Retrieves a list of code interpreter sessions in Amazon Bedrock that match the specified criteria. This operation returns summary information about each session, including identifiers, status, and timestamps.

You can filter the results by code interpreter identifier and session status. The operation supports pagination to handle large result sets efficiently.

We recommend using pagination to ensure that the operation returns quickly and successfully when retrieving large numbers of sessions.

The following operations are related to ListCodeInterpreterSessions:

Examples:

Request syntax with placeholder values


resp = client.list_code_interpreter_sessions({
  code_interpreter_identifier: "String", # required
  max_results: 1,
  next_token: "NextToken",
  status: "READY", # accepts READY, TERMINATED
})

Response structure


resp.items #=> Array
resp.items[0].code_interpreter_identifier #=> String
resp.items[0].session_id #=> String
resp.items[0].name #=> String
resp.items[0].status #=> String, one of "READY", "TERMINATED"
resp.items[0].created_at #=> Time
resp.items[0].last_updated_at #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_interpreter_identifier (required, String)

    The unique identifier of the code interpreter to list sessions for. If specified, only sessions for this code interpreter are returned. If not specified, sessions for all code interpreters are returned.

  • :max_results (Integer)

    The maximum number of results to return in a single call. The default value is 10. Valid values range from 1 to 100. To retrieve the remaining results, make another call with the returned nextToken value.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. If not specified, Amazon Bedrock returns the first page of results.

  • :status (String)

    The status of the code interpreter sessions to list. Valid values include ACTIVE, STOPPING, and STOPPED. If not specified, sessions with any status are returned.

Returns:

See Also:



1707
1708
1709
1710
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1707

def list_code_interpreter_sessions(params = {}, options = {})
  req = build_request(:list_code_interpreter_sessions, params)
  req.send_request(options)
end

#list_events(params = {}) ⇒ Types::ListEventsOutput

Lists events in a memory store based on specified criteria. We recommend using pagination to ensure that the operation returns quickly and successfully.

To use this operation, you must have the genesismemory:ListEvents permission.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_events({
  memory_id: "MemoryId", # required
  session_id: "SessionId", # required
  actor_id: "ActorId", # required
  include_payloads: false,
  filter: {
    branch: {
      name: "BranchName", # required
      include_parent_branches: false,
    },
  },
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.events #=> Array
resp.events[0].memory_id #=> String
resp.events[0].actor_id #=> String
resp.events[0].session_id #=> String
resp.events[0].event_id #=> String
resp.events[0].event_timestamp #=> Time
resp.events[0].payload #=> Array
resp.events[0].payload[0].conversational.content.text #=> String
resp.events[0].payload[0].conversational.role #=> String, one of "ASSISTANT", "USER", "TOOL", "OTHER"
resp.events[0].branch.root_event_id #=> String
resp.events[0].branch.name #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store for which to list events.

  • :session_id (required, String)

    The identifier of the session for which to list events. If specified, only events from this session are returned.

  • :actor_id (required, String)

    The identifier of the actor for which to list events. If specified, only events from this actor are returned.

  • :include_payloads (Boolean)

    Specifies whether to include event payloads in the response. Set to true to include payloads, or false to exclude them.

  • :filter (Types::FilterInput)

    Filter criteria to apply when listing events.

  • :max_results (Integer)

    The maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:



1789
1790
1791
1792
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1789

def list_events(params = {}, options = {})
  req = build_request(:list_events, params)
  req.send_request(options)
end

#list_memory_records(params = {}) ⇒ Types::ListMemoryRecordsOutput

Lists memory records in a memory store based on specified criteria. We recommend using pagination to ensure that the operation returns quickly and successfully.

To use this operation, you must have the genesismemory:ListMemoryRecords permission.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_memory_records({
  memory_id: "MemoryId", # required
  namespace: "Namespace", # required
  memory_strategy_id: "MemoryStrategyId",
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.memory_record_summaries #=> Array
resp.memory_record_summaries[0].memory_record_id #=> String
resp.memory_record_summaries[0].content.text #=> String
resp.memory_record_summaries[0].memory_strategy_id #=> String
resp.memory_record_summaries[0].namespaces #=> Array
resp.memory_record_summaries[0].namespaces[0] #=> String
resp.memory_record_summaries[0].created_at #=> Time
resp.memory_record_summaries[0].score #=> Float
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store for which to list memory records.

  • :namespace (required, String)

    The namespace to filter memory records by. If specified, only memory records in this namespace are returned.

  • :memory_strategy_id (String)

    The memory strategy identifier to filter memory records by. If specified, only memory records with this strategy ID are returned.

  • :max_results (Integer)

    The maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:



1854
1855
1856
1857
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1854

def list_memory_records(params = {}, options = {})
  req = build_request(:list_memory_records, params)
  req.send_request(options)
end

#list_sessions(params = {}) ⇒ Types::ListSessionsOutput

Lists sessions in a memory store based on specified criteria. We recommend using pagination to ensure that the operation returns quickly and successfully.

To use this operation, you must have the genesismemory:ListSessions permission.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_sessions({
  memory_id: "MemoryId", # required
  actor_id: "ActorId", # required
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.session_summaries #=> Array
resp.session_summaries[0].session_id #=> String
resp.session_summaries[0].actor_id #=> String
resp.session_summaries[0].created_at #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store for which to list sessions.

  • :actor_id (required, String)

    The identifier of the actor for which to list sessions. If specified, only sessions involving this actor are returned.

  • :max_results (Integer)

    The maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:



1910
1911
1912
1913
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1910

def list_sessions(params = {}, options = {})
  req = build_request(:list_sessions, params)
  req.send_request(options)
end

#retrieve_memory_records(params = {}) ⇒ Types::RetrieveMemoryRecordsOutput

Searches for and retrieves memory records from a memory store based on specified search criteria. We recommend using pagination to ensure that the operation returns quickly and successfully.

To use this operation, you must have the genesismemory:RetrieveMemoryRecords permission.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.retrieve_memory_records({
  memory_id: "MemoryId", # required
  namespace: "Namespace", # required
  search_criteria: { # required
    search_query: "SearchCriteriaSearchQueryString", # required
    memory_strategy_id: "MemoryStrategyId",
    top_k: 1,
  },
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


resp.memory_record_summaries #=> Array
resp.memory_record_summaries[0].memory_record_id #=> String
resp.memory_record_summaries[0].content.text #=> String
resp.memory_record_summaries[0].memory_strategy_id #=> String
resp.memory_record_summaries[0].namespaces #=> Array
resp.memory_record_summaries[0].namespaces[0] #=> String
resp.memory_record_summaries[0].created_at #=> Time
resp.memory_record_summaries[0].score #=> Float
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :memory_id (required, String)

    The identifier of the memory store from which to retrieve memory records.

  • :namespace (required, String)

    The namespace to filter memory records by. If specified, only memory records in this namespace are searched.

  • :search_criteria (required, Types::SearchCriteria)

    The search criteria to use for finding relevant memory records. This includes the search query, memory strategy ID, and other search parameters.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

  • :max_results (Integer)

    The maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.

Returns:

See Also:



1981
1982
1983
1984
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 1981

def retrieve_memory_records(params = {}, options = {})
  req = build_request(:retrieve_memory_records, params)
  req.send_request(options)
end

#start_browser_session(params = {}) ⇒ Types::StartBrowserSessionResponse

Creates and initializes a browser session in Amazon Bedrock. The session enables agents to navigate and interact with web content, extract information from websites, and perform web-based tasks as part of their response generation.

To create a session, you must specify a browser identifier and a name. You can also configure the viewport dimensions to control the visible area of web content. The session remains active until it times out or you explicitly stop it using the StopBrowserSession operation.

The following operations are related to StartBrowserSession:

Examples:

Request syntax with placeholder values


resp = client.start_browser_session({
  browser_identifier: "String", # required
  name: "Name",
  session_timeout_seconds: 1,
  view_port: {
    width: 1, # required
    height: 1, # required
  },
  client_token: "ClientToken",
})

Response structure


resp.browser_identifier #=> String
resp.session_id #=> String
resp.created_at #=> Time
resp.streams.automation_stream.stream_endpoint #=> String
resp.streams.automation_stream.stream_status #=> String, one of "ENABLED", "DISABLED"
resp.streams.live_view_stream.stream_endpoint #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :browser_identifier (required, String)

    The unique identifier of the browser to use for this session. This identifier specifies which browser environment to initialize for the session.

  • :name (String)

    The name of the browser session. This name helps you identify and manage the session. The name does not need to be unique.

  • :session_timeout_seconds (Integer)

    The time in seconds after which the session automatically terminates if there is no activity. The default value is 3600 seconds (1 hour). The minimum allowed value is 60 seconds, and the maximum allowed value is 28800 seconds (8 hours).

  • :view_port (Types::ViewPort)

    The dimensions of the browser viewport for this session. This determines the visible area of the web content and affects how web pages are rendered. If not specified, Amazon Bedrock uses a default viewport size.

  • :client_token (String)

    A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. This parameter helps prevent the creation of duplicate sessions if there are temporary network issues.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



2074
2075
2076
2077
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 2074

def start_browser_session(params = {}, options = {})
  req = build_request(:start_browser_session, params)
  req.send_request(options)
end

#start_code_interpreter_session(params = {}) ⇒ Types::StartCodeInterpreterSessionResponse

Creates and initializes a code interpreter session in Amazon Bedrock. The session enables agents to execute code as part of their response generation, supporting programming languages such as Python for data analysis, visualization, and computation tasks.

To create a session, you must specify a code interpreter identifier and a name. The session remains active until it times out or you explicitly stop it using the StopCodeInterpreterSession operation.

The following operations are related to StartCodeInterpreterSession:

Examples:

Request syntax with placeholder values


resp = client.start_code_interpreter_session({
  code_interpreter_identifier: "String", # required
  name: "Name",
  session_timeout_seconds: 1,
  client_token: "ClientToken",
})

Response structure


resp.code_interpreter_identifier #=> String
resp.session_id #=> String
resp.created_at #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_interpreter_identifier (required, String)

    The unique identifier of the code interpreter to use for this session. This identifier specifies which code interpreter environment to initialize for the session.

  • :name (String)

    The name of the code interpreter session. This name helps you identify and manage the session. The name does not need to be unique.

  • :session_timeout_seconds (Integer)

    The time in seconds after which the session automatically terminates if there is no activity. The default value is 3600 seconds (1 hour). The minimum allowed value is 60 seconds, and the maximum allowed value is 28800 seconds (8 hours).

  • :client_token (String)

    A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. This parameter helps prevent the creation of duplicate sessions if there are temporary network issues.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



2152
2153
2154
2155
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 2152

def start_code_interpreter_session(params = {}, options = {})
  req = build_request(:start_code_interpreter_session, params)
  req.send_request(options)
end

#stop_browser_session(params = {}) ⇒ Types::StopBrowserSessionResponse

Terminates an active browser session in Amazon Bedrock. This operation stops the session, releases associated resources, and makes the session unavailable for further use.

To stop a browser session, you must specify both the browser identifier and the session ID. Once stopped, a session cannot be restarted; you must create a new session using StartBrowserSession.

The following operations are related to StopBrowserSession:

Examples:

Request syntax with placeholder values


resp = client.stop_browser_session({
  browser_identifier: "String", # required
  session_id: "BrowserSessionId", # required
  client_token: "ClientToken",
})

Response structure


resp.browser_identifier #=> String
resp.session_id #=> String
resp.last_updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :browser_identifier (required, String)

    The unique identifier of the browser associated with the session.

  • :session_id (required, String)

    The unique identifier of the browser session to stop.

  • :client_token (String)

    A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



2215
2216
2217
2218
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 2215

def stop_browser_session(params = {}, options = {})
  req = build_request(:stop_browser_session, params)
  req.send_request(options)
end

#stop_code_interpreter_session(params = {}) ⇒ Types::StopCodeInterpreterSessionResponse

Terminates an active code interpreter session in Amazon Bedrock. This operation stops the session, releases associated resources, and makes the session unavailable for further use.

To stop a code interpreter session, you must specify both the code interpreter identifier and the session ID. Once stopped, a session cannot be restarted; you must create a new session using StartCodeInterpreterSession.

The following operations are related to StopCodeInterpreterSession:

Examples:

Request syntax with placeholder values


resp = client.stop_code_interpreter_session({
  code_interpreter_identifier: "String", # required
  session_id: "CodeInterpreterSessionId", # required
  client_token: "ClientToken",
})

Response structure


resp.code_interpreter_identifier #=> String
resp.session_id #=> String
resp.last_updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_interpreter_identifier (required, String)

    The unique identifier of the code interpreter associated with the session.

  • :session_id (required, String)

    The unique identifier of the code interpreter session to stop.

  • :client_token (String)

    A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



2280
2281
2282
2283
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 2280

def stop_code_interpreter_session(params = {}, options = {})
  req = build_request(:stop_code_interpreter_session, params)
  req.send_request(options)
end

#update_browser_stream(params = {}) ⇒ Types::UpdateBrowserStreamResponse

Updates a browser stream. To use this operation, you must have permissions to perform the bedrock:UpdateBrowserStream action.

Examples:

Request syntax with placeholder values


resp = client.update_browser_stream({
  browser_identifier: "String", # required
  session_id: "BrowserSessionId", # required
  stream_update: { # required
    automation_stream_update: {
      stream_status: "ENABLED", # accepts ENABLED, DISABLED
    },
  },
  client_token: "ClientToken",
})

Response structure


resp.browser_identifier #=> String
resp.session_id #=> String
resp.streams.automation_stream.stream_endpoint #=> String
resp.streams.automation_stream.stream_status #=> String, one of "ENABLED", "DISABLED"
resp.streams.live_view_stream.stream_endpoint #=> String
resp.updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :browser_identifier (required, String)

    The identifier of the browser.

  • :session_id (required, String)

    The identifier of the browser session.

  • :stream_update (required, Types::StreamUpdate)

    The update to apply to the browser stream.

  • :client_token (String)

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



2339
2340
2341
2342
# File 'gems/aws-sdk-bedrockagentcore/lib/aws-sdk-bedrockagentcore/client.rb', line 2339

def update_browser_stream(params = {}, options = {})
  req = build_request(:update_browser_stream, params)
  req.send_request(options)
end