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

io.github.cdklabs.generative_ai_cdk_constructs.TextToSql 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;

/**
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-23T22:27:31.928Z")
@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.TextToSql")
public class TextToSql extends io.github.cdklabs.generative_ai_cdk_constructs.BaseClass {

    protected TextToSql(final software.amazon.jsii.JsiiObjectRef objRef) {
        super(objRef);
    }

    protected TextToSql(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
        super(initializationMode);
    }

    /**
     * (experimental) Constructs a new instance of the TextToSql 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 TextToSql(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.TextToSqlProps 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 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 getConfigAssetBucket() { return software.amazon.jsii.Kernel.get(this, "configAssetBucket", 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.SecurityGroup getDbSecurityGroup() { return software.amazon.jsii.Kernel.get(this, "dbSecurityGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.SecurityGroup.class)); } /** * (experimental) Returns the instance of feedback Queue used by the construct. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sqs.Queue getFeedbackQueue() { return software.amazon.jsii.Kernel.get(this, "feedbackQueue", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sqs.Queue.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.SecurityGroup getLambdaSecurityGroup() { return software.amazon.jsii.Kernel.get(this, "lambdaSecurityGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.SecurityGroup.class)); } /** * (experimental) Returns the instance of output Queue used by the construct. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sqs.Queue getOutputQueue() { return software.amazon.jsii.Kernel.get(this, "outputQueue", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sqs.Queue.class)); } /** * (experimental) Returns the instance of subnet group used by the construct. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.rds.SubnetGroup getSubnetGroup() { return software.amazon.jsii.Kernel.get(this, "subnetGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.rds.SubnetGroup.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) Returns the instance of EventBus used by the construct. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.events.IEventBus getEventBus() { return software.amazon.jsii.Kernel.get(this, "eventBus", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.events.IEventBus.class)); } /** * (experimental) Returns the instance of EventBus used by the construct. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.events.Rule getEventsRule() { return software.amazon.jsii.Kernel.get(this, "eventsRule", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.events.Rule.class)); } /** * (experimental) Returns the Instance of stepfunction created by the construct. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.stepfunctions.StateMachine getStepFunction() { return software.amazon.jsii.Kernel.get(this, "stepFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.stepfunctions.StateMachine.class)); } /** * (experimental) A fluent builder for {@link io.github.cdklabs.generative_ai_cdk_constructs.TextToSql}. */ @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.TextToSqlProps.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.TextToSqlProps.Builder(); } /** * (experimental) Database secret. *

* DB credentials to connect to Database. *

* @return {@code this} * @param databaseSecretArn Database secret. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder databaseSecretArn(final java.lang.String databaseSecretArn) { this.props.databaseSecretArn(databaseSecretArn); return this; } /** * (experimental) Database name. *

* This is the target database against which the query will be generated. *

* @return {@code this} * @param dbName Database name. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder dbName(final io.github.cdklabs.generative_ai_cdk_constructs.DbName dbName) { this.props.dbName(dbName); return this; } /** * (experimental) The source of metatdata. *

* This metadata is required to reduce the natual language ambiguity * in order to generate the correct sql query. A knowledge layer is used to map the natural language * to the database schema. * Two metatdata source are supported: * 1: config_file - A local json file containing the knowledge layer key value pair. * 2: Knowledge base - Semantic search is used to fetch the knowledge layer from AWS knowledge base *

* Default: - config_file *

* @return {@code this} * @param metadataSource The source of metatdata. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder metadataSource(final java.lang.String metadataSource) { this.props.metadataSource(metadataSource); return this; } /** * (experimental) Optional. *

* User provided props to override the default props for the S3 Bucket. *

* Default: - Default props are used *

* @return {@code this} * @param configAssetsBucketProps Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder configAssetsBucketProps(final software.amazon.awscdk.services.s3.BucketProps configAssetsBucketProps) { this.props.configAssetsBucketProps(configAssetsBucketProps); return this; } /** * (experimental) Optional. *

* Allows to provide custom lambda code for all pre steps required before generating the query. * If not provided, default code will be used. *

* @return {@code this} * @param customQueryConfigurerLambdaProps Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder customQueryConfigurerLambdaProps(final io.github.cdklabs.generative_ai_cdk_constructs.DockerLambdaCustomProps customQueryConfigurerLambdaProps) { this.props.customQueryConfigurerLambdaProps(customQueryConfigurerLambdaProps); return this; } /** * (experimental) Optional. *

* Allows to provide custom lambda code for executing the query. * If not provided, default code will be used. *

* @return {@code this} * @param customQueryExecutorLambdaProps Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder customQueryExecutorLambdaProps(final io.github.cdklabs.generative_ai_cdk_constructs.DockerLambdaCustomProps customQueryExecutorLambdaProps) { this.props.customQueryExecutorLambdaProps(customQueryExecutorLambdaProps); return this; } /** * (experimental) Optional. *

* Allows to provide custom lambda code for generating the query. * If not provided, default code will be used. *

* @return {@code this} * @param customQueryGeneratorLambdaProps Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder customQueryGeneratorLambdaProps(final io.github.cdklabs.generative_ai_cdk_constructs.DockerLambdaCustomProps customQueryGeneratorLambdaProps) { this.props.customQueryGeneratorLambdaProps(customQueryGeneratorLambdaProps); return this; } /** * (experimental) Optional. *

* db port number. *

* Default: -1534 *

* @return {@code this} * @param dbPort Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder dbPort(final java.lang.Number dbPort) { this.props.dbPort(dbPort); return this; } /** * (experimental) Optional user provided event bus props. *

* Default: - Default props are used. *

* @return {@code this} * @param eventBusProps Optional user provided event bus props. 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 s3 Bucket to store the config files. *

* Default: - None *

* @return {@code this} * @param existingconfigAssetsBucketObj Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder existingconfigAssetsBucketObj(final software.amazon.awscdk.services.s3.IBucket existingconfigAssetsBucketObj) { this.props.existingconfigAssetsBucketObj(existingconfigAssetsBucketObj); return this; } /** * (experimental) Optional. *

* Security group for the db instance 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 existingDbSecurityGroup Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder existingDbSecurityGroup(final software.amazon.awscdk.services.ec2.SecurityGroup existingDbSecurityGroup) { this.props.existingDbSecurityGroup(existingDbSecurityGroup); return this; } /** * (experimental) Optional. *

* Existing instance of event bus, providing both this and eventBusProps will cause an error. *

* Default: - None. *

* @return {@code this} * @param existingEventBusInterface Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder existingEventBusInterface(final software.amazon.awscdk.services.events.IEventBus existingEventBusInterface) { this.props.existingEventBusInterface(existingEventBusInterface); 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 existingLambdaSecurityGroup Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder existingLambdaSecurityGroup(final software.amazon.awscdk.services.ec2.SecurityGroup existingLambdaSecurityGroup) { this.props.existingLambdaSecurityGroup(existingLambdaSecurityGroup); return this; } /** * (experimental) Optional. *

* An existing subnet group can be used to deploy the construct. *

* Default: - none *

* @return {@code this} * @param existingSubnetGroup Optional. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder existingSubnetGroup(final software.amazon.awscdk.services.rds.SubnetGroup existingSubnetGroup) { this.props.existingSubnetGroup(existingSubnetGroup); 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) 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. *

* 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.TextToSql}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public io.github.cdklabs.generative_ai_cdk_constructs.TextToSql build() { return new io.github.cdklabs.generative_ai_cdk_constructs.TextToSql( this.scope, this.id, this.props.build() ); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy