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

com.amazonaws.services.bedrockagent.model.ChunkingConfiguration Maven / Gradle / Ivy

/*
 * Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.bedrockagent.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source * that is returned when the knowledge base that it belongs to is queried. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ChunkingConfiguration implements Serializable, Cloneable, StructuredPojo { /** *

* Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source * that is returned when the knowledge base that it belongs to is queried. You have the following options for * chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting * them up such that each file corresponds to a chunk. *

*
    *
  • *

    * FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set * in the fixedSizeChunkingConfiguration. *

    *
  • *
  • *

    * NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to * pre-process your documents by splitting them into separate files. *

    *
  • *
*/ private String chunkingStrategy; /** *

* Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as * NONE, exclude this field. *

*/ private FixedSizeChunkingConfiguration fixedSizeChunkingConfiguration; /** *

* Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source * that is returned when the knowledge base that it belongs to is queried. You have the following options for * chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting * them up such that each file corresponds to a chunk. *

*
    *
  • *

    * FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set * in the fixedSizeChunkingConfiguration. *

    *
  • *
  • *

    * NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to * pre-process your documents by splitting them into separate files. *

    *
  • *
* * @param chunkingStrategy * Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data * source that is returned when the knowledge base that it belongs to is queried. You have the following * options for chunking your data. If you opt for NONE, then you may want to pre-process your * files by splitting them up such that each file corresponds to a chunk.

*
    *
  • *

    * FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that * you set in the fixedSizeChunkingConfiguration. *

    *
  • *
  • *

    * NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want * to pre-process your documents by splitting them into separate files. *

    *
  • * @see ChunkingStrategy */ public void setChunkingStrategy(String chunkingStrategy) { this.chunkingStrategy = chunkingStrategy; } /** *

    * Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source * that is returned when the knowledge base that it belongs to is queried. You have the following options for * chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting * them up such that each file corresponds to a chunk. *

    *
      *
    • *

      * FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set * in the fixedSizeChunkingConfiguration. *

      *
    • *
    • *

      * NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to * pre-process your documents by splitting them into separate files. *

      *
    • *
    * * @return Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data * source that is returned when the knowledge base that it belongs to is queried. You have the following * options for chunking your data. If you opt for NONE, then you may want to pre-process your * files by splitting them up such that each file corresponds to a chunk.

    *
      *
    • *

      * FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that * you set in the fixedSizeChunkingConfiguration. *

      *
    • *
    • *

      * NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want * to pre-process your documents by splitting them into separate files. *

      *
    • * @see ChunkingStrategy */ public String getChunkingStrategy() { return this.chunkingStrategy; } /** *

      * Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source * that is returned when the knowledge base that it belongs to is queried. You have the following options for * chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting * them up such that each file corresponds to a chunk. *

      *
        *
      • *

        * FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set * in the fixedSizeChunkingConfiguration. *

        *
      • *
      • *

        * NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to * pre-process your documents by splitting them into separate files. *

        *
      • *
      * * @param chunkingStrategy * Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data * source that is returned when the knowledge base that it belongs to is queried. You have the following * options for chunking your data. If you opt for NONE, then you may want to pre-process your * files by splitting them up such that each file corresponds to a chunk.

      *
        *
      • *

        * FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that * you set in the fixedSizeChunkingConfiguration. *

        *
      • *
      • *

        * NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want * to pre-process your documents by splitting them into separate files. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. * @see ChunkingStrategy */ public ChunkingConfiguration withChunkingStrategy(String chunkingStrategy) { setChunkingStrategy(chunkingStrategy); return this; } /** *

        * Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source * that is returned when the knowledge base that it belongs to is queried. You have the following options for * chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting * them up such that each file corresponds to a chunk. *

        *
          *
        • *

          * FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set * in the fixedSizeChunkingConfiguration. *

          *
        • *
        • *

          * NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to * pre-process your documents by splitting them into separate files. *

          *
        • *
        * * @param chunkingStrategy * Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data * source that is returned when the knowledge base that it belongs to is queried. You have the following * options for chunking your data. If you opt for NONE, then you may want to pre-process your * files by splitting them up such that each file corresponds to a chunk.

        *
          *
        • *

          * FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that * you set in the fixedSizeChunkingConfiguration. *

          *
        • *
        • *

          * NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want * to pre-process your documents by splitting them into separate files. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. * @see ChunkingStrategy */ public ChunkingConfiguration withChunkingStrategy(ChunkingStrategy chunkingStrategy) { this.chunkingStrategy = chunkingStrategy.toString(); return this; } /** *

          * Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as * NONE, exclude this field. *

          * * @param fixedSizeChunkingConfiguration * Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as * NONE, exclude this field. */ public void setFixedSizeChunkingConfiguration(FixedSizeChunkingConfiguration fixedSizeChunkingConfiguration) { this.fixedSizeChunkingConfiguration = fixedSizeChunkingConfiguration; } /** *

          * Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as * NONE, exclude this field. *

          * * @return Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as * NONE, exclude this field. */ public FixedSizeChunkingConfiguration getFixedSizeChunkingConfiguration() { return this.fixedSizeChunkingConfiguration; } /** *

          * Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as * NONE, exclude this field. *

          * * @param fixedSizeChunkingConfiguration * Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as * NONE, exclude this field. * @return Returns a reference to this object so that method calls can be chained together. */ public ChunkingConfiguration withFixedSizeChunkingConfiguration(FixedSizeChunkingConfiguration fixedSizeChunkingConfiguration) { setFixedSizeChunkingConfiguration(fixedSizeChunkingConfiguration); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getChunkingStrategy() != null) sb.append("ChunkingStrategy: ").append(getChunkingStrategy()).append(","); if (getFixedSizeChunkingConfiguration() != null) sb.append("FixedSizeChunkingConfiguration: ").append(getFixedSizeChunkingConfiguration()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ChunkingConfiguration == false) return false; ChunkingConfiguration other = (ChunkingConfiguration) obj; if (other.getChunkingStrategy() == null ^ this.getChunkingStrategy() == null) return false; if (other.getChunkingStrategy() != null && other.getChunkingStrategy().equals(this.getChunkingStrategy()) == false) return false; if (other.getFixedSizeChunkingConfiguration() == null ^ this.getFixedSizeChunkingConfiguration() == null) return false; if (other.getFixedSizeChunkingConfiguration() != null && other.getFixedSizeChunkingConfiguration().equals(this.getFixedSizeChunkingConfiguration()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getChunkingStrategy() == null) ? 0 : getChunkingStrategy().hashCode()); hashCode = prime * hashCode + ((getFixedSizeChunkingConfiguration() == null) ? 0 : getFixedSizeChunkingConfiguration().hashCode()); return hashCode; } @Override public ChunkingConfiguration clone() { try { return (ChunkingConfiguration) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.bedrockagent.model.transform.ChunkingConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy