commonMain.aws.sdk.kotlin.services.bedrockagent.model.CreateAgentRequest.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.model
import aws.smithy.kotlin.runtime.SdkDsl
public class CreateAgentRequest private constructor(builder: Builder) {
/**
* A name for the agent that you create.
*/
public val agentName: kotlin.String? = builder.agentName
/**
* The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.
*/
public val agentResourceRoleArn: kotlin.String? = builder.agentResourceRoleArn
/**
* A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see [Ensuring idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
*/
public val clientToken: kotlin.String? = builder.clientToken
/**
* The Amazon Resource Name (ARN) of the KMS key with which to encrypt the agent.
*/
public val customerEncryptionKeyArn: kotlin.String? = builder.customerEncryptionKeyArn
/**
* A description of the agent.
*/
public val description: kotlin.String? = builder.description
/**
* The identifier for the model that you want to be used for orchestration by the agent you create.
*
* The `modelId` to provide depends on the type of model or throughput that you use:
* + If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see [Amazon Bedrock base model IDs (on-demand throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) in the Amazon Bedrock User Guide.
* + If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see [Supported Regions and models for cross-region inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) in the Amazon Bedrock User Guide.
* + If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see [Run inference using a Provisioned Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) in the Amazon Bedrock User Guide.
* + If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see [Use a custom model in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) in the Amazon Bedrock User Guide.
* + If you use an [imported model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), specify the ARN of the imported model. You can get the model ARN from a successful call to [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) or from the Imported models page in the Amazon Bedrock console.
*/
public val foundationModel: kotlin.String? = builder.foundationModel
/**
* The unique Guardrail configuration assigned to the agent when it is created.
*/
public val guardrailConfiguration: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration? = builder.guardrailConfiguration
/**
* The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.
*
* A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.
*/
public val idleSessionTtlInSeconds: kotlin.Int? = builder.idleSessionTtlInSeconds
/**
* Instructions that tell the agent what it should do and how it should interact with users.
*/
public val instruction: kotlin.String? = builder.instruction
/**
* Contains the details of the memory configured for the agent.
*/
public val memoryConfiguration: aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration? = builder.memoryConfiguration
/**
* Contains configurations to override prompts in different parts of an agent sequence. For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html).
*/
public val promptOverrideConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration? = builder.promptOverrideConfiguration
/**
* Any tags that you want to attach to the agent.
*/
public val tags: Map? = builder.tags
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.CreateAgentRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateAgentRequest(")
append("agentName=$agentName,")
append("agentResourceRoleArn=$agentResourceRoleArn,")
append("clientToken=$clientToken,")
append("customerEncryptionKeyArn=$customerEncryptionKeyArn,")
append("description=$description,")
append("foundationModel=$foundationModel,")
append("guardrailConfiguration=$guardrailConfiguration,")
append("idleSessionTtlInSeconds=$idleSessionTtlInSeconds,")
append("instruction=*** Sensitive Data Redacted ***,")
append("memoryConfiguration=$memoryConfiguration,")
append("promptOverrideConfiguration=*** Sensitive Data Redacted ***,")
append("tags=$tags")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = agentName?.hashCode() ?: 0
result = 31 * result + (agentResourceRoleArn?.hashCode() ?: 0)
result = 31 * result + (clientToken?.hashCode() ?: 0)
result = 31 * result + (customerEncryptionKeyArn?.hashCode() ?: 0)
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (foundationModel?.hashCode() ?: 0)
result = 31 * result + (guardrailConfiguration?.hashCode() ?: 0)
result = 31 * result + (idleSessionTtlInSeconds ?: 0)
result = 31 * result + (instruction?.hashCode() ?: 0)
result = 31 * result + (memoryConfiguration?.hashCode() ?: 0)
result = 31 * result + (promptOverrideConfiguration?.hashCode() ?: 0)
result = 31 * result + (tags?.hashCode() ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as CreateAgentRequest
if (agentName != other.agentName) return false
if (agentResourceRoleArn != other.agentResourceRoleArn) return false
if (clientToken != other.clientToken) return false
if (customerEncryptionKeyArn != other.customerEncryptionKeyArn) return false
if (description != other.description) return false
if (foundationModel != other.foundationModel) return false
if (guardrailConfiguration != other.guardrailConfiguration) return false
if (idleSessionTtlInSeconds != other.idleSessionTtlInSeconds) return false
if (instruction != other.instruction) return false
if (memoryConfiguration != other.memoryConfiguration) return false
if (promptOverrideConfiguration != other.promptOverrideConfiguration) return false
if (tags != other.tags) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.CreateAgentRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A name for the agent that you create.
*/
public var agentName: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.
*/
public var agentResourceRoleArn: kotlin.String? = null
/**
* A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see [Ensuring idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
*/
public var clientToken: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the KMS key with which to encrypt the agent.
*/
public var customerEncryptionKeyArn: kotlin.String? = null
/**
* A description of the agent.
*/
public var description: kotlin.String? = null
/**
* The identifier for the model that you want to be used for orchestration by the agent you create.
*
* The `modelId` to provide depends on the type of model or throughput that you use:
* + If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see [Amazon Bedrock base model IDs (on-demand throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) in the Amazon Bedrock User Guide.
* + If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see [Supported Regions and models for cross-region inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) in the Amazon Bedrock User Guide.
* + If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see [Run inference using a Provisioned Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) in the Amazon Bedrock User Guide.
* + If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see [Use a custom model in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) in the Amazon Bedrock User Guide.
* + If you use an [imported model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), specify the ARN of the imported model. You can get the model ARN from a successful call to [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) or from the Imported models page in the Amazon Bedrock console.
*/
public var foundationModel: kotlin.String? = null
/**
* The unique Guardrail configuration assigned to the agent when it is created.
*/
public var guardrailConfiguration: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration? = null
/**
* The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.
*
* A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.
*/
public var idleSessionTtlInSeconds: kotlin.Int? = null
/**
* Instructions that tell the agent what it should do and how it should interact with users.
*/
public var instruction: kotlin.String? = null
/**
* Contains the details of the memory configured for the agent.
*/
public var memoryConfiguration: aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration? = null
/**
* Contains configurations to override prompts in different parts of an agent sequence. For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html).
*/
public var promptOverrideConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration? = null
/**
* Any tags that you want to attach to the agent.
*/
public var tags: Map? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.CreateAgentRequest) : this() {
this.agentName = x.agentName
this.agentResourceRoleArn = x.agentResourceRoleArn
this.clientToken = x.clientToken
this.customerEncryptionKeyArn = x.customerEncryptionKeyArn
this.description = x.description
this.foundationModel = x.foundationModel
this.guardrailConfiguration = x.guardrailConfiguration
this.idleSessionTtlInSeconds = x.idleSessionTtlInSeconds
this.instruction = x.instruction
this.memoryConfiguration = x.memoryConfiguration
this.promptOverrideConfiguration = x.promptOverrideConfiguration
this.tags = x.tags
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.CreateAgentRequest = CreateAgentRequest(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration] inside the given [block]
*/
public fun guardrailConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration.Builder.() -> kotlin.Unit) {
this.guardrailConfiguration = aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration] inside the given [block]
*/
public fun memoryConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration.Builder.() -> kotlin.Unit) {
this.memoryConfiguration = aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration] inside the given [block]
*/
public fun promptOverrideConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration.Builder.() -> kotlin.Unit) {
this.promptOverrideConfiguration = aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}