io.github.cdklabs.generative_ai_cdk_constructs.SummarizationAppsyncStepfn Maven / Gradle / Ivy
Show all versions of generative-ai-cdk-constructs Show documentation
package io.github.cdklabs.generative_ai_cdk_constructs;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-23T22:27:31.914Z")
@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.SummarizationAppsyncStepfn")
public class SummarizationAppsyncStepfn extends io.github.cdklabs.generative_ai_cdk_constructs.BaseClass {
protected SummarizationAppsyncStepfn(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected SummarizationAppsyncStepfn(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* (experimental) Constructs a new instance of the SummarizationAppsyncStepfn class.
*
* @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 SummarizationAppsyncStepfn(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.SummarizationAppsyncStepfnProps 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 an instance of lambda.DockerImageFunction used for the document reading job created by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.DockerImageFunction getDocumentReaderLambdaFunction() {
return software.amazon.jsii.Kernel.get(this, "documentReaderLambdaFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.DockerImageFunction.class));
}
/**
* (experimental) Returns an instance of events.IEventBus created by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.events.IEventBus getEventBridgeBus() {
return software.amazon.jsii.Kernel.get(this, "eventBridgeBus", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.events.IEventBus.class));
}
/**
* (experimental) Returns an instance of appsync.CfnGraphQLApi for summary created by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.appsync.IGraphqlApi getGraphqlApi() {
return software.amazon.jsii.Kernel.get(this, "graphqlApi", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.IGraphqlApi.class));
}
/**
* (experimental) Graphql Api Id value.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getGraphqlApiId() {
return software.amazon.jsii.Kernel.get(this, "graphqlApiId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) Graphql Url value.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getGraphqlUrl() {
return software.amazon.jsii.Kernel.get(this, "graphqlUrl", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) Returns the instance of s3.IBucket used by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.IBucket getInputAssetBucket() {
return software.amazon.jsii.Kernel.get(this, "inputAssetBucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.IBucket.class));
}
/**
* (experimental) Returns an instance of lambda.DockerImageFunction used for the input validation job created by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.DockerImageFunction getInputValidationLambdaFunction() {
return software.amazon.jsii.Kernel.get(this, "inputValidationLambdaFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.DockerImageFunction.class));
}
/**
* (experimental) Returns the instance of s3.IBucket used by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.IBucket getProcessedAssetBucket() {
return software.amazon.jsii.Kernel.get(this, "processedAssetBucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.IBucket.class));
}
/**
* (experimental) Returns the instance of ec2.ISecurityGroup used by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.ISecurityGroup getSecurityGroup() {
return software.amazon.jsii.Kernel.get(this, "securityGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.ISecurityGroup.class));
}
/**
* (experimental) Step function.
*
* Default: - fieldLogLevel - None
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.stepfunctions.StateMachine getStateMachine() {
return software.amazon.jsii.Kernel.get(this, "stateMachine", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.stepfunctions.StateMachine.class));
}
/**
* (experimental) Returns an instance of lambda.DockerImageFunction used for the summary generation job created by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.DockerImageFunction getSummaryGeneratorLambdaFunction() {
return software.amazon.jsii.Kernel.get(this, "summaryGeneratorLambdaFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.DockerImageFunction.class));
}
/**
* (experimental) Returns the instance of ec2.IVpc used by the construct.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.IVpc getVpc() {
return software.amazon.jsii.Kernel.get(this, "vpc", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.IVpc.class));
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.generative_ai_cdk_constructs.SummarizationAppsyncStepfn}.
*/
@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.SummarizationAppsyncStepfnProps.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.SummarizationAppsyncStepfnProps.Builder();
}
/**
* (experimental) Required.
*
* Cognito user pool used for authentication.
*
* Default: - None
*
* @return {@code this}
* @param cognitoUserPool Required. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder cognitoUserPool(final software.amazon.awscdk.services.cognito.IUserPool cognitoUserPool) {
this.props.cognitoUserPool(cognitoUserPool);
return this;
}
/**
* (experimental) Optional.
*
* User provided props to override the default props for the S3 Bucket.
* Providing both this and existingInputAssetsBucketObj
will cause an error.
*
* Default: - Default props are used
*
* @return {@code this}
* @param bucketInputsAssetsProps Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bucketInputsAssetsProps(final software.amazon.awscdk.services.s3.BucketProps bucketInputsAssetsProps) {
this.props.bucketInputsAssetsProps(bucketInputsAssetsProps);
return this;
}
/**
* (experimental) Optional.
*
* User provided props to override the default props for the S3 Bucket.
* Providing both this and existingProcessedAssetsBucketObj
will cause an error.
*
* Default: - Default props are used
*
* @return {@code this}
* @param bucketProcessedAssetsProps Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bucketProcessedAssetsProps(final software.amazon.awscdk.services.s3.BucketProps bucketProcessedAssetsProps) {
this.props.bucketProcessedAssetsProps(bucketProcessedAssetsProps);
return this;
}
/**
* (experimental) Optional.
*
* Allows to provide Embeddings custom lambda code
* and settings instead of the existing
*
* @return {@code this}
* @param customDocumentReaderDockerLambdaProps Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder customDocumentReaderDockerLambdaProps(final io.github.cdklabs.generative_ai_cdk_constructs.DockerLambdaCustomProps customDocumentReaderDockerLambdaProps) {
this.props.customDocumentReaderDockerLambdaProps(customDocumentReaderDockerLambdaProps);
return this;
}
/**
* (experimental) Optional.
*
* Allows to provide Input Validation custom lambda code
* and settings instead of the existing
*
* @return {@code this}
* @param customInputValidationDockerLambdaProps Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder customInputValidationDockerLambdaProps(final io.github.cdklabs.generative_ai_cdk_constructs.DockerLambdaCustomProps customInputValidationDockerLambdaProps) {
this.props.customInputValidationDockerLambdaProps(customInputValidationDockerLambdaProps);
return this;
}
/**
* (experimental) Optional.
*
* Allows to provide File Transformer custom lambda code
* and settings instead of the existing
*
* @return {@code this}
* @param customSummaryGeneratorDockerLambdaProps Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder customSummaryGeneratorDockerLambdaProps(final io.github.cdklabs.generative_ai_cdk_constructs.DockerLambdaCustomProps customSummaryGeneratorDockerLambdaProps) {
this.props.customSummaryGeneratorDockerLambdaProps(customSummaryGeneratorDockerLambdaProps);
return this;
}
/**
* (experimental) Optional.
*
* A new custom EventBus is created with provided props.
* Providing existingEventBusInterface and eventBusProps both will result in validation error.
*
* Default: - None
*
* @return {@code this}
* @param eventBusProps Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder eventBusProps(final software.amazon.awscdk.services.events.EventBusProps eventBusProps) {
this.props.eventBusProps(eventBusProps);
return this;
}
/**
* (experimental) Optional.
*
* Existing instance of EventBus. The summary construct integrate appsync with event bridge'
* to route the request to step functions.
*
* Default: - None
*
* @return {@code this}
* @param existingBusInterface Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder existingBusInterface(final software.amazon.awscdk.services.events.IEventBus existingBusInterface) {
this.props.existingBusInterface(existingBusInterface);
return this;
}
/**
* (experimental) Optional.
*
* Existing s3 Bucket to store the input document which needs to be summarized.
* pdf is the supported input document format. If transformed (txt format) file is
* available then this bucket is optional.
*
* Default: - None
*
* @return {@code this}
* @param existingInputAssetsBucketObj Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder existingInputAssetsBucketObj(final software.amazon.awscdk.services.s3.IBucket existingInputAssetsBucketObj) {
this.props.existingInputAssetsBucketObj(existingInputAssetsBucketObj);
return this;
}
/**
* (experimental) Optional - Existing merged Appsync GraphQL api.
*
* Default: - None
*
* @return {@code this}
* @param existingMergedApi Optional - Existing merged Appsync GraphQL api. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder existingMergedApi(final software.amazon.awscdk.services.appsync.CfnGraphQLApi existingMergedApi) {
this.props.existingMergedApi(existingMergedApi);
return this;
}
/**
* (experimental) Optional.
*
* This bucket stores the transformed (txt) assets for generating summary.
* If None is provided then this contruct will create one.
*
* Default: - None
*
* @return {@code this}
* @param existingProcessedAssetsBucketObj Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder existingProcessedAssetsBucketObj(final software.amazon.awscdk.services.s3.IBucket existingProcessedAssetsBucketObj) {
this.props.existingProcessedAssetsBucketObj(existingProcessedAssetsBucketObj);
return this;
}
/**
* (experimental) Optional.
*
* Security group for the lambda function which this construct will use.
* If no exisiting security group is provided it will create one from the vpc.
*
* Default: - none
*
* @return {@code this}
* @param existingSecurityGroup Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder existingSecurityGroup(final software.amazon.awscdk.services.ec2.ISecurityGroup existingSecurityGroup) {
this.props.existingSecurityGroup(existingSecurityGroup);
return this;
}
/**
* (experimental) Optional.
*
* An existing VPC can be used to deploy the construct.
* Providing both this and vpcProps is an error.
*
* Default: - none
*
* @return {@code this}
* @param existingVpc Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder existingVpc(final software.amazon.awscdk.services.ec2.IVpc existingVpc) {
this.props.existingVpc(existingVpc);
return this;
}
/**
* (experimental) Optional.
*
* The summary construct transform the input document into txt format. If the
* transformation is not required then this flag can be set to false. If set to true
* then a transformed asset bucket is created which transform the input document from
* input asset bucket to txt format.
*
* Default: - False
*
* @return {@code this}
* @param isFileTransformationRequired Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder isFileTransformationRequired(final java.lang.String isFileTransformationRequired) {
this.props.isFileTransformationRequired(isFileTransformationRequired);
return this;
}
/**
* (experimental) Enable observability.
*
* Warning: associated cost with the services
* used. Best practice to enable by default.
*
* Default: - true
*
* @return {@code this}
* @param observability Enable observability. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder observability(final java.lang.Boolean observability) {
this.props.observability(observability);
return this;
}
/**
* (experimental) Value will be appended to resources name.
*
* Default: - _dev
*
* @return {@code this}
* @param stage Value will be appended to resources name. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder stage(final java.lang.String stage) {
this.props.stage(stage);
return this;
}
/**
* (experimental) Optional.
*
* User provided Name for summary api on appsync.
* A graphql api will be created by this construct with this name.
*
* Default: 'summaryApi'
*
* @return {@code this}
* @param summaryApiName Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder summaryApiName(final java.lang.String summaryApiName) {
this.props.summaryApiName(summaryApiName);
return this;
}
/**
* (experimental) Optional.
*
* Chain type defines how to pass the document to LLM.
* there are three types of chain types.
* Stuff: Simply "stuff" all your documents into a single prompt.
* Map-reduce: Summarize each document on it's own in a "map" step and then "reduce" the summaries into a final summary
* Refine : This constructs a response by looping over the input documents and iteratively updating its answer
*
* Default: - Stuff
*
* @return {@code this}
* @param summaryChainType Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder summaryChainType(final java.lang.String summaryChainType) {
this.props.summaryChainType(summaryChainType);
return this;
}
/**
* (experimental) Optional.
*
* The construct creates a custom VPC based on vpcProps.
* Providing both this and existingVpc is an error.
*
* Default: - none
*
* @return {@code this}
* @param vpcProps Optional. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder vpcProps(final software.amazon.awscdk.services.ec2.VpcProps vpcProps) {
this.props.vpcProps(vpcProps);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.generative_ai_cdk_constructs.SummarizationAppsyncStepfn}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.generative_ai_cdk_constructs.SummarizationAppsyncStepfn build() {
return new io.github.cdklabs.generative_ai_cdk_constructs.SummarizationAppsyncStepfn(
this.scope,
this.id,
this.props.build()
);
}
}
}