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

io.github.cdklabs.generative_ai_cdk_constructs.bedrock.KnowledgeBaseProps 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 a knowledge base.
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-23T18:35:37.402Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.generative_ai_cdk_constructs.$Module.class, fqn = "@cdklabs/generative-ai-cdk-constructs.bedrock.KnowledgeBaseProps")
@software.amazon.jsii.Jsii.Proxy(KnowledgeBaseProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface KnowledgeBaseProps extends software.amazon.jsii.JsiiSerializable {

    /**
     * (experimental) The embeddings model for the knowledge base.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    @org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.bedrock.BedrockFoundationModel getEmbeddingsModel();

    /**
     * (experimental) The description of the knowledge base.
     * 

* Default: - No description provided. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getDescription() { return null; } /** * (experimental) Existing IAM role with a policy statement granting permission to invoke the specific embeddings model. *

* Any entity (e.g., an AWS service or application) that assumes * this role will be able to invoke or use the * specified embeddings model within the Bedrock service. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iam.Role getExistingRole() { return null; } /** * (experimental) The name of the vector index. *

* If vectorStore is not of type VectorCollection, * do not include this property as it will throw error. *

* Default: - 'bedrock-knowledge-base-default-index' */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getIndexName() { return null; } /** * (experimental) A narrative description of the knowledge base. *

* A Bedrock Agent can use this instruction to determine if it should * query this Knowledge Base. *

* Default: - No description provided. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getInstruction() { return null; } /** * (experimental) Specifies whether to use the knowledge base or not when sending an InvokeAgent request. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getKnowledgeBaseState() { return null; } /** * (experimental) The name of the knowledge base. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getName() { return null; } /** * (experimental) OPTIONAL: Tag (KEY-VALUE) bedrock agent resource. *

* Default: - false */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.util.Map getTags() { return null; } /** * (experimental) The name of the field in the vector index. *

* If vectorStore is not of type VectorCollection, * do not include this property as it will throw error. *

* Default: - 'bedrock-knowledge-base-default-vector' */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getVectorField() { return null; } /** * (experimental) The vector index for the OpenSearch Serverless backed knowledge base. *

* If vectorStore is not of type VectorCollection, do not include * this property as it will throw error. *

* Default: - A new vector index is created on the Vector Collection * if vector store is of `VectorCollection` type. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable io.github.cdklabs.generative_ai_cdk_constructs.opensearch_vectorindex.VectorIndex getVectorIndex() { return null; } /** * (experimental) The vector store for the knowledge base. *

* Must be either of * type VectorCollection, RedisEnterpriseVectorStore, * PineconeVectorStore, AmazonAuroraVectorStore or * AmazonAuroraDefaultVectorStore. *

* Default: - A new OpenSearch Serverless vector collection is created. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.Object getVectorStore() { return null; } /** * @return a {@link Builder} of {@link KnowledgeBaseProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) static Builder builder() { return new Builder(); } /** * A builder for {@link KnowledgeBaseProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { io.github.cdklabs.generative_ai_cdk_constructs.bedrock.BedrockFoundationModel embeddingsModel; java.lang.String description; software.amazon.awscdk.services.iam.Role existingRole; java.lang.String indexName; java.lang.String instruction; java.lang.String knowledgeBaseState; java.lang.String name; java.util.Map tags; java.lang.String vectorField; io.github.cdklabs.generative_ai_cdk_constructs.opensearch_vectorindex.VectorIndex vectorIndex; java.lang.Object vectorStore; /** * Sets the value of {@link KnowledgeBaseProps#getEmbeddingsModel} * @param embeddingsModel The embeddings model for the knowledge base. This parameter is required. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder embeddingsModel(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.BedrockFoundationModel embeddingsModel) { this.embeddingsModel = embeddingsModel; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getDescription} * @param description The description of the knowledge base. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder description(java.lang.String description) { this.description = description; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getExistingRole} * @param existingRole Existing IAM role with a policy statement granting permission to invoke the specific embeddings model. * Any entity (e.g., an AWS service or application) that assumes * this role will be able to invoke or use the * specified embeddings model within the Bedrock service. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder existingRole(software.amazon.awscdk.services.iam.Role existingRole) { this.existingRole = existingRole; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getIndexName} * @param indexName The name of the vector index. * If vectorStore is not of type VectorCollection, * do not include this property as it will throw error. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder indexName(java.lang.String indexName) { this.indexName = indexName; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getInstruction} * @param instruction A narrative description of the knowledge base. * A Bedrock Agent can use this instruction to determine if it should * query this Knowledge Base. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder instruction(java.lang.String instruction) { this.instruction = instruction; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getKnowledgeBaseState} * @param knowledgeBaseState Specifies whether to use the knowledge base or not when sending an InvokeAgent request. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder knowledgeBaseState(java.lang.String knowledgeBaseState) { this.knowledgeBaseState = knowledgeBaseState; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getName} * @param name The name of the knowledge base. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder name(java.lang.String name) { this.name = name; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getTags} * @param tags OPTIONAL: Tag (KEY-VALUE) bedrock agent resource. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder tags(java.util.Map tags) { this.tags = tags; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getVectorField} * @param vectorField The name of the field in the vector index. * If vectorStore is not of type VectorCollection, * do not include this property as it will throw error. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder vectorField(java.lang.String vectorField) { this.vectorField = vectorField; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getVectorIndex} * @param vectorIndex The vector index for the OpenSearch Serverless backed knowledge base. * If vectorStore is not of type VectorCollection, do not include * this property as it will throw error. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder vectorIndex(io.github.cdklabs.generative_ai_cdk_constructs.opensearch_vectorindex.VectorIndex vectorIndex) { this.vectorIndex = vectorIndex; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getVectorStore} * @param vectorStore The vector store for the knowledge base. * Must be either of * type VectorCollection, RedisEnterpriseVectorStore, * PineconeVectorStore, AmazonAuroraVectorStore or * AmazonAuroraDefaultVectorStore. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder vectorStore(io.github.cdklabs.generative_ai_cdk_constructs.amazonaurora.AmazonAuroraDefaultVectorStore vectorStore) { this.vectorStore = vectorStore; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getVectorStore} * @param vectorStore The vector store for the knowledge base. * Must be either of * type VectorCollection, RedisEnterpriseVectorStore, * PineconeVectorStore, AmazonAuroraVectorStore or * AmazonAuroraDefaultVectorStore. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder vectorStore(io.github.cdklabs.generative_ai_cdk_constructs.amazonaurora.AmazonAuroraVectorStore vectorStore) { this.vectorStore = vectorStore; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getVectorStore} * @param vectorStore The vector store for the knowledge base. * Must be either of * type VectorCollection, RedisEnterpriseVectorStore, * PineconeVectorStore, AmazonAuroraVectorStore or * AmazonAuroraDefaultVectorStore. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder vectorStore(io.github.cdklabs.generative_ai_cdk_constructs.opensearchserverless.VectorCollection vectorStore) { this.vectorStore = vectorStore; return this; } /** * Sets the value of {@link KnowledgeBaseProps#getVectorStore} * @param vectorStore The vector store for the knowledge base. * Must be either of * type VectorCollection, RedisEnterpriseVectorStore, * PineconeVectorStore, AmazonAuroraVectorStore or * AmazonAuroraDefaultVectorStore. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder vectorStore(io.github.cdklabs.generative_ai_cdk_constructs.pinecone.PineconeVectorStore vectorStore) { this.vectorStore = vectorStore; return this; } /** * Builds the configured instance. * @return a new instance of {@link KnowledgeBaseProps} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public KnowledgeBaseProps build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link KnowledgeBaseProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements KnowledgeBaseProps { private final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.BedrockFoundationModel embeddingsModel; private final java.lang.String description; private final software.amazon.awscdk.services.iam.Role existingRole; private final java.lang.String indexName; private final java.lang.String instruction; private final java.lang.String knowledgeBaseState; private final java.lang.String name; private final java.util.Map tags; private final java.lang.String vectorField; private final io.github.cdklabs.generative_ai_cdk_constructs.opensearch_vectorindex.VectorIndex vectorIndex; private final java.lang.Object vectorStore; /** * 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.embeddingsModel = software.amazon.jsii.Kernel.get(this, "embeddingsModel", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.bedrock.BedrockFoundationModel.class)); this.description = software.amazon.jsii.Kernel.get(this, "description", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.existingRole = software.amazon.jsii.Kernel.get(this, "existingRole", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.Role.class)); this.indexName = software.amazon.jsii.Kernel.get(this, "indexName", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.instruction = software.amazon.jsii.Kernel.get(this, "instruction", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.knowledgeBaseState = software.amazon.jsii.Kernel.get(this, "knowledgeBaseState", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.name = software.amazon.jsii.Kernel.get(this, "name", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.tags = software.amazon.jsii.Kernel.get(this, "tags", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.vectorField = software.amazon.jsii.Kernel.get(this, "vectorField", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.vectorIndex = software.amazon.jsii.Kernel.get(this, "vectorIndex", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.opensearch_vectorindex.VectorIndex.class)); this.vectorStore = software.amazon.jsii.Kernel.get(this, "vectorStore", software.amazon.jsii.NativeType.forClass(java.lang.Object.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.embeddingsModel = java.util.Objects.requireNonNull(builder.embeddingsModel, "embeddingsModel is required"); this.description = builder.description; this.existingRole = builder.existingRole; this.indexName = builder.indexName; this.instruction = builder.instruction; this.knowledgeBaseState = builder.knowledgeBaseState; this.name = builder.name; this.tags = builder.tags; this.vectorField = builder.vectorField; this.vectorIndex = builder.vectorIndex; this.vectorStore = builder.vectorStore; } @Override public final io.github.cdklabs.generative_ai_cdk_constructs.bedrock.BedrockFoundationModel getEmbeddingsModel() { return this.embeddingsModel; } @Override public final java.lang.String getDescription() { return this.description; } @Override public final software.amazon.awscdk.services.iam.Role getExistingRole() { return this.existingRole; } @Override public final java.lang.String getIndexName() { return this.indexName; } @Override public final java.lang.String getInstruction() { return this.instruction; } @Override public final java.lang.String getKnowledgeBaseState() { return this.knowledgeBaseState; } @Override public final java.lang.String getName() { return this.name; } @Override public final java.util.Map getTags() { return this.tags; } @Override public final java.lang.String getVectorField() { return this.vectorField; } @Override public final io.github.cdklabs.generative_ai_cdk_constructs.opensearch_vectorindex.VectorIndex getVectorIndex() { return this.vectorIndex; } @Override public final java.lang.Object getVectorStore() { return this.vectorStore; } @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("embeddingsModel", om.valueToTree(this.getEmbeddingsModel())); if (this.getDescription() != null) { data.set("description", om.valueToTree(this.getDescription())); } if (this.getExistingRole() != null) { data.set("existingRole", om.valueToTree(this.getExistingRole())); } if (this.getIndexName() != null) { data.set("indexName", om.valueToTree(this.getIndexName())); } if (this.getInstruction() != null) { data.set("instruction", om.valueToTree(this.getInstruction())); } if (this.getKnowledgeBaseState() != null) { data.set("knowledgeBaseState", om.valueToTree(this.getKnowledgeBaseState())); } if (this.getName() != null) { data.set("name", om.valueToTree(this.getName())); } if (this.getTags() != null) { data.set("tags", om.valueToTree(this.getTags())); } if (this.getVectorField() != null) { data.set("vectorField", om.valueToTree(this.getVectorField())); } if (this.getVectorIndex() != null) { data.set("vectorIndex", om.valueToTree(this.getVectorIndex())); } if (this.getVectorStore() != null) { data.set("vectorStore", om.valueToTree(this.getVectorStore())); } 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.KnowledgeBaseProps")); 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; KnowledgeBaseProps.Jsii$Proxy that = (KnowledgeBaseProps.Jsii$Proxy) o; if (!embeddingsModel.equals(that.embeddingsModel)) return false; if (this.description != null ? !this.description.equals(that.description) : that.description != null) return false; if (this.existingRole != null ? !this.existingRole.equals(that.existingRole) : that.existingRole != null) return false; if (this.indexName != null ? !this.indexName.equals(that.indexName) : that.indexName != null) return false; if (this.instruction != null ? !this.instruction.equals(that.instruction) : that.instruction != null) return false; if (this.knowledgeBaseState != null ? !this.knowledgeBaseState.equals(that.knowledgeBaseState) : that.knowledgeBaseState != null) return false; if (this.name != null ? !this.name.equals(that.name) : that.name != null) return false; if (this.tags != null ? !this.tags.equals(that.tags) : that.tags != null) return false; if (this.vectorField != null ? !this.vectorField.equals(that.vectorField) : that.vectorField != null) return false; if (this.vectorIndex != null ? !this.vectorIndex.equals(that.vectorIndex) : that.vectorIndex != null) return false; return this.vectorStore != null ? this.vectorStore.equals(that.vectorStore) : that.vectorStore == null; } @Override public final int hashCode() { int result = this.embeddingsModel.hashCode(); result = 31 * result + (this.description != null ? this.description.hashCode() : 0); result = 31 * result + (this.existingRole != null ? this.existingRole.hashCode() : 0); result = 31 * result + (this.indexName != null ? this.indexName.hashCode() : 0); result = 31 * result + (this.instruction != null ? this.instruction.hashCode() : 0); result = 31 * result + (this.knowledgeBaseState != null ? this.knowledgeBaseState.hashCode() : 0); result = 31 * result + (this.name != null ? this.name.hashCode() : 0); result = 31 * result + (this.tags != null ? this.tags.hashCode() : 0); result = 31 * result + (this.vectorField != null ? this.vectorField.hashCode() : 0); result = 31 * result + (this.vectorIndex != null ? this.vectorIndex.hashCode() : 0); result = 31 * result + (this.vectorStore != null ? this.vectorStore.hashCode() : 0); return result; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy