io.github.cdklabs.generative_ai_cdk_constructs.LangchainCommonDepsLayer Maven / Gradle / Ivy
Show all versions of generative-ai-cdk-constructs Show documentation
package io.github.cdklabs.generative_ai_cdk_constructs;
/**
* (experimental) The LangchainCommonDepsLayer class.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-23T22:27:31.894Z")
@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.LangchainCommonDepsLayer")
public class LangchainCommonDepsLayer extends software.constructs.Construct {
protected LangchainCommonDepsLayer(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected LangchainCommonDepsLayer(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* (experimental) This construct creates a lambda layer loaded with relevant libraries to run genai applications.
*
* Libraries include boto3, botocore, requests, requests-aws4auth, langchain, opensearch-py and openai.
*
* @param scope
- represents the scope for all the resources.
This parameter is required.
* @param id - this is a a scope-unique id.
This parameter is required.
* @param props - user provided props for the construct.
This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public LangchainCommonDepsLayer(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.LangchainLayerProps 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) Returns the instance of lambda.LayerVersion created by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.LayerVersion getLayer() {
return software.amazon.jsii.Kernel.get(this, "layer", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.LayerVersion.class));
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.generative_ai_cdk_constructs.LangchainCommonDepsLayer}.
*/
@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 - represents the scope for all the resources.
This parameter is required.
* @param id - this is a a scope-unique 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.LangchainLayerProps.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.LangchainLayerProps.Builder();
}
/**
* The description the this Lambda Layer.
*
* Default: - No description.
*
* @return {@code this}
* @param description The description the this Lambda Layer. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder description(final java.lang.String description) {
this.props.description(description);
return this;
}
/**
* The name of the layer.
*
* Default: - A name will be generated.
*
* @return {@code this}
* @param layerVersionName The name of the layer. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder layerVersionName(final java.lang.String layerVersionName) {
this.props.layerVersionName(layerVersionName);
return this;
}
/**
* The SPDX licence identifier or URL to the license file for this layer.
*
* Default: - No license information will be recorded.
*
* @return {@code this}
* @param license The SPDX licence identifier or URL to the license file for this layer. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder license(final java.lang.String license) {
this.props.license(license);
return this;
}
/**
* Whether to retain this version of the layer when a new version is added or when the stack is deleted.
*
* Default: RemovalPolicy.DESTROY
*
* @return {@code this}
* @param removalPolicy Whether to retain this version of the layer when a new version is added or when the stack is deleted. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder removalPolicy(final software.amazon.awscdk.RemovalPolicy removalPolicy) {
this.props.removalPolicy(removalPolicy);
return this;
}
/**
* (experimental) Required.
*
* Lambda function architecture compatible with this Layer.
*
* @return {@code this}
* @param architecture Required. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder architecture(final software.amazon.awscdk.services.lambda.Architecture architecture) {
this.props.architecture(architecture);
return this;
}
/**
* (experimental) Required.
*
* Lambda function runtime compatible with this Layer.
*
* @return {@code this}
* @param runtime Required. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder runtime(final software.amazon.awscdk.services.lambda.Runtime runtime) {
this.props.runtime(runtime);
return this;
}
/**
* (experimental) A prop allowing additional python pip libraries to be installed with this langchain layer.
*
* Default: - none
*
* @return {@code this}
* @param additionalPackages A prop allowing additional python pip libraries to be installed with this langchain layer. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder additionalPackages(final java.util.List additionalPackages) {
this.props.additionalPackages(additionalPackages);
return this;
}
/**
* (experimental) Optional: Add '--upgrade' to pip install requirements.txt In case of a LangchainCommonLayer, this parameter is not used.
*
* Default: - false
*
* @return {@code this}
* @param autoUpgrade Optional: Add '--upgrade' to pip install requirements.txt In case of a LangchainCommonLayer, this parameter is not used. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder autoUpgrade(final java.lang.Boolean autoUpgrade) {
this.props.autoUpgrade(autoUpgrade);
return this;
}
/**
* (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
*
* @return {@code this}
* @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. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder local(final java.lang.String local) {
this.props.local(local);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.generative_ai_cdk_constructs.LangchainCommonDepsLayer}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.generative_ai_cdk_constructs.LangchainCommonDepsLayer build() {
return new io.github.cdklabs.generative_ai_cdk_constructs.LangchainCommonDepsLayer(
this.scope,
this.id,
this.props.build()
);
}
}
}