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

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

package io.github.cdklabs.generative_ai_cdk_constructs.bedrock;

/**
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-07T16:14:00.664Z")
@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.ChunkingStrategy")
public abstract class ChunkingStrategy extends software.amazon.jsii.JsiiObject {

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

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

    static {
        DEFAULT = software.amazon.jsii.JsiiObject.jsiiStaticGet(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class, "DEFAULT", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class));
        FIXED_SIZE = software.amazon.jsii.JsiiObject.jsiiStaticGet(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class, "FIXED_SIZE", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class));
        HIERARCHICAL_COHERE = software.amazon.jsii.JsiiObject.jsiiStaticGet(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class, "HIERARCHICAL_COHERE", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class));
        HIERARCHICAL_TITAN = software.amazon.jsii.JsiiObject.jsiiStaticGet(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class, "HIERARCHICAL_TITAN", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class));
        NONE = software.amazon.jsii.JsiiObject.jsiiStaticGet(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class, "NONE", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class));
        SEMANTIC = software.amazon.jsii.JsiiObject.jsiiStaticGet(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class, "SEMANTIC", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class));
    }

    /**
     * (experimental) Method for customizing a fixed sized chunking strategy.
     * 

* @param props This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy fixedSize(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.bedrock.CfnDataSource.FixedSizeChunkingConfigurationProperty props) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class, "fixedSize", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class), new Object[] { java.util.Objects.requireNonNull(props, "props is required") }); } /** * (experimental) Method for customizing a hierarchical chunking strategy. *

* For custom chunking, the maximum token chunk size depends on the model. *

*

    *
  • Amazon Titan Text Embeddings: 8192
  • *
  • Cohere Embed models: 512
  • *
*

* @param props This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy hierarchical(final @org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.bedrock.HierarchicalChunkingProps props) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class, "hierarchical", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class), new Object[] { java.util.Objects.requireNonNull(props, "props is required") }); } /** * (experimental) Method for customizing a semantic chunking strategy. *

* For custom chunking, the maximum token chunk size depends on the model. *

*

    *
  • Amazon Titan Text Embeddings: 8192
  • *
  • Cohere Embed models: 512
  • *
*

* @param props This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy semantic(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.bedrock.CfnDataSource.SemanticChunkingConfigurationProperty props) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class, "semantic", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy.class), new Object[] { java.util.Objects.requireNonNull(props, "props is required") }); } /** * (experimental) Fixed Sized Chunking with the default chunk size of 300 tokens and 20% overlap. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final static io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy DEFAULT; /** * (experimental) Fixed Sized Chunking with the default chunk size of 300 tokens and 20% overlap. *

* You can adjust these values based on your specific requirements using the * ChunkingStrategy.fixedSize(params) method. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final static io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy FIXED_SIZE; /** * (experimental) Hierarchical Chunking with the default for Cohere Models. *

*

    *
  • Overlap tokens: 30
  • *
  • Max parent token size: 500
  • *
  • Max child token size: 100
  • *
*/ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final static io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy HIERARCHICAL_COHERE; /** * (experimental) Hierarchical Chunking with the default for Titan Models. *

*

    *
  • Overlap tokens: 60
  • *
  • Max parent token size: 1500
  • *
  • Max child token size: 300
  • *
*/ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final static io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy HIERARCHICAL_TITAN; /** * (experimental) Amazon Bedrock treats each file as one chunk. *

* Suitable for documents that * are already pre-processed or text split. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final static io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy NONE; /** * (experimental) Semantic Chunking with the default of bufferSize: 0, breakpointPercentileThreshold: 95, and maxTokens: 300. *

* You can adjust these values based on your specific requirements using the * ChunkingStrategy.semantic(params) method. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final static io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy SEMANTIC; /** * (experimental) The CloudFormation property representation of this configuration. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public abstract @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.bedrock.CfnDataSource.ChunkingConfigurationProperty getConfiguration(); /** * (experimental) The CloudFormation property representation of this configuration. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public abstract void setConfiguration(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.bedrock.CfnDataSource.ChunkingConfigurationProperty value); /** * A proxy class which represents a concrete javascript instance of this type. */ @software.amazon.jsii.Internal private static final class Jsii$Proxy extends io.github.cdklabs.generative_ai_cdk_constructs.bedrock.ChunkingStrategy { protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } /** * (experimental) The CloudFormation property representation of this configuration. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.bedrock.CfnDataSource.ChunkingConfigurationProperty getConfiguration() { return software.amazon.jsii.Kernel.get(this, "configuration", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.bedrock.CfnDataSource.ChunkingConfigurationProperty.class)); } /** * (experimental) The CloudFormation property representation of this configuration. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final void setConfiguration(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.bedrock.CfnDataSource.ChunkingConfigurationProperty value) { software.amazon.jsii.Kernel.set(this, "configuration", java.util.Objects.requireNonNull(value, "configuration is required")); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy