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

io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSource 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) Sets up a data source to be added to a knowledge base.
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-23T22:27:31.981Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.generative_ai_cdk_constructs.$Module.class, fqn = "@cdklabs/generative-ai-cdk-constructs.bedrock.S3DataSource")
public class S3DataSource extends software.constructs.Construct {

    protected S3DataSource(final software.amazon.jsii.JsiiObjectRef objRef) {
        super(objRef);
    }

    protected S3DataSource(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
        super(initializationMode);
    }

    /**
     * @param scope This parameter is required.
     * @param id This parameter is required.
     * @param props This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    public S3DataSource(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSourceProps props) {
        super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
        software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
    }

    /**
     * (experimental) The Data Source cfn resource.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.bedrock.CfnDataSource getDataSource() {
        return software.amazon.jsii.Kernel.get(this, "dataSource", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.bedrock.CfnDataSource.class));
    }

    /**
     * (experimental) The unique identifier of the data source.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    public @org.jetbrains.annotations.NotNull java.lang.String getDataSourceId() {
        return software.amazon.jsii.Kernel.get(this, "dataSourceId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
    }

    /**
     * (experimental) A fluent builder for {@link io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSource}.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    public static final class Builder implements software.amazon.jsii.Builder {
        /**
         * @return a new instance of {@link Builder}.
         * @param scope This parameter is required.
         * @param id This parameter is required.
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
            return new Builder(scope, id);
        }

        private final software.constructs.Construct scope;
        private final java.lang.String id;
        private final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSourceProps.Builder props;

        private Builder(final software.constructs.Construct scope, final java.lang.String id) {
            this.scope = scope;
            this.id = id;
            this.props = new io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSourceProps.Builder();
        }

        /**
         * (experimental) The bucket that contains the data source.
         * 

* @return {@code this} * @param bucket The bucket that contains the data source. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder bucket(final software.amazon.awscdk.services.s3.IBucket bucket) { this.props.bucket(bucket); return this; } /** * (experimental) The name of the data source. *

* @return {@code this} * @param dataSourceName The name of the data source. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder dataSourceName(final java.lang.String dataSourceName) { this.props.dataSourceName(dataSourceName); return this; } /** * (experimental) The knowledge base that this data source belongs to. *

* @return {@code this} * @param knowledgeBase The knowledge base that this data source belongs to. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder knowledgeBase(final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.KnowledgeBase knowledgeBase) { this.props.knowledgeBase(knowledgeBase); return this; } /** * (experimental) The chunking strategy to use. *

* Default: ChunkingStrategy.DEFAULT *

* @return {@code this} * @param chunkingStrategy The chunking strategy to use. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder chunkingStrategy(final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy chunkingStrategy) { this.props.chunkingStrategy(chunkingStrategy); return this; } /** * (experimental) The prefixes of the objects in the bucket that should be included in the data source. *

* Default: - All objects in the bucket. *

* @return {@code this} * @param inclusionPrefixes The prefixes of the objects in the bucket that should be included in the data source. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder inclusionPrefixes(final java.util.List inclusionPrefixes) { this.props.inclusionPrefixes(inclusionPrefixes); return this; } /** * (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 *

* @return {@code this} * @param kmsKey The KMS key to use to encrypt the data source. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder kmsKey(final software.amazon.awscdk.services.kms.IKey kmsKey) { this.props.kmsKey(kmsKey); return this; } /** * (experimental) The maximum number of tokens to use in a chunk. *

* Default: 300 *

* @return {@code this} * @param maxTokens The maximum number of tokens to use in a chunk. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder maxTokens(final java.lang.Number maxTokens) { this.props.maxTokens(maxTokens); return this; } /** * (experimental) The percentage of overlap to use in a chunk. *

* Default: 20 *

* @return {@code this} * @param overlapPercentage The percentage of overlap to use in a chunk. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder overlapPercentage(final java.lang.Number overlapPercentage) { this.props.overlapPercentage(overlapPercentage); return this; } /** * @return a newly built instance of {@link io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSource}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSource build() { return new io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSource( this.scope, this.id, this.props.build() ); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy