Class: Aws::BedrockAgent::Client

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

Overview

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

client = Aws::BedrockAgent::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):

  • :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, and :session_token options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • ~/.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::InstanceProfileCredentails 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)
  • :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

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :disable_request_compression (Boolean) — default: false

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

  • :endpoint (String)

    The client endpoint is normally constructed from the :region option. You should only configure an :endpoint when connecting to test or custom endpoints. This should be a valid HTTP(S) URI.

  • :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.

  • :ignore_configured_endpoint_urls (Boolean)

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

  • :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.

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

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

  • :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.

  • :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/. It should have a maximum length of 50.

  • :secret_access_key (String)
  • :session_token (String)
  • :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.

  • :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::BedrockAgent::EndpointProvider)

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

  • :http_proxy (URI::HTTP, String)

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

  • :http_open_timeout (Float) — default: 15

    The number of seconds to wait when opening a HTTP session before raising a Timeout::Error.

  • :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_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_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.

  • :ssl_timeout (Float) — default: nil

    Sets the SSL timeout in seconds.

  • :http_wire_trace (Boolean) — default: false

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

  • :ssl_verify_peer (Boolean) — default: true

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

  • :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.



385
386
387
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 385

def initialize(*args)
  super
end

Instance Method Details

#associate_agent_knowledge_base(params = {}) ⇒ Types::AssociateAgentKnowledgeBaseResponse

Associate a Knowledge Base to an existing Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.associate_agent_knowledge_base({
  agent_id: "Id", # required
  agent_version: "DraftVersion", # required
  knowledge_base_id: "Id", # required
  description: "Description", # required
  knowledge_base_state: "ENABLED", # accepts ENABLED, DISABLED
})

Response structure


resp.agent_knowledge_base.agent_id #=> String
resp.agent_knowledge_base.agent_version #=> String
resp.agent_knowledge_base.knowledge_base_id #=> String
resp.agent_knowledge_base.description #=> String
resp.agent_knowledge_base.created_at #=> Time
resp.agent_knowledge_base.updated_at #=> Time
resp.agent_knowledge_base.knowledge_base_state #=> String, one of "ENABLED", "DISABLED"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Draft Version of the Agent.

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :description (required, String)

    Description of the Resource.

  • :knowledge_base_state (String)

    State of the knowledge base; whether it is enabled or disabled

Returns:

See Also:



436
437
438
439
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 436

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

#create_agent(params = {}) ⇒ Types::CreateAgentResponse

Creates an Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.create_agent({
  agent_name: "Name", # required
  client_token: "ClientToken",
  instruction: "Instruction",
  foundation_model: "ModelIdentifier",
  description: "Description",
  idle_session_ttl_in_seconds: 1,
  agent_resource_role_arn: "AgentRoleArn", # required
  customer_encryption_key_arn: "KmsKeyArn",
  tags: {
    "TagKey" => "TagValue",
  },
  prompt_override_configuration: {
    prompt_configurations: [ # required
      {
        prompt_type: "PRE_PROCESSING", # accepts PRE_PROCESSING, ORCHESTRATION, POST_PROCESSING, KNOWLEDGE_BASE_RESPONSE_GENERATION
        prompt_creation_mode: "DEFAULT", # accepts DEFAULT, OVERRIDDEN
        prompt_state: "ENABLED", # accepts ENABLED, DISABLED
        base_prompt_template: "BasePromptTemplate",
        inference_configuration: {
          temperature: 1.0,
          top_p: 1.0,
          top_k: 1,
          maximum_length: 1,
          stop_sequences: ["String"],
        },
        parser_mode: "DEFAULT", # accepts DEFAULT, OVERRIDDEN
      },
    ],
    override_lambda: "LambdaArn",
  },
})

Response structure


resp.agent.agent_id #=> String
resp.agent.agent_name #=> String
resp.agent.agent_arn #=> String
resp.agent.agent_version #=> String
resp.agent.client_token #=> String
resp.agent.instruction #=> String
resp.agent.agent_status #=> String, one of "CREATING", "PREPARING", "PREPARED", "NOT_PREPARED", "DELETING", "FAILED", "VERSIONING", "UPDATING"
resp.agent.foundation_model #=> String
resp.agent.description #=> String
resp.agent.idle_session_ttl_in_seconds #=> Integer
resp.agent.agent_resource_role_arn #=> String
resp.agent.customer_encryption_key_arn #=> String
resp.agent.created_at #=> Time
resp.agent.updated_at #=> Time
resp.agent.prepared_at #=> Time
resp.agent.failure_reasons #=> Array
resp.agent.failure_reasons[0] #=> String
resp.agent.recommended_actions #=> Array
resp.agent.recommended_actions[0] #=> String
resp.agent.prompt_override_configuration.prompt_configurations #=> Array
resp.agent.prompt_override_configuration.prompt_configurations[0].prompt_type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "POST_PROCESSING", "KNOWLEDGE_BASE_RESPONSE_GENERATION"
resp.agent.prompt_override_configuration.prompt_configurations[0].prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
resp.agent.prompt_override_configuration.prompt_configurations[0].prompt_state #=> String, one of "ENABLED", "DISABLED"
resp.agent.prompt_override_configuration.prompt_configurations[0].base_prompt_template #=> String
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.temperature #=> Float
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.top_p #=> Float
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.top_k #=> Integer
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.maximum_length #=> Integer
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.stop_sequences #=> Array
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.stop_sequences[0] #=> String
resp.agent.prompt_override_configuration.prompt_configurations[0].parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
resp.agent.prompt_override_configuration.override_lambda #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :agent_name (required, String)

    Name for a resource.

  • :client_token (String)

    Client specified token used for idempotency checks

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

  • :instruction (String)

    Instruction for the agent.

  • :foundation_model (String)

    ARN or name of a Bedrock model.

  • :description (String)

    Description of the Resource.

  • :idle_session_ttl_in_seconds (Integer)

    Max Session Time.

  • :agent_resource_role_arn (required, String)

    ARN of a IAM role.

  • :customer_encryption_key_arn (String)

    A KMS key ARN

  • :tags (Hash<String,String>)

    A map of tag keys and values

  • :prompt_override_configuration (Types::PromptOverrideConfiguration)

    Configuration for prompt override.

Returns:

See Also:



554
555
556
557
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 554

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

#create_agent_action_group(params = {}) ⇒ Types::CreateAgentActionGroupResponse

Creates an Action Group for existing Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.create_agent_action_group({
  agent_id: "Id", # required
  agent_version: "DraftVersion", # required
  action_group_name: "Name", # required
  client_token: "ClientToken",
  description: "Description",
  parent_action_group_signature: "AMAZON.UserInput", # accepts AMAZON.UserInput
  action_group_executor: {
    lambda: "LambdaArn",
  },
  api_schema: {
    s3: {
      s3_bucket_name: "S3BucketName",
      s3_object_key: "S3ObjectKey",
    },
    payload: "Payload",
  },
  action_group_state: "ENABLED", # accepts ENABLED, DISABLED
})

Response structure


resp.agent_action_group.agent_id #=> String
resp.agent_action_group.agent_version #=> String
resp.agent_action_group.action_group_id #=> String
resp.agent_action_group.action_group_name #=> String
resp.agent_action_group.client_token #=> String
resp.agent_action_group.description #=> String
resp.agent_action_group.created_at #=> Time
resp.agent_action_group.updated_at #=> Time
resp.agent_action_group.parent_action_signature #=> String, one of "AMAZON.UserInput"
resp.agent_action_group.action_group_executor.lambda #=> String
resp.agent_action_group.api_schema.s3.s3_bucket_name #=> String
resp.agent_action_group.api_schema.s3.s3_object_key #=> String
resp.agent_action_group.api_schema.payload #=> String
resp.agent_action_group.action_group_state #=> String, one of "ENABLED", "DISABLED"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Draft Version of the Agent.

  • :action_group_name (required, String)

    Name for a resource.

  • :client_token (String)

    Client specified token used for idempotency checks

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

  • :description (String)

    Description of the Resource.

  • :parent_action_group_signature (String)

    Action Group Signature for a BuiltIn Action

  • :action_group_executor (Types::ActionGroupExecutor)

    Type of Executors for an Action Group

  • :api_schema (Types::APISchema)

    Contains information about the API Schema for the Action Group

  • :action_group_state (String)

    State of the action group

Returns:

See Also:



638
639
640
641
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 638

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

#create_agent_alias(params = {}) ⇒ Types::CreateAgentAliasResponse

Creates an Alias for an existing Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.create_agent_alias({
  agent_id: "Id", # required
  agent_alias_name: "Name", # required
  client_token: "ClientToken",
  description: "Description",
  routing_configuration: [
    {
      agent_version: "Version", # required
    },
  ],
  tags: {
    "TagKey" => "TagValue",
  },
})

Response structure


resp.agent_alias.agent_id #=> String
resp.agent_alias.agent_alias_id #=> String
resp.agent_alias.agent_alias_name #=> String
resp.agent_alias.agent_alias_arn #=> String
resp.agent_alias.client_token #=> String
resp.agent_alias.description #=> String
resp.agent_alias.routing_configuration #=> Array
resp.agent_alias.routing_configuration[0].agent_version #=> String
resp.agent_alias.created_at #=> Time
resp.agent_alias.updated_at #=> Time
resp.agent_alias.agent_alias_history_events #=> Array
resp.agent_alias.agent_alias_history_events[0].routing_configuration #=> Array
resp.agent_alias.agent_alias_history_events[0].routing_configuration[0].agent_version #=> String
resp.agent_alias.agent_alias_history_events[0].end_date #=> Time
resp.agent_alias.agent_alias_history_events[0].start_date #=> Time
resp.agent_alias.agent_alias_status #=> String, one of "CREATING", "PREPARED", "FAILED", "UPDATING", "DELETING"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_alias_name (required, String)

    Name for a resource.

  • :client_token (String)

    Client specified token used for idempotency checks

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

  • :description (String)

    Description of the Resource.

  • :routing_configuration (Array<Types::AgentAliasRoutingConfigurationListItem>)

    Routing configuration for an Agent alias.

  • :tags (Hash<String,String>)

    A map of tag keys and values

Returns:

See Also:



710
711
712
713
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 710

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

#create_data_source(params = {}) ⇒ Types::CreateDataSourceResponse

Create a new data source

Examples:

Request syntax with placeholder values


resp = client.create_data_source({
  knowledge_base_id: "Id", # required
  client_token: "ClientToken",
  name: "Name", # required
  description: "Description",
  data_source_configuration: { # required
    type: "S3", # required, accepts S3
    s3_configuration: {
      bucket_arn: "S3BucketArn", # required
      inclusion_prefixes: ["S3Prefix"],
    },
  },
  server_side_encryption_configuration: {
    kms_key_arn: "KmsKeyArn",
  },
  vector_ingestion_configuration: {
    chunking_configuration: {
      chunking_strategy: "FIXED_SIZE", # required, accepts FIXED_SIZE, NONE
      fixed_size_chunking_configuration: {
        max_tokens: 1, # required
        overlap_percentage: 1, # required
      },
    },
  },
})

Response structure


resp.data_source.knowledge_base_id #=> String
resp.data_source.data_source_id #=> String
resp.data_source.name #=> String
resp.data_source.status #=> String, one of "AVAILABLE", "DELETING"
resp.data_source.description #=> String
resp.data_source.data_source_configuration.type #=> String, one of "S3"
resp.data_source.data_source_configuration.s3_configuration.bucket_arn #=> String
resp.data_source.data_source_configuration.s3_configuration.inclusion_prefixes #=> Array
resp.data_source.data_source_configuration.s3_configuration.inclusion_prefixes[0] #=> String
resp.data_source.server_side_encryption_configuration.kms_key_arn #=> String
resp.data_source.vector_ingestion_configuration.chunking_configuration.chunking_strategy #=> String, one of "FIXED_SIZE", "NONE"
resp.data_source.vector_ingestion_configuration.chunking_configuration.fixed_size_chunking_configuration.max_tokens #=> Integer
resp.data_source.vector_ingestion_configuration.chunking_configuration.fixed_size_chunking_configuration.overlap_percentage #=> Integer
resp.data_source.created_at #=> Time
resp.data_source.updated_at #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :client_token (String)

    Client specified token used for idempotency checks

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

  • :name (required, String)

    Name for a resource.

  • :description (String)

    Description of the Resource.

  • :data_source_configuration (required, Types::DataSourceConfiguration)

    Specifies a raw data source location to ingest.

  • :server_side_encryption_configuration (Types::ServerSideEncryptionConfiguration)

    Server-side encryption configuration.

  • :vector_ingestion_configuration (Types::VectorIngestionConfiguration)

    Configures ingestion for a vector knowledge base

Returns:

See Also:



795
796
797
798
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 795

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

#create_knowledge_base(params = {}) ⇒ Types::CreateKnowledgeBaseResponse

Create a new knowledge base

Examples:

Request syntax with placeholder values


resp = client.create_knowledge_base({
  client_token: "ClientToken",
  name: "Name", # required
  description: "Description",
  role_arn: "KnowledgeBaseRoleArn", # required
  knowledge_base_configuration: { # required
    type: "VECTOR", # required, accepts VECTOR
    vector_knowledge_base_configuration: {
      embedding_model_arn: "BedrockEmbeddingModelArn", # required
    },
  },
  storage_configuration: { # required
    type: "OPENSEARCH_SERVERLESS", # required, accepts OPENSEARCH_SERVERLESS, PINECONE, REDIS_ENTERPRISE_CLOUD, RDS
    opensearch_serverless_configuration: {
      collection_arn: "OpenSearchServerlessCollectionArn", # required
      vector_index_name: "OpenSearchServerlessIndexName", # required
      field_mapping: { # required
        vector_field: "FieldName", # required
        text_field: "FieldName", # required
        metadata_field: "FieldName", # required
      },
    },
    pinecone_configuration: {
      connection_string: "PineconeConnectionString", # required
      credentials_secret_arn: "SecretArn", # required
      namespace: "PineconeNamespace",
      field_mapping: { # required
        text_field: "FieldName", # required
        metadata_field: "FieldName", # required
      },
    },
    redis_enterprise_cloud_configuration: {
      endpoint: "RedisEnterpriseCloudEndpoint", # required
      vector_index_name: "RedisEnterpriseCloudIndexName", # required
      credentials_secret_arn: "SecretArn", # required
      field_mapping: { # required
        vector_field: "FieldName", # required
        text_field: "FieldName", # required
        metadata_field: "FieldName", # required
      },
    },
    rds_configuration: {
      resource_arn: "RdsArn", # required
      credentials_secret_arn: "SecretArn", # required
      database_name: "RdsDatabaseName", # required
      table_name: "RdsTableName", # required
      field_mapping: { # required
        primary_key_field: "ColumnName", # required
        vector_field: "ColumnName", # required
        text_field: "ColumnName", # required
        metadata_field: "ColumnName", # required
      },
    },
  },
  tags: {
    "TagKey" => "TagValue",
  },
})

Response structure


resp.knowledge_base.knowledge_base_id #=> String
resp.knowledge_base.name #=> String
resp.knowledge_base.knowledge_base_arn #=> String
resp.knowledge_base.description #=> String
resp.knowledge_base.role_arn #=> String
resp.knowledge_base.knowledge_base_configuration.type #=> String, one of "VECTOR"
resp.knowledge_base.knowledge_base_configuration.vector_knowledge_base_configuration.embedding_model_arn #=> String
resp.knowledge_base.storage_configuration.type #=> String, one of "OPENSEARCH_SERVERLESS", "PINECONE", "REDIS_ENTERPRISE_CLOUD", "RDS"
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.collection_arn #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.vector_index_name #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.field_mapping.vector_field #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.field_mapping. #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.connection_string #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.credentials_secret_arn #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.namespace #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.field_mapping. #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.endpoint #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.vector_index_name #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.credentials_secret_arn #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.field_mapping.vector_field #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.field_mapping. #=> String
resp.knowledge_base.storage_configuration.rds_configuration.resource_arn #=> String
resp.knowledge_base.storage_configuration.rds_configuration.credentials_secret_arn #=> String
resp.knowledge_base.storage_configuration.rds_configuration.database_name #=> String
resp.knowledge_base.storage_configuration.rds_configuration.table_name #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping.primary_key_field #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping.vector_field #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping. #=> String
resp.knowledge_base.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "UPDATING", "FAILED"
resp.knowledge_base.created_at #=> Time
resp.knowledge_base.updated_at #=> Time
resp.knowledge_base.failure_reasons #=> Array
resp.knowledge_base.failure_reasons[0] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :client_token (String)

    Client specified token used for idempotency checks

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

  • :name (required, String)

    Name for a resource.

  • :description (String)

    Description of the Resource.

  • :role_arn (required, String)

    ARN of a IAM role.

  • :knowledge_base_configuration (required, Types::KnowledgeBaseConfiguration)

    Configures a bedrock knowledge base.

  • :storage_configuration (required, Types::StorageConfiguration)

    Configures the physical storage of ingested data in a knowledge base.

  • :tags (Hash<String,String>)

    A map of tag keys and values

Returns:

See Also:



935
936
937
938
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 935

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

#delete_agent(params = {}) ⇒ Types::DeleteAgentResponse

Deletes an Agent for existing Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.delete_agent({
  agent_id: "Id", # required
  skip_resource_in_use_check: false,
})

Response structure


resp.agent_id #=> String
resp.agent_status #=> String, one of "CREATING", "PREPARING", "PREPARED", "NOT_PREPARED", "DELETING", "FAILED", "VERSIONING", "UPDATING"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :skip_resource_in_use_check (Boolean)

    Skips checking if resource is in use when set to true. Defaults to false

Returns:

See Also:



970
971
972
973
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 970

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

#delete_agent_action_group(params = {}) ⇒ Struct

Deletes an Action Group for existing Amazon Bedrock Agent.

Examples:

Request syntax with placeholder values


resp = client.delete_agent_action_group({
  agent_id: "Id", # required
  agent_version: "DraftVersion", # required
  action_group_id: "Id", # required
  skip_resource_in_use_check: false,
})

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Draft Version of the Agent.

  • :action_group_id (required, String)

    Id generated at the server side when an Agent ActionGroup is created

  • :skip_resource_in_use_check (Boolean)

    Skips checking if resource is in use when set to true. Defaults to false

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1005
1006
1007
1008
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1005

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

#delete_agent_alias(params = {}) ⇒ Types::DeleteAgentAliasResponse

Deletes an Alias for a Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.delete_agent_alias({
  agent_id: "Id", # required
  agent_alias_id: "AgentAliasId", # required
})

Response structure


resp.agent_id #=> String
resp.agent_alias_id #=> String
resp.agent_alias_status #=> String, one of "CREATING", "PREPARED", "FAILED", "UPDATING", "DELETING"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_alias_id (required, String)

    Id generated at the server side when an Agent Alias is created

Returns:

See Also:



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

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

#delete_agent_version(params = {}) ⇒ Types::DeleteAgentVersionResponse

Deletes an Agent version for existing Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.delete_agent_version({
  agent_id: "Id", # required
  agent_version: "NumericalVersion", # required
  skip_resource_in_use_check: false,
})

Response structure


resp.agent_id #=> String
resp.agent_version #=> String
resp.agent_status #=> String, one of "CREATING", "PREPARING", "PREPARED", "NOT_PREPARED", "DELETING", "FAILED", "VERSIONING", "UPDATING"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Numerical Agent Version.

  • :skip_resource_in_use_check (Boolean)

    Skips checking if resource is in use when set to true. Defaults to false

Returns:

See Also:



1082
1083
1084
1085
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1082

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

#delete_data_source(params = {}) ⇒ Types::DeleteDataSourceResponse

Delete an existing data source

Examples:

Request syntax with placeholder values


resp = client.delete_data_source({
  knowledge_base_id: "Id", # required
  data_source_id: "Id", # required
})

Response structure


resp.knowledge_base_id #=> String
resp.data_source_id #=> String
resp.status #=> String, one of "AVAILABLE", "DELETING"

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :data_source_id (required, String)

    Identifier for a resource.

Returns:

See Also:



1118
1119
1120
1121
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1118

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

#delete_knowledge_base(params = {}) ⇒ Types::DeleteKnowledgeBaseResponse

Delete an existing knowledge base

Examples:

Request syntax with placeholder values


resp = client.delete_knowledge_base({
  knowledge_base_id: "Id", # required
})

Response structure


resp.knowledge_base_id #=> String
resp.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "UPDATING", "FAILED"

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

Returns:

See Also:



1148
1149
1150
1151
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1148

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

#disassociate_agent_knowledge_base(params = {}) ⇒ Struct

Disassociate an existing Knowledge Base from an Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.disassociate_agent_knowledge_base({
  agent_id: "Id", # required
  agent_version: "DraftVersion", # required
  knowledge_base_id: "Id", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Draft Version of the Agent.

  • :knowledge_base_id (required, String)

    Id generated at the server side when a Knowledge Base is associated to an Agent

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1179
1180
1181
1182
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1179

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

#get_agent(params = {}) ⇒ Types::GetAgentResponse

Gets an Agent for existing Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.get_agent({
  agent_id: "Id", # required
})

Response structure


resp.agent.agent_id #=> String
resp.agent.agent_name #=> String
resp.agent.agent_arn #=> String
resp.agent.agent_version #=> String
resp.agent.client_token #=> String
resp.agent.instruction #=> String
resp.agent.agent_status #=> String, one of "CREATING", "PREPARING", "PREPARED", "NOT_PREPARED", "DELETING", "FAILED", "VERSIONING", "UPDATING"
resp.agent.foundation_model #=> String
resp.agent.description #=> String
resp.agent.idle_session_ttl_in_seconds #=> Integer
resp.agent.agent_resource_role_arn #=> String
resp.agent.customer_encryption_key_arn #=> String
resp.agent.created_at #=> Time
resp.agent.updated_at #=> Time
resp.agent.prepared_at #=> Time
resp.agent.failure_reasons #=> Array
resp.agent.failure_reasons[0] #=> String
resp.agent.recommended_actions #=> Array
resp.agent.recommended_actions[0] #=> String
resp.agent.prompt_override_configuration.prompt_configurations #=> Array
resp.agent.prompt_override_configuration.prompt_configurations[0].prompt_type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "POST_PROCESSING", "KNOWLEDGE_BASE_RESPONSE_GENERATION"
resp.agent.prompt_override_configuration.prompt_configurations[0].prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
resp.agent.prompt_override_configuration.prompt_configurations[0].prompt_state #=> String, one of "ENABLED", "DISABLED"
resp.agent.prompt_override_configuration.prompt_configurations[0].base_prompt_template #=> String
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.temperature #=> Float
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.top_p #=> Float
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.top_k #=> Integer
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.maximum_length #=> Integer
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.stop_sequences #=> Array
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.stop_sequences[0] #=> String
resp.agent.prompt_override_configuration.prompt_configurations[0].parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
resp.agent.prompt_override_configuration.override_lambda #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

Returns:

See Also:



1238
1239
1240
1241
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1238

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

#get_agent_action_group(params = {}) ⇒ Types::GetAgentActionGroupResponse

Gets an Action Group for existing Amazon Bedrock Agent Version

Examples:

Request syntax with placeholder values


resp = client.get_agent_action_group({
  agent_id: "Id", # required
  agent_version: "Version", # required
  action_group_id: "Id", # required
})

Response structure


resp.agent_action_group.agent_id #=> String
resp.agent_action_group.agent_version #=> String
resp.agent_action_group.action_group_id #=> String
resp.agent_action_group.action_group_name #=> String
resp.agent_action_group.client_token #=> String
resp.agent_action_group.description #=> String
resp.agent_action_group.created_at #=> Time
resp.agent_action_group.updated_at #=> Time
resp.agent_action_group.parent_action_signature #=> String, one of "AMAZON.UserInput"
resp.agent_action_group.action_group_executor.lambda #=> String
resp.agent_action_group.api_schema.s3.s3_bucket_name #=> String
resp.agent_action_group.api_schema.s3.s3_object_key #=> String
resp.agent_action_group.api_schema.payload #=> String
resp.agent_action_group.action_group_state #=> String, one of "ENABLED", "DISABLED"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Version number generated when a version is created

  • :action_group_id (required, String)

    Id generated at the server side when an Agent Action Group is created

Returns:

See Also:



1287
1288
1289
1290
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1287

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

#get_agent_alias(params = {}) ⇒ Types::GetAgentAliasResponse

Describes an Alias for a Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.get_agent_alias({
  agent_id: "Id", # required
  agent_alias_id: "AgentAliasId", # required
})

Response structure


resp.agent_alias.agent_id #=> String
resp.agent_alias.agent_alias_id #=> String
resp.agent_alias.agent_alias_name #=> String
resp.agent_alias.agent_alias_arn #=> String
resp.agent_alias.client_token #=> String
resp.agent_alias.description #=> String
resp.agent_alias.routing_configuration #=> Array
resp.agent_alias.routing_configuration[0].agent_version #=> String
resp.agent_alias.created_at #=> Time
resp.agent_alias.updated_at #=> Time
resp.agent_alias.agent_alias_history_events #=> Array
resp.agent_alias.agent_alias_history_events[0].routing_configuration #=> Array
resp.agent_alias.agent_alias_history_events[0].routing_configuration[0].agent_version #=> String
resp.agent_alias.agent_alias_history_events[0].end_date #=> Time
resp.agent_alias.agent_alias_history_events[0].start_date #=> Time
resp.agent_alias.agent_alias_status #=> String, one of "CREATING", "PREPARED", "FAILED", "UPDATING", "DELETING"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_alias_id (required, String)

    Id generated at the server side when an Agent Alias is created

Returns:

See Also:



1334
1335
1336
1337
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1334

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

#get_agent_knowledge_base(params = {}) ⇒ Types::GetAgentKnowledgeBaseResponse

Gets a knowledge base associated to an existing Amazon Bedrock Agent Version

Examples:

Request syntax with placeholder values


resp = client.get_agent_knowledge_base({
  agent_id: "Id", # required
  agent_version: "Version", # required
  knowledge_base_id: "Id", # required
})

Response structure


resp.agent_knowledge_base.agent_id #=> String
resp.agent_knowledge_base.agent_version #=> String
resp.agent_knowledge_base.knowledge_base_id #=> String
resp.agent_knowledge_base.description #=> String
resp.agent_knowledge_base.created_at #=> Time
resp.agent_knowledge_base.updated_at #=> Time
resp.agent_knowledge_base.knowledge_base_state #=> String, one of "ENABLED", "DISABLED"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Version number generated when a version is created

  • :knowledge_base_id (required, String)

    Id generated at the server side when a Knowledge Base is associated

Returns:

See Also:



1377
1378
1379
1380
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1377

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

#get_agent_version(params = {}) ⇒ Types::GetAgentVersionResponse

Gets an Agent version for existing Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.get_agent_version({
  agent_id: "Id", # required
  agent_version: "NumericalVersion", # required
})

Response structure


resp.agent_version.agent_id #=> String
resp.agent_version.agent_name #=> String
resp.agent_version.agent_arn #=> String
resp.agent_version.version #=> String
resp.agent_version.instruction #=> String
resp.agent_version.agent_status #=> String, one of "CREATING", "PREPARING", "PREPARED", "NOT_PREPARED", "DELETING", "FAILED", "VERSIONING", "UPDATING"
resp.agent_version.foundation_model #=> String
resp.agent_version.description #=> String
resp.agent_version.idle_session_ttl_in_seconds #=> Integer
resp.agent_version.agent_resource_role_arn #=> String
resp.agent_version.customer_encryption_key_arn #=> String
resp.agent_version.created_at #=> Time
resp.agent_version.updated_at #=> Time
resp.agent_version.failure_reasons #=> Array
resp.agent_version.failure_reasons[0] #=> String
resp.agent_version.recommended_actions #=> Array
resp.agent_version.recommended_actions[0] #=> String
resp.agent_version.prompt_override_configuration.prompt_configurations #=> Array
resp.agent_version.prompt_override_configuration.prompt_configurations[0].prompt_type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "POST_PROCESSING", "KNOWLEDGE_BASE_RESPONSE_GENERATION"
resp.agent_version.prompt_override_configuration.prompt_configurations[0].prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
resp.agent_version.prompt_override_configuration.prompt_configurations[0].prompt_state #=> String, one of "ENABLED", "DISABLED"
resp.agent_version.prompt_override_configuration.prompt_configurations[0].base_prompt_template #=> String
resp.agent_version.prompt_override_configuration.prompt_configurations[0].inference_configuration.temperature #=> Float
resp.agent_version.prompt_override_configuration.prompt_configurations[0].inference_configuration.top_p #=> Float
resp.agent_version.prompt_override_configuration.prompt_configurations[0].inference_configuration.top_k #=> Integer
resp.agent_version.prompt_override_configuration.prompt_configurations[0].inference_configuration.maximum_length #=> Integer
resp.agent_version.prompt_override_configuration.prompt_configurations[0].inference_configuration.stop_sequences #=> Array
resp.agent_version.prompt_override_configuration.prompt_configurations[0].inference_configuration.stop_sequences[0] #=> String
resp.agent_version.prompt_override_configuration.prompt_configurations[0].parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
resp.agent_version.prompt_override_configuration.override_lambda #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Numerical Agent Version.

Returns:

See Also:



1438
1439
1440
1441
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1438

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

#get_data_source(params = {}) ⇒ Types::GetDataSourceResponse

Get an existing data source

Examples:

Request syntax with placeholder values


resp = client.get_data_source({
  knowledge_base_id: "Id", # required
  data_source_id: "Id", # required
})

Response structure


resp.data_source.knowledge_base_id #=> String
resp.data_source.data_source_id #=> String
resp.data_source.name #=> String
resp.data_source.status #=> String, one of "AVAILABLE", "DELETING"
resp.data_source.description #=> String
resp.data_source.data_source_configuration.type #=> String, one of "S3"
resp.data_source.data_source_configuration.s3_configuration.bucket_arn #=> String
resp.data_source.data_source_configuration.s3_configuration.inclusion_prefixes #=> Array
resp.data_source.data_source_configuration.s3_configuration.inclusion_prefixes[0] #=> String
resp.data_source.server_side_encryption_configuration.kms_key_arn #=> String
resp.data_source.vector_ingestion_configuration.chunking_configuration.chunking_strategy #=> String, one of "FIXED_SIZE", "NONE"
resp.data_source.vector_ingestion_configuration.chunking_configuration.fixed_size_chunking_configuration.max_tokens #=> Integer
resp.data_source.vector_ingestion_configuration.chunking_configuration.fixed_size_chunking_configuration.overlap_percentage #=> Integer
resp.data_source.created_at #=> Time
resp.data_source.updated_at #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :data_source_id (required, String)

    Identifier for a resource.

Returns:

See Also:



1484
1485
1486
1487
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1484

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

#get_ingestion_job(params = {}) ⇒ Types::GetIngestionJobResponse

Get an ingestion job

Examples:

Request syntax with placeholder values


resp = client.get_ingestion_job({
  knowledge_base_id: "Id", # required
  data_source_id: "Id", # required
  ingestion_job_id: "Id", # required
})

Response structure


resp.ingestion_job.knowledge_base_id #=> String
resp.ingestion_job.data_source_id #=> String
resp.ingestion_job.ingestion_job_id #=> String
resp.ingestion_job.description #=> String
resp.ingestion_job.status #=> String, one of "STARTING", "IN_PROGRESS", "COMPLETE", "FAILED"
resp.ingestion_job.statistics.number_of_documents_scanned #=> Integer
resp.ingestion_job.statistics.number_of_new_documents_indexed #=> Integer
resp.ingestion_job.statistics.number_of_modified_documents_indexed #=> Integer
resp.ingestion_job.statistics.number_of_documents_deleted #=> Integer
resp.ingestion_job.statistics.number_of_documents_failed #=> Integer
resp.ingestion_job.failure_reasons #=> Array
resp.ingestion_job.failure_reasons[0] #=> String
resp.ingestion_job.started_at #=> Time
resp.ingestion_job.updated_at #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :data_source_id (required, String)

    Identifier for a resource.

  • :ingestion_job_id (required, String)

    Identifier for a resource.

Returns:

See Also:



1533
1534
1535
1536
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1533

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

#get_knowledge_base(params = {}) ⇒ Types::GetKnowledgeBaseResponse

Get an existing knowledge base

Examples:

Request syntax with placeholder values


resp = client.get_knowledge_base({
  knowledge_base_id: "Id", # required
})

Response structure


resp.knowledge_base.knowledge_base_id #=> String
resp.knowledge_base.name #=> String
resp.knowledge_base.knowledge_base_arn #=> String
resp.knowledge_base.description #=> String
resp.knowledge_base.role_arn #=> String
resp.knowledge_base.knowledge_base_configuration.type #=> String, one of "VECTOR"
resp.knowledge_base.knowledge_base_configuration.vector_knowledge_base_configuration.embedding_model_arn #=> String
resp.knowledge_base.storage_configuration.type #=> String, one of "OPENSEARCH_SERVERLESS", "PINECONE", "REDIS_ENTERPRISE_CLOUD", "RDS"
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.collection_arn #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.vector_index_name #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.field_mapping.vector_field #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.field_mapping. #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.connection_string #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.credentials_secret_arn #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.namespace #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.field_mapping. #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.endpoint #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.vector_index_name #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.credentials_secret_arn #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.field_mapping.vector_field #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.field_mapping. #=> String
resp.knowledge_base.storage_configuration.rds_configuration.resource_arn #=> String
resp.knowledge_base.storage_configuration.rds_configuration.credentials_secret_arn #=> String
resp.knowledge_base.storage_configuration.rds_configuration.database_name #=> String
resp.knowledge_base.storage_configuration.rds_configuration.table_name #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping.primary_key_field #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping.vector_field #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping. #=> String
resp.knowledge_base.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "UPDATING", "FAILED"
resp.knowledge_base.created_at #=> Time
resp.knowledge_base.updated_at #=> Time
resp.knowledge_base.failure_reasons #=> Array
resp.knowledge_base.failure_reasons[0] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

Returns:

See Also:



1597
1598
1599
1600
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1597

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

#list_agent_action_groups(params = {}) ⇒ Types::ListAgentActionGroupsResponse

Lists an Action Group for existing Amazon Bedrock Agent Version

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_agent_action_groups({
  agent_id: "Id", # required
  agent_version: "Version", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.action_group_summaries #=> Array
resp.action_group_summaries[0].action_group_id #=> String
resp.action_group_summaries[0].action_group_name #=> String
resp.action_group_summaries[0].action_group_state #=> String, one of "ENABLED", "DISABLED"
resp.action_group_summaries[0].description #=> String
resp.action_group_summaries[0].updated_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is Listed

  • :agent_version (required, String)

    Id generated at the server side when an Agent is Listed

  • :max_results (Integer)

    Max Results.

  • :next_token (String)

    Opaque continuation token of previous paginated response.

Returns:

See Also:



1646
1647
1648
1649
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1646

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

#list_agent_aliases(params = {}) ⇒ Types::ListAgentAliasesResponse

Lists all the Aliases for an Amazon Bedrock Agent

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_agent_aliases({
  agent_id: "Id", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.agent_alias_summaries #=> Array
resp.agent_alias_summaries[0].agent_alias_id #=> String
resp.agent_alias_summaries[0].agent_alias_name #=> String
resp.agent_alias_summaries[0].description #=> String
resp.agent_alias_summaries[0].routing_configuration #=> Array
resp.agent_alias_summaries[0].routing_configuration[0].agent_version #=> String
resp.agent_alias_summaries[0].agent_alias_status #=> String, one of "CREATING", "PREPARED", "FAILED", "UPDATING", "DELETING"
resp.agent_alias_summaries[0].created_at #=> Time
resp.agent_alias_summaries[0].updated_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :max_results (Integer)

    Max Results.

  • :next_token (String)

    Opaque continuation token of previous paginated response.

Returns:

See Also:



1694
1695
1696
1697
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1694

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

#list_agent_knowledge_bases(params = {}) ⇒ Types::ListAgentKnowledgeBasesResponse

List of Knowledge Bases associated to an existing Amazon Bedrock Agent Version

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_agent_knowledge_bases({
  agent_id: "Id", # required
  agent_version: "Version", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.agent_knowledge_base_summaries #=> Array
resp.agent_knowledge_base_summaries[0].knowledge_base_id #=> String
resp.agent_knowledge_base_summaries[0].description #=> String
resp.agent_knowledge_base_summaries[0].knowledge_base_state #=> String, one of "ENABLED", "DISABLED"
resp.agent_knowledge_base_summaries[0].updated_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Version number generated when a version is created

  • :max_results (Integer)

    Max Results.

  • :next_token (String)

    Opaque continuation token of previous paginated response.

Returns:

See Also:



1743
1744
1745
1746
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1743

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

#list_agent_versions(params = {}) ⇒ Types::ListAgentVersionsResponse

Lists Agent Versions

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_agent_versions({
  agent_id: "Id", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.agent_version_summaries #=> Array
resp.agent_version_summaries[0].agent_name #=> String
resp.agent_version_summaries[0].agent_status #=> String, one of "CREATING", "PREPARING", "PREPARED", "NOT_PREPARED", "DELETING", "FAILED", "VERSIONING", "UPDATING"
resp.agent_version_summaries[0].agent_version #=> String
resp.agent_version_summaries[0].created_at #=> Time
resp.agent_version_summaries[0].updated_at #=> Time
resp.agent_version_summaries[0].description #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :max_results (Integer)

    Max Results.

  • :next_token (String)

    Opaque continuation token of previous paginated response.

Returns:

See Also:



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

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

#list_agents(params = {}) ⇒ Types::ListAgentsResponse

Lists Agents

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_agents({
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.agent_summaries #=> Array
resp.agent_summaries[0].agent_id #=> String
resp.agent_summaries[0].agent_name #=> String
resp.agent_summaries[0].agent_status #=> String, one of "CREATING", "PREPARING", "PREPARED", "NOT_PREPARED", "DELETING", "FAILED", "VERSIONING", "UPDATING"
resp.agent_summaries[0].description #=> String
resp.agent_summaries[0].updated_at #=> Time
resp.agent_summaries[0].latest_agent_version #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :max_results (Integer)

    Max Results.

  • :next_token (String)

    Opaque continuation token of previous paginated response.

Returns:

See Also:



1831
1832
1833
1834
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1831

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

#list_data_sources(params = {}) ⇒ Types::ListDataSourcesResponse

List data sources

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_data_sources({
  knowledge_base_id: "Id", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.data_source_summaries #=> Array
resp.data_source_summaries[0].knowledge_base_id #=> String
resp.data_source_summaries[0].data_source_id #=> String
resp.data_source_summaries[0].name #=> String
resp.data_source_summaries[0].status #=> String, one of "AVAILABLE", "DELETING"
resp.data_source_summaries[0].description #=> String
resp.data_source_summaries[0].updated_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :max_results (Integer)

    Max Results.

  • :next_token (String)

    Opaque continuation token of previous paginated response.

Returns:

See Also:



1877
1878
1879
1880
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1877

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

#list_ingestion_jobs(params = {}) ⇒ Types::ListIngestionJobsResponse

List ingestion jobs

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_ingestion_jobs({
  knowledge_base_id: "Id", # required
  data_source_id: "Id", # required
  filters: [
    {
      attribute: "STATUS", # required, accepts STATUS
      operator: "EQ", # required, accepts EQ
      values: ["IngestionJobFilterValue"], # required
    },
  ],
  sort_by: {
    attribute: "STATUS", # required, accepts STATUS, STARTED_AT
    order: "ASCENDING", # required, accepts ASCENDING, DESCENDING
  },
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.ingestion_job_summaries #=> Array
resp.ingestion_job_summaries[0].knowledge_base_id #=> String
resp.ingestion_job_summaries[0].data_source_id #=> String
resp.ingestion_job_summaries[0].ingestion_job_id #=> String
resp.ingestion_job_summaries[0].description #=> String
resp.ingestion_job_summaries[0].status #=> String, one of "STARTING", "IN_PROGRESS", "COMPLETE", "FAILED"
resp.ingestion_job_summaries[0].started_at #=> Time
resp.ingestion_job_summaries[0].updated_at #=> Time
resp.ingestion_job_summaries[0].statistics.number_of_documents_scanned #=> Integer
resp.ingestion_job_summaries[0].statistics.number_of_new_documents_indexed #=> Integer
resp.ingestion_job_summaries[0].statistics.number_of_modified_documents_indexed #=> Integer
resp.ingestion_job_summaries[0].statistics.number_of_documents_deleted #=> Integer
resp.ingestion_job_summaries[0].statistics.number_of_documents_failed #=> Integer
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :data_source_id (required, String)

    Identifier for a resource.

  • :filters (Array<Types::IngestionJobFilter>)

    List of IngestionJobFilters

  • :sort_by (Types::IngestionJobSortBy)

    Sorts the response returned by ListIngestionJobs operation.

  • :max_results (Integer)

    Max Results.

  • :next_token (String)

    Opaque continuation token of previous paginated response.

Returns:

See Also:



1950
1951
1952
1953
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1950

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

#list_knowledge_bases(params = {}) ⇒ Types::ListKnowledgeBasesResponse

List Knowledge Bases

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_knowledge_bases({
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.knowledge_base_summaries #=> Array
resp.knowledge_base_summaries[0].knowledge_base_id #=> String
resp.knowledge_base_summaries[0].name #=> String
resp.knowledge_base_summaries[0].description #=> String
resp.knowledge_base_summaries[0].status #=> String, one of "CREATING", "ACTIVE", "DELETING", "UPDATING", "FAILED"
resp.knowledge_base_summaries[0].updated_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :max_results (Integer)

    Max Results.

  • :next_token (String)

    Opaque continuation token of previous paginated response.

Returns:

See Also:



1991
1992
1993
1994
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 1991

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

#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse

List tags for a resource

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "TaggableResourcesArn", # required
})

Response structure


resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base]

Returns:

See Also:



2020
2021
2022
2023
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2020

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

#prepare_agent(params = {}) ⇒ Types::PrepareAgentResponse

Prepares an existing Amazon Bedrock Agent to receive runtime requests

Examples:

Request syntax with placeholder values


resp = client.prepare_agent({
  agent_id: "Id", # required
})

Response structure


resp.agent_id #=> String
resp.agent_status #=> String, one of "CREATING", "PREPARING", "PREPARED", "NOT_PREPARED", "DELETING", "FAILED", "VERSIONING", "UPDATING"
resp.agent_version #=> String
resp.prepared_at #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

Returns:

See Also:



2054
2055
2056
2057
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2054

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

#start_ingestion_job(params = {}) ⇒ Types::StartIngestionJobResponse

Start a new ingestion job

Examples:

Request syntax with placeholder values


resp = client.start_ingestion_job({
  knowledge_base_id: "Id", # required
  data_source_id: "Id", # required
  client_token: "ClientToken",
  description: "Description",
})

Response structure


resp.ingestion_job.knowledge_base_id #=> String
resp.ingestion_job.data_source_id #=> String
resp.ingestion_job.ingestion_job_id #=> String
resp.ingestion_job.description #=> String
resp.ingestion_job.status #=> String, one of "STARTING", "IN_PROGRESS", "COMPLETE", "FAILED"
resp.ingestion_job.statistics.number_of_documents_scanned #=> Integer
resp.ingestion_job.statistics.number_of_new_documents_indexed #=> Integer
resp.ingestion_job.statistics.number_of_modified_documents_indexed #=> Integer
resp.ingestion_job.statistics.number_of_documents_deleted #=> Integer
resp.ingestion_job.statistics.number_of_documents_failed #=> Integer
resp.ingestion_job.failure_reasons #=> Array
resp.ingestion_job.failure_reasons[0] #=> String
resp.ingestion_job.started_at #=> Time
resp.ingestion_job.updated_at #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :data_source_id (required, String)

    Identifier for a resource.

  • :client_token (String)

    Client specified token used for idempotency checks

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

  • :description (String)

    Description of the Resource.

Returns:

See Also:



2110
2111
2112
2113
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2110

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

#tag_resource(params = {}) ⇒ Struct

Tag a resource

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "TaggableResourcesArn", # required
  tags: { # required
    "TagKey" => "TagValue",
  },
})

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base]

  • :tags (required, Hash<String,String>)

    A map of tag keys and values

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2138
2139
2140
2141
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2138

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

#untag_resource(params = {}) ⇒ Struct

Untag a resource

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "TaggableResourcesArn", # required
  tag_keys: ["TagKey"], # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base]

  • :tag_keys (required, Array<String>)

    List of Tag Keys

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2164
2165
2166
2167
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2164

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

#update_agent(params = {}) ⇒ Types::UpdateAgentResponse

Updates an existing Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.update_agent({
  agent_id: "Id", # required
  agent_name: "Name", # required
  instruction: "Instruction",
  foundation_model: "ModelIdentifier",
  description: "Description",
  idle_session_ttl_in_seconds: 1,
  agent_resource_role_arn: "AgentRoleArn", # required
  customer_encryption_key_arn: "KmsKeyArn",
  prompt_override_configuration: {
    prompt_configurations: [ # required
      {
        prompt_type: "PRE_PROCESSING", # accepts PRE_PROCESSING, ORCHESTRATION, POST_PROCESSING, KNOWLEDGE_BASE_RESPONSE_GENERATION
        prompt_creation_mode: "DEFAULT", # accepts DEFAULT, OVERRIDDEN
        prompt_state: "ENABLED", # accepts ENABLED, DISABLED
        base_prompt_template: "BasePromptTemplate",
        inference_configuration: {
          temperature: 1.0,
          top_p: 1.0,
          top_k: 1,
          maximum_length: 1,
          stop_sequences: ["String"],
        },
        parser_mode: "DEFAULT", # accepts DEFAULT, OVERRIDDEN
      },
    ],
    override_lambda: "LambdaArn",
  },
})

Response structure


resp.agent.agent_id #=> String
resp.agent.agent_name #=> String
resp.agent.agent_arn #=> String
resp.agent.agent_version #=> String
resp.agent.client_token #=> String
resp.agent.instruction #=> String
resp.agent.agent_status #=> String, one of "CREATING", "PREPARING", "PREPARED", "NOT_PREPARED", "DELETING", "FAILED", "VERSIONING", "UPDATING"
resp.agent.foundation_model #=> String
resp.agent.description #=> String
resp.agent.idle_session_ttl_in_seconds #=> Integer
resp.agent.agent_resource_role_arn #=> String
resp.agent.customer_encryption_key_arn #=> String
resp.agent.created_at #=> Time
resp.agent.updated_at #=> Time
resp.agent.prepared_at #=> Time
resp.agent.failure_reasons #=> Array
resp.agent.failure_reasons[0] #=> String
resp.agent.recommended_actions #=> Array
resp.agent.recommended_actions[0] #=> String
resp.agent.prompt_override_configuration.prompt_configurations #=> Array
resp.agent.prompt_override_configuration.prompt_configurations[0].prompt_type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "POST_PROCESSING", "KNOWLEDGE_BASE_RESPONSE_GENERATION"
resp.agent.prompt_override_configuration.prompt_configurations[0].prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
resp.agent.prompt_override_configuration.prompt_configurations[0].prompt_state #=> String, one of "ENABLED", "DISABLED"
resp.agent.prompt_override_configuration.prompt_configurations[0].base_prompt_template #=> String
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.temperature #=> Float
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.top_p #=> Float
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.top_k #=> Integer
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.maximum_length #=> Integer
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.stop_sequences #=> Array
resp.agent.prompt_override_configuration.prompt_configurations[0].inference_configuration.stop_sequences[0] #=> String
resp.agent.prompt_override_configuration.prompt_configurations[0].parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
resp.agent.prompt_override_configuration.override_lambda #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_name (required, String)

    Name for a resource.

  • :instruction (String)

    Instruction for the agent.

  • :foundation_model (String)

    ARN or name of a Bedrock model.

  • :description (String)

    Description of the Resource.

  • :idle_session_ttl_in_seconds (Integer)

    Max Session Time.

  • :agent_resource_role_arn (required, String)

    ARN of a IAM role.

  • :customer_encryption_key_arn (String)

    A KMS key ARN

  • :prompt_override_configuration (Types::PromptOverrideConfiguration)

    Configuration for prompt override.

Returns:

See Also:



2273
2274
2275
2276
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2273

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

#update_agent_action_group(params = {}) ⇒ Types::UpdateAgentActionGroupResponse

Updates an existing Action Group for Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.update_agent_action_group({
  agent_id: "Id", # required
  agent_version: "DraftVersion", # required
  action_group_id: "Id", # required
  action_group_name: "Name", # required
  description: "Description",
  parent_action_group_signature: "AMAZON.UserInput", # accepts AMAZON.UserInput
  action_group_executor: {
    lambda: "LambdaArn",
  },
  action_group_state: "ENABLED", # accepts ENABLED, DISABLED
  api_schema: {
    s3: {
      s3_bucket_name: "S3BucketName",
      s3_object_key: "S3ObjectKey",
    },
    payload: "Payload",
  },
})

Response structure


resp.agent_action_group.agent_id #=> String
resp.agent_action_group.agent_version #=> String
resp.agent_action_group.action_group_id #=> String
resp.agent_action_group.action_group_name #=> String
resp.agent_action_group.client_token #=> String
resp.agent_action_group.description #=> String
resp.agent_action_group.created_at #=> Time
resp.agent_action_group.updated_at #=> Time
resp.agent_action_group.parent_action_signature #=> String, one of "AMAZON.UserInput"
resp.agent_action_group.action_group_executor.lambda #=> String
resp.agent_action_group.api_schema.s3.s3_bucket_name #=> String
resp.agent_action_group.api_schema.s3.s3_object_key #=> String
resp.agent_action_group.api_schema.payload #=> String
resp.agent_action_group.action_group_state #=> String, one of "ENABLED", "DISABLED"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Draft Version of the Agent.

  • :action_group_id (required, String)

    Id generated at the server side when an Action Group is created under Agent

  • :action_group_name (required, String)

    Name for a resource.

  • :description (String)

    Description of the Resource.

  • :parent_action_group_signature (String)

    Action Group Signature for a BuiltIn Action

  • :action_group_executor (Types::ActionGroupExecutor)

    Type of Executors for an Action Group

  • :action_group_state (String)

    State of the action group

  • :api_schema (Types::APISchema)

    Contains information about the API Schema for the Action Group

Returns:

See Also:



2355
2356
2357
2358
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2355

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

#update_agent_alias(params = {}) ⇒ Types::UpdateAgentAliasResponse

Updates an existing Alias for an Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.update_agent_alias({
  agent_id: "Id", # required
  agent_alias_id: "AgentAliasId", # required
  agent_alias_name: "Name", # required
  description: "Description",
  routing_configuration: [
    {
      agent_version: "Version", # required
    },
  ],
})

Response structure


resp.agent_alias.agent_id #=> String
resp.agent_alias.agent_alias_id #=> String
resp.agent_alias.agent_alias_name #=> String
resp.agent_alias.agent_alias_arn #=> String
resp.agent_alias.client_token #=> String
resp.agent_alias.description #=> String
resp.agent_alias.routing_configuration #=> Array
resp.agent_alias.routing_configuration[0].agent_version #=> String
resp.agent_alias.created_at #=> Time
resp.agent_alias.updated_at #=> Time
resp.agent_alias.agent_alias_history_events #=> Array
resp.agent_alias.agent_alias_history_events[0].routing_configuration #=> Array
resp.agent_alias.agent_alias_history_events[0].routing_configuration[0].agent_version #=> String
resp.agent_alias.agent_alias_history_events[0].end_date #=> Time
resp.agent_alias.agent_alias_history_events[0].start_date #=> Time
resp.agent_alias.agent_alias_status #=> String, one of "CREATING", "PREPARED", "FAILED", "UPDATING", "DELETING"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_alias_id (required, String)

    Id generated at the server side when an Agent Alias is created

  • :agent_alias_name (required, String)

    Name for a resource.

  • :description (String)

    Description of the Resource.

  • :routing_configuration (Array<Types::AgentAliasRoutingConfigurationListItem>)

    Routing configuration for an Agent alias.

Returns:

See Also:



2418
2419
2420
2421
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2418

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

#update_agent_knowledge_base(params = {}) ⇒ Types::UpdateAgentKnowledgeBaseResponse

Updates an existing Knowledge Base associated to an Amazon Bedrock Agent

Examples:

Request syntax with placeholder values


resp = client.update_agent_knowledge_base({
  agent_id: "Id", # required
  agent_version: "DraftVersion", # required
  knowledge_base_id: "Id", # required
  description: "Description",
  knowledge_base_state: "ENABLED", # accepts ENABLED, DISABLED
})

Response structure


resp.agent_knowledge_base.agent_id #=> String
resp.agent_knowledge_base.agent_version #=> String
resp.agent_knowledge_base.knowledge_base_id #=> String
resp.agent_knowledge_base.description #=> String
resp.agent_knowledge_base.created_at #=> Time
resp.agent_knowledge_base.updated_at #=> Time
resp.agent_knowledge_base.knowledge_base_state #=> String, one of "ENABLED", "DISABLED"

Parameters:

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

    ({})

Options Hash (params):

  • :agent_id (required, String)

    Id generated at the server side when an Agent is created

  • :agent_version (required, String)

    Draft Version of the Agent.

  • :knowledge_base_id (required, String)

    Id generated at the server side when a Knowledge Base is associated to an Agent

  • :description (String)

    Description of the Resource.

  • :knowledge_base_state (String)

    State of the knowledge base; whether it is enabled or disabled

Returns:

See Also:



2470
2471
2472
2473
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2470

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

#update_data_source(params = {}) ⇒ Types::UpdateDataSourceResponse

Update an existing data source

Examples:

Request syntax with placeholder values


resp = client.update_data_source({
  knowledge_base_id: "Id", # required
  data_source_id: "Id", # required
  name: "Name", # required
  description: "Description",
  data_source_configuration: { # required
    type: "S3", # required, accepts S3
    s3_configuration: {
      bucket_arn: "S3BucketArn", # required
      inclusion_prefixes: ["S3Prefix"],
    },
  },
  server_side_encryption_configuration: {
    kms_key_arn: "KmsKeyArn",
  },
  vector_ingestion_configuration: {
    chunking_configuration: {
      chunking_strategy: "FIXED_SIZE", # required, accepts FIXED_SIZE, NONE
      fixed_size_chunking_configuration: {
        max_tokens: 1, # required
        overlap_percentage: 1, # required
      },
    },
  },
})

Response structure


resp.data_source.knowledge_base_id #=> String
resp.data_source.data_source_id #=> String
resp.data_source.name #=> String
resp.data_source.status #=> String, one of "AVAILABLE", "DELETING"
resp.data_source.description #=> String
resp.data_source.data_source_configuration.type #=> String, one of "S3"
resp.data_source.data_source_configuration.s3_configuration.bucket_arn #=> String
resp.data_source.data_source_configuration.s3_configuration.inclusion_prefixes #=> Array
resp.data_source.data_source_configuration.s3_configuration.inclusion_prefixes[0] #=> String
resp.data_source.server_side_encryption_configuration.kms_key_arn #=> String
resp.data_source.vector_ingestion_configuration.chunking_configuration.chunking_strategy #=> String, one of "FIXED_SIZE", "NONE"
resp.data_source.vector_ingestion_configuration.chunking_configuration.fixed_size_chunking_configuration.max_tokens #=> Integer
resp.data_source.vector_ingestion_configuration.chunking_configuration.fixed_size_chunking_configuration.overlap_percentage #=> Integer
resp.data_source.created_at #=> Time
resp.data_source.updated_at #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :data_source_id (required, String)

    Identifier for a resource.

  • :name (required, String)

    Name for a resource.

  • :description (String)

    Description of the Resource.

  • :data_source_configuration (required, Types::DataSourceConfiguration)

    Specifies a raw data source location to ingest.

  • :server_side_encryption_configuration (Types::ServerSideEncryptionConfiguration)

    Server-side encryption configuration.

  • :vector_ingestion_configuration (Types::VectorIngestionConfiguration)

    Configures ingestion for a vector knowledge base

Returns:

See Also:



2552
2553
2554
2555
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2552

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

#update_knowledge_base(params = {}) ⇒ Types::UpdateKnowledgeBaseResponse

Update an existing knowledge base

Examples:

Request syntax with placeholder values


resp = client.update_knowledge_base({
  knowledge_base_id: "Id", # required
  name: "Name", # required
  description: "Description",
  role_arn: "KnowledgeBaseRoleArn", # required
  knowledge_base_configuration: { # required
    type: "VECTOR", # required, accepts VECTOR
    vector_knowledge_base_configuration: {
      embedding_model_arn: "BedrockEmbeddingModelArn", # required
    },
  },
  storage_configuration: { # required
    type: "OPENSEARCH_SERVERLESS", # required, accepts OPENSEARCH_SERVERLESS, PINECONE, REDIS_ENTERPRISE_CLOUD, RDS
    opensearch_serverless_configuration: {
      collection_arn: "OpenSearchServerlessCollectionArn", # required
      vector_index_name: "OpenSearchServerlessIndexName", # required
      field_mapping: { # required
        vector_field: "FieldName", # required
        text_field: "FieldName", # required
        metadata_field: "FieldName", # required
      },
    },
    pinecone_configuration: {
      connection_string: "PineconeConnectionString", # required
      credentials_secret_arn: "SecretArn", # required
      namespace: "PineconeNamespace",
      field_mapping: { # required
        text_field: "FieldName", # required
        metadata_field: "FieldName", # required
      },
    },
    redis_enterprise_cloud_configuration: {
      endpoint: "RedisEnterpriseCloudEndpoint", # required
      vector_index_name: "RedisEnterpriseCloudIndexName", # required
      credentials_secret_arn: "SecretArn", # required
      field_mapping: { # required
        vector_field: "FieldName", # required
        text_field: "FieldName", # required
        metadata_field: "FieldName", # required
      },
    },
    rds_configuration: {
      resource_arn: "RdsArn", # required
      credentials_secret_arn: "SecretArn", # required
      database_name: "RdsDatabaseName", # required
      table_name: "RdsTableName", # required
      field_mapping: { # required
        primary_key_field: "ColumnName", # required
        vector_field: "ColumnName", # required
        text_field: "ColumnName", # required
        metadata_field: "ColumnName", # required
      },
    },
  },
})

Response structure


resp.knowledge_base.knowledge_base_id #=> String
resp.knowledge_base.name #=> String
resp.knowledge_base.knowledge_base_arn #=> String
resp.knowledge_base.description #=> String
resp.knowledge_base.role_arn #=> String
resp.knowledge_base.knowledge_base_configuration.type #=> String, one of "VECTOR"
resp.knowledge_base.knowledge_base_configuration.vector_knowledge_base_configuration.embedding_model_arn #=> String
resp.knowledge_base.storage_configuration.type #=> String, one of "OPENSEARCH_SERVERLESS", "PINECONE", "REDIS_ENTERPRISE_CLOUD", "RDS"
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.collection_arn #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.vector_index_name #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.field_mapping.vector_field #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.opensearch_serverless_configuration.field_mapping. #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.connection_string #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.credentials_secret_arn #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.namespace #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.pinecone_configuration.field_mapping. #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.endpoint #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.vector_index_name #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.credentials_secret_arn #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.field_mapping.vector_field #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.redis_enterprise_cloud_configuration.field_mapping. #=> String
resp.knowledge_base.storage_configuration.rds_configuration.resource_arn #=> String
resp.knowledge_base.storage_configuration.rds_configuration.credentials_secret_arn #=> String
resp.knowledge_base.storage_configuration.rds_configuration.database_name #=> String
resp.knowledge_base.storage_configuration.rds_configuration.table_name #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping.primary_key_field #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping.vector_field #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping.text_field #=> String
resp.knowledge_base.storage_configuration.rds_configuration.field_mapping. #=> String
resp.knowledge_base.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "UPDATING", "FAILED"
resp.knowledge_base.created_at #=> Time
resp.knowledge_base.updated_at #=> Time
resp.knowledge_base.failure_reasons #=> Array
resp.knowledge_base.failure_reasons[0] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :knowledge_base_id (required, String)

    Identifier for a resource.

  • :name (required, String)

    Name for a resource.

  • :description (String)

    Description of the Resource.

  • :role_arn (required, String)

    ARN of a IAM role.

  • :knowledge_base_configuration (required, Types::KnowledgeBaseConfiguration)

    Configures a bedrock knowledge base.

  • :storage_configuration (required, Types::StorageConfiguration)

    Configures the physical storage of ingested data in a knowledge base.

Returns:

See Also:



2683
2684
2685
2686
# File 'gems/aws-sdk-bedrockagent/lib/aws-sdk-bedrockagent/client.rb', line 2683

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