io.github.cdklabs.generative_ai_cdk_constructs.LangchainLayerProps Maven / Gradle / Ivy
Show all versions of generative-ai-cdk-constructs Show documentation
package io.github.cdklabs.generative_ai_cdk_constructs;
/**
* (experimental) The properties for the LangchainLayerProps class.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-23T22:27:31.896Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.generative_ai_cdk_constructs.$Module.class, fqn = "@cdklabs/generative-ai-cdk-constructs.LangchainLayerProps")
@software.amazon.jsii.Jsii.Proxy(LangchainLayerProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface LangchainLayerProps extends software.amazon.jsii.JsiiSerializable, io.github.cdklabs.generative_ai_cdk_constructs.LangchainProps {
/**
* (experimental) Required.
*
* Lambda function architecture compatible with this Layer.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.Architecture getArchitecture();
/**
* (experimental) Required.
*
* Lambda function runtime compatible with this Layer.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.Runtime getRuntime();
/**
* (experimental) A prop allowing additional python pip libraries to be installed with this langchain layer.
*
* Default: - none
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getAdditionalPackages() {
return null;
}
/**
* (experimental) Optional: Add '--upgrade' to pip install requirements.txt In case of a LangchainCommonLayer, this parameter is not used.
*
* Default: - false
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getAutoUpgrade() {
return null;
}
/**
* (experimental) Optional: Local compute will be used when installing requirements.txt. By default, a docker container will be spun up to install requirements. To override this behavior, use the python alias string of python
or python3
The string value will be the python alias used to install requirements.
*
* Default: - none
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getLocal() {
return null;
}
/**
* @return a {@link Builder} of {@link LangchainLayerProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link LangchainLayerProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.lambda.Architecture architecture;
software.amazon.awscdk.services.lambda.Runtime runtime;
java.util.List additionalPackages;
java.lang.Boolean autoUpgrade;
java.lang.String local;
java.lang.String description;
java.lang.String layerVersionName;
java.lang.String license;
software.amazon.awscdk.RemovalPolicy removalPolicy;
/**
* Sets the value of {@link LangchainLayerProps#getArchitecture}
* @param architecture Required. This parameter is required.
* Lambda function architecture compatible with this Layer.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder architecture(software.amazon.awscdk.services.lambda.Architecture architecture) {
this.architecture = architecture;
return this;
}
/**
* Sets the value of {@link LangchainLayerProps#getRuntime}
* @param runtime Required. This parameter is required.
* Lambda function runtime compatible with this Layer.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder runtime(software.amazon.awscdk.services.lambda.Runtime runtime) {
this.runtime = runtime;
return this;
}
/**
* Sets the value of {@link LangchainLayerProps#getAdditionalPackages}
* @param additionalPackages A prop allowing additional python pip libraries to be installed with this langchain layer.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder additionalPackages(java.util.List additionalPackages) {
this.additionalPackages = additionalPackages;
return this;
}
/**
* Sets the value of {@link LangchainLayerProps#getAutoUpgrade}
* @param autoUpgrade Optional: Add '--upgrade' to pip install requirements.txt In case of a LangchainCommonLayer, this parameter is not used.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder autoUpgrade(java.lang.Boolean autoUpgrade) {
this.autoUpgrade = autoUpgrade;
return this;
}
/**
* Sets the value of {@link LangchainLayerProps#getLocal}
* @param local Optional: Local compute will be used when installing requirements.txt. By default, a docker container will be spun up to install requirements. To override this behavior, use the python alias string of python
or python3
The string value will be the python alias used to install requirements.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder local(java.lang.String local) {
this.local = local;
return this;
}
/**
* Sets the value of {@link LangchainLayerProps#getDescription}
* @param description The description the this Lambda Layer.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder description(java.lang.String description) {
this.description = description;
return this;
}
/**
* Sets the value of {@link LangchainLayerProps#getLayerVersionName}
* @param layerVersionName The name of the layer.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder layerVersionName(java.lang.String layerVersionName) {
this.layerVersionName = layerVersionName;
return this;
}
/**
* Sets the value of {@link LangchainLayerProps#getLicense}
* @param license The SPDX licence identifier or URL to the license file for this layer.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder license(java.lang.String license) {
this.license = license;
return this;
}
/**
* Sets the value of {@link LangchainLayerProps#getRemovalPolicy}
* @param removalPolicy Whether to retain this version of the layer when a new version is added or when the stack is deleted.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder removalPolicy(software.amazon.awscdk.RemovalPolicy removalPolicy) {
this.removalPolicy = removalPolicy;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link LangchainLayerProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public LangchainLayerProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link LangchainLayerProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements LangchainLayerProps {
private final software.amazon.awscdk.services.lambda.Architecture architecture;
private final software.amazon.awscdk.services.lambda.Runtime runtime;
private final java.util.List additionalPackages;
private final java.lang.Boolean autoUpgrade;
private final java.lang.String local;
private final java.lang.String description;
private final java.lang.String layerVersionName;
private final java.lang.String license;
private final software.amazon.awscdk.RemovalPolicy removalPolicy;
/**
* 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.architecture = software.amazon.jsii.Kernel.get(this, "architecture", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Architecture.class));
this.runtime = software.amazon.jsii.Kernel.get(this, "runtime", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Runtime.class));
this.additionalPackages = software.amazon.jsii.Kernel.get(this, "additionalPackages", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.autoUpgrade = software.amazon.jsii.Kernel.get(this, "autoUpgrade", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.local = software.amazon.jsii.Kernel.get(this, "local", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.description = software.amazon.jsii.Kernel.get(this, "description", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.layerVersionName = software.amazon.jsii.Kernel.get(this, "layerVersionName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.license = software.amazon.jsii.Kernel.get(this, "license", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.removalPolicy = software.amazon.jsii.Kernel.get(this, "removalPolicy", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.RemovalPolicy.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.architecture = java.util.Objects.requireNonNull(builder.architecture, "architecture is required");
this.runtime = java.util.Objects.requireNonNull(builder.runtime, "runtime is required");
this.additionalPackages = builder.additionalPackages;
this.autoUpgrade = builder.autoUpgrade;
this.local = builder.local;
this.description = builder.description;
this.layerVersionName = builder.layerVersionName;
this.license = builder.license;
this.removalPolicy = builder.removalPolicy;
}
@Override
public final software.amazon.awscdk.services.lambda.Architecture getArchitecture() {
return this.architecture;
}
@Override
public final software.amazon.awscdk.services.lambda.Runtime getRuntime() {
return this.runtime;
}
@Override
public final java.util.List getAdditionalPackages() {
return this.additionalPackages;
}
@Override
public final java.lang.Boolean getAutoUpgrade() {
return this.autoUpgrade;
}
@Override
public final java.lang.String getLocal() {
return this.local;
}
@Override
public final java.lang.String getDescription() {
return this.description;
}
@Override
public final java.lang.String getLayerVersionName() {
return this.layerVersionName;
}
@Override
public final java.lang.String getLicense() {
return this.license;
}
@Override
public final software.amazon.awscdk.RemovalPolicy getRemovalPolicy() {
return this.removalPolicy;
}
@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("architecture", om.valueToTree(this.getArchitecture()));
data.set("runtime", om.valueToTree(this.getRuntime()));
if (this.getAdditionalPackages() != null) {
data.set("additionalPackages", om.valueToTree(this.getAdditionalPackages()));
}
if (this.getAutoUpgrade() != null) {
data.set("autoUpgrade", om.valueToTree(this.getAutoUpgrade()));
}
if (this.getLocal() != null) {
data.set("local", om.valueToTree(this.getLocal()));
}
if (this.getDescription() != null) {
data.set("description", om.valueToTree(this.getDescription()));
}
if (this.getLayerVersionName() != null) {
data.set("layerVersionName", om.valueToTree(this.getLayerVersionName()));
}
if (this.getLicense() != null) {
data.set("license", om.valueToTree(this.getLicense()));
}
if (this.getRemovalPolicy() != null) {
data.set("removalPolicy", om.valueToTree(this.getRemovalPolicy()));
}
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.LangchainLayerProps"));
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;
LangchainLayerProps.Jsii$Proxy that = (LangchainLayerProps.Jsii$Proxy) o;
if (!architecture.equals(that.architecture)) return false;
if (!runtime.equals(that.runtime)) return false;
if (this.additionalPackages != null ? !this.additionalPackages.equals(that.additionalPackages) : that.additionalPackages != null) return false;
if (this.autoUpgrade != null ? !this.autoUpgrade.equals(that.autoUpgrade) : that.autoUpgrade != null) return false;
if (this.local != null ? !this.local.equals(that.local) : that.local != null) return false;
if (this.description != null ? !this.description.equals(that.description) : that.description != null) return false;
if (this.layerVersionName != null ? !this.layerVersionName.equals(that.layerVersionName) : that.layerVersionName != null) return false;
if (this.license != null ? !this.license.equals(that.license) : that.license != null) return false;
return this.removalPolicy != null ? this.removalPolicy.equals(that.removalPolicy) : that.removalPolicy == null;
}
@Override
public final int hashCode() {
int result = this.architecture.hashCode();
result = 31 * result + (this.runtime.hashCode());
result = 31 * result + (this.additionalPackages != null ? this.additionalPackages.hashCode() : 0);
result = 31 * result + (this.autoUpgrade != null ? this.autoUpgrade.hashCode() : 0);
result = 31 * result + (this.local != null ? this.local.hashCode() : 0);
result = 31 * result + (this.description != null ? this.description.hashCode() : 0);
result = 31 * result + (this.layerVersionName != null ? this.layerVersionName.hashCode() : 0);
result = 31 * result + (this.license != null ? this.license.hashCode() : 0);
result = 31 * result + (this.removalPolicy != null ? this.removalPolicy.hashCode() : 0);
return result;
}
}
}