io.github.cdklabs.generative_ai_cdk_constructs.bedrock.S3DataSource Maven / Gradle / Ivy
Show all versions of generative-ai-cdk-constructs Show documentation
package io.github.cdklabs.generative_ai_cdk_constructs.bedrock;
/**
* (experimental) Sets up an S3 Data Source to be added to a knowledge base.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-01T15:41:28.760Z")
@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 io.github.cdklabs.generative_ai_cdk_constructs.bedrock.DataSourceNew {
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 bucket associated with the data source.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.IBucket getBucket() {
return software.amazon.jsii.Kernel.get(this, "bucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.IBucket.class));
}
/**
* (experimental) The unique identifier of the data source.
*
* Example:
*
*
* 'JHUEVXUZMU'
*
*/
@Override
@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) The name of the data source.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getDataSourceName() {
return software.amazon.jsii.Kernel.get(this, "dataSourceName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) The type of data source.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.bedrock.DataSourceType getDataSourceType() {
return software.amazon.jsii.Kernel.get(this, "dataSourceType", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.DataSourceType.class));
}
/**
* (experimental) The knowledge base associated with the data source.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.bedrock.IKnowledgeBase getKnowledgeBase() {
return software.amazon.jsii.Kernel.get(this, "knowledgeBase", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.IKnowledgeBase.class));
}
/**
* (experimental) The KMS key to use to encrypt the data source.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.kms.IKey getKmsKey() {
return software.amazon.jsii.Kernel.get(this, "kmsKey", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kms.IKey.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 chunking stategy to use for splitting your documents or content.
*
* The chunks are then converted to embeddings and written to the vector
* index allowing for similarity search and retrieval of the content.
*
* Default: ChunkingStrategy.DEFAULT
*
* @return {@code this}
* @param chunkingStrategy The chunking stategy to use for splitting your documents or content. 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 custom transformation strategy to use.
*
* Default: - No custom transformation is used.
*
* @return {@code this}
* @param customTransformation The custom transformation strategy to use. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder customTransformation(final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.CustomTransformation customTransformation) {
this.props.customTransformation(customTransformation);
return this;
}
/**
* (experimental) The data deletion policy to apply to the data source.
*
* Default: - Sets the data deletion policy to the default of the data source type.
*
* @return {@code this}
* @param dataDeletionPolicy The data deletion policy to apply to the data source. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder dataDeletionPolicy(final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.DataDeletionPolicy dataDeletionPolicy) {
this.props.dataDeletionPolicy(dataDeletionPolicy);
return this;
}
/**
* (experimental) The name of the data source.
*
* Default: - A new name will be generated.
*
* @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) A description of the data source.
*
* Default: - No description is provided.
*
* @return {@code this}
* @param description A description of the data source. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder description(final java.lang.String description) {
this.props.description(description);
return this;
}
/**
* (experimental) The KMS key to use to encrypt the data source.
*
* Default: - Service owned and managed key.
*
* @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 parsing strategy to use.
*
* Default: - No Parsing Stategy is used.
*
* @return {@code this}
* @param parsingStrategy The parsing strategy to use. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder parsingStrategy(final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ParsingStategy parsingStrategy) {
this.props.parsingStrategy(parsingStrategy);
return this;
}
/**
* (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 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 knowledge base to associate with the data source.
*
* @return {@code this}
* @param knowledgeBase The knowledge base to associate with the data source. 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.IKnowledgeBase knowledgeBase) {
this.props.knowledgeBase(knowledgeBase);
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()
);
}
}
}