All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSourceProps Maven / Gradle / Ivy

Go to download

AWS Generative AI CDK Constructs is a library for well-architected generative AI patterns.

There is a newer version: 0.1.271
Show newest version
package io.github.cdklabs.generative_ai_cdk_constructs.bedrock;

/**
 * (experimental) Properties for an S3 Data Source.
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-23T22:27:31.982Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.generative_ai_cdk_constructs.$Module.class, fqn = "@cdklabs/generative-ai-cdk-constructs.bedrock.S3DataSourceProps")
@software.amazon.jsii.Jsii.Proxy(S3DataSourceProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface S3DataSourceProps extends software.amazon.jsii.JsiiSerializable {

    /**
     * (experimental) The bucket that contains the data source.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.IBucket getBucket();

    /**
     * (experimental) The name of the data source.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    @org.jetbrains.annotations.NotNull java.lang.String getDataSourceName();

    /**
     * (experimental) The knowledge base that this data source belongs to.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    @org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.bedrock.KnowledgeBase getKnowledgeBase();

    /**
     * (experimental) The chunking strategy to use.
     * 

* Default: ChunkingStrategy.DEFAULT */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy getChunkingStrategy() { return null; } /** * (experimental) The prefixes of the objects in the bucket that should be included in the data source. *

* Default: - All objects in the bucket. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.util.List getInclusionPrefixes() { return null; } /** * (experimental) The KMS key to use to encrypt the data source. *

* Default: Amazon Bedrock encrypts your data with a key that AWS owns and manages */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.kms.IKey getKmsKey() { return null; } /** * (experimental) The maximum number of tokens to use in a chunk. *

* Default: 300 */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.Number getMaxTokens() { return null; } /** * (experimental) The percentage of overlap to use in a chunk. *

* Default: 20 */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.Number getOverlapPercentage() { return null; } /** * @return a {@link Builder} of {@link S3DataSourceProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) static Builder builder() { return new Builder(); } /** * A builder for {@link S3DataSourceProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { software.amazon.awscdk.services.s3.IBucket bucket; java.lang.String dataSourceName; io.github.cdklabs.generative_ai_cdk_constructs.bedrock.KnowledgeBase knowledgeBase; io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy chunkingStrategy; java.util.List inclusionPrefixes; software.amazon.awscdk.services.kms.IKey kmsKey; java.lang.Number maxTokens; java.lang.Number overlapPercentage; /** * Sets the value of {@link S3DataSourceProps#getBucket} * @param bucket The bucket that contains the data source. This parameter is required. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder bucket(software.amazon.awscdk.services.s3.IBucket bucket) { this.bucket = bucket; return this; } /** * Sets the value of {@link S3DataSourceProps#getDataSourceName} * @param dataSourceName The name of the data source. This parameter is required. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder dataSourceName(java.lang.String dataSourceName) { this.dataSourceName = dataSourceName; return this; } /** * Sets the value of {@link S3DataSourceProps#getKnowledgeBase} * @param knowledgeBase The knowledge base that this data source belongs to. This parameter is required. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder knowledgeBase(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.KnowledgeBase knowledgeBase) { this.knowledgeBase = knowledgeBase; return this; } /** * Sets the value of {@link S3DataSourceProps#getChunkingStrategy} * @param chunkingStrategy The chunking strategy to use. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder chunkingStrategy(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy chunkingStrategy) { this.chunkingStrategy = chunkingStrategy; return this; } /** * Sets the value of {@link S3DataSourceProps#getInclusionPrefixes} * @param inclusionPrefixes The prefixes of the objects in the bucket that should be included in the data source. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder inclusionPrefixes(java.util.List inclusionPrefixes) { this.inclusionPrefixes = inclusionPrefixes; return this; } /** * Sets the value of {@link S3DataSourceProps#getKmsKey} * @param kmsKey The KMS key to use to encrypt the data source. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder kmsKey(software.amazon.awscdk.services.kms.IKey kmsKey) { this.kmsKey = kmsKey; return this; } /** * Sets the value of {@link S3DataSourceProps#getMaxTokens} * @param maxTokens The maximum number of tokens to use in a chunk. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder maxTokens(java.lang.Number maxTokens) { this.maxTokens = maxTokens; return this; } /** * Sets the value of {@link S3DataSourceProps#getOverlapPercentage} * @param overlapPercentage The percentage of overlap to use in a chunk. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder overlapPercentage(java.lang.Number overlapPercentage) { this.overlapPercentage = overlapPercentage; return this; } /** * Builds the configured instance. * @return a new instance of {@link S3DataSourceProps} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public S3DataSourceProps build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link S3DataSourceProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements S3DataSourceProps { private final software.amazon.awscdk.services.s3.IBucket bucket; private final java.lang.String dataSourceName; private final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.KnowledgeBase knowledgeBase; private final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy chunkingStrategy; private final java.util.List inclusionPrefixes; private final software.amazon.awscdk.services.kms.IKey kmsKey; private final java.lang.Number maxTokens; private final java.lang.Number overlapPercentage; /** * Constructor that initializes the object based on values retrieved from the JsiiObject. * @param objRef Reference to the JSII managed object. */ protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); this.bucket = software.amazon.jsii.Kernel.get(this, "bucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.IBucket.class)); this.dataSourceName = software.amazon.jsii.Kernel.get(this, "dataSourceName", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.knowledgeBase = software.amazon.jsii.Kernel.get(this, "knowledgeBase", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.KnowledgeBase.class)); this.chunkingStrategy = software.amazon.jsii.Kernel.get(this, "chunkingStrategy", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class)); this.inclusionPrefixes = software.amazon.jsii.Kernel.get(this, "inclusionPrefixes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.kmsKey = software.amazon.jsii.Kernel.get(this, "kmsKey", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kms.IKey.class)); this.maxTokens = software.amazon.jsii.Kernel.get(this, "maxTokens", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.overlapPercentage = software.amazon.jsii.Kernel.get(this, "overlapPercentage", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); } /** * Constructor that initializes the object based on literal property values passed by the {@link Builder}. */ protected Jsii$Proxy(final Builder builder) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); this.bucket = java.util.Objects.requireNonNull(builder.bucket, "bucket is required"); this.dataSourceName = java.util.Objects.requireNonNull(builder.dataSourceName, "dataSourceName is required"); this.knowledgeBase = java.util.Objects.requireNonNull(builder.knowledgeBase, "knowledgeBase is required"); this.chunkingStrategy = builder.chunkingStrategy; this.inclusionPrefixes = builder.inclusionPrefixes; this.kmsKey = builder.kmsKey; this.maxTokens = builder.maxTokens; this.overlapPercentage = builder.overlapPercentage; } @Override public final software.amazon.awscdk.services.s3.IBucket getBucket() { return this.bucket; } @Override public final java.lang.String getDataSourceName() { return this.dataSourceName; } @Override public final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.KnowledgeBase getKnowledgeBase() { return this.knowledgeBase; } @Override public final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy getChunkingStrategy() { return this.chunkingStrategy; } @Override public final java.util.List getInclusionPrefixes() { return this.inclusionPrefixes; } @Override public final software.amazon.awscdk.services.kms.IKey getKmsKey() { return this.kmsKey; } @Override public final java.lang.Number getMaxTokens() { return this.maxTokens; } @Override public final java.lang.Number getOverlapPercentage() { return this.overlapPercentage; } @Override @software.amazon.jsii.Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); data.set("bucket", om.valueToTree(this.getBucket())); data.set("dataSourceName", om.valueToTree(this.getDataSourceName())); data.set("knowledgeBase", om.valueToTree(this.getKnowledgeBase())); if (this.getChunkingStrategy() != null) { data.set("chunkingStrategy", om.valueToTree(this.getChunkingStrategy())); } if (this.getInclusionPrefixes() != null) { data.set("inclusionPrefixes", om.valueToTree(this.getInclusionPrefixes())); } if (this.getKmsKey() != null) { data.set("kmsKey", om.valueToTree(this.getKmsKey())); } if (this.getMaxTokens() != null) { data.set("maxTokens", om.valueToTree(this.getMaxTokens())); } if (this.getOverlapPercentage() != null) { data.set("overlapPercentage", om.valueToTree(this.getOverlapPercentage())); } final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); struct.set("fqn", om.valueToTree("@cdklabs/generative-ai-cdk-constructs.bedrock.S3DataSourceProps")); struct.set("data", data); final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); obj.set("$jsii.struct", struct); return obj; } @Override public final boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; S3DataSourceProps.Jsii$Proxy that = (S3DataSourceProps.Jsii$Proxy) o; if (!bucket.equals(that.bucket)) return false; if (!dataSourceName.equals(that.dataSourceName)) return false; if (!knowledgeBase.equals(that.knowledgeBase)) return false; if (this.chunkingStrategy != null ? !this.chunkingStrategy.equals(that.chunkingStrategy) : that.chunkingStrategy != null) return false; if (this.inclusionPrefixes != null ? !this.inclusionPrefixes.equals(that.inclusionPrefixes) : that.inclusionPrefixes != null) return false; if (this.kmsKey != null ? !this.kmsKey.equals(that.kmsKey) : that.kmsKey != null) return false; if (this.maxTokens != null ? !this.maxTokens.equals(that.maxTokens) : that.maxTokens != null) return false; return this.overlapPercentage != null ? this.overlapPercentage.equals(that.overlapPercentage) : that.overlapPercentage == null; } @Override public final int hashCode() { int result = this.bucket.hashCode(); result = 31 * result + (this.dataSourceName.hashCode()); result = 31 * result + (this.knowledgeBase.hashCode()); result = 31 * result + (this.chunkingStrategy != null ? this.chunkingStrategy.hashCode() : 0); result = 31 * result + (this.inclusionPrefixes != null ? this.inclusionPrefixes.hashCode() : 0); result = 31 * result + (this.kmsKey != null ? this.kmsKey.hashCode() : 0); result = 31 * result + (this.maxTokens != null ? this.maxTokens.hashCode() : 0); result = 31 * result + (this.overlapPercentage != null ? this.overlapPercentage.hashCode() : 0); return result; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy