commonMain.aws.sdk.kotlin.services.bedrockagent.BedrockAgentClient.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockagent-jvm Show documentation
Show all versions of bedrockagent-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Agent
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockagent
import aws.sdk.kotlin.runtime.auth.credentials.DefaultChainCredentialsProvider
import aws.sdk.kotlin.runtime.auth.credentials.internal.manage
import aws.sdk.kotlin.runtime.client.AwsSdkClientConfig
import aws.sdk.kotlin.runtime.config.AbstractAwsSdkClientFactory
import aws.sdk.kotlin.runtime.config.endpoints.resolveEndpointUrl
import aws.sdk.kotlin.runtime.config.profile.AwsProfile
import aws.sdk.kotlin.runtime.config.profile.AwsSharedConfig
import aws.sdk.kotlin.runtime.http.retries.AwsRetryPolicy
import aws.sdk.kotlin.services.bedrockagent.auth.BedrockAgentAuthSchemeProvider
import aws.sdk.kotlin.services.bedrockagent.auth.DefaultBedrockAgentAuthSchemeProvider
import aws.sdk.kotlin.services.bedrockagent.endpoints.BedrockAgentEndpointParameters
import aws.sdk.kotlin.services.bedrockagent.endpoints.BedrockAgentEndpointProvider
import aws.sdk.kotlin.services.bedrockagent.endpoints.DefaultBedrockAgentEndpointProvider
import aws.sdk.kotlin.services.bedrockagent.model.AssociateAgentKnowledgeBaseRequest
import aws.sdk.kotlin.services.bedrockagent.model.AssociateAgentKnowledgeBaseResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreateAgentActionGroupRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreateAgentActionGroupResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreateAgentAliasRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreateAgentAliasResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreateAgentRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreateAgentResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreateDataSourceRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreateDataSourceResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreateFlowAliasRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreateFlowAliasResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreateFlowRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreateFlowResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreateFlowVersionRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreateFlowVersionResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreateKnowledgeBaseRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreateKnowledgeBaseResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreatePromptRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreatePromptResponse
import aws.sdk.kotlin.services.bedrockagent.model.CreatePromptVersionRequest
import aws.sdk.kotlin.services.bedrockagent.model.CreatePromptVersionResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeleteAgentActionGroupRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeleteAgentActionGroupResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeleteAgentAliasRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeleteAgentAliasResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeleteAgentRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeleteAgentResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeleteAgentVersionRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeleteAgentVersionResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeleteDataSourceRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeleteDataSourceResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeleteFlowAliasRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeleteFlowAliasResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeleteFlowRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeleteFlowResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeleteFlowVersionRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeleteFlowVersionResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeleteKnowledgeBaseRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeleteKnowledgeBaseResponse
import aws.sdk.kotlin.services.bedrockagent.model.DeletePromptRequest
import aws.sdk.kotlin.services.bedrockagent.model.DeletePromptResponse
import aws.sdk.kotlin.services.bedrockagent.model.DisassociateAgentKnowledgeBaseRequest
import aws.sdk.kotlin.services.bedrockagent.model.DisassociateAgentKnowledgeBaseResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentActionGroupRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentActionGroupResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentAliasRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentAliasResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentKnowledgeBaseRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentKnowledgeBaseResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentVersionRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetAgentVersionResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetDataSourceRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetDataSourceResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetFlowAliasRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetFlowAliasResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetFlowRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetFlowResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetFlowVersionRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetFlowVersionResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetIngestionJobRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetIngestionJobResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetKnowledgeBaseRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetKnowledgeBaseResponse
import aws.sdk.kotlin.services.bedrockagent.model.GetPromptRequest
import aws.sdk.kotlin.services.bedrockagent.model.GetPromptResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentActionGroupsRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentActionGroupsResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentAliasesRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentAliasesResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentKnowledgeBasesRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentKnowledgeBasesResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentVersionsRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentVersionsResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentsRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListAgentsResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListDataSourcesRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListDataSourcesResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListFlowAliasesRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListFlowAliasesResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListFlowVersionsRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListFlowVersionsResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListFlowsRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListFlowsResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListIngestionJobsRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListIngestionJobsResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListKnowledgeBasesRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListKnowledgeBasesResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListPromptsRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListPromptsResponse
import aws.sdk.kotlin.services.bedrockagent.model.ListTagsForResourceRequest
import aws.sdk.kotlin.services.bedrockagent.model.ListTagsForResourceResponse
import aws.sdk.kotlin.services.bedrockagent.model.PrepareAgentRequest
import aws.sdk.kotlin.services.bedrockagent.model.PrepareAgentResponse
import aws.sdk.kotlin.services.bedrockagent.model.PrepareFlowRequest
import aws.sdk.kotlin.services.bedrockagent.model.PrepareFlowResponse
import aws.sdk.kotlin.services.bedrockagent.model.StartIngestionJobRequest
import aws.sdk.kotlin.services.bedrockagent.model.StartIngestionJobResponse
import aws.sdk.kotlin.services.bedrockagent.model.StopIngestionJobRequest
import aws.sdk.kotlin.services.bedrockagent.model.StopIngestionJobResponse
import aws.sdk.kotlin.services.bedrockagent.model.TagResourceRequest
import aws.sdk.kotlin.services.bedrockagent.model.TagResourceResponse
import aws.sdk.kotlin.services.bedrockagent.model.UntagResourceRequest
import aws.sdk.kotlin.services.bedrockagent.model.UntagResourceResponse
import aws.sdk.kotlin.services.bedrockagent.model.UpdateAgentActionGroupRequest
import aws.sdk.kotlin.services.bedrockagent.model.UpdateAgentActionGroupResponse
import aws.sdk.kotlin.services.bedrockagent.model.UpdateAgentAliasRequest
import aws.sdk.kotlin.services.bedrockagent.model.UpdateAgentAliasResponse
import aws.sdk.kotlin.services.bedrockagent.model.UpdateAgentKnowledgeBaseRequest
import aws.sdk.kotlin.services.bedrockagent.model.UpdateAgentKnowledgeBaseResponse
import aws.sdk.kotlin.services.bedrockagent.model.UpdateAgentRequest
import aws.sdk.kotlin.services.bedrockagent.model.UpdateAgentResponse
import aws.sdk.kotlin.services.bedrockagent.model.UpdateDataSourceRequest
import aws.sdk.kotlin.services.bedrockagent.model.UpdateDataSourceResponse
import aws.sdk.kotlin.services.bedrockagent.model.UpdateFlowAliasRequest
import aws.sdk.kotlin.services.bedrockagent.model.UpdateFlowAliasResponse
import aws.sdk.kotlin.services.bedrockagent.model.UpdateFlowRequest
import aws.sdk.kotlin.services.bedrockagent.model.UpdateFlowResponse
import aws.sdk.kotlin.services.bedrockagent.model.UpdateKnowledgeBaseRequest
import aws.sdk.kotlin.services.bedrockagent.model.UpdateKnowledgeBaseResponse
import aws.sdk.kotlin.services.bedrockagent.model.UpdatePromptRequest
import aws.sdk.kotlin.services.bedrockagent.model.UpdatePromptResponse
import aws.sdk.kotlin.services.bedrockagent.model.ValidateFlowDefinitionRequest
import aws.sdk.kotlin.services.bedrockagent.model.ValidateFlowDefinitionResponse
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderConfig
import aws.smithy.kotlin.runtime.awsprotocol.ClockSkewInterceptor
import aws.smithy.kotlin.runtime.client.AbstractSdkClientBuilder
import aws.smithy.kotlin.runtime.client.AbstractSdkClientFactory
import aws.smithy.kotlin.runtime.client.IdempotencyTokenConfig
import aws.smithy.kotlin.runtime.client.IdempotencyTokenProvider
import aws.smithy.kotlin.runtime.client.LogMode
import aws.smithy.kotlin.runtime.client.RetryClientConfig
import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfig
import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfigImpl
import aws.smithy.kotlin.runtime.client.SdkClient
import aws.smithy.kotlin.runtime.client.SdkClientConfig
import aws.smithy.kotlin.runtime.http.auth.AuthScheme
import aws.smithy.kotlin.runtime.http.auth.HttpAuthConfig
import aws.smithy.kotlin.runtime.http.config.HttpClientConfig
import aws.smithy.kotlin.runtime.http.config.HttpEngineConfig
import aws.smithy.kotlin.runtime.http.engine.HttpClientEngine
import aws.smithy.kotlin.runtime.http.engine.HttpEngineConfigImpl
import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
import aws.smithy.kotlin.runtime.net.url.Url
import aws.smithy.kotlin.runtime.retries.RetryStrategy
import aws.smithy.kotlin.runtime.retries.policy.RetryPolicy
import aws.smithy.kotlin.runtime.telemetry.Global
import aws.smithy.kotlin.runtime.telemetry.TelemetryConfig
import aws.smithy.kotlin.runtime.telemetry.TelemetryProvider
import aws.smithy.kotlin.runtime.util.LazyAsyncValue
import kotlin.collections.List
import kotlin.jvm.JvmStatic
public const val ServiceId: String = "Bedrock Agent"
public const val SdkVersion: String = "1.3.70"
public const val ServiceApiVersion: String = "2023-06-05"
/**
* Describes the API operations for creating and managing Amazon Bedrock agents.
*/
public interface BedrockAgentClient : SdkClient {
/**
* BedrockAgentClient's configuration
*/
public override val config: Config
public companion object : AbstractAwsSdkClientFactory()
{
@JvmStatic
override fun builder(): Builder = Builder()
override fun finalizeConfig(builder: Builder) {
super.finalizeConfig(builder)
builder.config.interceptors.add(0, ClockSkewInterceptor())
}
override suspend fun finalizeEnvironmentalConfig(builder: Builder, sharedConfig: LazyAsyncValue, activeProfile: LazyAsyncValue) {
super.finalizeEnvironmentalConfig(builder, sharedConfig, activeProfile)
builder.config.endpointUrl = builder.config.endpointUrl ?: resolveEndpointUrl(
sharedConfig,
"BedrockAgent",
"BEDROCK_AGENT",
"bedrock_agent",
)
}
}
public class Builder internal constructor(): AbstractSdkClientBuilder() {
override val config: Config.Builder = Config.Builder()
override fun newClient(config: Config): BedrockAgentClient = DefaultBedrockAgentClient(config)
}
public class Config private constructor(builder: Builder) : AwsSdkClientConfig, CredentialsProviderConfig, HttpAuthConfig, HttpClientConfig, HttpEngineConfig by builder.buildHttpEngineConfig(), IdempotencyTokenConfig, RetryClientConfig, RetryStrategyClientConfig by builder.buildRetryStrategyClientConfig(), SdkClientConfig, TelemetryConfig {
override val clientName: String = builder.clientName
override val region: String? = builder.region
override val authSchemes: kotlin.collections.List = builder.authSchemes
override val credentialsProvider: CredentialsProvider = builder.credentialsProvider ?: DefaultChainCredentialsProvider(httpClient = httpClient, region = region).manage()
public val endpointProvider: BedrockAgentEndpointProvider = builder.endpointProvider ?: DefaultBedrockAgentEndpointProvider()
public val endpointUrl: Url? = builder.endpointUrl
override val idempotencyTokenProvider: IdempotencyTokenProvider = builder.idempotencyTokenProvider ?: IdempotencyTokenProvider.Default
override val interceptors: kotlin.collections.List = builder.interceptors
override val logMode: LogMode = builder.logMode ?: LogMode.Default
override val retryPolicy: RetryPolicy = builder.retryPolicy ?: AwsRetryPolicy.Default
override val telemetryProvider: TelemetryProvider = builder.telemetryProvider ?: TelemetryProvider.Global
override val useDualStack: Boolean = builder.useDualStack ?: false
override val useFips: Boolean = builder.useFips ?: false
override val applicationId: String? = builder.applicationId
public val authSchemeProvider: BedrockAgentAuthSchemeProvider = builder.authSchemeProvider ?: DefaultBedrockAgentAuthSchemeProvider()
public companion object {
public inline operator fun invoke(block: Builder.() -> kotlin.Unit): Config = Builder().apply(block).build()
}
public fun toBuilder(): Builder = Builder().apply {
clientName = [email protected]
region = [email protected]
authSchemes = [email protected]
credentialsProvider = [email protected]
endpointProvider = [email protected]
endpointUrl = [email protected]
httpClient = [email protected]
idempotencyTokenProvider = [email protected]
interceptors = [email protected]()
logMode = [email protected]
retryPolicy = [email protected]
retryStrategy = [email protected]
telemetryProvider = [email protected]
useDualStack = [email protected]
useFips = [email protected]
applicationId = [email protected]
authSchemeProvider = [email protected]
}
public class Builder : AwsSdkClientConfig.Builder, CredentialsProviderConfig.Builder, HttpAuthConfig.Builder, HttpClientConfig.Builder, HttpEngineConfig.Builder by HttpEngineConfigImpl.BuilderImpl(), IdempotencyTokenConfig.Builder, RetryClientConfig.Builder, RetryStrategyClientConfig.Builder by RetryStrategyClientConfigImpl.BuilderImpl(), SdkClientConfig.Builder, TelemetryConfig.Builder {
/**
* A reader-friendly name for the client.
*/
override var clientName: String = "Bedrock Agent"
/**
* The AWS region (e.g. `us-west-2`) to make requests to. See about AWS
* [global infrastructure](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/) for more
* information
*/
override var region: String? = null
/**
* Register new or override default [AuthScheme]s configured for this client. By default, the set
* of auth schemes configured comes from the service model. An auth scheme configured explicitly takes
* precedence over the defaults and can be used to customize identity resolution and signing for specific
* authentication schemes.
*/
override var authSchemes: kotlin.collections.List = emptyList()
/**
* The AWS credentials provider to use for authenticating requests. If not provided a
* [aws.sdk.kotlin.runtime.auth.credentials.DefaultChainCredentialsProvider] instance will be used.
* NOTE: The caller is responsible for managing the lifetime of the provider when set. The SDK
* client will not close it when the client is closed.
*/
override var credentialsProvider: CredentialsProvider? = null
/**
* The endpoint provider used to determine where to make service requests. **This is an advanced config
* option.**
*
* Endpoint resolution occurs as part of the workflow for every request made via the service client.
*
* The inputs to endpoint resolution are defined on a per-service basis (see [EndpointParameters]).
*/
public var endpointProvider: BedrockAgentEndpointProvider? = null
/**
* A custom endpoint to route requests to. The endpoint set here is passed to the configured
* [endpointProvider], which may inspect and modify it as needed.
*
* Setting a custom endpointUrl should generally be preferred to overriding the [endpointProvider] and is
* the recommended way to route requests to development or preview instances of a service.
*
* **This is an advanced config option.**
*/
public var endpointUrl: Url? = null
/**
* Override the default idempotency token generator. SDK clients will generate tokens for members
* that represent idempotent tokens when not explicitly set by the caller using this generator.
*/
override var idempotencyTokenProvider: IdempotencyTokenProvider? = null
/**
* Add an [aws.smithy.kotlin.runtime.client.Interceptor] that will have access to read and modify
* the request and response objects as they are processed by the SDK.
* Interceptors added using this method are executed in the order they are configured and are always
* later than any added automatically by the SDK.
*/
override var interceptors: kotlin.collections.MutableList = kotlin.collections.mutableListOf()
/**
* Configure events that will be logged. By default clients will not output
* raw requests or responses. Use this setting to opt-in to additional debug logging.
*
* This can be used to configure logging of requests, responses, retries, etc of SDK clients.
*
* **NOTE**: Logging of raw requests or responses may leak sensitive information! It may also have
* performance considerations when dumping the request/response body. This is primarily a tool for
* debug purposes.
*/
override var logMode: LogMode? = null
/**
* The policy to use for evaluating operation results and determining whether/how to retry.
*/
override var retryPolicy: RetryPolicy? = null
/**
* The telemetry provider used to instrument the SDK operations with. By default, the global telemetry
* provider will be used.
*/
override var telemetryProvider: TelemetryProvider? = null
/**
* Flag to toggle whether to use dual-stack endpoints when making requests.
* See [https://docs.aws.amazon.com/sdkref/latest/guide/feature-endpoints.html] for more information.
* ` Disabled by default.
*/
override var useDualStack: Boolean? = null
/**
* Flag to toggle whether to use [FIPS](https://aws.amazon.com/compliance/fips/) endpoints when making requests.
* ` Disabled by default.
*/
override var useFips: Boolean? = null
/**
* An optional application specific identifier.
* When set it will be appended to the User-Agent header of every request in the form of: `app/{applicationId}`.
* When not explicitly set, the value will be loaded from the following locations:
*
* - JVM System Property: `aws.userAgentAppId`
* - Environment variable: `AWS_SDK_UA_APP_ID`
* - Shared configuration profile attribute: `sdk_ua_app_id`
*
* See [shared configuration settings](https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html)
* reference for more information on environment variables and shared config settings.
*/
override var applicationId: String? = null
/**
* Configure the provider used to resolve the authentication scheme to use for a particular operation.
*/
public var authSchemeProvider: BedrockAgentAuthSchemeProvider? = null
override fun build(): Config = Config(this)
}
}
/**
* Associates a knowledge base with an agent. If a knowledge base is associated and its `indexState` is set to `Enabled`, the agent queries the knowledge base for information to augment its response to the user.
*/
public suspend fun associateAgentKnowledgeBase(input: AssociateAgentKnowledgeBaseRequest): AssociateAgentKnowledgeBaseResponse
/**
* Creates an agent that orchestrates interactions between foundation models, data sources, software applications, user conversations, and APIs to carry out tasks to help customers.
* + Specify the following fields for security purposes.
* + `agentResourceRoleArn` – The Amazon Resource Name (ARN) of the role with permissions to invoke API operations on an agent.
* + (Optional) `customerEncryptionKeyArn` – The Amazon Resource Name (ARN) of a KMS key to encrypt the creation of the agent.
* + (Optional) `idleSessionTTLinSeconds` – Specify the number of seconds for which the agent should maintain session information. After this time expires, the subsequent `InvokeAgent` request begins a new session.
* + To enable your agent to retain conversational context across multiple sessions, include a `memoryConfiguration` object. For more information, see [Configure memory](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-configure-memory.html).
* + To override the default prompt behavior for agent orchestration and to use advanced prompts, include a `promptOverrideConfiguration` object. For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html).
* + If your agent fails to be created, the response returns a list of `failureReasons` alongside a list of `recommendedActions` for you to troubleshoot.
* + The agent instructions will not be honored if your agent has only one knowledge base, uses default prompts, has no action group, and user input is disabled.
*/
public suspend fun createAgent(input: CreateAgentRequest): CreateAgentResponse
/**
* Creates an action group for an agent. An action group represents the actions that an agent can carry out for the customer by defining the APIs that an agent can call and the logic for calling them.
*
* To allow your agent to request the user for additional information when trying to complete a task, add an action group with the `parentActionGroupSignature` field set to `AMAZON.UserInput`.
*
* To allow your agent to generate, run, and troubleshoot code when trying to complete a task, add an action group with the `parentActionGroupSignature` field set to `AMAZON.CodeInterpreter`.
*
* You must leave the `description`, `apiSchema`, and `actionGroupExecutor` fields blank for this action group. During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an [Observation](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html) reprompting the user for more information.
*/
public suspend fun createAgentActionGroup(input: CreateAgentActionGroupRequest): CreateAgentActionGroupResponse
/**
* Creates an alias of an agent that can be used to deploy the agent.
*/
public suspend fun createAgentAlias(input: CreateAgentAliasRequest): CreateAgentAliasResponse
/**
* Creates a data source connector for a knowledge base.
*
* You can't change the `chunkingConfiguration` after you create the data source connector.
*/
public suspend fun createDataSource(input: CreateDataSourceRequest): CreateDataSourceResponse
/**
* Creates a prompt flow that you can use to send an input through various steps to yield an output. Configure nodes, each of which corresponds to a step of the flow, and create connections between the nodes to create paths to different outputs. For more information, see [How it works](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html) and [Create a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-create.html) in the Amazon Bedrock User Guide.
*/
public suspend fun createFlow(input: CreateFlowRequest): CreateFlowResponse
/**
* Creates an alias of a flow for deployment. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend fun createFlowAlias(input: CreateFlowAliasRequest): CreateFlowAliasResponse
/**
* Creates a version of the flow that you can deploy. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend fun createFlowVersion(input: CreateFlowVersionRequest): CreateFlowVersionResponse
/**
* Creates a knowledge base. A knowledge base contains your data sources so that Large Language Models (LLMs) can use your data. To create a knowledge base, you must first set up your data sources and configure a supported vector store. For more information, see [Set up a knowledge base](https://docs.aws.amazon.com/bedrock/latest/userguide/knowlege-base-prereq.html).
*
* If you prefer to let Amazon Bedrock create and manage a vector store for you in Amazon OpenSearch Service, use the console. For more information, see [Create a knowledge base](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-create).
*
* + Provide the `name` and an optional `description`.
* + Provide the Amazon Resource Name (ARN) with permissions to create a knowledge base in the `roleArn` field.
* + Provide the embedding model to use in the `embeddingModelArn` field in the `knowledgeBaseConfiguration` object.
* + Provide the configuration for your vector store in the `storageConfiguration` object.
* + For an Amazon OpenSearch Service database, use the `opensearchServerlessConfiguration` object. For more information, see [Create a vector store in Amazon OpenSearch Service](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-oss.html).
* + For an Amazon Aurora database, use the `RdsConfiguration` object. For more information, see [Create a vector store in Amazon Aurora](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-rds.html).
* + For a Pinecone database, use the `pineconeConfiguration` object. For more information, see [Create a vector store in Pinecone](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-pinecone.html).
* + For a Redis Enterprise Cloud database, use the `redisEnterpriseCloudConfiguration` object. For more information, see [Create a vector store in Redis Enterprise Cloud](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-redis.html).
*/
public suspend fun createKnowledgeBase(input: CreateKnowledgeBaseRequest): CreateKnowledgeBaseResponse
/**
* Creates a prompt in your prompt library that you can add to a flow. For more information, see [Prompt management in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html), [Create a prompt using Prompt management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html) and [Prompt flows in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows.html) in the Amazon Bedrock User Guide.
*/
public suspend fun createPrompt(input: CreatePromptRequest): CreatePromptResponse
/**
* Creates a static snapshot of your prompt that can be deployed to production. For more information, see [Deploy prompts using Prompt management by creating versions](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend fun createPromptVersion(input: CreatePromptVersionRequest): CreatePromptVersionResponse
/**
* Deletes an agent.
*/
public suspend fun deleteAgent(input: DeleteAgentRequest): DeleteAgentResponse
/**
* Deletes an action group in an agent.
*/
public suspend fun deleteAgentActionGroup(input: DeleteAgentActionGroupRequest): DeleteAgentActionGroupResponse
/**
* Deletes an alias of an agent.
*/
public suspend fun deleteAgentAlias(input: DeleteAgentAliasRequest): DeleteAgentAliasResponse
/**
* Deletes a version of an agent.
*/
public suspend fun deleteAgentVersion(input: DeleteAgentVersionRequest): DeleteAgentVersionResponse
/**
* Deletes a data source from a knowledge base.
*/
public suspend fun deleteDataSource(input: DeleteDataSourceRequest): DeleteDataSourceResponse
/**
* Deletes a flow.
*/
public suspend fun deleteFlow(input: DeleteFlowRequest): DeleteFlowResponse
/**
* Deletes an alias of a flow.
*/
public suspend fun deleteFlowAlias(input: DeleteFlowAliasRequest): DeleteFlowAliasResponse
/**
* Deletes a version of a flow.
*/
public suspend fun deleteFlowVersion(input: DeleteFlowVersionRequest): DeleteFlowVersionResponse
/**
* Deletes a knowledge base. Before deleting a knowledge base, you should disassociate the knowledge base from any agents that it is associated with by making a [DisassociateAgentKnowledgeBase](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_DisassociateAgentKnowledgeBase.html) request.
*/
public suspend fun deleteKnowledgeBase(input: DeleteKnowledgeBaseRequest): DeleteKnowledgeBaseResponse
/**
* Deletes a prompt or a version of it, depending on whether you include the `promptVersion` field or not. For more information, see [Delete prompts from the Prompt management tool](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-delete.html) and [Delete a version of a prompt from the Prompt management tool](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html#prompt-management-versions-delete.html) in the Amazon Bedrock User Guide.
*/
public suspend fun deletePrompt(input: DeletePromptRequest): DeletePromptResponse
/**
* Disassociates a knowledge base from an agent.
*/
public suspend fun disassociateAgentKnowledgeBase(input: DisassociateAgentKnowledgeBaseRequest): DisassociateAgentKnowledgeBaseResponse
/**
* Gets information about an agent.
*/
public suspend fun getAgent(input: GetAgentRequest): GetAgentResponse
/**
* Gets information about an action group for an agent.
*/
public suspend fun getAgentActionGroup(input: GetAgentActionGroupRequest): GetAgentActionGroupResponse
/**
* Gets information about an alias of an agent.
*/
public suspend fun getAgentAlias(input: GetAgentAliasRequest): GetAgentAliasResponse
/**
* Gets information about a knowledge base associated with an agent.
*/
public suspend fun getAgentKnowledgeBase(input: GetAgentKnowledgeBaseRequest): GetAgentKnowledgeBaseResponse
/**
* Gets details about a version of an agent.
*/
public suspend fun getAgentVersion(input: GetAgentVersionRequest): GetAgentVersionResponse
/**
* Gets information about a data source.
*/
public suspend fun getDataSource(input: GetDataSourceRequest): GetDataSourceResponse
/**
* Retrieves information about a flow. For more information, see [Manage a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-manage.html) in the Amazon Bedrock User Guide.
*/
public suspend fun getFlow(input: GetFlowRequest): GetFlowResponse
/**
* Retrieves information about a flow. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend fun getFlowAlias(input: GetFlowAliasRequest): GetFlowAliasResponse
/**
* Retrieves information about a version of a flow. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend fun getFlowVersion(input: GetFlowVersionRequest): GetFlowVersionResponse
/**
* Gets information about a data ingestion job. Data sources are ingested into your knowledge base so that Large Language Models (LLMs) can use your data.
*/
public suspend fun getIngestionJob(input: GetIngestionJobRequest): GetIngestionJobResponse
/**
* Gets information about a knoweldge base.
*/
public suspend fun getKnowledgeBase(input: GetKnowledgeBaseRequest): GetKnowledgeBaseResponse
/**
* Retrieves information about the working draft (`DRAFT` version) of a prompt or a version of it, depending on whether you include the `promptVersion` field or not. For more information, see [View information about prompts using Prompt management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-view.html) and [View information about a version of your prompt](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html#prompt-management-versions-view.html) in the Amazon Bedrock User Guide.
*/
public suspend fun getPrompt(input: GetPromptRequest): GetPromptResponse
/**
* Lists the action groups for an agent and information about each one.
*/
public suspend fun listAgentActionGroups(input: ListAgentActionGroupsRequest): ListAgentActionGroupsResponse
/**
* Lists the aliases of an agent and information about each one.
*/
public suspend fun listAgentAliases(input: ListAgentAliasesRequest): ListAgentAliasesResponse
/**
* Lists knowledge bases associated with an agent and information about each one.
*/
public suspend fun listAgentKnowledgeBases(input: ListAgentKnowledgeBasesRequest): ListAgentKnowledgeBasesResponse
/**
* Lists the versions of an agent and information about each version.
*/
public suspend fun listAgentVersions(input: ListAgentVersionsRequest): ListAgentVersionsResponse
/**
* Lists the agents belonging to an account and information about each agent.
*/
public suspend fun listAgents(input: ListAgentsRequest = ListAgentsRequest { }): ListAgentsResponse
/**
* Lists the data sources in a knowledge base and information about each one.
*/
public suspend fun listDataSources(input: ListDataSourcesRequest): ListDataSourcesResponse
/**
* Returns a list of aliases for a flow.
*/
public suspend fun listFlowAliases(input: ListFlowAliasesRequest): ListFlowAliasesResponse
/**
* Returns a list of information about each flow. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend fun listFlowVersions(input: ListFlowVersionsRequest): ListFlowVersionsResponse
/**
* Returns a list of flows and information about each flow. For more information, see [Manage a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-manage.html) in the Amazon Bedrock User Guide.
*/
public suspend fun listFlows(input: ListFlowsRequest = ListFlowsRequest { }): ListFlowsResponse
/**
* Lists the data ingestion jobs for a data source. The list also includes information about each job.
*/
public suspend fun listIngestionJobs(input: ListIngestionJobsRequest): ListIngestionJobsResponse
/**
* Lists the knowledge bases in an account. The list also includesinformation about each knowledge base.
*/
public suspend fun listKnowledgeBases(input: ListKnowledgeBasesRequest = ListKnowledgeBasesRequest { }): ListKnowledgeBasesResponse
/**
* Returns either information about the working draft (`DRAFT` version) of each prompt in an account, or information about of all versions of a prompt, depending on whether you include the `promptIdentifier` field or not. For more information, see [View information about prompts using Prompt management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-view.html) in the Amazon Bedrock User Guide.
*/
public suspend fun listPrompts(input: ListPromptsRequest = ListPromptsRequest { }): ListPromptsResponse
/**
* List all the tags for the resource you specify.
*/
public suspend fun listTagsForResource(input: ListTagsForResourceRequest): ListTagsForResourceResponse
/**
* Creates a `DRAFT` version of the agent that can be used for internal testing.
*/
public suspend fun prepareAgent(input: PrepareAgentRequest): PrepareAgentResponse
/**
* Prepares the `DRAFT` version of a flow so that it can be invoked. For more information, see [Test a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-test.html) in the Amazon Bedrock User Guide.
*/
public suspend fun prepareFlow(input: PrepareFlowRequest): PrepareFlowResponse
/**
* Begins a data ingestion job. Data sources are ingested into your knowledge base so that Large Language Models (LLMs) can use your data.
*/
public suspend fun startIngestionJob(input: StartIngestionJobRequest): StartIngestionJobResponse
/**
* Stops a currently running data ingestion job. You can send a `StartIngestionJob` request again to ingest the rest of your data when you are ready.
*/
public suspend fun stopIngestionJob(input: StopIngestionJobRequest): StopIngestionJobResponse
/**
* Associate tags with a resource. For more information, see [Tagging resources](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) in the Amazon Bedrock User Guide.
*/
public suspend fun tagResource(input: TagResourceRequest): TagResourceResponse
/**
* Remove tags from a resource.
*/
public suspend fun untagResource(input: UntagResourceRequest): UntagResourceResponse
/**
* Updates the configuration of an agent.
*/
public suspend fun updateAgent(input: UpdateAgentRequest): UpdateAgentResponse
/**
* Updates the configuration for an action group for an agent.
*/
public suspend fun updateAgentActionGroup(input: UpdateAgentActionGroupRequest): UpdateAgentActionGroupResponse
/**
* Updates configurations for an alias of an agent.
*/
public suspend fun updateAgentAlias(input: UpdateAgentAliasRequest): UpdateAgentAliasResponse
/**
* Updates the configuration for a knowledge base that has been associated with an agent.
*/
public suspend fun updateAgentKnowledgeBase(input: UpdateAgentKnowledgeBaseRequest): UpdateAgentKnowledgeBaseResponse
/**
* Updates the configurations for a data source connector.
*
* You can't change the `chunkingConfiguration` after you create the data source connector. Specify the existing `chunkingConfiguration`.
*/
public suspend fun updateDataSource(input: UpdateDataSourceRequest): UpdateDataSourceResponse
/**
* Modifies a flow. Include both fields that you want to keep and fields that you want to change. For more information, see [How it works](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html) and [Create a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-create.html) in the Amazon Bedrock User Guide.
*/
public suspend fun updateFlow(input: UpdateFlowRequest): UpdateFlowResponse
/**
* Modifies the alias of a flow. Include both fields that you want to keep and ones that you want to change. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend fun updateFlowAlias(input: UpdateFlowAliasRequest): UpdateFlowAliasResponse
/**
* Updates the configuration of a knowledge base with the fields that you specify. Because all fields will be overwritten, you must include the same values for fields that you want to keep the same.
*
* You can change the following fields:
* + `name`
* + `description`
* + `roleArn`
*
* You can't change the `knowledgeBaseConfiguration` or `storageConfiguration` fields, so you must specify the same configurations as when you created the knowledge base. You can send a [GetKnowledgeBase](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetKnowledgeBase.html) request and copy the same configurations.
*/
public suspend fun updateKnowledgeBase(input: UpdateKnowledgeBaseRequest): UpdateKnowledgeBaseResponse
/**
* Modifies a prompt in your prompt library. Include both fields that you want to keep and fields that you want to replace. For more information, see [Prompt management in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html) and [Edit prompts in your prompt library](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-edit) in the Amazon Bedrock User Guide.
*/
public suspend fun updatePrompt(input: UpdatePromptRequest): UpdatePromptResponse
/**
* Validates the definition of a flow.
*/
public suspend fun validateFlowDefinition(input: ValidateFlowDefinitionRequest): ValidateFlowDefinitionResponse
}
/**
* Create a copy of the client with one or more configuration values overridden.
* This method allows the caller to perform scoped config overrides for one or more client operations.
*
* Any resources created on your behalf will be shared between clients, and will only be closed when ALL clients using them are closed.
* If you provide a resource (e.g. [HttpClientEngine]) to the SDK, you are responsible for managing the lifetime of that resource.
*/
public fun BedrockAgentClient.withConfig(block: BedrockAgentClient.Config.Builder.() -> Unit): BedrockAgentClient {
val newConfig = config.toBuilder().apply(block).build()
return DefaultBedrockAgentClient(newConfig)
}
/**
* Associates a knowledge base with an agent. If a knowledge base is associated and its `indexState` is set to `Enabled`, the agent queries the knowledge base for information to augment its response to the user.
*/
public suspend inline fun BedrockAgentClient.associateAgentKnowledgeBase(crossinline block: AssociateAgentKnowledgeBaseRequest.Builder.() -> Unit): AssociateAgentKnowledgeBaseResponse = associateAgentKnowledgeBase(AssociateAgentKnowledgeBaseRequest.Builder().apply(block).build())
/**
* Creates an agent that orchestrates interactions between foundation models, data sources, software applications, user conversations, and APIs to carry out tasks to help customers.
* + Specify the following fields for security purposes.
* + `agentResourceRoleArn` – The Amazon Resource Name (ARN) of the role with permissions to invoke API operations on an agent.
* + (Optional) `customerEncryptionKeyArn` – The Amazon Resource Name (ARN) of a KMS key to encrypt the creation of the agent.
* + (Optional) `idleSessionTTLinSeconds` – Specify the number of seconds for which the agent should maintain session information. After this time expires, the subsequent `InvokeAgent` request begins a new session.
* + To enable your agent to retain conversational context across multiple sessions, include a `memoryConfiguration` object. For more information, see [Configure memory](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-configure-memory.html).
* + To override the default prompt behavior for agent orchestration and to use advanced prompts, include a `promptOverrideConfiguration` object. For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html).
* + If your agent fails to be created, the response returns a list of `failureReasons` alongside a list of `recommendedActions` for you to troubleshoot.
* + The agent instructions will not be honored if your agent has only one knowledge base, uses default prompts, has no action group, and user input is disabled.
*/
public suspend inline fun BedrockAgentClient.createAgent(crossinline block: CreateAgentRequest.Builder.() -> Unit): CreateAgentResponse = createAgent(CreateAgentRequest.Builder().apply(block).build())
/**
* Creates an action group for an agent. An action group represents the actions that an agent can carry out for the customer by defining the APIs that an agent can call and the logic for calling them.
*
* To allow your agent to request the user for additional information when trying to complete a task, add an action group with the `parentActionGroupSignature` field set to `AMAZON.UserInput`.
*
* To allow your agent to generate, run, and troubleshoot code when trying to complete a task, add an action group with the `parentActionGroupSignature` field set to `AMAZON.CodeInterpreter`.
*
* You must leave the `description`, `apiSchema`, and `actionGroupExecutor` fields blank for this action group. During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an [Observation](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html) reprompting the user for more information.
*/
public suspend inline fun BedrockAgentClient.createAgentActionGroup(crossinline block: CreateAgentActionGroupRequest.Builder.() -> Unit): CreateAgentActionGroupResponse = createAgentActionGroup(CreateAgentActionGroupRequest.Builder().apply(block).build())
/**
* Creates an alias of an agent that can be used to deploy the agent.
*/
public suspend inline fun BedrockAgentClient.createAgentAlias(crossinline block: CreateAgentAliasRequest.Builder.() -> Unit): CreateAgentAliasResponse = createAgentAlias(CreateAgentAliasRequest.Builder().apply(block).build())
/**
* Creates a data source connector for a knowledge base.
*
* You can't change the `chunkingConfiguration` after you create the data source connector.
*/
public suspend inline fun BedrockAgentClient.createDataSource(crossinline block: CreateDataSourceRequest.Builder.() -> Unit): CreateDataSourceResponse = createDataSource(CreateDataSourceRequest.Builder().apply(block).build())
/**
* Creates a prompt flow that you can use to send an input through various steps to yield an output. Configure nodes, each of which corresponds to a step of the flow, and create connections between the nodes to create paths to different outputs. For more information, see [How it works](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html) and [Create a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-create.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.createFlow(crossinline block: CreateFlowRequest.Builder.() -> Unit): CreateFlowResponse = createFlow(CreateFlowRequest.Builder().apply(block).build())
/**
* Creates an alias of a flow for deployment. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.createFlowAlias(crossinline block: CreateFlowAliasRequest.Builder.() -> Unit): CreateFlowAliasResponse = createFlowAlias(CreateFlowAliasRequest.Builder().apply(block).build())
/**
* Creates a version of the flow that you can deploy. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.createFlowVersion(crossinline block: CreateFlowVersionRequest.Builder.() -> Unit): CreateFlowVersionResponse = createFlowVersion(CreateFlowVersionRequest.Builder().apply(block).build())
/**
* Creates a knowledge base. A knowledge base contains your data sources so that Large Language Models (LLMs) can use your data. To create a knowledge base, you must first set up your data sources and configure a supported vector store. For more information, see [Set up a knowledge base](https://docs.aws.amazon.com/bedrock/latest/userguide/knowlege-base-prereq.html).
*
* If you prefer to let Amazon Bedrock create and manage a vector store for you in Amazon OpenSearch Service, use the console. For more information, see [Create a knowledge base](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-create).
*
* + Provide the `name` and an optional `description`.
* + Provide the Amazon Resource Name (ARN) with permissions to create a knowledge base in the `roleArn` field.
* + Provide the embedding model to use in the `embeddingModelArn` field in the `knowledgeBaseConfiguration` object.
* + Provide the configuration for your vector store in the `storageConfiguration` object.
* + For an Amazon OpenSearch Service database, use the `opensearchServerlessConfiguration` object. For more information, see [Create a vector store in Amazon OpenSearch Service](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-oss.html).
* + For an Amazon Aurora database, use the `RdsConfiguration` object. For more information, see [Create a vector store in Amazon Aurora](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-rds.html).
* + For a Pinecone database, use the `pineconeConfiguration` object. For more information, see [Create a vector store in Pinecone](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-pinecone.html).
* + For a Redis Enterprise Cloud database, use the `redisEnterpriseCloudConfiguration` object. For more information, see [Create a vector store in Redis Enterprise Cloud](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-redis.html).
*/
public suspend inline fun BedrockAgentClient.createKnowledgeBase(crossinline block: CreateKnowledgeBaseRequest.Builder.() -> Unit): CreateKnowledgeBaseResponse = createKnowledgeBase(CreateKnowledgeBaseRequest.Builder().apply(block).build())
/**
* Creates a prompt in your prompt library that you can add to a flow. For more information, see [Prompt management in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html), [Create a prompt using Prompt management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html) and [Prompt flows in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.createPrompt(crossinline block: CreatePromptRequest.Builder.() -> Unit): CreatePromptResponse = createPrompt(CreatePromptRequest.Builder().apply(block).build())
/**
* Creates a static snapshot of your prompt that can be deployed to production. For more information, see [Deploy prompts using Prompt management by creating versions](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.createPromptVersion(crossinline block: CreatePromptVersionRequest.Builder.() -> Unit): CreatePromptVersionResponse = createPromptVersion(CreatePromptVersionRequest.Builder().apply(block).build())
/**
* Deletes an agent.
*/
public suspend inline fun BedrockAgentClient.deleteAgent(crossinline block: DeleteAgentRequest.Builder.() -> Unit): DeleteAgentResponse = deleteAgent(DeleteAgentRequest.Builder().apply(block).build())
/**
* Deletes an action group in an agent.
*/
public suspend inline fun BedrockAgentClient.deleteAgentActionGroup(crossinline block: DeleteAgentActionGroupRequest.Builder.() -> Unit): DeleteAgentActionGroupResponse = deleteAgentActionGroup(DeleteAgentActionGroupRequest.Builder().apply(block).build())
/**
* Deletes an alias of an agent.
*/
public suspend inline fun BedrockAgentClient.deleteAgentAlias(crossinline block: DeleteAgentAliasRequest.Builder.() -> Unit): DeleteAgentAliasResponse = deleteAgentAlias(DeleteAgentAliasRequest.Builder().apply(block).build())
/**
* Deletes a version of an agent.
*/
public suspend inline fun BedrockAgentClient.deleteAgentVersion(crossinline block: DeleteAgentVersionRequest.Builder.() -> Unit): DeleteAgentVersionResponse = deleteAgentVersion(DeleteAgentVersionRequest.Builder().apply(block).build())
/**
* Deletes a data source from a knowledge base.
*/
public suspend inline fun BedrockAgentClient.deleteDataSource(crossinline block: DeleteDataSourceRequest.Builder.() -> Unit): DeleteDataSourceResponse = deleteDataSource(DeleteDataSourceRequest.Builder().apply(block).build())
/**
* Deletes a flow.
*/
public suspend inline fun BedrockAgentClient.deleteFlow(crossinline block: DeleteFlowRequest.Builder.() -> Unit): DeleteFlowResponse = deleteFlow(DeleteFlowRequest.Builder().apply(block).build())
/**
* Deletes an alias of a flow.
*/
public suspend inline fun BedrockAgentClient.deleteFlowAlias(crossinline block: DeleteFlowAliasRequest.Builder.() -> Unit): DeleteFlowAliasResponse = deleteFlowAlias(DeleteFlowAliasRequest.Builder().apply(block).build())
/**
* Deletes a version of a flow.
*/
public suspend inline fun BedrockAgentClient.deleteFlowVersion(crossinline block: DeleteFlowVersionRequest.Builder.() -> Unit): DeleteFlowVersionResponse = deleteFlowVersion(DeleteFlowVersionRequest.Builder().apply(block).build())
/**
* Deletes a knowledge base. Before deleting a knowledge base, you should disassociate the knowledge base from any agents that it is associated with by making a [DisassociateAgentKnowledgeBase](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_DisassociateAgentKnowledgeBase.html) request.
*/
public suspend inline fun BedrockAgentClient.deleteKnowledgeBase(crossinline block: DeleteKnowledgeBaseRequest.Builder.() -> Unit): DeleteKnowledgeBaseResponse = deleteKnowledgeBase(DeleteKnowledgeBaseRequest.Builder().apply(block).build())
/**
* Deletes a prompt or a version of it, depending on whether you include the `promptVersion` field or not. For more information, see [Delete prompts from the Prompt management tool](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-delete.html) and [Delete a version of a prompt from the Prompt management tool](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html#prompt-management-versions-delete.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.deletePrompt(crossinline block: DeletePromptRequest.Builder.() -> Unit): DeletePromptResponse = deletePrompt(DeletePromptRequest.Builder().apply(block).build())
/**
* Disassociates a knowledge base from an agent.
*/
public suspend inline fun BedrockAgentClient.disassociateAgentKnowledgeBase(crossinline block: DisassociateAgentKnowledgeBaseRequest.Builder.() -> Unit): DisassociateAgentKnowledgeBaseResponse = disassociateAgentKnowledgeBase(DisassociateAgentKnowledgeBaseRequest.Builder().apply(block).build())
/**
* Gets information about an agent.
*/
public suspend inline fun BedrockAgentClient.getAgent(crossinline block: GetAgentRequest.Builder.() -> Unit): GetAgentResponse = getAgent(GetAgentRequest.Builder().apply(block).build())
/**
* Gets information about an action group for an agent.
*/
public suspend inline fun BedrockAgentClient.getAgentActionGroup(crossinline block: GetAgentActionGroupRequest.Builder.() -> Unit): GetAgentActionGroupResponse = getAgentActionGroup(GetAgentActionGroupRequest.Builder().apply(block).build())
/**
* Gets information about an alias of an agent.
*/
public suspend inline fun BedrockAgentClient.getAgentAlias(crossinline block: GetAgentAliasRequest.Builder.() -> Unit): GetAgentAliasResponse = getAgentAlias(GetAgentAliasRequest.Builder().apply(block).build())
/**
* Gets information about a knowledge base associated with an agent.
*/
public suspend inline fun BedrockAgentClient.getAgentKnowledgeBase(crossinline block: GetAgentKnowledgeBaseRequest.Builder.() -> Unit): GetAgentKnowledgeBaseResponse = getAgentKnowledgeBase(GetAgentKnowledgeBaseRequest.Builder().apply(block).build())
/**
* Gets details about a version of an agent.
*/
public suspend inline fun BedrockAgentClient.getAgentVersion(crossinline block: GetAgentVersionRequest.Builder.() -> Unit): GetAgentVersionResponse = getAgentVersion(GetAgentVersionRequest.Builder().apply(block).build())
/**
* Gets information about a data source.
*/
public suspend inline fun BedrockAgentClient.getDataSource(crossinline block: GetDataSourceRequest.Builder.() -> Unit): GetDataSourceResponse = getDataSource(GetDataSourceRequest.Builder().apply(block).build())
/**
* Retrieves information about a flow. For more information, see [Manage a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-manage.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.getFlow(crossinline block: GetFlowRequest.Builder.() -> Unit): GetFlowResponse = getFlow(GetFlowRequest.Builder().apply(block).build())
/**
* Retrieves information about a flow. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.getFlowAlias(crossinline block: GetFlowAliasRequest.Builder.() -> Unit): GetFlowAliasResponse = getFlowAlias(GetFlowAliasRequest.Builder().apply(block).build())
/**
* Retrieves information about a version of a flow. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.getFlowVersion(crossinline block: GetFlowVersionRequest.Builder.() -> Unit): GetFlowVersionResponse = getFlowVersion(GetFlowVersionRequest.Builder().apply(block).build())
/**
* Gets information about a data ingestion job. Data sources are ingested into your knowledge base so that Large Language Models (LLMs) can use your data.
*/
public suspend inline fun BedrockAgentClient.getIngestionJob(crossinline block: GetIngestionJobRequest.Builder.() -> Unit): GetIngestionJobResponse = getIngestionJob(GetIngestionJobRequest.Builder().apply(block).build())
/**
* Gets information about a knoweldge base.
*/
public suspend inline fun BedrockAgentClient.getKnowledgeBase(crossinline block: GetKnowledgeBaseRequest.Builder.() -> Unit): GetKnowledgeBaseResponse = getKnowledgeBase(GetKnowledgeBaseRequest.Builder().apply(block).build())
/**
* Retrieves information about the working draft (`DRAFT` version) of a prompt or a version of it, depending on whether you include the `promptVersion` field or not. For more information, see [View information about prompts using Prompt management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-view.html) and [View information about a version of your prompt](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html#prompt-management-versions-view.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.getPrompt(crossinline block: GetPromptRequest.Builder.() -> Unit): GetPromptResponse = getPrompt(GetPromptRequest.Builder().apply(block).build())
/**
* Lists the action groups for an agent and information about each one.
*/
public suspend inline fun BedrockAgentClient.listAgentActionGroups(crossinline block: ListAgentActionGroupsRequest.Builder.() -> Unit): ListAgentActionGroupsResponse = listAgentActionGroups(ListAgentActionGroupsRequest.Builder().apply(block).build())
/**
* Lists the aliases of an agent and information about each one.
*/
public suspend inline fun BedrockAgentClient.listAgentAliases(crossinline block: ListAgentAliasesRequest.Builder.() -> Unit): ListAgentAliasesResponse = listAgentAliases(ListAgentAliasesRequest.Builder().apply(block).build())
/**
* Lists knowledge bases associated with an agent and information about each one.
*/
public suspend inline fun BedrockAgentClient.listAgentKnowledgeBases(crossinline block: ListAgentKnowledgeBasesRequest.Builder.() -> Unit): ListAgentKnowledgeBasesResponse = listAgentKnowledgeBases(ListAgentKnowledgeBasesRequest.Builder().apply(block).build())
/**
* Lists the versions of an agent and information about each version.
*/
public suspend inline fun BedrockAgentClient.listAgentVersions(crossinline block: ListAgentVersionsRequest.Builder.() -> Unit): ListAgentVersionsResponse = listAgentVersions(ListAgentVersionsRequest.Builder().apply(block).build())
/**
* Lists the agents belonging to an account and information about each agent.
*/
public suspend inline fun BedrockAgentClient.listAgents(crossinline block: ListAgentsRequest.Builder.() -> Unit): ListAgentsResponse = listAgents(ListAgentsRequest.Builder().apply(block).build())
/**
* Lists the data sources in a knowledge base and information about each one.
*/
public suspend inline fun BedrockAgentClient.listDataSources(crossinline block: ListDataSourcesRequest.Builder.() -> Unit): ListDataSourcesResponse = listDataSources(ListDataSourcesRequest.Builder().apply(block).build())
/**
* Returns a list of aliases for a flow.
*/
public suspend inline fun BedrockAgentClient.listFlowAliases(crossinline block: ListFlowAliasesRequest.Builder.() -> Unit): ListFlowAliasesResponse = listFlowAliases(ListFlowAliasesRequest.Builder().apply(block).build())
/**
* Returns a list of information about each flow. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.listFlowVersions(crossinline block: ListFlowVersionsRequest.Builder.() -> Unit): ListFlowVersionsResponse = listFlowVersions(ListFlowVersionsRequest.Builder().apply(block).build())
/**
* Returns a list of flows and information about each flow. For more information, see [Manage a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-manage.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.listFlows(crossinline block: ListFlowsRequest.Builder.() -> Unit): ListFlowsResponse = listFlows(ListFlowsRequest.Builder().apply(block).build())
/**
* Lists the data ingestion jobs for a data source. The list also includes information about each job.
*/
public suspend inline fun BedrockAgentClient.listIngestionJobs(crossinline block: ListIngestionJobsRequest.Builder.() -> Unit): ListIngestionJobsResponse = listIngestionJobs(ListIngestionJobsRequest.Builder().apply(block).build())
/**
* Lists the knowledge bases in an account. The list also includesinformation about each knowledge base.
*/
public suspend inline fun BedrockAgentClient.listKnowledgeBases(crossinline block: ListKnowledgeBasesRequest.Builder.() -> Unit): ListKnowledgeBasesResponse = listKnowledgeBases(ListKnowledgeBasesRequest.Builder().apply(block).build())
/**
* Returns either information about the working draft (`DRAFT` version) of each prompt in an account, or information about of all versions of a prompt, depending on whether you include the `promptIdentifier` field or not. For more information, see [View information about prompts using Prompt management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-view.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.listPrompts(crossinline block: ListPromptsRequest.Builder.() -> Unit): ListPromptsResponse = listPrompts(ListPromptsRequest.Builder().apply(block).build())
/**
* List all the tags for the resource you specify.
*/
public suspend inline fun BedrockAgentClient.listTagsForResource(crossinline block: ListTagsForResourceRequest.Builder.() -> Unit): ListTagsForResourceResponse = listTagsForResource(ListTagsForResourceRequest.Builder().apply(block).build())
/**
* Creates a `DRAFT` version of the agent that can be used for internal testing.
*/
public suspend inline fun BedrockAgentClient.prepareAgent(crossinline block: PrepareAgentRequest.Builder.() -> Unit): PrepareAgentResponse = prepareAgent(PrepareAgentRequest.Builder().apply(block).build())
/**
* Prepares the `DRAFT` version of a flow so that it can be invoked. For more information, see [Test a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-test.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.prepareFlow(crossinline block: PrepareFlowRequest.Builder.() -> Unit): PrepareFlowResponse = prepareFlow(PrepareFlowRequest.Builder().apply(block).build())
/**
* Begins a data ingestion job. Data sources are ingested into your knowledge base so that Large Language Models (LLMs) can use your data.
*/
public suspend inline fun BedrockAgentClient.startIngestionJob(crossinline block: StartIngestionJobRequest.Builder.() -> Unit): StartIngestionJobResponse = startIngestionJob(StartIngestionJobRequest.Builder().apply(block).build())
/**
* Stops a currently running data ingestion job. You can send a `StartIngestionJob` request again to ingest the rest of your data when you are ready.
*/
public suspend inline fun BedrockAgentClient.stopIngestionJob(crossinline block: StopIngestionJobRequest.Builder.() -> Unit): StopIngestionJobResponse = stopIngestionJob(StopIngestionJobRequest.Builder().apply(block).build())
/**
* Associate tags with a resource. For more information, see [Tagging resources](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.tagResource(crossinline block: TagResourceRequest.Builder.() -> Unit): TagResourceResponse = tagResource(TagResourceRequest.Builder().apply(block).build())
/**
* Remove tags from a resource.
*/
public suspend inline fun BedrockAgentClient.untagResource(crossinline block: UntagResourceRequest.Builder.() -> Unit): UntagResourceResponse = untagResource(UntagResourceRequest.Builder().apply(block).build())
/**
* Updates the configuration of an agent.
*/
public suspend inline fun BedrockAgentClient.updateAgent(crossinline block: UpdateAgentRequest.Builder.() -> Unit): UpdateAgentResponse = updateAgent(UpdateAgentRequest.Builder().apply(block).build())
/**
* Updates the configuration for an action group for an agent.
*/
public suspend inline fun BedrockAgentClient.updateAgentActionGroup(crossinline block: UpdateAgentActionGroupRequest.Builder.() -> Unit): UpdateAgentActionGroupResponse = updateAgentActionGroup(UpdateAgentActionGroupRequest.Builder().apply(block).build())
/**
* Updates configurations for an alias of an agent.
*/
public suspend inline fun BedrockAgentClient.updateAgentAlias(crossinline block: UpdateAgentAliasRequest.Builder.() -> Unit): UpdateAgentAliasResponse = updateAgentAlias(UpdateAgentAliasRequest.Builder().apply(block).build())
/**
* Updates the configuration for a knowledge base that has been associated with an agent.
*/
public suspend inline fun BedrockAgentClient.updateAgentKnowledgeBase(crossinline block: UpdateAgentKnowledgeBaseRequest.Builder.() -> Unit): UpdateAgentKnowledgeBaseResponse = updateAgentKnowledgeBase(UpdateAgentKnowledgeBaseRequest.Builder().apply(block).build())
/**
* Updates the configurations for a data source connector.
*
* You can't change the `chunkingConfiguration` after you create the data source connector. Specify the existing `chunkingConfiguration`.
*/
public suspend inline fun BedrockAgentClient.updateDataSource(crossinline block: UpdateDataSourceRequest.Builder.() -> Unit): UpdateDataSourceResponse = updateDataSource(UpdateDataSourceRequest.Builder().apply(block).build())
/**
* Modifies a flow. Include both fields that you want to keep and fields that you want to change. For more information, see [How it works](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html) and [Create a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-create.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.updateFlow(crossinline block: UpdateFlowRequest.Builder.() -> Unit): UpdateFlowResponse = updateFlow(UpdateFlowRequest.Builder().apply(block).build())
/**
* Modifies the alias of a flow. Include both fields that you want to keep and ones that you want to change. For more information, see [Deploy a flow in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.updateFlowAlias(crossinline block: UpdateFlowAliasRequest.Builder.() -> Unit): UpdateFlowAliasResponse = updateFlowAlias(UpdateFlowAliasRequest.Builder().apply(block).build())
/**
* Updates the configuration of a knowledge base with the fields that you specify. Because all fields will be overwritten, you must include the same values for fields that you want to keep the same.
*
* You can change the following fields:
* + `name`
* + `description`
* + `roleArn`
*
* You can't change the `knowledgeBaseConfiguration` or `storageConfiguration` fields, so you must specify the same configurations as when you created the knowledge base. You can send a [GetKnowledgeBase](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetKnowledgeBase.html) request and copy the same configurations.
*/
public suspend inline fun BedrockAgentClient.updateKnowledgeBase(crossinline block: UpdateKnowledgeBaseRequest.Builder.() -> Unit): UpdateKnowledgeBaseResponse = updateKnowledgeBase(UpdateKnowledgeBaseRequest.Builder().apply(block).build())
/**
* Modifies a prompt in your prompt library. Include both fields that you want to keep and fields that you want to replace. For more information, see [Prompt management in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html) and [Edit prompts in your prompt library](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-edit) in the Amazon Bedrock User Guide.
*/
public suspend inline fun BedrockAgentClient.updatePrompt(crossinline block: UpdatePromptRequest.Builder.() -> Unit): UpdatePromptResponse = updatePrompt(UpdatePromptRequest.Builder().apply(block).build())
/**
* Validates the definition of a flow.
*/
public suspend inline fun BedrockAgentClient.validateFlowDefinition(crossinline block: ValidateFlowDefinitionRequest.Builder.() -> Unit): ValidateFlowDefinitionResponse = validateFlowDefinition(ValidateFlowDefinitionRequest.Builder().apply(block).build())