bedrock

package
v0.1.296 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

README

Amazon Bedrock Construct Library

---

All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


Language Package
Typescript Logo TypeScript @cdklabs/generative-ai-cdk-constructs
Python Logo Python cdklabs.generative_ai_cdk_constructs
Java Logo Java io.github.cdklabs.generative_ai_cdk_constructs
.Net .Net CdkLabs.GenerativeAICdkConstructs
Go Go github.com/cdklabs/generative-ai-cdk-constructs-go/generative-ai-cdk-constructs

Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies and Amazon through a single API, along with a broad set of capabilities you need to build generative AI applications with security, privacy, and responsible AI.

This construct library facilitates the deployment of Knowledge Bases, Bedrock Agents, Guardrails, Prompt Management, and Inference Pipelines. It leverages underlying CloudFormation L1 resources to provision these Bedrock features.

Table of contents

API

See the API documentation.

Knowledge Bases

Amazon Bedrock Knowledge Bases enable you to provide foundation models and agents with contextual information from your company’s private data sources. This enhances the relevance, accuracy, and customization of their responses.

Vector Knowledge Base
Create a vector Knowledge Base

A vector index on a vector store is required to create a vector Knowledge Base. This construct currently supports Amazon OpenSearch Serverless, Amazon RDS Aurora PostgreSQL, Pinecone . By default, this resource will create an OpenSearch Serverless vector collection and index for each Knowledge Base you create, but you can provide an existing collection and/or index to have more control. For other resources you need to have the vector stores already created and credentials stored in AWS Secrets Manager. For Aurora, the construct provides an option to create a default AmazonAuroraDefaultVectorStore construct that will provision the vector store backed by Amazon Aurora for you. To learn more you can read here.

The resource accepts an instruction prop that is provided to any Bedrock Agent it is associated with so the agent can decide when to query the Knowledge Base.

Vector Knowledge Base Properties
Name Type Required Description
embeddingsModel BedrockFoundationModel Yes The embeddings model for the knowledge base
name string No The name of the knowledge base
vectorType VectorType No The vector type to store vector embeddings
description string No The description of the knowledge base
instruction string No Instructions for agents based on the design and type of information of the Knowledge Base that will impact how Agents interact with the Knowledge Base
existingRole iam.IRole No Existing IAM role with a policy statement granting permission to invoke the specific embeddings model
indexName string No The name of the vector index (only applicable if vectorStore is of type VectorCollection)
vectorField string No The name of the field in the vector index (only applicable if vectorStore is of type VectorCollection)
vectorStore VectorCollection PineconeVectorStore AmazonAuroraVectorStore
vectorIndex VectorIndex No The vector index for the OpenSearch Serverless backed knowledge base
knowledgeBaseState string No Specifies whether to use the knowledge base or not when sending an InvokeAgent request
tags Record<string, string> No Tag (KEY-VALUE) bedrock agent resource
Initializer

Example of OpenSearch Serverless:

TypeScript

import * as s3 from 'aws-cdk-lib/aws-s3';
import { bedrock } from '@cdklabs/generative-ai-cdk-constructs';

const kb = new bedrock.VectorKnowledgeBase(this, 'KnowledgeBase', {
  embeddingsModel: bedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V1,
  instruction: 'Use this knowledge base to answer questions about books. ' + 'It contains the full text of novels.',
});

const docBucket = new s3.Bucket(this, 'DocBucket');

new bedrock.S3DataSource(this, 'DataSource', {
  bucket: docBucket,
  knowledgeBase: kb,
  dataSourceName: 'books',
  chunkingStrategy: bedrock.ChunkingStrategy.fixedSize({
    maxTokens: 500,
    overlapPercentage: 20,
  }),
});

Python


from aws_cdk import (
    aws_s3 as s3,
)
from cdklabs.generative_ai_cdk_constructs import (
    bedrock
)

kb = bedrock.VectorKnowledgeBase(self, 'KnowledgeBase',
            embeddings_model= bedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V1,
            instruction=  'Use this knowledge base to answer questions about books. ' +
    'It contains the full text of novels.'
        )

docBucket = s3.Bucket(self, 'DockBucket')

bedrock.S3DataSource(self, 'DataSource',
    bucket= docBucket,
    knowledge_base=kb,
    data_source_name='books',
    chunking_strategy= bedrock.ChunkingStrategy.FIXED_SIZE,
)

Example of Amazon RDS Aurora PostgreSQL:

TypeScript

import * as s3 from 'aws-cdk-lib/aws-s3';
import { amazonaurora, bedrock } from '@cdklabs/generative-ai-cdk-constructs';

// Dimension of your vector embedding
embeddingsModelVectorDimension = 1024;
const auroraDb = new amazonaurora.AmazonAuroraVectorStore(stack, 'AuroraDefaultVectorStore', {
  embeddingsModelVectorDimension: embeddingsModelVectorDimension,
});

const kb = new bedrock.VectorKnowledgeBase(this, 'KnowledgeBase', {
  vectorStore: auroraDb,
  embeddingsModel: foundation_models.BedrockFoundationModel.TITAN_EMBED_TEXT_V1,
  instruction: 'Use this knowledge base to answer questions about books. ' + 'It contains the full text of novels.',
});

const docBucket = new s3.Bucket(this, 'DocBucket');

new bedrock.S3DataSource(this, 'DataSource', {
  bucket: docBucket,
  knowledgeBase: kb,
  dataSourceName: 'books',
  chunkingStrategy: bedrock.ChunkingStrategy.FIXED_SIZE,
});

Python


from aws_cdk import (
    aws_s3 as s3,
    aws_rds as rds,
    aws_ec2 as ec2,
    Stack,
    ArnFormat
)
from cdklabs.generative_ai_cdk_constructs import (
    bedrock,
    amazonaurora,
)

# Dimension of your vector embedding
embeddings_model_vector_dimension = 1024
aurora_db = amazonaurora.AmazonAuroraVectorStore(self, 'AuroraDefaultVectorStore',
  embeddings_model_vector_dimension=embeddings_model_vector_dimension
)

kb = bedrock.VectorKnowledgeBase(self, 'KnowledgeBase',
  vector_store= aurora_db,
  embeddings_model= foundation_models.BedrockFoundationModel.TITAN_EMBED_TEXT_V1,
  instruction=  'Use this knowledge base to answer questions about books. ' +
'It contains the full text of novels.'
)

docBucket = s3.Bucket(self, 'DockBucket')

bedrock.S3DataSource(self, 'DataSource',
  bucket= docBucket,
  knowledge_base=kb,
  data_source_name='books',
  chunking_strategy= bedrock.ChunkingStrategy.FIXED_SIZE,
)

Example of importing existing Amazon RDS Aurora PostgreSQL using fromExistingAuroraVectorStore() method. Note - you need to provide clusterIdentifier, databaseName, vpc, secret and auroraSecurityGroupId used in deployment of your existing RDS Amazon Aurora DB, as well as embeddingsModel that you want to be used by a Knowledge Base for chunking:

TypeScript

import * as s3 from "aws-cdk-lib/aws-s3";
import { amazonaurora, bedrock } from '@cdklabs/generative-ai-cdk-constructs';

const auroraDb = aurora.AmazonAuroraVectorStore.fromExistingAuroraVectorStore(stack, 'ExistingAuroraVectorStore', {
  clusterIdentifier: 'aurora-serverless-vector-cluster',
  databaseName: 'bedrock_vector_db',
  schemaName: 'bedrock_integration',
  tableName: 'bedrock_kb',
  vectorField: 'embedding',
  textField: 'chunks',
  metadataField: 'metadata',
  primaryKeyField: 'id',
  embeddingsModel: bedrock.BedrockFoundationModel.COHERE_EMBED_ENGLISH_V3,
  vpc: cdk.aws_ec2.Vpc.fromLookup(stack, 'VPC', {
    vpcId: 'vpc-0c1a234567ee8bc90',
  }),
  auroraSecurityGroupId: 'sg-012ef345678c98a76',,
  secret: cdk.aws_rds.DatabaseSecret.fromSecretCompleteArn(
    stack,
    'Secret',
    cdk.Stack.of(stack).formatArn({
      service: 'secretsmanager',
      resource: 'secret',
      resourceName: 'rds-db-credentials/cluster-1234567890',
      region: cdk.Stack.of(stack).region,
      account: cdk.Stack.of(stack).account,
      arnFormat: cdk.ArnFormat.COLON_RESOURCE_NAME,
    }),
  ),
});

const kb = new bedrock.VectorKnowledgeBase(this, "KnowledgeBase", {
  vectorStore: auroraDb,
  embeddingsModel: bedrock.BedrockFoundationModel.COHERE_EMBED_ENGLISH_V3,
  instruction:
    "Use this knowledge base to answer questions about books. " +
    "It contains the full text of novels.",
});

const docBucket = new s3.Bucket(this, "DocBucket");

new bedrock.S3DataSource(this, "DataSource", {
  bucket: docBucket,
  knowledgeBase: kb,
  dataSourceName: "books",
  chunkingStrategy: bedrock.ChunkingStrategy.FIXED_SIZE,
});

Python


from aws_cdk import (
    aws_s3 as s3,
    aws_rds as rds,
    aws_ec2 as ec2,
    Stack,
    ArnFormat
)
from cdklabs.generative_ai_cdk_constructs import (
    bedrock,
    amazonaurora,
)

aurora_db = amazonaurora.AmazonAuroraVectorStore.from_existing_aurora_vector_store(
    self, 'ExistingAuroraVectorStore',
    cluster_identifier='aurora-serverless-vector-cluster',
    database_name='bedrock_vector_db',
    schema_name='bedrock_integration',
    table_name='bedrock_kb',
    vector_field='embedding',
    text_field='chunks',
    metadata_field='metadata',
    primary_key_field='id',
    embeddings_model=bedrock.BedrockFoundationModel.COHERE_EMBED_ENGLISH_V3,
    vpc=ec2.Vpc.from_lookup(self, 'VPC', vpc_id='vpc-0c1a234567ee8bc90'),
    aurora_security_group_id='sg-012ef345678c98a76',,
    secret=rds.DatabaseSecret.from_secret_complete_arn(
        self,
        'Secret',
        Stack.of(self).format_arn(
            service= 'secretsmanager',
            resource= 'secret',
            resource_name= 'rds-db-credentials/cluster-1234567890',
            region= Stack.of(self).region,
            account= Stack.of(self).account,
            arn_format= ArnFormat.COLON_RESOURCE_NAME
        )
    )
)

kb = bedrock.VectorKnowledgeBase(self, 'KnowledgeBase',
            vector_store= aurora_db,
            embeddings_model= bedrock.BedrockFoundationModel.COHERE_EMBED_ENGLISH_V3,
            instruction=  'Use this knowledge base to answer questions about books. ' +
    'It contains the full text of novels.'
        )

docBucket = s3.Bucket(self, 'DockBucket')

bedrock.S3DataSource(self, 'DataSource',
    bucket= docBucket,
    knowledge_base=kb,
    data_source_name='books',
    chunking_strategy= bedrock.ChunkingStrategy.FIXED_SIZE,
)

Example of Pinecone (manual, you must have Pinecone vector store created):

TypeScript

import * as s3 from 'aws-cdk-lib/aws-s3';
import { pinecone, bedrock } from '@cdklabs/generative-ai-cdk-constructs';

const pineconeds = new pinecone.PineconeVectorStore({
  connectionString: 'https://your-index-1234567.svc.gcp-starter.pinecone.io',
  credentialsSecretArn: 'arn:aws:secretsmanager:your-region:123456789876:secret:your-key-name',
  textField: 'question',
  metadataField: 'metadata',
});

const kb = new bedrock.VectorKnowledgeBase(this, 'KnowledgeBase', {
  vectorStore: pineconeds,
  embeddingsModel: bedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V1,
  instruction: 'Use this knowledge base to answer questions about books. ' + 'It contains the full text of novels.',
});

const docBucket = new s3.Bucket(this, 'DocBucket');

new bedrock.S3DataSource(this, 'DataSource', {
  bucket: docBucket,
  knowledgeBase: kb,
  dataSourceName: 'books',
  chunkingStrategy: bedrock.ChunkingStrategy.FIXED_SIZE,
});

Python


from aws_cdk import (
    aws_s3 as s3,
)
from cdklabs.generative_ai_cdk_constructs import (
    bedrock,
    pinecone,
)

pineconevs = pinecone.PineconeVectorStore(
            connection_string='https://your-index-1234567.svc.gcp-starter.pinecone.io',
            credentials_secret_arn='arn:aws:secretsmanager:your-region:123456789876:secret:your-key-name',
            text_field='question',
            metadata_field='metadata'
        )

kb = bedrock.VectorKnowledgeBase(self, 'KnowledgeBase',
            vector_store= pineconevs,
            embeddings_model= bedrock.BedrockFoundationModel.COHERE_EMBED_ENGLISH_V3,
            instruction=  'Use this knowledge base to answer questions about books. ' +
    'It contains the full text of novels.'
        )

docBucket = s3.Bucket(self, 'DockBucket')

bedrock.S3DataSource(self, 'DataSource',
    bucket= docBucket,
    knowledge_base=kb,
    data_source_name='books',
    chunking_strategy= bedrock.ChunkingStrategy.FIXED_SIZE,
)
Vector Knowledge Base - Vector Type

The data type for the vectors when using a model to convert text into vector embeddings. Embeddings type may impact the availability of some embeddings models and vector stores. The following vector types are available:

  • Floating point: More precise vector representation of the text, but more costly in storage.
  • Binary: Not as precise vector representation of the text, but not as costly in storage as a standard floating-point (float32). Not all embedding models and vector stores support binary embeddings

See Supported embeddings models for information on the available models and their vector data types.

Typescript

const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-cdk-bedrock-data-sources-integ-test');

const kb = new VectorKnowledgeBase(stack, 'MyKnowledgeBase', {
  name: 'MyKnowledgeBase',
  vectorType: bedrock.VectorType.BINARY,
  embeddingsModel: BedrockFoundationModel.COHERE_EMBED_MULTILINGUAL_V3,
});

Python


from aws_cdk import (
    aws_s3 as s3,
)
from cdklabs.generative_ai_cdk_constructs import (
    bedrock
)

kb = bedrock.VectorKnowledgeBase(self, 'KnowledgeBase',
    name= 'MyKnowledgeBase',
    vector_type= bedrock.VectorType.BINARY,
    embeddings_model= bedrock.BedrockFoundationModel.COHERE_EMBED_MULTILINGUAL_V3,
)
Vector Knowledge Base - Data Sources

Data sources are the various repositories or systems from which information is extracted and ingested into the knowledge base. These sources provide the raw content that will be processed, indexed, and made available for querying within the knowledge base system. Data sources can include various types of systems such as document management systems, databases, file storage systems, and content management platforms. Suuported Data Sources include Amazon S3 buckets, Web Crawlers, SharePoint sites, Salesforce instances, and Confluence spaces.

  • Amazon S3. You can either create a new data source using the bedrock.S3DataSource(..) class, or using the kb.addS3DataSource(..).
  • Web Crawler. You can either create a new data source using the bedrock.WebCrawlerDataSource(..) class, or using the kb.addWebCrawlerDataSource(..).
  • Confluence. You can either create a new data source using the bedrock.ConfluenceDataSource(..) class, or using the kb.addConfluenceDataSource(..).
  • SharePoint. You can either create a new data source using the bedrock.SharePointDataSource(..) class, or using the kb.addSharePointDataSource(..).
  • Salesforce. You can either create a new data source using the bedrock.SalesforceDataSource(..) class, or using the kb.addSalesforceDataSource(..).

Typescript

const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-cdk-bedrock-data-sources-integ-test');

const kb = new VectorKnowledgeBase(stack, 'MyKnowledgeBase', {
  name: 'MyKnowledgeBase',
  embeddingsModel: BedrockFoundationModel.COHERE_EMBED_MULTILINGUAL_V3,
});

const bucket = new Bucket(stack, 'Bucket', {});
const lambdaFunction = new Function(stack, 'MyFunction', {
  runtime: cdk.aws_lambda.Runtime.PYTHON_3_9,
  handler: 'index.handler',
  code: cdk.aws_lambda.Code.fromInline('print("Hello, World!")'),
});

const secret = new Secret(stack, 'Secret');
const key = new Key(stack, 'Key');

kb.addWebCrawlerDataSource({
  sourceUrls: ['https://docs.aws.amazon.com/'],
  chunkingStrategy: ChunkingStrategy.HIERARCHICAL_COHERE,
  customTransformation: CustomTransformation.lambda({
    lambdaFunction: lambdaFunction,
    s3BucketUri: `s3://${bucket.bucketName}/chunk-processor/`,
  }),
});

kb.addS3DataSource({
  bucket,
  chunkingStrategy: ChunkingStrategy.SEMANTIC,
  parsingStrategy: ParsingStategy.foundationModel({
    model: BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0,
  }),
});

kb.addConfluenceDataSource({
  dataSourceName: 'TestDataSource',
  authSecret: secret,
  kmsKey: key,
  confluenceUrl: 'https://example.atlassian.net',
  filters: [
    {
      objectType: ConfluenceObjectType.ATTACHMENT,
      includePatterns: ['.*\\.pdf'],
      excludePatterns: ['.*private.*\\.pdf'],
    },
    {
      objectType: ConfluenceObjectType.PAGE,
      includePatterns: ['.*public.*\\.pdf'],
      excludePatterns: ['.*confidential.*\\.pdf'],
    },
  ],
});

kb.addSalesforceDataSource({
  authSecret: secret,
  endpoint: 'https://your-instance.my.salesforce.com',
  kmsKey: key,
  filters: [
    {
      objectType: SalesforceObjectType.ATTACHMENT,
      includePatterns: ['.*\\.pdf'],
      excludePatterns: ['.*private.*\\.pdf'],
    },
    {
      objectType: SalesforceObjectType.CONTRACT,
      includePatterns: ['.*public.*\\.pdf'],
      excludePatterns: ['.*confidential.*\\.pdf'],
    },
  ],
});

kb.addSharePointDataSource({
  dataSourceName: 'SharepointDataSource',
  authSecret: secret,
  kmsKey: key,
  domain: 'yourdomain',
  siteUrls: ['https://yourdomain.sharepoint.com/sites/mysite'],
  tenantId: '888d0b57-69f1-4fb8-957f-e1f0bedf64de',
  filters: [
    {
      objectType: SharePointObjectType.PAGE,
      includePatterns: ['.*\\.pdf'],
      excludePatterns: ['.*private.*\\.pdf'],
    },
    {
      objectType: SharePointObjectType.FILE,
      includePatterns: ['.*public.*\\.pdf'],
      excludePatterns: ['.*confidential.*\\.pdf'],
    },
  ],
});

Python

from aws_cdk import (
    Stack,
    aws_s3 as s3,
    aws_lambda as _lambda,
    aws_secretsmanager as secretsmanager,
    aws_kms as kms
)
from constructs import Construct
from cdklabs.generative_ai_cdk_constructs import (
    bedrock
)

class PythonTestStack(Stack):

    def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
        super().__init__(scope, construct_id, **kwargs)

        kb = bedrock.VectorKnowledgeBase(self, 'MyKnowledgeBase',
                    embeddings_model= bedrock.BedrockFoundationModel.COHERE_EMBED_MULTILINGUAL_V3,
                )

        docBucket = s3.Bucket(self, 'Bucket')

        function = _lambda.Function(self, 'MyFunction',
            runtime=_lambda.Runtime.PYTHON_3_12,
            handler='index.handler',
            code=_lambda.Code.from_inline('print("Hello, World!")'),
        )

        kb.add_web_crawler_data_source(
            source_urls= ['https://docs.aws.amazon.com/'],
            chunking_strategy= bedrock.ChunkingStrategy.HIERARCHICAL_COHERE,
            custom_transformation= bedrock.CustomTransformation.lambda_(
                lambda_function= function,
                s3_bucket_uri= f's3://{docBucket.bucket_name}/chunk-processor/'
            )
        )

        kb.add_s3_data_source(
            bucket= docBucket,
            chunking_strategy= bedrock.ChunkingStrategy.SEMANTIC,
            parsing_strategy= bedrock.ParsingStategy.foundation_model(
                parsing_model= bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0.as_i_model(self)
            )
        )

        secret = secretsmanager.Secret(self, 'Secret')
        key = kms.Key(self, 'Key')

        kb.add_confluence_data_source(
            data_source_name='TestDataSource',
            auth_secret=secret,
            kms_key=key,
            confluence_url='https://example.atlassian.net',
            filters=[
                bedrock.ConfluenceCrawlingFilters(
                    object_type=bedrock.ConfluenceObjectType.ATTACHMENT,
                    include_patterns= [".*\\.pdf"],
                    exclude_patterns= [".*private.*\\.pdf"],
                ),
                bedrock.ConfluenceCrawlingFilters(
                    object_type=bedrock.ConfluenceObjectType.PAGE,
                    include_patterns= [".*public.*\\.pdf"],
                    exclude_patterns= [".*confidential.*\\.pdf"],
                ),
            ]
        )

        kb.add_salesforce_data_source(
            auth_secret=secret,
            endpoint='https://your-instance.my.salesforce.com',
            kms_key=key,
            filters=[
                bedrock.SalesforceCrawlingFilters(
                    object_type=bedrock.SalesforceObjectType.ATTACHMENT,
                    include_patterns= [".*\\.pdf"],
                    exclude_patterns= [".*private.*\\.pdf"],
                ),
                bedrock.SalesforceCrawlingFilters(
                    object_type=bedrock.SalesforceObjectType.CONTRACT,
                    include_patterns= [".*public.*\\.pdf"],
                    exclude_patterns= [".*confidential.*\\.pdf"],
                ),
            ]
        )

        kb.add_share_point_data_source(
            data_source_name='SharepointDataSource',
            auth_secret=secret,
            kms_key=key,
            domain='yourDomain',
            site_urls= ['https://yourdomain.sharepoint.com/sites/mysite'],
            tenant_id='888d0b57-69f1-4fb8-957f-e1f0bedf64de',
            filters=[
                bedrock.SharePointCrawlingFilters(
                    object_type=bedrock.SharePointObjectType.PAGE,
                    include_patterns= [".*\\.pdf"],
                    exclude_patterns= [".*private.*\\.pdf"],
                ),
                bedrock.SharePointCrawlingFilters(
                    object_type=bedrock.SharePointObjectType.FILE,
                    include_patterns= [".*public.*\\.pdf"],
                    exclude_patterns= [".*confidential.*\\.pdf"],
                ),
            ]
        )

Vector Knowledge Base - Chunking Strategies
  • Default Chunking: Applies Fixed Chunking with the default chunk size of 300 tokens and 20% overlap.

    TypeScript

    ChunkingStrategy.DEFAULT;
    

    Python

    ChunkingStrategy.DEFAULT
    
  • Fixed Size Chunking: This method divides the data into fixed-size chunks, with each chunk containing a predetermined number of tokens. This strategy is useful when the data is uniform in size and structure. Typescript

    TypeScript

    // Fixed Size Chunking with sane defaults.
    ChunkingStrategy.FIXED_SIZE;
    
    // Fixed Size Chunking with custom values.
    ChunkingStrategy.fixedSize({ maxTokens: 200, overlapPercentage: 25 });
    

    Python

    # Fixed Size Chunking with sane defaults.
    ChunkingStrategy.FIXED_SIZE
    
    # Fixed Size Chunking with custom values.
    ChunkingStrategy.fixed_size(
      max_tokens= 200,
      overlap_percentage= 25
    )
    
  • Hierarchical Chunking: This strategy organizes data into layers of chunks, with the first layer containing large chunks and the second layer containing smaller chunks derived from the first. It is ideal for data with inherent hierarchies or nested structures.

    TypeScript

    // Hierarchical Chunking with the default for Cohere Models.
    ChunkingStrategy.HIERARCHICAL_COHERE;
    
    // Hierarchical Chunking with the default for Titan Models.
    ChunkingStrategy.HIERARCHICAL_TITAN;
    
    // Hierarchical Chunking with custom values. Tthe maximum chunk size depends on the model.
    // Amazon Titan Text Embeddings: 8192. Cohere Embed models: 512
    ChunkingStrategy.hierarchical({
      overlapTokens: 60,
      maxParentTokenSize: 1500,
      maxChildTokenSize: 300,
    });
    

    Python

    # Hierarchical Chunking with the default for Cohere Models.
    ChunkingStrategy.HIERARCHICAL_COHERE
    
    # Hierarchical Chunking with the default for Titan Models.
    ChunkingStrategy.HIERARCHICAL_TITAN
    
    # Hierarchical Chunking with custom values. Tthe maximum chunk size depends on the model.
    # Amazon Titan Text Embeddings: 8192. Cohere Embed models: 512
    chunking_strategy= ChunkingStrategy.hierarchical(
        overlap_tokens=60,
        max_parent_token_size=1500,
        max_child_token_size=300
    )
    
  • Semantic Chunking: This method splits data into smaller documents based on groups of similar content derived from the text using natural language processing. It helps preserve contextual relationships and ensures accurate and contextually appropriate results.

    TypeScript

    // Semantic Chunking with sane defaults.
    ChunkingStrategy.SEMANTIC;
    
    // Semantic Chunking with custom values.
    ChunkingStrategy.semantic({ bufferSize: 0, breakpointPercentileThreshold: 95, maxTokens: 300 });
    

    Python

    # Semantic Chunking with sane defaults.
    ChunkingStrategy.SEMANTIC
    
    # Semantic Chunking with custom values.
    ChunkingStrategy.semantic(
      buffer_size=0,
      breakpoint_percentile_threshold=95,
      max_tokens=300
    )
    
  • No Chunking: This strategy treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

    TypeScript

    ChunkingStrategy.NONE;
    

    Python

    ChunkingStrategy.NONE
    
Vector Knowledge Base - Parsing Strategy

A parsing strategy in Amazon Bedrock is a configuration that determines how the service processes and interprets the contents of a document. It involves converting the document's contents into text and splitting it into smaller chunks for analysis. Amazon Bedrock offers two parsing strategies:

  • Default Parsing Strategy: This strategy converts the document's contents into text and splits it into chunks using a predefined approach. It is suitable for most use cases but may not be optimal for specific document types or requirements.

  • Foundation Model Parsing Strategy: This strategy uses a foundation model to describe the contents of the document. It is particularly useful for improved processing of PDF files with tables and images. To use this strategy, set the parsingStrategy in a data source as below.

    TypeScript

    bedrock.ParsingStategy.foundationModel({
      model: BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0,
    });
    

    Python

    bedrock.ParsingStategy.foundation_model(
        parsing_model=BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0
    )
    
Knowledge Base - Custom Transformation

Custom Transformation in Amazon Bedrock is a feature that allows you to create and apply custom processing steps to documents moving through a data source ingestion pipeline.

Custom Transformation uses AWS Lambda functions to process documents, enabling you to perform custom operations such as data extraction, normalization, or enrichment. To create a custom transformation, set the customTransformation in a data source as below.

TypeScript

CustomTransformation.lambda({
lambdaFunction: lambdaFunction,
s3BucketUri: `s3://${bucket.bucketName}/chunk-processor/`,
}),

Python

CustomTransformation.lambda_(
  lambda_function= function,
  s3_bucket_uri= f's3://{docBucket.bucket_name}/chunk-processor/'
)
Kendra Knowledge Base
Create a Kendra Knowledge Base

With Amazon Bedrock Knowledge Bases, you can build a knowledge base from an Amazon Kendra GenAI index to create more sophisticated and accurate Retrieval Augmented Generation (RAG)-powered digital assistants. By combining an Amazon Kendra GenAI index with Amazon Bedrock Knowledge Bases, you can:

  • Reuse your indexed content across multiple Amazon Bedrock applications without rebuilding indexes or re-ingesting data.
  • Leverage the advanced GenAI capabilities of Amazon Bedrock while benefiting from the high-accuracy information retrieval of Amazon Kendra.
  • Customize your digital assistant's behavior using the tools of Amazon Bedrock while maintaining the semantic accuracy of an Amazon Kendra GenAI index.
Kendra Knowledge Base properties
Name Type Required Description
kendraIndex IKendraGenAiIndex Yes The Kendra Index to use for the knowledge base.
name string No The name of the knowledge base. If not provided, a name will be auto-generated.
description string No Description of the knowledge base.
instruction string No Instructions for the knowledge base.
existingRole iam.IRole No An existing IAM role to use for the knowledge base. If not provided, a new role will be created.
Initializer

TypeScript

import * as s3 from 'aws-cdk-lib/aws-s3';
import { bedrock, kendra } from '@cdklabs/generative-ai-cdk-constructs';

const cmk = new kms.Key(stack, 'cmk', {});

// you can create a new index using the api below
const index = new kendra.KendraGenAiIndex(this, 'index', {
  name: 'kendra-index-cdk',
  kmsKey: cmk,
  documentCapacityUnits: 1, // 40K documents
  queryCapacityUnits: 1,    // 0.2 QPS
});

// or import an existing one
const index = kendra.KendraGenAiIndex.fromAttrs(this, 'myindex', {
  indexId: 'myindex',
  role: myRole
});

new bedrock.KendraKnowledgeBase(this, 'kb', {
  name: 'kendra-kb-cdk',
  kendraIndex: index,
});

Python

from aws_cdk import aws_kms as kms
from cdklabs.generative_ai_cdk_constructs import bedrock, kendra

# Create a KMS key
cmk = kms.Key(stack, 'cmk')

# Create a new Kendra index
index = kendra.KendraGenAiIndex(self, 'index',
    name='kendra-index-cdk',
    kms_key=cmk,
    document_capacity_units=1,  # 40K documents
    query_capacity_units=1      # 0.2 QPS
)

# Or import an existing index
index = kendra.KendraGenAiIndex.from_attrs(self, 'myindex',
    index_id='myindex',
    role=my_role
)

# Create a Kendra Knowledge Base
kb = bedrock.KendraKnowledgeBase(self, 'kb',
    name='kendra-kb-cdk',
    kendra_index=index
)

Agents

Amazon Bedrock Agents allow generative AI applications to automate complex, multistep tasks by seamlessly integrating with your company’s systems, APIs, and data sources.

Agent Properties
Name Type Required Description
name string No The name of the agent. Defaults to a name generated by CDK
instruction string Yes The instruction used by the agent that determines how it will perform its task. Must have a minimum of 40 characters
foundationModel IInvokable Yes The foundation model used for orchestration by the agent
existingRole iam.IRole No The existing IAM Role for the agent to use. Must have a trust policy allowing Bedrock service to assume the role. Defaults to a new created role
shouldPrepareAgent boolean No Specifies whether to automatically update the DRAFT version of the agent after making changes. Defaults to false
idleSessionTTL Duration No How long sessions should be kept open for the agent. Session expires if no conversation occurs during this time. Defaults to 1 hour
kmsKey kms.IKey No The KMS key of the agent if custom encryption is configured. Defaults to AWS managed key
description string No A description of the agent. Defaults to no description
knowledgeBases IKnowledgeBase[] No The KnowledgeBases associated with the agent
actionGroups AgentActionGroup[] No The Action Groups associated with the agent
guardrail IGuardrail No The guardrail that will be associated with the agent
promptOverrideConfiguration PromptOverrideConfiguration No Overrides some prompt templates in different parts of an agent sequence configuration
userInputEnabled boolean No Select whether the agent can prompt additional information from the user when it lacks enough information. Defaults to false
codeInterpreterEnabled boolean No Select whether the agent can generate, run, and troubleshoot code when trying to complete a task. Defaults to false
forceDelete boolean No Whether to delete the resource even if it's in use. Defaults to true
Create an Agent

The following example creates an Agent with a simple instruction and default prompts that consults a Knowledge Base.

Initializer

TypeScript

const agent = new bedrock.Agent(this, 'Agent', {
  foundationModel: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_HAIKU_V1_0,
  instruction: 'You are a helpful and friendly agent that answers questions about literature.',
});

agent.addKnowledgeBase(kb);

Python

agent = bedrock.Agent(
    self,
    "Agent",
    foundation_model=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_HAIKU_V1_0,
    instruction="You are a helpful and friendly agent that answers questions about insurance claims.",
)
  agent.add_knowledge_base(kb)

You can also use system defined inference profiles to enable cross region inference requests for supported models. For instance:

TypeScript

const cris = bedrock.CrossRegionInferenceProfile.fromConfig({
  geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
  model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,
});

const agent = new bedrock.Agent(this, 'Agent', {
  foundationModel: cris,
  instruction: 'You are a helpful and friendly agent that answers questions about agriculture.',
});

Python

cris = bedrock.CrossRegionInferenceProfile.from_config(
  geo_region= bedrock.CrossRegionInferenceProfileRegion.US,
  model= bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0
)

agent = bedrock.Agent(
    self,
    "Agent",
    foundation_model=cris,
    instruction="You are a helpful and friendly agent that answers questions about agriculture.",
)

For more information on cross region inference, please refer to System defined inference profiles

Action Groups

An action group defines functions your agent can call. The functions are Lambda functions. The action group uses an OpenAPI schema to tell the agent what your functions do and how to call them.

Action Group Properties
Name Type Required Description
name string Yes The name of the action group
description string No A description of the action group
apiSchema ApiSchema No The API Schema
executor ActionGroupExecutor No The action group executor
enabled boolean No Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request. Defaults to true
forceDelete boolean No Specifies whether to delete the resource even if it's in use. Defaults to false
functionSchema CfnAgent.FunctionSchemaProperty No Defines functions that each define parameters that the agent needs to invoke from the user
parentActionGroupSignature ParentActionGroupSignature No The AWS Defined signature for enabling certain capabilities in your agent. When specified, description, apiSchema, and actionGroupExecutor must be blank
Initializer
const actionGroupFunction = new lambda_python.PythonFunction(this, 'ActionGroupFunction', {
  runtime: lambda.Runtime.PYTHON_3_12,
  entry: path.join(__dirname, '../lambda/action-group'),
});

const actionGroup = new AgentActionGroup({
  name: 'query-library',
  description: 'Use these functions to get information about the books in the library.',
  executor: bedrock.ActionGroupExecutor.fromlambdaFunction(actionGroupFunction),
  enabled: true,
  apiSchema: bedrock.ApiSchema.fromLocalAsset(path.join(__dirname, 'action-group.yaml')),
});

agent.addActionGroup(actionGroup);

Python


action_group_function = PythonFunction(
            self,
            "LambdaFunction",
            runtime=Runtime.PYTHON_3_12,
            entry="./lambda",
            index="app.py",
            handler="lambda_handler",
)

actionGroup = bedrock.AgentActionGroup(
    name="query-library",
    description="Use these functions to get information about the books in the library.",
    executor= bedrock.ActionGroupExecutor.fromlambda_function(action_group_function),
    enabled=True,
    api_schema=bedrock.ApiSchema.from_local_asset("action-group.yaml"))

agent.add_action_group(actionGroup)
Prepare the Agent

The Agent constructs take an optional parameter shouldPrepareAgent to indicate that the Agent should be prepared after any updates to an agent, Knowledge Base association, or action group. This may increase the time to create and update those resources. By default, this value is false .

Creating an agent alias will not prepare the agent, so if you create an alias using the AgentAlias resource then you should set shouldPrepareAgent to true.

Prompt Overrides

Bedrock Agents allows you to customize the prompts and LLM configuration for its different steps. You can disable steps or create a new prompt template. Prompt templates can be inserted from plain text files.

TypeScript

import { readFileSync } from 'fs';

const file = readFileSync(prompt_path, 'utf-8');

const agent = new bedrock.Agent(this, 'Agent', {
      foundationModel: bedrock.BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
      instruction: 'You are a helpful and friendly agent that answers questions about literature.',
      userInputEnabled: true,
      codeInterpreterEnabled: false,
      shouldPrepareAgent:true,
      promptOverrideConfiguration: bedrock.PromptOverrideConfiguration.fromSteps(
        [
          {
            stepType: bedrock.AgentStepType.PRE_PROCESSING,
            stepEnabled: true,
            customPromptTemplate: file,
            inferenceConfig: {
              temperature: 0.0,
              topP: 1,
              topK: 250,
              maximumLength: 1,
              stopSequences: ["\n\nHuman:"],
            },
          }
        ]
      )
    });

Python

orchestration = open('prompts/orchestration.txt', encoding="utf-8").read()
agent = bedrock.Agent(self, "Agent",
            foundation_model=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_V2_1,
            instruction="You are a helpful and friendly agent that answers questions about insurance claims.",
            user_input_enabled=True,
            code_interpreter_enabled=False,
            should_prepare_agent=True,
            prompt_override_configuration= bedrock.PromptOverrideConfiguration.from_steps(
                steps=[
                    bedrock.PromptStepConfiguration(
                        step_type=bedrock.AgentStepType.PRE_PROCESSING,
                        step_enabled= True,
                        custom_prompt_template= file,
                        inference_config=bedrock.InferenceConfiguration(
                            temperature=0.0,
                            top_k=250,
                            top_p=1,
                            maximum_length=1,
                            stop_sequences=['\n\nHuman:'],
                        )
                    ),
                ]
            ),
        )
Memory Configuration

Agents can maintain context across multiple sessions and recall past interactions using memory. This feature is useful for creating a more coherent conversational experience.

Memory Options

You can configure memory for an agent using the memory property in the AgentProps interface. The memory configuration allows you to specify the type of memory and its properties.

TypeScript

import { Agent, Memory, SessionSummaryMemoryProps } from 'src/cdk-lib/bedrock/agents';

const agent = new Agent(this, 'MyAgent', {
  name: 'MyAgent',
  instruction: 'Your instruction here',
  foundationModel: bedrock.BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
  memory: Memory.sessionSummary({
        maxRecentSessions: 10, // Keep the last 20 session summaries
        memoryDurationDays: 20, // Retain summaries for 30 days
      }),
});

Python

from src.cdk_lib.bedrock.agents import Agent, Memory, BedrockFoundationModel

agent = Agent(self, 'MyAgent',
    name='MyAgent',
    instruction='Your instruction here',
    foundation_model=BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
    memory=Memory.session_summary(
        max_recent_sessions=10,  # Keep the last 10 session summaries
        memory_duration_days=20,  # Retain summaries for 20 days
    ),
)
Memory Properties
  • memoryDurationDays: Duration in days for which session summaries are retained (1-365). Default is 30 days.
  • maxRecentSessions: Maximum number of recent session summaries to include (minimum 1). Default is 20.
Memory Types

Currently, the following memory type is supported:

  • SESSION_SUMMARY: Uses memory summarization to enhance accuracy by summarizing sessions.

For more information on memory configuration, refer to the AWS Bedrock documentation.

Agent Alias

After you have sufficiently iterated on your working draft and are satisfied with the behavior of your agent, you can set it up for deployment and integration into your application by creating aliases of your agent.

To deploy your agent, you need to create an alias. During alias creation, Amazon Bedrock automatically creates a version of your agent. The alias points to this newly created version. You can point the alias to a previously created version if necessary. You then configure your application to make API calls to that alias.

By default, the Agent resource does not create any aliases, and you can use the 'DRAFT' version.

Specific version

You can use the AgentAlias resource if you want to create an Alias for an existing Agent.

TypeScript

const agentAlias2 = new bedrock.AgentAlias(this, 'myalias2', {
  aliasName: 'myalias',
  agent: agent,
  agentVersion: '1', // optional
  description: 'mytest'
});

Python

agent_alias_2 = bedrock.AgentAlias(self, 'myalias2',
    alias_name='myalias',
    agent=agent,
    agent_version='1', # optional
    description='mytest'
)

Bedrock Guardrails

Amazon Bedrock's Guardrails feature enables you to implement robust governance and control mechanisms for your generative AI applications, ensuring alignment with your specific use cases and responsible AI policies. Guardrails empowers you to create multiple tailored policy configurations, each designed to address the unique requirements and constraints of different use cases. These policy configurations can then be seamlessly applied across multiple foundation models (FMs) and Agents, ensuring a consistent user experience and standardizing safety, security, and privacy controls throughout your generative AI ecosystem.

With Guardrails, you can define and enforce granular, customizable policies to precisely govern the behavior of your generative AI applications. You can configure the following policies in a guardrail to avoid undesirable and harmful content and remove sensitive information for privacy protection.

Content filters – Adjust filter strengths to block input prompts or model responses containing harmful content.

Denied topics – Define a set of topics that are undesirable in the context of your application. These topics will be blocked if detected in user queries or model responses.

Word filters – Configure filters to block undesirable words, phrases, and profanity. Such words can include offensive terms, competitor names etc.

Sensitive information filters – Block or mask sensitive information such as personally identifiable information (PII) or custom regex in user inputs and model responses.

You can create a Guardrail with a minimum blockedInputMessaging ,blockedOutputsMessaging and default content filter policy.

TypeScript

const guardrails = new bedrock.Guardrail(this, 'bedrockGuardrails', {
  name: 'my-BedrockGuardrails',
  description: 'Legal ethical guardrails.',
});

// Optional - Add Sensitive information filters

guardrail.addPIIFilter({
  type: PIIType.General.ADDRESS,
  action: GuardrailAction.ANONYMIZE,
});

guardrail.addRegexFilter({
  name: 'TestRegexFilter',
  description: 'This is a test regex filter',
  pattern: '/^[A-Z]{2}d{6}$/',
  action: bedrock.GuardrailAction.ANONYMIZE,
});

// Optional - Add contextual grounding

guardrail.addContextualGroundingFilter({
  type: ContextualGroundingFilterType.GROUNDING,
  threshold: 0.95,
});

guardrail.addContextualGroundingFilter({
  type: ContextualGroundingFilterType.RELEVANCE,
  threshold: 0.95,
});

// Optional - Add Denied topics . You can use a Topic or create your custom Topic

guardrail.addDeniedTopicFilter(Topic.FINANCIAL_ADVICE);
guardrail.addDeniedTopicFilter(
  Topic.custom({
    name: 'Legal_Advice',
    definition:
      'Offering guidance or suggestions on legal matters, legal actions, interpretation of laws, or legal rights and responsibilities.',
    examples: [
      'Can I sue someone for this?',
      'What are my legal rights in this situation?',
      'Is this action against the law?',
      'What should I do to file a legal complaint?',
      'Can you explain this law to me?',
    ],
  })
);

// Optional - Add Word filters. You can upload words from a file with addWordFilterFromFile function.
guardrail.addWordFilter('drugs');
guardrail.addManagedWordListFilter(ManagedWordFilterType.PROFANITY);
guardrails.addWordFilterFromFile('./scripts/wordsPolicy.csv');

// versioning - if you change any guardrail configuration, a new version will be created
guardrails.createVersion('testversion');

// Importing existing guardrail
const importedGuardrail = bedrock.Guardrail.fromGuardrailAttributes(stack, 'TestGuardrail', {
  guardrailArn: 'arn:aws:bedrock:us-east-1:123456789012:guardrail/oygh3o8g7rtl',
  guardrailVersion: '1', //optional
  kmsKey: kmsKey, //optional
});

// Importing Guardrails created through the L1 CDK CfnGuardrail construct
const cfnGuardrail = new CfnGuardrail(this, 'MyCfnGuardrail', {
  blockedInputMessaging: 'blockedInputMessaging',
  blockedOutputsMessaging: 'blockedOutputsMessaging',
  name: 'namemycfnguardrails',
  wordPolicyConfig: {
    wordsConfig: [
      {
        text: 'drugs',
      },
    ],
  },
});

const importedGuardrail = bedrock.Guardrail.fromCfnGuardrail(cfnGuardrail);

Python

    guardrail = bedrock.Guardrail(self, 'myGuardrails',
        name='my-BedrockGuardrails',
        description= "Legal ethical guardrails.")

    # Optional - Add Sensitive information filters

    guardrail.add_pii_filter(
        type= bedrock.pii_type.General.ADDRESS,
        action= bedrock.GuardrailAction.ANONYMIZE,
    )

    guardrail.add_regex_filter(
        name= "TestRegexFilter",
        description= "This is a test regex filter",
        pattern= "/^[A-Z]{2}d{6}$/",
        action= bedrock.GuardrailAction.ANONYMIZE,
    )

    # Optional - Add contextual grounding

    guardrail.add_contextual_grounding_filter(
        type= bedrock.ContextualGroundingFilterType.GROUNDING,
        threshold= 0.95,
    )

    # Optional - Add Denied topics . You can use default Topic or create your custom Topic with createTopic function. The default Topics can also be overwritten.

    guardrail.add_contextual_grounding_filter(
        type= bedrock.ContextualGroundingFilterType.RELEVANCE,
        threshold= 0.95,
    )

    guardrail.add_denied_topic_filter(bedrock.Topic.FINANCIAL_ADVICE)

    guardrail.add_denied_topic_filter(
      bedrock.Topic.custom(
        name= "Legal_Advice",
        definition=
            "Offering guidance or suggestions on legal matters, legal actions, interpretation of laws, or legal rights and responsibilities.",
        examples= [
            "Can I sue someone for this?",
            "What are my legal rights in this situation?",
            "Is this action against the law?",
            "What should I do to file a legal complaint?",
            "Can you explain this law to me?",
        ]
      )
    )

    # Optional - Add Word filters. You can upload words from a file with addWordFilterFromFile function.
    guardrail.add_word_filter("drugs")
    guardrail.add_managed_word_list_filter(bedrock.ManagedWordFilterType.PROFANITY)
    guardrail.add_word_filter_from_file("./scripts/wordsPolicy.csv")

    # versioning - if you change any guardrail configuration, a new version will be created
    guardrail.create_version("testversion")

    # Importing existing guardrail
    imported_guardrail = bedrock.Guardrail.from_guardrail_attributes(self, "TestGuardrail",
      guardrail_arn="arn:aws:bedrock:us-east-1:123456789012:guardrail/oygh3o8g7rtl",
      guardrail_version="1",
      kms_key=kms_key
    )

    # Importing Guardrails created through the L1 CDK CfnGuardrail construct
    cfn_guardrail = cfnbedrock.CfnGuardrail(self, "MyCfnGuardrail",
        blocked_input_messaging="blockedInputMessaging",
        blocked_outputs_messaging="blockedOutputsMessaging",
        name="name",

        # the properties below are optional
        word_policy_config=cfnbedrock.CfnGuardrail.WordPolicyConfigProperty(
            words_config=[cfnbedrock.CfnGuardrail.WordConfigProperty(
                text="drugs"
            )]
        )
    )

    imported_guardrail = bedrock.Guardrail.from_cfn_guardrail(cfn_guardrail)



Prompt management

Amazon Bedrock provides the ability to create and save prompts using Prompt management so that you can save time by applying the same prompt to different workflows. You can include variables in the prompt so that you can adjust the prompt for different use case.

The Prompt resource allows you to create a new prompt. Example of a basic Text Prompt:

TypeScript

const cmk = new kms.Key(this, 'cmk', {});
const claudeModel = BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0;

const variant1 = PromptVariant.text({
  variantName: 'variant1',
  model: claudeModel,
  promptVariables: ['topic'],
  promptText: 'This is my first text prompt. Please summarize our conversation on: {{topic}}.',
  inferenceConfiguration: {
    temperature: 1.0,
    topP: 0.999,
    maxTokens: 2000,
  },
});

const prompt1 = new Prompt(this, 'prompt1', {
  promptName: 'prompt1',
  description: 'my first prompt',
  defaultVariant: variant1,
  variants: [variant1],
  kmsKey: cmk,
});

Python

        cmk = kms.Key(self, "cmk")
        claude_model = bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0

        variant1 = bedrock.PromptVariant.text(
            variant_name="variant1",
            model=claude_model,
            prompt_variables=["topic"],
            prompt_text="This is my first text prompt. Please summarize our conversation on: {{topic}}.",
            inference_configuration={
                "temperature": 1.0,
                "top_p": 0.999,
                "max_tokens": 2000,
            }
        )

        prompt = bedrock.Prompt(
            self,
            "myprompt",
            prompt_name="prompt1",
            description="my first prompt",
            default_variant=variant1,
            variants=[variant1],
            kms_key=cmk
        )

Example of a "Chat" Prompt. Use this template type when the model supports the Converse API or the Anthropic Claude Messages API. This allows you to include a System prompt and previous User messages and Assistant messages for context.

TypeScript

const cmk = new kms.Key(this, 'cmk', {});

const variantChat = PromptVariant.chat({
  variantName: 'variant1',
  model: BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,
  messages: [
    ChatMessage.userMessage('From now on, you speak Japanese!'),
    ChatMessage.assistantMessage('Konnichiwa!'),
    ChatMessage.userMessage('From now on, you speak {{language}}!'),
  ],
  system: 'You are a helpful assistant that only speaks the language you`re told.',
  promptVariables: ['language'],
  toolConfiguration: {
    toolChoice: ToolChoice.AUTO,
    tools: [
      {
        toolSpec: {
          name: 'top_song',
          description: 'Get the most popular song played on a radio station.',
          inputSchema: {
            json: {
              type: 'object',
              properties: {
                sign: {
                  type: 'string',
                  description:
                    'The call sign for the radio station for which you want the most popular song. Example calls signs are WZPZ and WKR.',
                },
              },
              required: ['sign'],
            },
          },
        },
      },
    ],
  },
});

new Prompt(stack, 'prompt1', {
  promptName: 'prompt-chat',
  description: 'my first chat prompt',
  defaultVariant: variantChat,
  variants: [variantChat],
  kmsKey: cmk,
});

Python


# Create KMS key
        cmk = kms.Key(self, "cmk")

        # Create tool specification
        tool_spec = CfnPrompt.ToolSpecificationProperty(
            name="top_song",
            description="Get the most popular song played on a radio station.",
            input_schema=CfnPrompt.ToolInputSchemaProperty(
                json={
                    "type": "object",
                    "properties": {
                        "sign": {
                            "type": "string",
                            "description": "The call sign for the radio station for which you want the most popular song. Example calls signs are WZPZ and WKR."
                        }
                    },
                    "required": ["sign"]
                }
            )
        )

        # Create tool configuration
        tool_config = bedrock.ToolConfiguration(
            tool_choice=bedrock.ToolChoice.AUTO,
            tools=[
                CfnPrompt.ToolProperty(
                    tool_spec=tool_spec
                )
            ]
        )

        # Create chat variant
        variant_chat = bedrock.PromptVariant.chat(
            variant_name="variant1",
            model=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,
            messages=[
                bedrock.ChatMessage.user("From now on, you speak Japanese!"),
                bedrock.ChatMessage.assistant("Konnichiwa!"),
                bedrock.ChatMessage.user("From now on, you speak {{language}}!"),
            ],
            system="You are a helpful assistant that only speaks the language you're told.",
            prompt_variables=["language"],
            tool_configuration=tool_config
        )

        # Create prompt
        prompt = bedrock.Prompt(
            self,
            "prompt1",
            prompt_name="prompt-chat",
            description="my first chat prompt",
            default_variant=variant_chat,
            variants=[variant_chat],
            kms_key=cmk
        )

Prompt Variants

Prompt variants in the context of Amazon Bedrock refer to alternative configurations of a prompt, including its message or the model and inference configurations used. Prompt variants allow you to create different versions of a prompt, test them, and save the variant that works best for your use case. You can add prompt variants to a prompt by creating a PromptVariant object and specify the variants on prompt creation, or by using the .addVariant(..) method on a Prompt object.

Example of PromptVariant:

TypeScript

...

const variant2 = PromptVariant.text({
  variantName: "variant2",
  model: claudeModel,
  promptVariables: [ "topic" ],
  promptText: "This is my second text prompt. Please summarize our conversation on: {{topic}}.",
  inferenceConfiguration: {
    temperature: 0.5,
    topP: 0.999,
    maxTokens: 2000,
  },
});

prompt1.addVariant(variant2);

Python


        variant2 = bedrock.PromptVariant.text(
            variant_name="variant2",
            model=claude_model,
            prompt_variables=["topic"],
            prompt_text="This is my second text prompt. Please summarize our conversation on: {{topic}}.",
            inference_configuration={
                "temperature": 0.5,
                "topP": 0.999,
                "maxTokens": 2000,
            }
        )

        prompt.add_variant(variant2)
Prompt routing

Amazon Bedrock intelligent prompt routing provides a single serverless endpoint for efficiently routing requests between different foundational models within the same model family. It can help you optimize for response quality and cost. They offer a comprehensive solution for managing multiple AI models through a single serverless endpoint, simplifying the process for you. Intelligent prompt routing predicts the performance of each model for each request, and dynamically routes each request to the model that it predicts is most likely to give the desired response at the lowest cost. More information about prompt routing in the documentation

TypeScript

const variant = PromptVariant.text({
  variantName: 'variant1',
  promptText: 'What is the capital of France?',
  model: PromptRouter.fromDefaultId(DefaultPromptRouterIdentifier.ANTHROPIC_CLAUDE_V1, region),
});

new Prompt(stack, 'Prompt', {
  promptName: 'prompt-router-test',
  variants: [variant],
});

Python

variant = bedrock.PromptVariant.text(
    variant_name='variant1',
    prompt_text='What is the capital of France?',
    model=bedrock.PromptRouter.from_default_id(bedrock.DefaultPromptRouterIdentifier.ANTHROPIC_CLAUDE_V1, region),
)

bedrock.Prompt(self, 'Prompt',
    prompt_name='prompt-router-test',
    variants=[variant],
)
Prompt Version

A prompt version is a snapshot of a prompt at a specific point in time that you create when you are satisfied with a set of configurations. Versions allow you to deploy your prompt and easily switch between different configurations for your prompt and update your application with the most appropriate version for your use-case.

You can create a Prompt version by using the PromptVersion class or by using the .createVersion(..) on a Prompt object. It is recommended to use the .createVersion(..) method. It uses a hash based mechanism to update the version whenever a certain configuration property changes.

TypeScript

new PromptVersion(prompt1, 'my first version');
bedrock.PromptVersion(self, "my first version")

or alternatively:

prompt1.createVersion('my first version');
prompt.create_version("version1", "my first version")

System defined inference profiles

You can build a CrossRegionInferenceProfile using a system defined inference profile. The inference profile will route requests to the Regions defined in the cross region (system-defined) inference profile that you choose. You can find the system defined inference profiles by navigating to your console (Amazon Bedrock -> Cross-region inference) or programmatically, for instance using boto3.

Before using creating a CrossRegionInferenceProfile, ensure that you have access to the models and regions defined in the inference profiles. For instance, if you see the system defined inference profile "us.anthropic.claude-3-5-sonnet-20241022-v2:0" defined in your region, the table mentions that inference requests will be routed to US East (Virginia) us-east-1, US East (Ohio) us-east-2 and US West (Oregon) us-west-2. Thus, you need to have model access enabled in those regions for the model anthropic.claude-3-5-sonnet-20241022-v2:0. You can then create the CrossRegionInferenceProfile as follows:

TypeScript

const cris = bedrock.CrossRegionInferenceProfile.fromConfig({
  geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
  model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0,
});

Python

cris = bedrock.CrossRegionInferenceProfile.from_config(
  geo_region= bedrock.CrossRegionInferenceProfileRegion.US,
  model= bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0
)

Application inference profile

You can create an application inference profile with one or more Regions to track usage and costs when invoking a model.

To create an application inference profile for one Region, specify a foundation model. Usage and costs for requests made to that Region with that model will be tracked.

To create an application inference profile for multiple Regions, specify a cross region (system-defined) inference profile. The inference profile will route requests to the Regions defined in the cross region (system-defined) inference profile that you choose. Usage and costs for requests made to the Regions in the inference profile will be tracked. You can find the system defined inference profiles by navigating to your console (Amazon Bedrock -> Cross-region inference) or programmatically, for instance using boto3:

bedrock = session.client("bedrock", region_name="us-east-1")
bedrock.list_inference_profiles(typeEquals='SYSTEM_DEFINED')

Before using application inference profiles, ensure that:

  • You have appropriate IAM permissions
  • You have access to the models and regions defined in the inference profiles
  • Ensure proper configuration of the required API permissions for inference profile-related actions

Specifically the role you are assuming needs to have permissions for following actions in the IAM policy

"Action": [
      "bedrock:GetInferenceProfile",
      "bedrock:ListInferenceProfiles",
      "bedrock:DeleteInferenceProfile"
      "bedrock:TagResource",
      "bedrock:UntagResource",
      "bedrock:ListTagsForResource"
  ]

You can restrict to specific resources by applying "Resources" tag in the IAM policy.

"Resource": ["arn:aws:bedrock:*:*:application-inference-profile/*"]

TypeScript

// Create an application inference profile for one Region
// You can use the 'bedrock.BedrockFoundationModel' or pass the arn as a string
const appInfProfile1 = new ApplicationInferenceProfile(this, 'myapplicationprofile', {
  inferenceProfileName: 'claude 3 sonnet v1',
  modelSource: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0,
  tags: [{ key: 'test', value: 'test' }],
});

// To create an application inference profile across regions, specify the cross region inference profile
const cris = bedrock.CrossRegionInferenceProfile.fromConfig({
  geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
  model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0,
});

const appInfProfile2 = new ApplicationInferenceProfile(this, 'myapplicationprofile2', {
  inferenceProfileName: 'claude 3 sonnet v1',
  modelSource: cris,
});

// Import a Cfn L1 construct created application inference profile
const cfnapp = new CfnApplicationInferenceProfile(this, 'mytestaip3', {
  inferenceProfileName: 'mytest',
  modelSource: {
    copyFrom: 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-sonnet-20240229-v1:0',
  },
});

const appInfProfile3 = bedrock.ApplicationInferenceProfile.fromCfnApplicationInferenceProfile(cfnapp);

// Import an inference profile through attributes
const appInfProfile4 = bedrock.ApplicationInferenceProfile.fromApplicationInferenceProfileAttributes(this, 'TestAIP', {
  inferenceProfileArn: 'arn:aws:bedrock:us-east-1:XXXXX:application-inference-profile/ID',
  inferenceProfileIdentifier: 'arn:aws:bedrock:us-east-1:XXXXXXX:application-inference-profile/ID',
});

Python


# Create an application inference profile for one Region
# You can use the 'bedrock.BedrockFoundationModel' or pass the arn as a string
appInfProfile1 = bedrock.ApplicationInferenceProfile(self, 'myapplicationprofile',
  inference_profile_name='claude 3 sonnet v1',
  model_source=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0,
  tags=[CfnTag(
    key="key",
    value="value"
  )]
)

# To create an application inference profile across regions, specify the cross region inference profile
cris = bedrock.CrossRegionInferenceProfile.from_config(
  geo_region= bedrock.CrossRegionInferenceProfileRegion.US,
  model= bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0
)

appInfProfile2 = bedrock.ApplicationInferenceProfile(self, 'myapplicationprofile2',
  inference_profile_name='claude 35 sonnet v2',
  model_source=cris
)

# Import an inference profile through attributes
appInfProfile3 = bedrock.ApplicationInferenceProfile.from_application_inference_profile_attributes(self, 'TestAIP',
  inference_profile_arn='arn:aws:bedrock:us-east-1:XXXXX:application-inference-profile/ID',
  inference_profile_identifier='arn:aws:bedrock:us-east-1:XXXXXXX:application-inference-profile/ID',
)

# Import a Cfn L1 construct created application inference profile
cfnaip = CfnApplicationInferenceProfile(this, 'mytestaip4',
  inference_profile_name='mytest',
  model_source= CfnApplicationInferenceProfile.InferenceProfileModelSourceProperty(
    copy_from='arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-sonnet-20240229-v1:0'
  ),
)

appInfProfile4 = bedrock.ApplicationInferenceProfile.from_cfn_application_inference_profile(cfnaip);

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentAliasBase_IsConstruct added in v0.1.290

func AgentAliasBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func AgentAliasBase_IsOwnedResource added in v0.1.290

func AgentAliasBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func AgentAliasBase_IsResource added in v0.1.290

func AgentAliasBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func AgentAlias_IsConstruct

func AgentAlias_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func AgentAlias_IsOwnedResource added in v0.1.290

func AgentAlias_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func AgentAlias_IsResource added in v0.1.290

func AgentAlias_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func AgentBase_IsConstruct added in v0.1.290

func AgentBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func AgentBase_IsOwnedResource added in v0.1.290

func AgentBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func AgentBase_IsResource added in v0.1.290

func AgentBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func Agent_IsConstruct

func Agent_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func Agent_IsOwnedResource added in v0.1.290

func Agent_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func Agent_IsResource added in v0.1.290

func Agent_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func ApplicationInferenceProfile_IsConstruct added in v0.1.283

func ApplicationInferenceProfile_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func ApplicationInferenceProfile_IsOwnedResource added in v0.1.283

func ApplicationInferenceProfile_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func ApplicationInferenceProfile_IsResource added in v0.1.283

func ApplicationInferenceProfile_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func ConfluenceDataSource_IsConstruct added in v0.1.270

func ConfluenceDataSource_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func ConfluenceDataSource_IsOwnedResource added in v0.1.270

func ConfluenceDataSource_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func ConfluenceDataSource_IsResource added in v0.1.270

func ConfluenceDataSource_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func DataSourceBase_IsConstruct added in v0.1.270

func DataSourceBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func DataSourceBase_IsOwnedResource added in v0.1.270

func DataSourceBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func DataSourceBase_IsResource added in v0.1.270

func DataSourceBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func DataSourceNew_IsConstruct added in v0.1.270

func DataSourceNew_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func DataSourceNew_IsOwnedResource added in v0.1.270

func DataSourceNew_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func DataSourceNew_IsResource added in v0.1.270

func DataSourceNew_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func DataSource_IsConstruct added in v0.1.270

func DataSource_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func DataSource_IsOwnedResource added in v0.1.270

func DataSource_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func DataSource_IsResource added in v0.1.270

func DataSource_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func GuardrailBase_IsConstruct added in v0.1.276

func GuardrailBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func GuardrailBase_IsOwnedResource added in v0.1.276

func GuardrailBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func GuardrailBase_IsResource added in v0.1.276

func GuardrailBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func GuardrailBase_MetricAll added in v0.1.293

func GuardrailBase_MetricAll(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the given named metric for all guardrails.

By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the `statistic` and `period` properties. Experimental.

func GuardrailBase_MetricAllInvocationLatency added in v0.1.293

func GuardrailBase_MetricAllInvocationLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the invocation latency metric for all guardrails. Experimental.

func GuardrailBase_MetricAllInvocations added in v0.1.293

func GuardrailBase_MetricAllInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the invocations metric for all guardrails. Experimental.

func GuardrailBase_MetricAllInvocationsIntervened added in v0.1.293

func GuardrailBase_MetricAllInvocationsIntervened(props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the invocations intervened metric for all guardrails. Experimental.

func GuardrailBase_MetricAllTextUnitCount added in v0.1.293

func GuardrailBase_MetricAllTextUnitCount(props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the text unit count metric for all guardrails. Experimental.

func Guardrail_IsConstruct

func Guardrail_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func Guardrail_IsOwnedResource added in v0.1.276

func Guardrail_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func Guardrail_IsResource added in v0.1.276

func Guardrail_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func Guardrail_MetricAll added in v0.1.293

func Guardrail_MetricAll(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the given named metric for all guardrails.

By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the `statistic` and `period` properties. Experimental.

func Guardrail_MetricAllInvocationLatency added in v0.1.293

func Guardrail_MetricAllInvocationLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the invocation latency metric for all guardrails. Experimental.

func Guardrail_MetricAllInvocations added in v0.1.293

func Guardrail_MetricAllInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the invocations metric for all guardrails. Experimental.

func Guardrail_MetricAllInvocationsIntervened added in v0.1.293

func Guardrail_MetricAllInvocationsIntervened(props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the invocations intervened metric for all guardrails. Experimental.

func Guardrail_MetricAllTextUnitCount added in v0.1.293

func Guardrail_MetricAllTextUnitCount(props *awscloudwatch.MetricOptions) awscloudwatch.Metric

Return the text unit count metric for all guardrails. Experimental.

func InferenceProfileBase_IsConstruct added in v0.1.283

func InferenceProfileBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func InferenceProfileBase_IsOwnedResource added in v0.1.283

func InferenceProfileBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func InferenceProfileBase_IsResource added in v0.1.283

func InferenceProfileBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func KendraKnowledgeBaseBase_IsConstruct added in v0.1.292

func KendraKnowledgeBaseBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func KendraKnowledgeBaseBase_IsOwnedResource added in v0.1.292

func KendraKnowledgeBaseBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func KendraKnowledgeBaseBase_IsResource added in v0.1.292

func KendraKnowledgeBaseBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func KendraKnowledgeBase_IsConstruct added in v0.1.292

func KendraKnowledgeBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func KendraKnowledgeBase_IsOwnedResource added in v0.1.292

func KendraKnowledgeBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func KendraKnowledgeBase_IsResource added in v0.1.292

func KendraKnowledgeBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func KnowledgeBaseBase_IsConstruct added in v0.1.292

func KnowledgeBaseBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func KnowledgeBaseBase_IsOwnedResource added in v0.1.292

func KnowledgeBaseBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func KnowledgeBaseBase_IsResource added in v0.1.292

func KnowledgeBaseBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func Memory_SESSION_SUMMARY added in v0.1.295

func Memory_SESSION_SUMMARY() *awsbedrock.CfnAgent_MemoryConfigurationProperty

func Memory_SessionSummary added in v0.1.295

Creates a session summary memory with custom configuration.

Returns: Memory configuration object. Experimental.

func NewAgentActionGroup_Override

func NewAgentActionGroup_Override(a AgentActionGroup, props *AgentActionGroupProps)

Experimental.

func NewAgentAliasBase_Override added in v0.1.290

func NewAgentAliasBase_Override(a AgentAliasBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewAgentAlias_Override

func NewAgentAlias_Override(a AgentAlias, scope constructs.Construct, id *string, props *AgentAliasProps)

Experimental.

func NewAgentBase_Override added in v0.1.290

func NewAgentBase_Override(a AgentBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewAgent_Override

func NewAgent_Override(a Agent, scope constructs.Construct, id *string, props *AgentProps)

Experimental.

func NewApiSchema_Override

func NewApiSchema_Override(a ApiSchema, s3File *awss3.Location, inlineSchema *string)

Constructor accessible only to extending classes. Experimental.

func NewApplicationInferenceProfile_Override added in v0.1.283

func NewApplicationInferenceProfile_Override(a ApplicationInferenceProfile, scope constructs.Construct, id *string, props *ApplicationInferenceProfileProps)

Experimental.

func NewBedrockFoundationModel_Override

func NewBedrockFoundationModel_Override(b BedrockFoundationModel, value *string, props *BedrockFoundationModelProps)

Experimental.

func NewChatMessage_Override added in v0.1.289

func NewChatMessage_Override(c ChatMessage, role ChatMessageRole, text *string)

Experimental.

func NewConfluenceDataSource_Override added in v0.1.270

func NewConfluenceDataSource_Override(c ConfluenceDataSource, scope constructs.Construct, id *string, props *ConfluenceDataSourceProps)

Experimental.

func NewCustomTransformation_Override added in v0.1.270

func NewCustomTransformation_Override(c CustomTransformation)

Experimental.

func NewDataSourceBase_Override added in v0.1.270

func NewDataSourceBase_Override(d DataSourceBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewDataSourceNew_Override added in v0.1.270

func NewDataSourceNew_Override(d DataSourceNew, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewGuardrailBase_Override added in v0.1.276

func NewGuardrailBase_Override(g GuardrailBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewGuardrail_Override

func NewGuardrail_Override(g Guardrail, scope constructs.Construct, id *string, props *GuardrailProps)

Experimental.

func NewInferenceProfileBase_Override added in v0.1.283

func NewInferenceProfileBase_Override(i InferenceProfileBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewInlineApiSchema_Override

func NewInlineApiSchema_Override(i InlineApiSchema, schema *string)

Experimental.

func NewKendraKnowledgeBaseBase_Override added in v0.1.292

func NewKendraKnowledgeBaseBase_Override(k KendraKnowledgeBaseBase, scope constructs.Construct, id *string)

Experimental.

func NewKendraKnowledgeBase_Override added in v0.1.292

func NewKendraKnowledgeBase_Override(k KendraKnowledgeBase, scope constructs.Construct, id *string, props *KendraKnowledgeBaseProps)

Experimental.

func NewKnowledgeBaseBase_Override added in v0.1.292

func NewKnowledgeBaseBase_Override(k KnowledgeBaseBase, scope constructs.Construct, id *string)

Experimental.

func NewMemory_Override added in v0.1.295

func NewMemory_Override(m Memory)

Experimental.

func NewParentActionGroupSignature_Override added in v0.1.290

func NewParentActionGroupSignature_Override(p ParentActionGroupSignature, value *string)

Constructor should be used as a temporary solution when a new signature is supported but its implementation in CDK hasn't been added yet. Experimental.

func NewParsingStategy_Override added in v0.1.270

func NewParsingStategy_Override(p ParsingStategy)

Experimental.

func NewPromptBase_Override added in v0.1.279

func NewPromptBase_Override(p PromptBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewPromptRouter_Override added in v0.1.289

func NewPromptRouter_Override(p PromptRouter, props *PromptRouterProps, region *string)

Experimental.

func NewPromptVariant_Override added in v0.1.262

func NewPromptVariant_Override(p PromptVariant)

Experimental.

func NewPromptVersion_Override added in v0.1.262

func NewPromptVersion_Override(p PromptVersion, scope constructs.Construct, id *string, props *PromptVersionProps)

Experimental.

func NewPrompt_Override added in v0.1.262

func NewPrompt_Override(p Prompt, scope constructs.Construct, id *string, props *PromptProps)

Experimental.

func NewS3ApiSchema_Override

func NewS3ApiSchema_Override(s S3ApiSchema, location *awss3.Location)

Experimental.

func NewS3DataSource_Override

func NewS3DataSource_Override(s S3DataSource, scope constructs.Construct, id *string, props *S3DataSourceProps)

Experimental.

func NewSalesforceDataSource_Override added in v0.1.270

func NewSalesforceDataSource_Override(s SalesforceDataSource, scope constructs.Construct, id *string, props *SalesforceDataSourceProps)

Experimental.

func NewSharePointDataSource_Override added in v0.1.270

func NewSharePointDataSource_Override(s SharePointDataSource, scope constructs.Construct, id *string, props *SharePointDataSourceProps)

Experimental.

func NewToolChoice_Override added in v0.1.289

func NewToolChoice_Override(t ToolChoice, any interface{}, auto interface{}, tool *string)

Experimental.

func NewTopic_Override

func NewTopic_Override(t Topic, props *CustomTopicProps)

Experimental.

func NewVectorKnowledgeBase_Override added in v0.1.292

func NewVectorKnowledgeBase_Override(v VectorKnowledgeBase, scope constructs.Construct, id *string, props *VectorKnowledgeBaseProps)

Experimental.

func NewWebCrawlerDataSource_Override added in v0.1.270

func NewWebCrawlerDataSource_Override(w WebCrawlerDataSource, scope constructs.Construct, id *string, props *WebCrawlerDataSourceProps)

Experimental.

func PromptBase_IsConstruct added in v0.1.279

func PromptBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func PromptBase_IsOwnedResource added in v0.1.279

func PromptBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func PromptBase_IsResource added in v0.1.279

func PromptBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func PromptVersion_IsConstruct added in v0.1.262

func PromptVersion_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func Prompt_IsConstruct added in v0.1.262

func Prompt_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func S3DataSource_IsConstruct

func S3DataSource_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func S3DataSource_IsOwnedResource added in v0.1.270

func S3DataSource_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func S3DataSource_IsResource added in v0.1.270

func S3DataSource_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func SalesforceDataSource_IsConstruct added in v0.1.270

func SalesforceDataSource_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func SalesforceDataSource_IsOwnedResource added in v0.1.270

func SalesforceDataSource_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func SalesforceDataSource_IsResource added in v0.1.270

func SalesforceDataSource_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func SharePointDataSource_IsConstruct added in v0.1.270

func SharePointDataSource_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func SharePointDataSource_IsOwnedResource added in v0.1.270

func SharePointDataSource_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func SharePointDataSource_IsResource added in v0.1.270

func SharePointDataSource_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func VectorKnowledgeBase_IsConstruct added in v0.1.292

func VectorKnowledgeBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func VectorKnowledgeBase_IsOwnedResource added in v0.1.292

func VectorKnowledgeBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func VectorKnowledgeBase_IsResource added in v0.1.292

func VectorKnowledgeBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func WebCrawlerDataSource_IsConstruct added in v0.1.270

func WebCrawlerDataSource_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func WebCrawlerDataSource_IsOwnedResource added in v0.1.270

func WebCrawlerDataSource_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func WebCrawlerDataSource_IsResource added in v0.1.270

func WebCrawlerDataSource_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

Types

type ActionGroupExecutor

type ActionGroupExecutor interface {
	// Experimental.
	CustomControl() *string
	// Experimental.
	LambdaFunction() awslambda.IFunction
}

Defines how fulfillment of the action group is handled after the necessary information has been elicited from the user.

Valid executors are: - Lambda function - Return Control. See: https://docs.aws.amazon.com/bedrock/latest/userguide/action-handle.html

Experimental.

func ActionGroupExecutor_FromlambdaFunction added in v0.1.290

func ActionGroupExecutor_FromlambdaFunction(lambdaFunction awslambda.IFunction) ActionGroupExecutor

Defines an action group with a Lambda function containing the business logic. See: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html

Experimental.

func ActionGroupExecutor_RETURN_CONTROL added in v0.1.290

func ActionGroupExecutor_RETURN_CONTROL() ActionGroupExecutor

type Agent

type Agent interface {
	AgentBase
	// The action groups associated with the agent.
	// Experimental.
	ActionGroups() *[]AgentActionGroup
	// Experimental.
	SetActionGroups(val *[]AgentActionGroup)
	// The ARN of the agent.
	// Experimental.
	AgentArn() *string
	// The unique identifier for the agent.
	// Experimental.
	AgentId() *string
	// The version of the agent.
	// Experimental.
	AgentVersion() *string
	// Experimental.
	SetAgentVersion(val *string)
	// Whether the agent can generate, run, and troubleshoot code when trying to complete a task.
	// Experimental.
	CodeInterpreterEnabled() *bool
	// The description for the agent.
	// Experimental.
	Description() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// Whether the resource will be deleted even if it's in use.
	// Experimental.
	ForceDelete() *bool
	// The foundation model used for orchestration by the agent.
	// Experimental.
	FoundationModel() IInvokable
	// The guardrail associated with the agent.
	// Experimental.
	Guardrail() IGuardrail
	// Experimental.
	SetGuardrail(val IGuardrail)
	// How long sessions should be kept open for the agent.
	// Experimental.
	IdleSessionTTL() awscdk.Duration
	// The instruction used by the agent.
	//
	// This determines how the agent will perform his task.
	// Experimental.
	Instruction() *string
	// Optional KMS encryption key associated with this agent.
	// Experimental.
	KmsKey() awskms.IKey
	// The KnowledgeBases associated with the agent.
	// Experimental.
	KnowledgeBases() *[]IKnowledgeBase
	// Experimental.
	SetKnowledgeBases(val *[]IKnowledgeBase)
	// When this agent was last updated.
	// Experimental.
	LastUpdated() *string
	// The memory configuration for the agent.
	// Experimental.
	Memory() Memory
	// The name of the agent.
	// Experimental.
	Name() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// Overrides some prompt templates in different parts of an agent sequence configuration.
	// Default: - No overrides are provided.
	//
	// Experimental.
	PromptOverrideConfiguration() PromptOverrideConfiguration
	// The IAM role associated to the agent.
	// Experimental.
	Role() awsiam.IRole
	// Whether the agent will automatically update the DRAFT version of the agent after making changes to the agent.
	// Experimental.
	ShouldPrepareAgent() *bool
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The default test alias for this agent.
	//
	// This corresponds to the test alias
	// (`TSTALIASID`) that points to the working (`DRAFT`) version.
	// Experimental.
	TestAlias() IAgentAlias
	// Whether the agent can prompt additional information from the user when it does not have enough information to respond to an utterance.
	// Experimental.
	UserInputEnabled() *bool
	// Add an action group to the agent.
	// Experimental.
	AddActionGroup(actionGroup AgentActionGroup)
	// Add multiple action groups to the agent.
	// Experimental.
	AddActionGroups(actionGroups ...AgentActionGroup)
	// Add guardrail to the agent.
	// Experimental.
	AddGuardrail(guardrail IGuardrail)
	// Add knowledge base to the agent.
	// Experimental.
	AddKnowledgeBase(knowledgeBase IKnowledgeBase)
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Class to create (or import) an Agent with CDK. Experimental.

func NewAgent

func NewAgent(scope constructs.Construct, id *string, props *AgentProps) Agent

Experimental.

type AgentActionGroup

type AgentActionGroup interface {
	// The api schema for this action group (if defined).
	// Experimental.
	ApiSchema() ApiSchema
	// A description of the action group.
	// Experimental.
	Description() *string
	// Whether this action group is available for the agent to invoke or not.
	// Experimental.
	Enabled() *bool
	// The action group executor for this action group (if defined).
	// Experimental.
	Executor() ActionGroupExecutor
	// Whether to delete the resource even if it's in use.
	// Experimental.
	ForceDelete() *bool
	// The function schema for this action group (if defined).
	// Experimental.
	FunctionSchema() *awsbedrock.CfnAgent_FunctionSchemaProperty
	// The name of the action group.
	// Experimental.
	Name() *string
	// The AWS Defined signature (if defined).
	// Experimental.
	ParentActionGroupSignature() ParentActionGroupSignature
}

**************************************************************************** DEF - Action Group Class ***************************************************************************. Experimental.

func AgentActionGroup_CodeInterpreter added in v0.1.290

func AgentActionGroup_CodeInterpreter(enabled *bool) AgentActionGroup

Defines an action group that allows your agent to request the user for additional information when trying to complete a task. Experimental.

func AgentActionGroup_UserInput added in v0.1.290

func AgentActionGroup_UserInput(enabled *bool) AgentActionGroup

Defines an action group that allows your agent to request the user for additional information when trying to complete a task. Experimental.

func NewAgentActionGroup

func NewAgentActionGroup(props *AgentActionGroupProps) AgentActionGroup

Experimental.

type AgentActionGroupProps

type AgentActionGroupProps struct {
	// The name of the action group.
	// Experimental.
	Name *string `field:"required" json:"name" yaml:"name"`
	// The API Schema.
	// Default: - No API Schema.
	//
	// Experimental.
	ApiSchema ApiSchema `field:"optional" json:"apiSchema" yaml:"apiSchema"`
	// A description of the action group.
	// Default: - No description.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.
	// Default: true.
	//
	// Experimental.
	Enabled *bool `field:"optional" json:"enabled" yaml:"enabled"`
	// The action group executor.
	// Default: - No executor.
	//
	// Experimental.
	Executor ActionGroupExecutor `field:"optional" json:"executor" yaml:"executor"`
	// Specifies whether to delete the resource even if it's in use.
	// Default: false.
	//
	// Experimental.
	ForceDelete *bool `field:"optional" json:"forceDelete" yaml:"forceDelete"`
	// Defines functions that each define parameters that the agent needs to invoke from the user.
	//
	// NO L2 yet as this doesn't make much sense IMHO.
	// Experimental.
	FunctionSchema *awsbedrock.CfnAgent_FunctionSchemaProperty `field:"optional" json:"functionSchema" yaml:"functionSchema"`
	// The AWS Defined signature for enabling certain capabilities in your agent.
	//
	// When this property is specified, you must leave the description, apiSchema,
	// and actionGroupExecutor fields blank for this action group.
	// Experimental.
	ParentActionGroupSignature ParentActionGroupSignature `field:"optional" json:"parentActionGroupSignature" yaml:"parentActionGroupSignature"`
}

**************************************************************************** PROPS - Action Group Class ***************************************************************************. Experimental.

type AgentAlias

type AgentAlias interface {
	AgentAliasBase
	// The underlying agent for this alias.
	// Experimental.
	Agent() IAgent
	// The ARN of the agent alias.
	// Experimental.
	AliasArn() *string
	// The unique identifier of the agent alias.
	// Experimental.
	AliasId() *string
	// Experimental.
	AliasName() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the given principal identity permissions to perform actions on this agent alias.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to invoke the agent alias.
	// Experimental.
	GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
	// Define an EventBridge rule that triggers when something happens to this agent alias.
	//
	// Requires that there exists at least one CloudTrail Trail in your account
	// that captures the event. This method will not create the Trail.
	// Experimental.
	OnCloudTrailEvent(id *string, options *awsevents.OnEventOptions) awsevents.Rule
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Class to create an Agent Alias with CDK. Experimental.

func NewAgentAlias

func NewAgentAlias(scope constructs.Construct, id *string, props *AgentAliasProps) AgentAlias

Experimental.

type AgentAliasAttributes added in v0.1.290

type AgentAliasAttributes struct {
	// The underlying agent for this alias.
	// Experimental.
	Agent IAgent `field:"required" json:"agent" yaml:"agent"`
	// The agent version for this alias.
	// Experimental.
	AgentVersion *string `field:"required" json:"agentVersion" yaml:"agentVersion"`
	// The Id of the agent alias.
	// Experimental.
	AliasId *string `field:"required" json:"aliasId" yaml:"aliasId"`
	// The name of the agent alias.
	// Experimental.
	AliasName *string `field:"optional" json:"aliasName" yaml:"aliasName"`
}

Attributes needed to create an import. Experimental.

type AgentAliasBase added in v0.1.290

type AgentAliasBase interface {
	awscdk.Resource
	IAgentAlias
	// The underlying agent for this alias.
	// Experimental.
	Agent() IAgent
	// The ARN of the agent alias.
	// Experimental.
	AliasArn() *string
	// The unique identifier of the agent alias.
	// Experimental.
	AliasId() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the given principal identity permissions to perform actions on this agent alias.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to invoke the agent alias.
	// Experimental.
	GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
	// Define an EventBridge rule that triggers when something happens to this agent alias.
	//
	// Requires that there exists at least one CloudTrail Trail in your account
	// that captures the event. This method will not create the Trail.
	// Experimental.
	OnCloudTrailEvent(id *string, options *awsevents.OnEventOptions) awsevents.Rule
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Abstract base class for an Agent.

Contains methods and attributes valid for Agents either created with CDK or imported. Experimental.

type AgentAliasProps

type AgentAliasProps struct {
	// The agent associated to this alias.
	// Experimental.
	Agent IAgent `field:"required" json:"agent" yaml:"agent"`
	// The version of the agent to associate with the agent alias.
	// Default: - Creates a new version of the agent.
	//
	// Experimental.
	AgentVersion *string `field:"optional" json:"agentVersion" yaml:"agentVersion"`
	// The name for the agent alias.
	// Default: - "latest-{hash}".
	//
	// Experimental.
	AliasName *string `field:"optional" json:"aliasName" yaml:"aliasName"`
	// Description for the agent alias.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
}

Properties for creating a CDK-Managed Agent Alias. Experimental.

type AgentAttributes added in v0.1.290

type AgentAttributes struct {
	// The ARN of the agent.
	//
	// Example:
	//   "arn:aws:bedrock:us-east-1:123456789012:agent/OKDSJOGKMO"@attributeundefined
	//
	// Experimental.
	AgentArn *string `field:"required" json:"agentArn" yaml:"agentArn"`
	// The ARN of the IAM role associated to the agent.
	//
	// Example:
	//   "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"@attributeundefined
	//
	// Experimental.
	RoleArn *string `field:"required" json:"roleArn" yaml:"roleArn"`
	// The agent version.
	//
	// If no explicit versions have been created,
	// leave this  empty to use the DRAFT version. Otherwise, use the
	// version number (e.g. 1).
	// Experimental.
	AgentVersion *string `field:"optional" json:"agentVersion" yaml:"agentVersion"`
	// Optional KMS encryption key associated with this agent.
	// Experimental.
	KmsKeyArn *string `field:"optional" json:"kmsKeyArn" yaml:"kmsKeyArn"`
	// When this agent was last updated.
	// Experimental.
	LastUpdated *string `field:"optional" json:"lastUpdated" yaml:"lastUpdated"`
}

Attributes for specifying an imported Bedrock Agent. Experimental.

type AgentBase added in v0.1.290

type AgentBase interface {
	awscdk.Resource
	IAgent
	// The ARN of the agent.
	// Experimental.
	AgentArn() *string
	// The ID of the Agent.
	// Experimental.
	AgentId() *string
	// Experimental.
	AgentVersion() *string
	// Experimental.
	SetAgentVersion(val *string)
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// Optional KMS encryption key associated with this agent.
	// Experimental.
	KmsKey() awskms.IKey
	// When this agent was last updated.
	// Experimental.
	LastUpdated() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The IAM role associated to the agent.
	// Experimental.
	Role() awsiam.IRole
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Abstract base class for an Agent.

Contains methods and attributes valid for Agents either created with CDK or imported. Experimental.

type AgentPromptVariantProps added in v0.1.289

type AgentPromptVariantProps struct {
	// The model which is used to run the prompt.
	//
	// The model could be a foundation
	// model, a custom model, or a provisioned model.
	// Experimental.
	Model IInvokable `field:"required" json:"model" yaml:"model"`
	// The name of the prompt variant.
	// Experimental.
	VariantName *string `field:"required" json:"variantName" yaml:"variantName"`
	// The variables in the prompt template that can be filled in at runtime.
	// Experimental.
	PromptVariables *[]*string `field:"optional" json:"promptVariables" yaml:"promptVariables"`
	// An alias pointing to the agent version to be used.
	// Experimental.
	AgentAlias IAgentAlias `field:"required" json:"agentAlias" yaml:"agentAlias"`
	// The text prompt.
	//
	// Variables are used by enclosing its name with double curly braces
	// as in `{{variable_name}}`.
	// Experimental.
	PromptText *string `field:"required" json:"promptText" yaml:"promptText"`
}

Experimental.

type AgentProps

type AgentProps struct {
	// The foundation model used for orchestration by the agent.
	// Experimental.
	FoundationModel IInvokable `field:"required" json:"foundationModel" yaml:"foundationModel"`
	// The instruction used by the agent.
	//
	// This determines how the agent will perform his task.
	// This instruction must have a minimum of 40 characters.
	// Experimental.
	Instruction *string `field:"required" json:"instruction" yaml:"instruction"`
	// The Action Groups associated with the agent.
	// Experimental.
	ActionGroups *[]AgentActionGroup `field:"optional" json:"actionGroups" yaml:"actionGroups"`
	// Select whether the agent can generate, run, and troubleshoot code when trying to complete a task.
	// Default: - false.
	//
	// Experimental.
	CodeInterpreterEnabled *bool `field:"optional" json:"codeInterpreterEnabled" yaml:"codeInterpreterEnabled"`
	// A description of the agent.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The existing IAM Role for the agent to use.
	//
	// Ensure the role has a trust policy that allows the Bedrock service to assume the role.
	// Default: - A new role is created for you.
	//
	// Experimental.
	ExistingRole awsiam.IRole `field:"optional" json:"existingRole" yaml:"existingRole"`
	// Whether to delete the resource even if it's in use.
	// Default: - true.
	//
	// Experimental.
	ForceDelete *bool `field:"optional" json:"forceDelete" yaml:"forceDelete"`
	// The guardrail that will be associated with the agent.
	// Experimental.
	Guardrail IGuardrail `field:"optional" json:"guardrail" yaml:"guardrail"`
	// How long sessions should be kept open for the agent.
	//
	// If no conversation occurs
	// during this time, the session expires and Amazon Bedrock deletes any data
	// provided before the timeout.
	// Default: - 1 hour.
	//
	// Experimental.
	IdleSessionTTL awscdk.Duration `field:"optional" json:"idleSessionTTL" yaml:"idleSessionTTL"`
	// The KMS key of the agent if custom encryption is configured.
	// Default: - An AWS managed key is used.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The KnowledgeBases associated with the agent.
	// Experimental.
	KnowledgeBases *[]IKnowledgeBase `field:"optional" json:"knowledgeBases" yaml:"knowledgeBases"`
	// The type and configuration of the memory to maintain context across multiple sessions and recall past interactions.
	//
	// This can be useful for maintaining continuity in multi-turn conversations and recalling user preferences
	// or past interactions.
	// See: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-memory.html
	//
	// Default: - No memory will be used. Agents will retain context from the current session only.
	//
	// Experimental.
	Memory Memory `field:"optional" json:"memory" yaml:"memory"`
	// The name of the agent.
	// Default: - A name is generated by CDK.
	//
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// Overrides some prompt templates in different parts of an agent sequence configuration.
	// Default: - No overrides are provided.
	//
	// Experimental.
	PromptOverrideConfiguration PromptOverrideConfiguration `field:"optional" json:"promptOverrideConfiguration" yaml:"promptOverrideConfiguration"`
	// Specifies whether to automatically update the `DRAFT` version of the agent after making changes to the agent.
	//
	// The `DRAFT` version can be continually iterated
	// upon during internal development.
	// Default: - false.
	//
	// Experimental.
	ShouldPrepareAgent *bool `field:"optional" json:"shouldPrepareAgent" yaml:"shouldPrepareAgent"`
	// Select whether the agent can prompt additional information from the user when it does not have enough information to respond to an utterance.
	// Default: - false.
	//
	// Experimental.
	UserInputEnabled *bool `field:"optional" json:"userInputEnabled" yaml:"userInputEnabled"`
}

Properties for creating a CDK managed Bedrock Agent. Experimental.

type AgentStepType added in v0.1.290

type AgentStepType string

The step in the agent sequence that this prompt configuration applies to. Experimental.

const (
	// Experimental.
	AgentStepType_PRE_PROCESSING AgentStepType = "PRE_PROCESSING"
	// Experimental.
	AgentStepType_ORCHESTRATION AgentStepType = "ORCHESTRATION"
	// Experimental.
	AgentStepType_POST_PROCESSING AgentStepType = "POST_PROCESSING"
	// Experimental.
	AgentStepType_ROUTING_CLASSIFIER AgentStepType = "ROUTING_CLASSIFIER"
	// Experimental.
	AgentStepType_MEMORY_SUMMARIZATION AgentStepType = "MEMORY_SUMMARIZATION"
	// Experimental.
	AgentStepType_KNOWLEDGE_BASE_RESPONSE_GENERATION AgentStepType = "KNOWLEDGE_BASE_RESPONSE_GENERATION"
)

type ApiSchema

type ApiSchema interface {
	// Experimental.
	InlineSchema() *string
	// Experimental.
	S3File() *awss3.Location
}

Represents the concept of an API Schema for a Bedrock Agent Action Group. Experimental.

type ApplicationInferenceProfile added in v0.1.283

type ApplicationInferenceProfile interface {
	InferenceProfileBase
	IInvokable
	// Time Stamp for ApplicationInferenceProfile creation.
	// Experimental.
	CreatedAt() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The ARN of the application application inference profile.
	// Experimental.
	InferenceProfileArn() *string
	// The unique identifier of the application inference profile.
	// Experimental.
	InferenceProfileId() *string
	// The underlying model/cross-region model used by the application inference profile.
	// Experimental.
	InferenceProfileModel() IInvokable
	// The name of the application inference profile.
	// Experimental.
	InferenceProfileName() *string
	// This equals to the inferenceProfileArn property, useful just to implement IInvokable interface.
	// Experimental.
	InvokableArn() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The status of the application inference profile.
	//
	// ACTIVE means that the inference profile is ready to be used.
	// Experimental.
	Status() *string
	// The type of the inference profile.
	//
	// The following types are possible:
	// SYSTEM_DEFINED – The inference profile is defined by Amazon Bedrock.
	// You can route inference requests across regions with these inference profiles.
	// APPLICATION – The inference profile was created by a user.
	// This type of inference profile can track metrics and costs when invoking the model in it.
	// The inference profile may route requests to one or multiple regions.
	// Experimental.
	Type() InferenceProfileType
	// Time Stamp for ApplicationInferenceProfile update.
	// Experimental.
	UpdatedAt() *string
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Gives the appropriate policies to invoke and use the application inference profile.
	// Experimental.
	GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
	// Grants appropriate permissions to use the application inference profile (AIP).
	//
	// Does not grant permissions to use the model/cross-region profile in the AIP.
	// Experimental.
	GrantProfileUsage(grantee awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Class to create a ApplicationInferenceProfile with CDK.

These are inference profiles created by users (user defined). This helps to track costs and model usage. See: https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-create.html

Experimental.

func NewApplicationInferenceProfile added in v0.1.283

func NewApplicationInferenceProfile(scope constructs.Construct, id *string, props *ApplicationInferenceProfileProps) ApplicationInferenceProfile

Experimental.

type ApplicationInferenceProfileAttributes added in v0.1.283

type ApplicationInferenceProfileAttributes struct {
	// The ARN of the application inference profile.
	// Experimental.
	InferenceProfileArn *string `field:"required" json:"inferenceProfileArn" yaml:"inferenceProfileArn"`
	// The ID or Amazon Resource Name (ARN) of the inference profile.
	// Experimental.
	InferenceProfileIdentifier *string `field:"required" json:"inferenceProfileIdentifier" yaml:"inferenceProfileIdentifier"`
}

**************************************************************************** ATTRS FOR IMPORTED CONSTRUCT ***************************************************************************. Experimental.

type ApplicationInferenceProfileProps added in v0.1.283

type ApplicationInferenceProfileProps struct {
	// The name of the inference profile.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-applicationinferenceprofile.html#cfn-bedrock-applicationinferenceprofile-inferenceprofilename
	//
	// Experimental.
	InferenceProfileName *string `field:"required" json:"inferenceProfileName" yaml:"inferenceProfileName"`
	// To create an application inference profile for one Region, specify a foundation model.
	//
	// Usage and costs for requests made to that Region with that model will be tracked.
	//
	// To create an application inference profile for multiple Regions,
	// specify a cross region (system-defined) inference profile.
	// The inference profile will route requests to the Regions defined in
	// the cross region (system-defined) inference profile that you choose.
	// Usage and costs for requests made to the Regions in the inference profile will be tracked.
	// Experimental.
	ModelSource IInvokable `field:"required" json:"modelSource" yaml:"modelSource"`
	// Description of the inference profile.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-applicationinferenceprofile.html#cfn-bedrock-applicationinferenceprofile-description
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// A list of tags associated with the inference profile.
	// Experimental.
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
}

Properties for creating a ApplicationInferenceProfile. Experimental.

type BedrockFoundationModel

type BedrockFoundationModel interface {
	IInvokable
	// The ARN of the Bedrock invokable abstraction.
	// Experimental.
	InvokableArn() *string
	// Experimental.
	ModelArn() *string
	// **************************************************************************                           Constructor *************************************************************************.
	// Experimental.
	ModelId() *string
	// Experimental.
	SupportedVectorType() *[]VectorType
	// Experimental.
	SupportsAgents() *bool
	// Experimental.
	SupportsCrossRegion() *bool
	// Experimental.
	SupportsKnowledgeBase() *bool
	// Experimental.
	VectorDimensions() *float64
	// Returns the ARN of the foundation model in the following format: `arn:${Partition}:bedrock:${Region}::foundation-model/${ResourceId}`.
	// Experimental.
	AsArn(construct constructs.IConstruct) *string
	// Experimental.
	AsIModel(construct constructs.IConstruct) awsbedrock.IModel
	// Gives the appropriate policies to invoke and use the Foundation Model in the stack region.
	// Experimental.
	GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
	// Gives the appropriate policies to invoke and use the Foundation Model in all regions.
	// Experimental.
	GrantInvokeAllRegions(grantee awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of an object.
	// Experimental.
	ToString() *string
}

Bedrock models.

If you need to use a model name that doesn't exist as a static member, you can instantiate a `BedrockFoundationModel` object, e.g: `new BedrockFoundationModel('my-model')`. Experimental.

func BedrockFoundationModel_AI21_JAMBA_1_5_LARGE_V1 added in v0.1.296

func BedrockFoundationModel_AI21_JAMBA_1_5_LARGE_V1() BedrockFoundationModel

func BedrockFoundationModel_AI21_JAMBA_1_5_MINI_V1 added in v0.1.296

func BedrockFoundationModel_AI21_JAMBA_1_5_MINI_V1() BedrockFoundationModel

func BedrockFoundationModel_AI21_JAMBA_INSTRUCT_V1 added in v0.1.296

func BedrockFoundationModel_AI21_JAMBA_INSTRUCT_V1() BedrockFoundationModel

func BedrockFoundationModel_AMAZON_NOVA_LITE_V1 added in v0.1.287

func BedrockFoundationModel_AMAZON_NOVA_LITE_V1() BedrockFoundationModel

func BedrockFoundationModel_AMAZON_NOVA_MICRO_V1 added in v0.1.287

func BedrockFoundationModel_AMAZON_NOVA_MICRO_V1() BedrockFoundationModel

func BedrockFoundationModel_AMAZON_NOVA_PRO_V1 added in v0.1.287

func BedrockFoundationModel_AMAZON_NOVA_PRO_V1() BedrockFoundationModel

func BedrockFoundationModel_AMAZON_TITAN_PREMIER_V1_0

func BedrockFoundationModel_AMAZON_TITAN_PREMIER_V1_0() BedrockFoundationModel

func BedrockFoundationModel_AMAZON_TITAN_TEXT_EXPRESS_V1

func BedrockFoundationModel_AMAZON_TITAN_TEXT_EXPRESS_V1() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_3_5_HAIKU_V1_0 added in v0.1.279

func BedrockFoundationModel_ANTHROPIC_CLAUDE_3_5_HAIKU_V1_0() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_3_5_SONNET_V1_0 added in v0.1.264

func BedrockFoundationModel_ANTHROPIC_CLAUDE_3_5_SONNET_V1_0() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_3_5_SONNET_V2_0 added in v0.1.278

func BedrockFoundationModel_ANTHROPIC_CLAUDE_3_5_SONNET_V2_0() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_3_7_SONNET_V1_0 added in v0.1.294

func BedrockFoundationModel_ANTHROPIC_CLAUDE_3_7_SONNET_V1_0() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_HAIKU_V1_0

func BedrockFoundationModel_ANTHROPIC_CLAUDE_HAIKU_V1_0() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_INSTANT_V1_2

func BedrockFoundationModel_ANTHROPIC_CLAUDE_INSTANT_V1_2() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_OPUS_V1_0 added in v0.1.264

func BedrockFoundationModel_ANTHROPIC_CLAUDE_OPUS_V1_0() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_SONNET_V1_0

func BedrockFoundationModel_ANTHROPIC_CLAUDE_SONNET_V1_0() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_V2

func BedrockFoundationModel_ANTHROPIC_CLAUDE_V2() BedrockFoundationModel

func BedrockFoundationModel_ANTHROPIC_CLAUDE_V2_1

func BedrockFoundationModel_ANTHROPIC_CLAUDE_V2_1() BedrockFoundationModel

func BedrockFoundationModel_COHERE_EMBED_ENGLISH_V3

func BedrockFoundationModel_COHERE_EMBED_ENGLISH_V3() BedrockFoundationModel

func BedrockFoundationModel_COHERE_EMBED_MULTILINGUAL_V3

func BedrockFoundationModel_COHERE_EMBED_MULTILINGUAL_V3() BedrockFoundationModel

func BedrockFoundationModel_FromCdkFoundationModel added in v0.1.283

func BedrockFoundationModel_FromCdkFoundationModel(modelId awsbedrock.FoundationModel, props *BedrockFoundationModelProps) BedrockFoundationModel

Experimental.

func BedrockFoundationModel_FromCdkFoundationModelId added in v0.1.283

func BedrockFoundationModel_FromCdkFoundationModelId(modelId awsbedrock.FoundationModelIdentifier, props *BedrockFoundationModelProps) BedrockFoundationModel

Experimental.

func BedrockFoundationModel_META_LLAMA_3_1_70B_INSTRUCT_V1 added in v0.1.289

func BedrockFoundationModel_META_LLAMA_3_1_70B_INSTRUCT_V1() BedrockFoundationModel

func BedrockFoundationModel_META_LLAMA_3_1_8B_INSTRUCT_V1 added in v0.1.289

func BedrockFoundationModel_META_LLAMA_3_1_8B_INSTRUCT_V1() BedrockFoundationModel

func BedrockFoundationModel_META_LLAMA_3_2_11B_INSTRUCT_V1 added in v0.1.283

func BedrockFoundationModel_META_LLAMA_3_2_11B_INSTRUCT_V1() BedrockFoundationModel

func BedrockFoundationModel_META_LLAMA_3_2_1B_INSTRUCT_V1 added in v0.1.283

func BedrockFoundationModel_META_LLAMA_3_2_1B_INSTRUCT_V1() BedrockFoundationModel

func BedrockFoundationModel_META_LLAMA_3_2_3B_INSTRUCT_V1 added in v0.1.283

func BedrockFoundationModel_META_LLAMA_3_2_3B_INSTRUCT_V1() BedrockFoundationModel

func BedrockFoundationModel_META_LLAMA_3_3_70B_INSTRUCT_V1 added in v0.1.296

func BedrockFoundationModel_META_LLAMA_3_3_70B_INSTRUCT_V1() BedrockFoundationModel

func BedrockFoundationModel_TITAN_EMBED_TEXT_V1

func BedrockFoundationModel_TITAN_EMBED_TEXT_V1() BedrockFoundationModel

func BedrockFoundationModel_TITAN_EMBED_TEXT_V2_1024

func BedrockFoundationModel_TITAN_EMBED_TEXT_V2_1024() BedrockFoundationModel

func BedrockFoundationModel_TITAN_EMBED_TEXT_V2_256 added in v0.1.263

func BedrockFoundationModel_TITAN_EMBED_TEXT_V2_256() BedrockFoundationModel

func BedrockFoundationModel_TITAN_EMBED_TEXT_V2_512 added in v0.1.263

func BedrockFoundationModel_TITAN_EMBED_TEXT_V2_512() BedrockFoundationModel

func NewBedrockFoundationModel

func NewBedrockFoundationModel(value *string, props *BedrockFoundationModelProps) BedrockFoundationModel

Experimental.

type BedrockFoundationModelProps

type BedrockFoundationModelProps struct {
	// https://docs.aws.amazon.com/bedrock/latest/userguide/model-lifecycle.html A version is marked Legacy when there is a more recent version which provides superior performance. Amazon Bedrock sets an EOL date for Legacy versions.
	// Default: - false.
	//
	// Experimental.
	Legacy *bool `field:"optional" json:"legacy" yaml:"legacy"`
	// Currently, some of the offered models are optimized with prompts/parsers fine-tuned for integrating with the agents architecture.
	// Default: - false.
	//
	// Experimental.
	OptimizedForAgents *bool `field:"optional" json:"optimizedForAgents" yaml:"optimizedForAgents"`
	// Embeddings models have different supported vector types.
	// Experimental.
	SupportedVectorType *[]VectorType `field:"optional" json:"supportedVectorType" yaml:"supportedVectorType"`
	// Bedrock Agents can use this model.
	// Default: - false.
	//
	// Experimental.
	SupportsAgents *bool `field:"optional" json:"supportsAgents" yaml:"supportsAgents"`
	// Can be used with a Cross-Region Inference Profile.
	// Default: - false.
	//
	// Experimental.
	SupportsCrossRegion *bool `field:"optional" json:"supportsCrossRegion" yaml:"supportsCrossRegion"`
	// Bedrock Knowledge Base can use this model.
	// Default: - false.
	//
	// Experimental.
	SupportsKnowledgeBase *bool `field:"optional" json:"supportsKnowledgeBase" yaml:"supportsKnowledgeBase"`
	// Embedding models have different vector dimensions.
	//
	// Only applicable for embedding models.
	// Experimental.
	VectorDimensions *float64 `field:"optional" json:"vectorDimensions" yaml:"vectorDimensions"`
}

Experimental.

type ChatMessage added in v0.1.289

type ChatMessage interface {
	// Experimental.
	Role() ChatMessageRole
	// Experimental.
	Text() *string
}

Experimental.

func ChatMessage_Assistant added in v0.1.289

func ChatMessage_Assistant(text *string) ChatMessage

Experimental.

func ChatMessage_User added in v0.1.289

func ChatMessage_User(text *string) ChatMessage

Experimental.

func NewChatMessage added in v0.1.289

func NewChatMessage(role ChatMessageRole, text *string) ChatMessage

Experimental.

type ChatMessageRole added in v0.1.289

type ChatMessageRole string

Experimental.

const (
	// This role represents the human user in the conversation.
	//
	// Inputs from the
	// user guide  the conversation and prompt responses from the assistant.
	// Experimental.
	ChatMessageRole_USER ChatMessageRole = "USER"
	// This is the role of the model itself, responding to user inputs based on the context set by the system.
	// Experimental.
	ChatMessageRole_ASSISTANT ChatMessageRole = "ASSISTANT"
)

type ChatPromptVariantProps added in v0.1.289

type ChatPromptVariantProps struct {
	// The model which is used to run the prompt.
	//
	// The model could be a foundation
	// model, a custom model, or a provisioned model.
	// Experimental.
	Model IInvokable `field:"required" json:"model" yaml:"model"`
	// The name of the prompt variant.
	// Experimental.
	VariantName *string `field:"required" json:"variantName" yaml:"variantName"`
	// The variables in the prompt template that can be filled in at runtime.
	// Experimental.
	PromptVariables *[]*string `field:"optional" json:"promptVariables" yaml:"promptVariables"`
	// Inference configuration for the Chat Prompt.
	//
	// Must include at least one User Message.
	// The messages should alternate between User and Assistant.
	// Experimental.
	Messages *[]ChatMessage `field:"required" json:"messages" yaml:"messages"`
	// Inference configuration for the Text Prompt.
	// Experimental.
	InferenceConfiguration *awsbedrock.CfnPrompt_PromptModelInferenceConfigurationProperty `field:"optional" json:"inferenceConfiguration" yaml:"inferenceConfiguration"`
	// Context or instructions for the model to consider before generating a response.
	// Experimental.
	System *string `field:"optional" json:"system" yaml:"system"`
	// The configuration with available tools to the model and how it must use them.
	// Experimental.
	ToolConfiguration *ToolConfiguration `field:"optional" json:"toolConfiguration" yaml:"toolConfiguration"`
}

Experimental.

type ChunkingStrategy

type ChunkingStrategy interface {
	// The CloudFormation property representation of this configuration.
	// Experimental.
	Configuration() *awsbedrock.CfnDataSource_ChunkingConfigurationProperty
	// Experimental.
	SetConfiguration(val *awsbedrock.CfnDataSource_ChunkingConfigurationProperty)
}

Experimental.

func ChunkingStrategy_DEFAULT

func ChunkingStrategy_DEFAULT() ChunkingStrategy

func ChunkingStrategy_FIXED_SIZE

func ChunkingStrategy_FIXED_SIZE() ChunkingStrategy

func ChunkingStrategy_FixedSize added in v0.1.270

Method for customizing a fixed sized chunking strategy. Experimental.

func ChunkingStrategy_HIERARCHICAL_COHERE added in v0.1.270

func ChunkingStrategy_HIERARCHICAL_COHERE() ChunkingStrategy

func ChunkingStrategy_HIERARCHICAL_TITAN added in v0.1.270

func ChunkingStrategy_HIERARCHICAL_TITAN() ChunkingStrategy

func ChunkingStrategy_Hierarchical added in v0.1.270

func ChunkingStrategy_Hierarchical(props *HierarchicalChunkingProps) ChunkingStrategy

Method for customizing a hierarchical chunking strategy.

For custom chunking, the maximum token chunk size depends on the model. - Amazon Titan Text Embeddings: 8192 - Cohere Embed models: 512. Experimental.

func ChunkingStrategy_NONE

func ChunkingStrategy_NONE() ChunkingStrategy

func ChunkingStrategy_SEMANTIC added in v0.1.270

func ChunkingStrategy_SEMANTIC() ChunkingStrategy

func ChunkingStrategy_Semantic added in v0.1.270

Method for customizing a semantic chunking strategy.

For custom chunking, the maximum token chunk size depends on the model. - Amazon Titan Text Embeddings: 8192 - Cohere Embed models: 512. Experimental.

type CommonKnowledgeBaseAttributes added in v0.1.292

type CommonKnowledgeBaseAttributes struct {
	// The Service Execution Role associated with the knowledge base.
	//
	// Example:
	//   "arn:aws:iam::123456789012:role/AmazonBedrockExecutionRoleForKnowledgeBaseawscdkbdgeBaseKB12345678"
	//
	// Experimental.
	ExecutionRoleArn *string `field:"required" json:"executionRoleArn" yaml:"executionRoleArn"`
	// The ID of the knowledge base.
	//
	// Example:
	//   "KB12345678"
	//
	// Experimental.
	KnowledgeBaseId *string `field:"required" json:"knowledgeBaseId" yaml:"knowledgeBaseId"`
	// The description of the knowledge base.
	// Default: - No description provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Instructions for agents based on the design and type of information of the Knowledge Base.
	//
	// This will impact how Agents interact with the Knowledge Base.
	// Default: - No description provided.
	//
	// Experimental.
	Instruction *string `field:"optional" json:"instruction" yaml:"instruction"`
	// Specifies whether to use the knowledge base or not when sending an InvokeAgent request.
	// Default: - ENABLED.
	//
	// Experimental.
	KnowledgeBaseState *string `field:"optional" json:"knowledgeBaseState" yaml:"knowledgeBaseState"`
}

Common properties for importing a knowledge base (of any type) created outside of this stack. Experimental.

type CommonKnowledgeBaseProps added in v0.1.292

type CommonKnowledgeBaseProps struct {
	// The description of the knowledge base.
	// Default: - No description provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Existing IAM role with policy statements granting appropriate permissions to invoke the specific embeddings models.
	//
	// 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.
	// Experimental.
	ExistingRole awsiam.IRole `field:"optional" json:"existingRole" yaml:"existingRole"`
	// 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.
	//
	// Experimental.
	Instruction *string `field:"optional" json:"instruction" yaml:"instruction"`
	// The name of the knowledge base.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
}

Common properties for creating any type of new Knowledge Base. Experimental.

type CommonPromptVariantProps added in v0.1.262

type CommonPromptVariantProps struct {
	// The model which is used to run the prompt.
	//
	// The model could be a foundation
	// model, a custom model, or a provisioned model.
	// Experimental.
	Model IInvokable `field:"required" json:"model" yaml:"model"`
	// The name of the prompt variant.
	// Experimental.
	VariantName *string `field:"required" json:"variantName" yaml:"variantName"`
	// The variables in the prompt template that can be filled in at runtime.
	// Experimental.
	PromptVariables *[]*string `field:"optional" json:"promptVariables" yaml:"promptVariables"`
}

Experimental.

type ConfluenceCrawlingFilters added in v0.1.270

type ConfluenceCrawlingFilters struct {
	// The type of Confluence object to apply the filters to.
	// Experimental.
	ObjectType ConfluenceObjectType `field:"required" json:"objectType" yaml:"objectType"`
	// Regular expression patterns to exclude content.
	//
	// Content matching these patterns will not be crawled, even if it matches an include pattern.
	// Experimental.
	ExcludePatterns *[]*string `field:"optional" json:"excludePatterns" yaml:"excludePatterns"`
	// Regular expression patterns to include content.
	//
	// If specified, only content matching these patterns will be crawled.
	// Experimental.
	IncludePatterns *[]*string `field:"optional" json:"includePatterns" yaml:"includePatterns"`
}

Defines filters for crawling Confluence content.

These filters allow you to include or exclude specific content based on object types and patterns.

- For Spaces: Use the unique space key - For Pages: Use the main page title - For Blogs: Use the main blog title - For Comments: Use "Re: Page/Blog Title" - For Attachments: Use the filename with extension.

Example:

{
  objectType: ConfluenceObjectType.ATTACHMENT,
  excludePatterns: [".*private.*\\.pdf"]
}

Experimental.

type ConfluenceDataSource added in v0.1.270

type ConfluenceDataSource interface {
	DataSourceNew
	// The AWS Secrets Manager secret that stores your authentication credentials.
	// Experimental.
	AuthSecret() awssecretsmanager.ISecret
	// The Confluence host URL or instance URL.
	// Experimental.
	ConfluenceUrl() *string
	// The unique identifier of the data source.
	//
	// Example:
	//   'JHUEVXUZMU'
	//
	// Experimental.
	DataSourceId() *string
	// The name of the data source.
	// Experimental.
	DataSourceName() *string
	// The type of data source.
	// Experimental.
	DataSourceType() DataSourceType
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The KMS key to use to encrypt the data source.
	// Experimental.
	KmsKey() awskms.IKey
	// The knowledge base associated with the data source.
	// Experimental.
	KnowledgeBase() IKnowledgeBase
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Formats the data source configuration properties for CloudFormation.
	// Experimental.
	FormatAsCfnProps(props *DataSourceAssociationProps, dataSourceConfiguration *awsbedrock.CfnDataSource_DataSourceConfigurationProperty) *awsbedrock.CfnDataSourceProps
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds appropriate permissions to the KB execution role needed by the data source.
	// Experimental.
	HandleCommonPermissions(props *DataSourceAssociationProps)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Sets up a Confluence Data Source to be added to a knowledge base. See: https://docs.aws.amazon.com/bedrock/latest/userguide/confluence-data-source-connector.html

Experimental.

func NewConfluenceDataSource added in v0.1.270

func NewConfluenceDataSource(scope constructs.Construct, id *string, props *ConfluenceDataSourceProps) ConfluenceDataSource

Experimental.

type ConfluenceDataSourceAssociationProps added in v0.1.270

type ConfluenceDataSourceAssociationProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The AWS Secrets Manager secret that stores your authentication credentials for your Confluence instance URL.
	//
	// Secret must start with "AmazonBedrock-".
	// Experimental.
	AuthSecret awssecretsmanager.ISecret `field:"required" json:"authSecret" yaml:"authSecret"`
	// The Confluence host URL or instance URL.
	//
	// Example:
	//   https://example.atlassian.net
	//
	// Experimental.
	ConfluenceUrl *string `field:"required" json:"confluenceUrl" yaml:"confluenceUrl"`
	// The supported authentication method to connect to the data source.
	// Default: ConfluenceDataSourceAuthType.OAUTH2_CLIENT_CREDENTIALS
	//
	// Experimental.
	AuthType ConfluenceDataSourceAuthType `field:"optional" json:"authType" yaml:"authType"`
	// The filters (regular expression patterns) for the crawling.
	//
	// If there's a conflict, the exclude pattern takes precedence.
	// Default: None - all your content is crawled.
	//
	// Experimental.
	Filters *[]*ConfluenceCrawlingFilters `field:"optional" json:"filters" yaml:"filters"`
}

Interface to add a new data source to an existing KB. Experimental.

type ConfluenceDataSourceAuthType added in v0.1.270

type ConfluenceDataSourceAuthType string

The different authentication types available to connect to your Confluence instance. See: https://docs.aws.amazon.com/bedrock/latest/userguide/confluence-data-source-connector.html#configuration-confluence-connector

Experimental.

const (
	// Your secret authentication credentials in AWS Secrets Manager should include: - `confluenceAppKey` - `confluenceAppSecret` - `confluenceAccessToken` - `confluenceRefreshToken`.
	// Experimental.
	ConfluenceDataSourceAuthType_OAUTH2_CLIENT_CREDENTIALS ConfluenceDataSourceAuthType = "OAUTH2_CLIENT_CREDENTIALS"
	// Your secret authentication credentials in AWS Secrets Manager should include:  - `username` (email of admin account)  - `password` (API token).
	// Experimental.
	ConfluenceDataSourceAuthType_BASIC ConfluenceDataSourceAuthType = "BASIC"
)

type ConfluenceDataSourceProps added in v0.1.270

type ConfluenceDataSourceProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The AWS Secrets Manager secret that stores your authentication credentials for your Confluence instance URL.
	//
	// Secret must start with "AmazonBedrock-".
	// Experimental.
	AuthSecret awssecretsmanager.ISecret `field:"required" json:"authSecret" yaml:"authSecret"`
	// The Confluence host URL or instance URL.
	//
	// Example:
	//   https://example.atlassian.net
	//
	// Experimental.
	ConfluenceUrl *string `field:"required" json:"confluenceUrl" yaml:"confluenceUrl"`
	// The supported authentication method to connect to the data source.
	// Default: ConfluenceDataSourceAuthType.OAUTH2_CLIENT_CREDENTIALS
	//
	// Experimental.
	AuthType ConfluenceDataSourceAuthType `field:"optional" json:"authType" yaml:"authType"`
	// The filters (regular expression patterns) for the crawling.
	//
	// If there's a conflict, the exclude pattern takes precedence.
	// Default: None - all your content is crawled.
	//
	// Experimental.
	Filters *[]*ConfluenceCrawlingFilters `field:"optional" json:"filters" yaml:"filters"`
	// The knowledge base to associate with the data source.
	// Experimental.
	KnowledgeBase IKnowledgeBase `field:"required" json:"knowledgeBase" yaml:"knowledgeBase"`
}

Interface to create a new standalone data source object. Experimental.

type ConfluenceObjectType added in v0.1.270

type ConfluenceObjectType string

Represents the different types of content objects in Confluence that can be crawled by the data source. Experimental.

const (
	// Experimental.
	ConfluenceObjectType_SPACE ConfluenceObjectType = "SPACE"
	// Experimental.
	ConfluenceObjectType_PAGE ConfluenceObjectType = "PAGE"
	// Experimental.
	ConfluenceObjectType_BLOG ConfluenceObjectType = "BLOG"
	// Experimental.
	ConfluenceObjectType_COMMENT ConfluenceObjectType = "COMMENT"
	// Experimental.
	ConfluenceObjectType_ATTACHMENT ConfluenceObjectType = "ATTACHMENT"
)

type ContentFilter added in v0.1.276

type ContentFilter struct {
	// The strength of the content filter to apply to prompts / user input.
	// Experimental.
	InputStrength ContentFilterStrength `field:"required" json:"inputStrength" yaml:"inputStrength"`
	// The strength of the content filter to apply to model responses.
	// Experimental.
	OutputStrength ContentFilterStrength `field:"required" json:"outputStrength" yaml:"outputStrength"`
	// The type of harmful category that the content filter is applied to.
	// Experimental.
	Type ContentFilterType `field:"required" json:"type" yaml:"type"`
}

Interface to declare a content filter. Experimental.

type ContentFilterStrength added in v0.1.276

type ContentFilterStrength string

The strength of the content filter.

As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces. Experimental.

const (
	// Experimental.
	ContentFilterStrength_NONE ContentFilterStrength = "NONE"
	// Experimental.
	ContentFilterStrength_LOW ContentFilterStrength = "LOW"
	// Experimental.
	ContentFilterStrength_MEDIUM ContentFilterStrength = "MEDIUM"
	// Experimental.
	ContentFilterStrength_HIGH ContentFilterStrength = "HIGH"
)

type ContentFilterType added in v0.1.276

type ContentFilterType string

The type of harmful category usable in a content filter. Experimental.

const (
	// Describes input prompts and model responses that indicates sexual interest, activity, or arousal using direct or indirect references to body parts, physical traits, or sex.
	// Experimental.
	ContentFilterType_SEXUAL ContentFilterType = "SEXUAL"
	// Describes input prompts and model responses that includes glorification of or threats to inflict physical pain, hurt, or injury toward a person, group or thing.
	// Experimental.
	ContentFilterType_VIOLENCE ContentFilterType = "VIOLENCE"
	// Describes input prompts and model responses that discriminate, criticize, insult, denounce, or dehumanize a person or group on the basis of an identity (such as race, ethnicity, gender, religion, sexual orientation, ability, and national origin).
	// Experimental.
	ContentFilterType_HATE ContentFilterType = "HATE"
	// Describes input prompts and model responses that includes demeaning, humiliating, mocking, insulting, or belittling language.
	//
	// This type of language is also labeled
	// as bullying.
	// Experimental.
	ContentFilterType_INSULTS ContentFilterType = "INSULTS"
	// Describes input prompts and model responses that seeks or provides information about engaging in misconduct activity, or harming, defrauding, or taking advantage of a person, group or institution.
	// Experimental.
	ContentFilterType_MISCONDUCT ContentFilterType = "MISCONDUCT"
	// Enable to detect and block user inputs attempting to override system instructions.
	//
	// To avoid misclassifying system prompts as a prompt attack and ensure that the filters
	// are selectively applied to user inputs, use input tagging.
	// Experimental.
	ContentFilterType_PROMPT_ATTACK ContentFilterType = "PROMPT_ATTACK"
)

type ContextualGroundingFilter added in v0.1.276

type ContextualGroundingFilter struct {
	// The threshold for the contextual grounding filter.
	//
	// - `0` (blocks nothing)
	// - `0.99` (blocks almost everything)
	// Experimental.
	Threshold *float64 `field:"required" json:"threshold" yaml:"threshold"`
	// The type of contextual grounding filter.
	// Experimental.
	Type ContextualGroundingFilterType `field:"required" json:"type" yaml:"type"`
}

Interface to define a Contextual Grounding Filter. Experimental.

type ContextualGroundingFilterType added in v0.1.276

type ContextualGroundingFilterType string

The type of contextual grounding filter. Experimental.

const (
	// Grounding score represents the confidence that the model response is factually correct and grounded in the source.
	//
	// If the model response has a lower score than
	// the defined threshold, the response will be blocked and the configured blocked
	// message will be returned to the user. A higher threshold level blocks more responses.
	// Experimental.
	ContextualGroundingFilterType_GROUNDING ContextualGroundingFilterType = "GROUNDING"
	// Relevance score represents the confidence that the model response is relevant to the user's query.
	//
	// If the model response has a lower score than the defined
	// threshold, the response will be blocked and the configured blocked message will
	// be returned to the user. A higher threshold level blocks more responses.
	// Experimental.
	ContextualGroundingFilterType_RELEVANCE ContextualGroundingFilterType = "RELEVANCE"
)

type CrawlingFilters added in v0.1.270

type CrawlingFilters struct {
	// Exclude paths.
	// Experimental.
	ExcludePatterns *[]*string `field:"optional" json:"excludePatterns" yaml:"excludePatterns"`
	// Include patterns.
	// Experimental.
	IncludePatterns *[]*string `field:"optional" json:"includePatterns" yaml:"includePatterns"`
}

The filters (regular expression patterns) to include or exclude in the crawling in accordance with your scope. Experimental.

type CrawlingScope added in v0.1.270

type CrawlingScope string

The scope of the crawling. Experimental.

const (
	// Crawls only web pages that belong to the same host or primary domain.
	// Experimental.
	CrawlingScope_HOST_ONLY CrawlingScope = "HOST_ONLY"
	// Includes subdomains in addition to the host or primary domain, i.e. web pages that contain "aws.amazon.com" can also include sub domain "docs.aws.amazon.com".
	// Experimental.
	CrawlingScope_SUBDOMAINS CrawlingScope = "SUBDOMAINS"
	// Limit crawling to web pages that belong to the same host and with the same initial URL path.
	// Experimental.
	CrawlingScope_DEFAULT CrawlingScope = "DEFAULT"
)

type CrossRegionInferenceProfile added in v0.1.283

type CrossRegionInferenceProfile interface {
	IInferenceProfile
	IInvokable
	// The ARN of the application inference profile.
	//
	// Example:
	//   'arn:aws:bedrock:us-east-1:123456789012:inference-profile/us.anthropic.claude-3-5-sonnet-20240620-v1:0'
	//
	// Experimental.
	InferenceProfileArn() *string
	// The unique identifier of the inference profile.
	//
	// Example:
	//   'us.anthropic.claude-3-5-sonnet-20240620-v1:0'
	//
	// Experimental.
	InferenceProfileId() *string
	// The underlying model supporting cross-region inference.
	// Experimental.
	InferenceProfileModel() BedrockFoundationModel
	// This equals to the inferenceProfileArn property, useful just to implement IInvokable interface.
	// Experimental.
	InvokableArn() *string
	// The type of inference profile.
	//
	// Example:
	//   InferenceProfileType.SYSTEM_DEFINED
	//
	// Experimental.
	Type() InferenceProfileType
	// Gives the appropriate policies to invoke and use the Foundation Model.
	// Experimental.
	GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
	// Grants appropriate permissions to use the cross-region inference profile.
	//
	// Does not grant permissions to use the model in the profile.
	// Experimental.
	GrantProfileUsage(grantee awsiam.IGrantable) awsiam.Grant
}

Cross-region inference enables you to seamlessly manage unplanned traffic bursts by utilizing compute across different AWS Regions.

With cross-region inference, you can distribute traffic across multiple AWS Regions, enabling higher throughput and enhanced resilience during periods of peak demands. See: https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html

Experimental.

func CrossRegionInferenceProfile_FromConfig added in v0.1.283

func CrossRegionInferenceProfile_FromConfig(config *CrossRegionInferenceProfileProps) CrossRegionInferenceProfile

Experimental.

type CrossRegionInferenceProfileProps added in v0.1.283

type CrossRegionInferenceProfileProps struct {
	// The geographic region where the traffic is going to be distributed.
	//
	// Routing
	// factors in user traffic, demand and utilization of resources.
	// Experimental.
	GeoRegion CrossRegionInferenceProfileRegion `field:"required" json:"geoRegion" yaml:"geoRegion"`
	// A model supporting cross-region inference.
	// See: https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html
	//
	// Experimental.
	Model BedrockFoundationModel `field:"required" json:"model" yaml:"model"`
}

**************************************************************************** PROPS FOR NEW CONSTRUCT ***************************************************************************. Experimental.

type CrossRegionInferenceProfileRegion added in v0.1.283

type CrossRegionInferenceProfileRegion string

Experimental.

const (
	// Cross-region Inference Identifier for the European area.
	//
	// According to the model chosen, this might include:
	// - Frankfurt (`eu-central-1`)
	// - Ireland (`eu-west-1`)
	// - Paris (`eu-west-3`).
	// Experimental.
	CrossRegionInferenceProfileRegion_EU CrossRegionInferenceProfileRegion = "EU"
	// Cross-region Inference Identifier for the United States area.
	//
	// According to the model chosen, this might include:
	// - N. Virginia (`us-east-1`)
	// - Oregon (`us-west-2`)
	// - Ohio (`us-east-2`).
	// Experimental.
	CrossRegionInferenceProfileRegion_US CrossRegionInferenceProfileRegion = "US"
	// Cross-region Inference Identifier for the Asia-Pacific area.
	//
	// According to the model chosen, this might include:
	// - Tokyo (`ap-northeast-1`)
	// - Seoul (`ap-northeast-2`)
	// - Mumbai (`ap-south-1`)
	// - Singapore (`ap-southeast-1`)
	// - Sydney (`ap-southeast-2`).
	// Experimental.
	CrossRegionInferenceProfileRegion_APAC CrossRegionInferenceProfileRegion = "APAC"
)

type CustomParserProps added in v0.1.290

type CustomParserProps struct {
	// Experimental.
	Parser awslambda.IFunction `field:"optional" json:"parser" yaml:"parser"`
	// Experimental.
	Steps *[]*PromptStepConfigurationCustomParser `field:"optional" json:"steps" yaml:"steps"`
}

Experimental.

type CustomTopicProps added in v0.1.276

type CustomTopicProps struct {
	// Provide a clear definition to detect and block user inputs and FM responses that fall into this topic.
	//
	// Avoid starting with "don't".
	//
	// Example:
	//   `Investment advice refers to inquiries, guidance, or recommendations
	//   regarding the management or allocation of funds or assets with the goal of
	//   generating returns or achieving specific financial objectives.`
	//
	// Experimental.
	Definition *string `field:"required" json:"definition" yaml:"definition"`
	// Representative phrases that refer to the topic.
	//
	// These phrases can represent
	// a user input or a model response. Add up to 5 phrases, up to 100 characters
	// each.
	//
	// Example:
	//   "Where should I invest my money?"
	//
	// Experimental.
	Examples *[]*string `field:"required" json:"examples" yaml:"examples"`
	// The name of the topic to deny.
	// Experimental.
	Name *string `field:"required" json:"name" yaml:"name"`
}

Interface for creating a custom Topic. Experimental.

type CustomTransformation added in v0.1.270

type CustomTransformation interface {
	// The CloudFormation property representation of this custom transformation configuration.
	// Experimental.
	Configuration() *awsbedrock.CfnDataSource_CustomTransformationConfigurationProperty
	// Experimental.
	SetConfiguration(val *awsbedrock.CfnDataSource_CustomTransformationConfigurationProperty)
	// Experimental.
	GeneratePolicyStatements(scope constructs.Construct) *[]awsiam.PolicyStatement
}

Represents a custom transformation configuration for a data source ingestion. See: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-chunking-parsing.html#kb-custom-transformation

Experimental.

func CustomTransformation_Lambda added in v0.1.270

func CustomTransformation_Lambda(props *LambdaCustomTransformationProps) CustomTransformation

This feature allows you to use a Lambda function to inject your own logic into the knowledge base ingestion process. See: https://github.com/aws-samples/amazon-bedrock-samples/blob/main/knowledge-bases/features-examples/02-optimizing-accuracy-retrieved-results/advanced_chunking_options.ipynb

Experimental.

type DataDeletionPolicy added in v0.1.270

type DataDeletionPolicy string

Specifies the policy for handling data when a data source resource is deleted.

This policy affects the vector embeddings created from the data source. Experimental.

const (
	// Deletes all vector embeddings derived from the data source upon deletion of a data source resource.
	// Experimental.
	DataDeletionPolicy_DELETE DataDeletionPolicy = "DELETE"
	// Retains all vector embeddings derived from the data source even after deletion of a data source resource.
	// Experimental.
	DataDeletionPolicy_RETAIN DataDeletionPolicy = "RETAIN"
)

type DataSource added in v0.1.270

type DataSource interface {
	DataSourceBase
	// The unique identifier of the data source.
	// Experimental.
	DataSourceId() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Experimental.

type DataSourceAssociationProps added in v0.1.270

type DataSourceAssociationProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
}

Properties common for creating any of the different data source types. Experimental.

type DataSourceBase added in v0.1.270

type DataSourceBase interface {
	awscdk.Resource
	IDataSource
	// The unique identifier of the data source.
	//
	// Example:
	//   'JHUEVXUZMU'
	//
	// Experimental.
	DataSourceId() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Specifies the base class for all data source resources (imported and new). Experimental.

type DataSourceNew added in v0.1.270

type DataSourceNew interface {
	DataSourceBase
	// The unique identifier of the data source.
	//
	// Example:
	//   'JHUEVXUZMU'
	//
	// Experimental.
	DataSourceId() *string
	// The name of the data source.
	// Experimental.
	DataSourceName() *string
	// The type of data source.
	// Experimental.
	DataSourceType() DataSourceType
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The KMS key to use to encrypt the data source.
	// Experimental.
	KmsKey() awskms.IKey
	// The knowledge base associated with the data source.
	// Experimental.
	KnowledgeBase() IKnowledgeBase
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Formats the data source configuration properties for CloudFormation.
	// Experimental.
	FormatAsCfnProps(props *DataSourceAssociationProps, dataSourceConfiguration *awsbedrock.CfnDataSource_DataSourceConfigurationProperty) *awsbedrock.CfnDataSourceProps
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds appropriate permissions to the KB execution role needed by the data source.
	// Experimental.
	HandleCommonPermissions(props *DataSourceAssociationProps)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Specifies the base class for all NEW data source resources of ANY type. Experimental.

type DataSourceType added in v0.1.270

type DataSourceType string

Represents the types of data sources that can be associated to an Knowledge Base. Experimental.

const (
	// Amazon S3 Bucket data source.
	// Experimental.
	DataSourceType_S3 DataSourceType = "S3"
	// Confluence Cloud Instance data source.
	// Experimental.
	DataSourceType_CONFLUENCE DataSourceType = "CONFLUENCE"
	// Salesforce instance data source.
	// Experimental.
	DataSourceType_SALESFORCE DataSourceType = "SALESFORCE"
	// Microsoft SharePoint instance data source.
	// Experimental.
	DataSourceType_SHAREPOINT DataSourceType = "SHAREPOINT"
	// Web Crawler data source.
	//
	// Extracts content from authorized public web pages using a crawler.
	// Experimental.
	DataSourceType_WEB_CRAWLER DataSourceType = "WEB_CRAWLER"
)

type DefaultPromptRouterIdentifier added in v0.1.289

type DefaultPromptRouterIdentifier interface {
	// Experimental.
	PromptRouterId() *string
	// Experimental.
	RoutingModels() *[]BedrockFoundationModel
}

Represents identifiers for default prompt routers in Bedrock. Experimental.

func DefaultPromptRouterIdentifier_ANTHROPIC_CLAUDE_V1 added in v0.1.289

func DefaultPromptRouterIdentifier_ANTHROPIC_CLAUDE_V1() DefaultPromptRouterIdentifier

func DefaultPromptRouterIdentifier_META_LLAMA_3_1 added in v0.1.289

func DefaultPromptRouterIdentifier_META_LLAMA_3_1() DefaultPromptRouterIdentifier

type FoundationModelParsingStategyProps added in v0.1.270

type FoundationModelParsingStategyProps struct {
	// The Foundation Model to use for parsing non-textual information.
	//
	// Currently supported models are Claude 3 Sonnet and Claude 3 Haiku.
	// Experimental.
	ParsingModel IInvokable `field:"required" json:"parsingModel" yaml:"parsingModel"`
	// Specifies whether to enable parsing of multimodal data, including both text and/or images.
	// Default: undefined - Text only.
	//
	// Experimental.
	ParsingModality ParsingModality `field:"optional" json:"parsingModality" yaml:"parsingModality"`
	// Custom prompt to instruct the parser on how to interpret the document.
	// Default: - Uses the default instruction prompt as provided in the AWS Console.
	//
	// Experimental.
	ParsingPrompt *string `field:"optional" json:"parsingPrompt" yaml:"parsingPrompt"`
}

Properties for configuring a Foundation Model parsing strategy. Experimental.

type Guardrail

type Guardrail interface {
	GuardrailBase
	// The content filters applied by the guardrail.
	// Experimental.
	ContentFilters() *[]*ContentFilter
	// The contextual grounding filters applied by the guardrail.
	// Experimental.
	ContextualGroundingFilters() *[]*ContextualGroundingFilter
	// The denied topic filters applied by the guardrail.
	// Experimental.
	DeniedTopics() *[]Topic
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The ARN of the guardrail.
	// Experimental.
	GuardrailArn() *string
	// The ID of the guardrail.
	// Experimental.
	GuardrailId() *string
	// The version of the guardrail.
	//
	// By default, this value will always be `DRAFT` unless an explicit version is created.
	// For an explicit version created, this will usually be a number (e.g. for Version 1 just enter "1")
	//
	// Example:
	//   "1"
	//
	// Default: - "DRAFT".
	//
	// Experimental.
	GuardrailVersion() *string
	// Experimental.
	SetGuardrailVersion(val *string)
	// The computed hash of the guardrail properties.
	// Experimental.
	Hash() *string
	// The KMS key used to encrypt data.
	// Default: undefined - "Data is encrypted by default with a key that AWS owns and manages for you".
	//
	// Experimental.
	KmsKey() awskms.IKey
	// When this guardrail was last updated.
	// Experimental.
	LastUpdated() *string
	// The managed word list filters applied by the guardrail.
	// Experimental.
	ManagedWordListFilters() *[]ManagedWordFilterType
	// The name of the guardrail.
	// Experimental.
	Name() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The PII filters applied by the guardrail.
	// Experimental.
	PiiFilters() *[]*PIIFilter
	// The regex filters applied by the guardrail.
	// Experimental.
	RegexFilters() *[]*RegexFilter
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The word filters applied by the guardrail.
	// Experimental.
	WordFilters() *[]*string
	// Adds a content filter to the guardrail.
	// Experimental.
	AddContentFilter(filter *ContentFilter)
	// Adds a contextual grounding filter to the guardrail.
	// Experimental.
	AddContextualGroundingFilter(filter *ContextualGroundingFilter)
	// Adds a denied topic filter to the guardrail.
	// Experimental.
	AddDeniedTopicFilter(filter Topic)
	// Adds a managed word list filter to the guardrail.
	// Experimental.
	AddManagedWordListFilter(filter ManagedWordFilterType)
	// Adds a PII filter to the guardrail.
	// Experimental.
	AddPIIFilter(filter *PIIFilter)
	// Adds a regex filter to the guardrail.
	// Experimental.
	AddRegexFilter(filter *RegexFilter)
	// Adds a word filter to the guardrail.
	// Experimental.
	AddWordFilter(filter *string)
	// Adds a word filter to the guardrail.
	// Experimental.
	AddWordFilterFromFile(filePath *string)
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Create a version for the guardrail.
	//
	// Returns: The guardrail version.
	// Experimental.
	CreateVersion(description *string) *string
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the given principal identity permissions to perform actions on this agent alias.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to apply the guardrail.
	// Experimental.
	GrantApply(grantee awsiam.IGrantable) awsiam.Grant
	// Return the given named metric for this guardrail.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation client errors metric for this guardrail.
	// Experimental.
	MetricInvocationClientErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation latency metric for this guardrail.
	// Experimental.
	MetricInvocationLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocations metric for this guardrail.
	// Experimental.
	MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation server errors metric for this guardrail.
	// Experimental.
	MetricInvocationServerErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocations intervened metric for this guardrail.
	// Experimental.
	MetricInvocationsIntervened(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation throttles metric for this guardrail.
	// Experimental.
	MetricInvocationThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the text unit count metric for this guardrail.
	// Experimental.
	MetricTextUnitCount(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Class to create a Guardrail with CDK. Experimental.

func NewGuardrail

func NewGuardrail(scope constructs.Construct, id *string, props *GuardrailProps) Guardrail

Experimental.

type GuardrailAction added in v0.1.276

type GuardrailAction string

Guardrail action when a sensitive entity is detected. Experimental.

const (
	// If sensitive information is detected in the prompt or response, the guardrail blocks all the content and returns a message that you configure.
	// Experimental.
	GuardrailAction_BLOCK GuardrailAction = "BLOCK"
	// If sensitive information is detected in the model response, the guardrail masks it with an identifier, the sensitive information is masked and replaced with identifier tags (for example: [NAME-1], [NAME-2], [EMAIL-1], etc.).
	// Experimental.
	GuardrailAction_ANONYMIZE GuardrailAction = "ANONYMIZE"
)

type GuardrailAttributes added in v0.1.276

type GuardrailAttributes struct {
	// The ARN of the guardrail.
	//
	// At least one of guardrailArn or guardrailId must be
	// defined in order to initialize a guardrail ref.
	// Experimental.
	GuardrailArn *string `field:"required" json:"guardrailArn" yaml:"guardrailArn"`
	// The version of the guardrail.
	// Default: "DRAFT".
	//
	// Experimental.
	GuardrailVersion *string `field:"optional" json:"guardrailVersion" yaml:"guardrailVersion"`
	// The KMS key of the guardrail if custom encryption is configured.
	// Default: undefined - Means data is encrypted by default with a AWS-managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
}

**************************************************************************** ATTRS FOR IMPORTED CONSTRUCT ***************************************************************************. Experimental.

type GuardrailBase added in v0.1.276

type GuardrailBase interface {
	awscdk.Resource
	IGuardrail
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The ARN of the guardrail.
	// Experimental.
	GuardrailArn() *string
	// The ID of the guardrail.
	// Experimental.
	GuardrailId() *string
	// The ID of the guardrail.
	// Experimental.
	GuardrailVersion() *string
	// Experimental.
	SetGuardrailVersion(val *string)
	// The KMS key of the guardrail if custom encryption is configured.
	// Experimental.
	KmsKey() awskms.IKey
	// When this guardrail was last updated.
	// Experimental.
	LastUpdated() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the given principal identity permissions to perform actions on this agent alias.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to apply the guardrail.
	// Experimental.
	GrantApply(grantee awsiam.IGrantable) awsiam.Grant
	// Return the given named metric for this guardrail.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation client errors metric for this guardrail.
	// Experimental.
	MetricInvocationClientErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation latency metric for this guardrail.
	// Experimental.
	MetricInvocationLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocations metric for this guardrail.
	// Experimental.
	MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation server errors metric for this guardrail.
	// Experimental.
	MetricInvocationServerErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocations intervened metric for this guardrail.
	// Experimental.
	MetricInvocationsIntervened(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation throttles metric for this guardrail.
	// Experimental.
	MetricInvocationThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the text unit count metric for this guardrail.
	// Experimental.
	MetricTextUnitCount(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Abstract base class for a Guardrail.

Contains methods and attributes valid for Guardrails either created with CDK or imported. Experimental.

type GuardrailProps

type GuardrailProps struct {
	// The name of the guardrail.
	// Experimental.
	Name *string `field:"required" json:"name" yaml:"name"`
	// The message to return when the guardrail blocks a prompt.
	// Default: "Sorry, your query violates our usage policy."
	//
	// Experimental.
	BlockedInputMessaging *string `field:"optional" json:"blockedInputMessaging" yaml:"blockedInputMessaging"`
	// The message to return when the guardrail blocks a model response.
	// Default: "Sorry, I am unable to answer your question because of our usage policy."
	//
	// Experimental.
	BlockedOutputsMessaging *string `field:"optional" json:"blockedOutputsMessaging" yaml:"blockedOutputsMessaging"`
	// The content filters to apply to the guardrail.
	//
	// Note, if one of.
	// Experimental.
	ContentFilters *[]*ContentFilter `field:"optional" json:"contentFilters" yaml:"contentFilters"`
	// The contextual grounding filters to apply to the guardrail.
	// Experimental.
	ContextualGroundingFilters *[]*ContextualGroundingFilter `field:"optional" json:"contextualGroundingFilters" yaml:"contextualGroundingFilters"`
	// Up to 30 denied topics to block user inputs or model responses associated with the topic.
	// Experimental.
	DeniedTopics *[]Topic `field:"optional" json:"deniedTopics" yaml:"deniedTopics"`
	// The description of the guardrail.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// A custom KMS key to use for encrypting data.
	// Default: "Your data is encrypted by default with a key that AWS owns and manages for you."
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The managed word filters to apply to the guardrail.
	// Experimental.
	ManagedWordListFilters *[]ManagedWordFilterType `field:"optional" json:"managedWordListFilters" yaml:"managedWordListFilters"`
	// The PII filters to apply to the guardrail.
	// Experimental.
	PiiFilters *[]*PIIFilter `field:"optional" json:"piiFilters" yaml:"piiFilters"`
	// The regular expression (regex) filters to apply to the guardrail.
	// Experimental.
	RegexFilters *[]*RegexFilter `field:"optional" json:"regexFilters" yaml:"regexFilters"`
	// The word filters to apply to the guardrail.
	// Experimental.
	WordFilters *[]*string `field:"optional" json:"wordFilters" yaml:"wordFilters"`
}

Properties for creating a Guardrail. Experimental.

type HierarchicalChunkingProps added in v0.1.270

type HierarchicalChunkingProps struct {
	// Maximum number of tokens that a child chunk can contain.
	//
	// Keep in mind the maximum chunk size depends on the embedding model chosen.
	// Experimental.
	MaxChildTokenSize *float64 `field:"required" json:"maxChildTokenSize" yaml:"maxChildTokenSize"`
	// Maximum number of tokens that a parent chunk can contain.
	//
	// Keep in mind the maximum chunk size depends on the embedding model chosen.
	// Experimental.
	MaxParentTokenSize *float64 `field:"required" json:"maxParentTokenSize" yaml:"maxParentTokenSize"`
	// The overlap tokens between adjacent chunks.
	// Experimental.
	OverlapTokens *float64 `field:"required" json:"overlapTokens" yaml:"overlapTokens"`
}

Experimental.

type IAgent added in v0.1.290

type IAgent interface {
	awscdk.IResource
	// The ARN of the agent.
	//
	// Example:
	//   "arn:aws:bedrock:us-east-1:123456789012:agent/OKDSJOGKMO"@attributeundefined
	//
	// Experimental.
	AgentArn() *string
	// The ID of the Agent.
	//
	// Example:
	//   "OKDSJOGKMO"@attributeundefined
	//
	// Experimental.
	AgentId() *string
	// Optional KMS encryption key associated with this agent.
	// Experimental.
	KmsKey() awskms.IKey
	// When this agent was last updated.
	// Experimental.
	LastUpdated() *string
	// The IAM role associated to the agent.
	// Experimental.
	Role() awsiam.IRole
}

Represents an Agent, either created with CDK or imported. Experimental.

func Agent_FromAgentAttrs added in v0.1.290

func Agent_FromAgentAttrs(scope constructs.Construct, id *string, attrs *AgentAttributes) IAgent

Static Method for importing an existing Bedrock Agent. Experimental.

type IAgentAlias added in v0.1.263

type IAgentAlias interface {
	awscdk.IResource
	// Grant the given principal identity permissions to perform actions on this agent alias.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to invoke the agent alias.
	// Experimental.
	GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
	// Define an EventBridge rule that triggers when something happens to this agent alias.
	//
	// Requires that there exists at least one CloudTrail Trail in your account
	// that captures the event. This method will not create the Trail.
	// Experimental.
	OnCloudTrailEvent(id *string, options *awsevents.OnEventOptions) awsevents.Rule
	// The underlying agent for this alias.
	// Experimental.
	Agent() IAgent
	// The ARN of the agent alias.
	//
	// Example:
	//   `arn:aws:bedrock:us-east-1:123456789012:agent-alias/DNCJJYQKSU/TCLCITFZTN`
	//
	// Experimental.
	AliasArn() *string
	// The unique identifier of the agent alias.
	//
	// Example:
	//   `TCLCITFZTN`
	//
	// Experimental.
	AliasId() *string
}

Represents an Agent Alias, either created with CDK or imported. Experimental.

func AgentAlias_FromAttributes added in v0.1.290

func AgentAlias_FromAttributes(scope constructs.Construct, id *string, attrs *AgentAliasAttributes) IAgentAlias

Brings an Agent Alias from an existing one created outside of CDK. Experimental.

type IDataSource added in v0.1.270

type IDataSource interface {
	awscdk.IResource
	// The unique identifier of the data source.
	//
	// Example:
	//   'JHUEVXUZMU'
	//
	// Experimental.
	DataSourceId() *string
}

Specifies interface for resources created with CDK or imported into CDK. Experimental.

func DataSource_FromDataSourceId added in v0.1.270

func DataSource_FromDataSourceId(scope constructs.Construct, id *string, dataSourceId *string) IDataSource

Experimental.

type IGuardrail added in v0.1.276

type IGuardrail interface {
	awscdk.IResource
	// Grant the given principal identity permissions to perform actions on this guardrail.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to apply the guardrail.
	// Experimental.
	GrantApply(grantee awsiam.IGrantable) awsiam.Grant
	// Return the given named metric for this guardrail.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation client errors metric for this guardrail.
	// Experimental.
	MetricInvocationClientErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation latency metric for this guardrail.
	// Experimental.
	MetricInvocationLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocations metric for this guardrail.
	// Experimental.
	MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation server errors metric for this guardrail.
	// Experimental.
	MetricInvocationServerErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocations intervened metric for this guardrail.
	// Experimental.
	MetricInvocationsIntervened(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the invocation throttles metric for this guardrail.
	// Experimental.
	MetricInvocationThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Return the text unit count metric for this guardrail.
	// Experimental.
	MetricTextUnitCount(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The ARN of the guardrail.
	//
	// Example:
	//   "arn:aws:bedrock:us-east-1:123456789012:guardrail/yympzo398ipq"@attributeundefined
	//
	// Experimental.
	GuardrailArn() *string
	// The ID of the guardrail.
	//
	// Example:
	//   "yympzo398ipq"@attributeundefined
	//
	// Experimental.
	GuardrailId() *string
	// The version of the guardrail.
	//
	// If no explicit version is created,
	// this will default to "DRAFT".
	// Experimental.
	GuardrailVersion() *string
	// Experimental.
	SetGuardrailVersion(g *string)
	// Optional KMS encryption key associated with this guardrail.
	// Experimental.
	KmsKey() awskms.IKey
	// When this guardrail was last updated.
	// Experimental.
	LastUpdated() *string
}

Represents a Guardrail, either created with CDK or imported. Experimental.

func Guardrail_FromCfnGuardrail added in v0.1.276

func Guardrail_FromCfnGuardrail(cfnGuardrail awsbedrock.CfnGuardrail) IGuardrail

Import a low-level L1 Cfn Guardrail. Experimental.

func Guardrail_FromGuardrailAttributes added in v0.1.276

func Guardrail_FromGuardrailAttributes(scope constructs.Construct, id *string, attrs *GuardrailAttributes) IGuardrail

Import a guardrail given its attributes. Experimental.

type IInferenceProfile added in v0.1.283

type IInferenceProfile interface {
	// Grants appropriate permissions to use the inference profile.
	// Experimental.
	GrantProfileUsage(grantee awsiam.IGrantable) awsiam.Grant
	// The ARN of the application inference profile.
	// Experimental.
	InferenceProfileArn() *string
	// The unique identifier of the inference profile.
	// Experimental.
	InferenceProfileId() *string
	// The type of inference profile.
	// Experimental.
	Type() InferenceProfileType
}

Represents a ApplicationInferenceProfile, either created with CDK or imported. Experimental.

func ApplicationInferenceProfile_FromApplicationInferenceProfileAttributes added in v0.1.283

func ApplicationInferenceProfile_FromApplicationInferenceProfileAttributes(scope constructs.Construct, id *string, attrs *ApplicationInferenceProfileAttributes) IInferenceProfile

Import a ApplicationInferenceProfile given its attributes. Experimental.

func ApplicationInferenceProfile_FromCfnApplicationInferenceProfile added in v0.1.283

func ApplicationInferenceProfile_FromCfnApplicationInferenceProfile(CfnApplicationInferenceProfile awsbedrock.CfnApplicationInferenceProfile) IInferenceProfile

Import a low-level L1 Cfn ApplicationInferenceProfile. Experimental.

type IInvokable added in v0.1.283

type IInvokable interface {
	// Gives the appropriate policies to invoke and use the invokable abstraction.
	// Experimental.
	GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
	// The ARN of the Bedrock invokable abstraction.
	// Experimental.
	InvokableArn() *string
}

Represents an Amazon Bedrock abstraction on which you can run the `Invoke` API.

This can be a Foundational Model, a Custom Model, or an Inference Profile. Experimental.

type IKendraKnowledgeBase added in v0.1.292

type IKendraKnowledgeBase interface {
	IKnowledgeBase
	// The GenAI Kendra Index.
	// Experimental.
	KendraIndex() kendra.IKendraGenAiIndex
}

**************************************************************************** COMMON INTERFACES ***************************************************************************. Experimental.

func KendraKnowledgeBase_FromKnowledgeBaseAttributes added in v0.1.292

func KendraKnowledgeBase_FromKnowledgeBaseAttributes(scope constructs.Construct, id *string, attrs *KendraKnowledgeBaseAttributes) IKendraKnowledgeBase

Experimental.

type IKnowledgeBase added in v0.1.270

type IKnowledgeBase interface {
	awscdk.IResource
	// Grant the given principal identity permissions to perform actions on this knowledge base.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to query the knowledge base.
	// Experimental.
	GrantQuery(grantee awsiam.IGrantable) awsiam.Grant
	// The description of the knowledge base.
	// Experimental.
	Description() *string
	// A narrative instruction of the knowledge base.
	//
	// A Bedrock Agent can use this instruction to determine if it should
	// query this Knowledge Base.
	// Experimental.
	Instruction() *string
	// The ARN of the knowledge base.
	//
	// Example:
	//   "arn:aws:bedrock:us-east-1:123456789012:knowledge-base/KB12345678"
	//
	// Experimental.
	KnowledgeBaseArn() *string
	// The ID of the knowledge base.
	//
	// Example:
	//   "KB12345678"
	//
	// Experimental.
	KnowledgeBaseId() *string
	// The role associated with the knowledge base.
	// Experimental.
	Role() awsiam.IRole
	// The type of knowledge base.
	// Experimental.
	Type() KnowledgeBaseType
}

Represents a Knowledge Base, either created with CDK or imported, of any type. Experimental.

type IPrompt added in v0.1.262

type IPrompt interface {
	// Optional KMS encryption key associated with this prompt.
	// Experimental.
	KmsKey() awskms.IKey
	// The ARN of the prompt.
	//
	// Example:
	//   "arn:aws:bedrock:us-east-1:123456789012:prompt/PROMPT12345"
	//
	// Experimental.
	PromptArn() *string
	// The ID of the prompt.
	//
	// Example:
	//   "PROMPT12345"
	//
	// Experimental.
	PromptId() *string
	// The version of the prompt.
	// Default: - "DRAFT".
	//
	// Experimental.
	PromptVersion() *string
	// Experimental.
	SetPromptVersion(p *string)
}

Represents a Prompt, either created with CDK or imported. Experimental.

func Prompt_FromPromptAttributes added in v0.1.279

func Prompt_FromPromptAttributes(scope constructs.Construct, id *string, attrs *PromptAttributes) IPrompt

Experimental.

type IPromptRouter added in v0.1.289

type IPromptRouter interface {
	// The ARN of the prompt router.
	// Experimental.
	PromptRouterArn() *string
	// The Id of the prompt router.
	// Experimental.
	PromptRouterId() *string
	// The foundation models / profiles this router will route to.
	// Experimental.
	RoutingEndpoints() *[]IInvokable
}

Experimental.

type IVectorKnowledgeBase added in v0.1.292

type IVectorKnowledgeBase interface {
	IKnowledgeBase
	// Add a Confluence data source to the knowledge base.
	// Experimental.
	AddConfluenceDataSource(props *ConfluenceDataSourceAssociationProps) ConfluenceDataSource
	// Add an S3 data source to the knowledge base.
	// Experimental.
	AddS3DataSource(props *S3DataSourceAssociationProps) S3DataSource
	// Add a Salesforce data source to the knowledge base.
	// Experimental.
	AddSalesforceDataSource(props *SalesforceDataSourceAssociationProps) SalesforceDataSource
	// Add a SharePoint data source to the knowledge base.
	// Experimental.
	AddSharePointDataSource(props *SharePointDataSourceAssociationProps) SharePointDataSource
	// Add a web crawler data source to the knowledge base.
	// Experimental.
	AddWebCrawlerDataSource(props *WebCrawlerDataSourceAssociationProps) WebCrawlerDataSource
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieve(grantee awsiam.IGrantable) awsiam.Grant
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieveAndGenerate(grantee awsiam.IGrantable) awsiam.Grant
}

Represents a Knowledge Base, either created with CDK or imported. Experimental.

func VectorKnowledgeBase_FromKnowledgeBaseAttributes added in v0.1.292

func VectorKnowledgeBase_FromKnowledgeBaseAttributes(scope constructs.Construct, id *string, attrs *VectorKnowledgeBaseAttributes) IVectorKnowledgeBase

Experimental.

type InferenceConfiguration

type InferenceConfiguration struct {
	// The maximum number of tokens to generate in the response.
	//
	// Integer
	//
	// min 0
	// max 4096.
	// Experimental.
	MaximumLength *float64 `field:"required" json:"maximumLength" yaml:"maximumLength"`
	// A list of stop sequences.
	//
	// A stop sequence is a sequence of characters that
	// causes the model to stop generating the response.
	//
	// length 0-4.
	// Experimental.
	StopSequences *[]*string `field:"required" json:"stopSequences" yaml:"stopSequences"`
	// The likelihood of the model selecting higher-probability options while generating a response.
	//
	// A lower value makes the model more likely to choose
	// higher-probability options, while a higher value makes the model more
	// likely to choose lower-probability options.
	//
	// Floating point
	//
	// min 0
	// max 1.
	// Experimental.
	Temperature *float64 `field:"required" json:"temperature" yaml:"temperature"`
	// While generating a response, the model determines the probability of the following token at each point of generation.
	//
	// The value that you set for
	// topK is the number of most-likely candidates from which the model chooses
	// the next token in the sequence. For example, if you set topK to 50, the
	// model selects the next token from among the top 50 most likely choices.
	//
	// Integer
	//
	// min 0
	// max 500.
	// Experimental.
	TopK *float64 `field:"required" json:"topK" yaml:"topK"`
	// While generating a response, the model determines the probability of the following token at each point of generation.
	//
	// The value that you set for
	// Top P determines the number of most-likely candidates from which the model
	// chooses the next token in the sequence. For example, if you set topP to
	// 80, the model only selects the next token from the top 80% of the
	// probability distribution of next tokens.
	//
	// Floating point
	//
	// min 0
	// max 1.
	// Experimental.
	TopP *float64 `field:"required" json:"topP" yaml:"topP"`
}

LLM inference configuration. Experimental.

type InferenceProfileBase added in v0.1.283

type InferenceProfileBase interface {
	awscdk.Resource
	IInferenceProfile
	awscdk.IResource
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The ARN of the application inference profile.
	// Experimental.
	InferenceProfileArn() *string
	// The unique identifier of the inference profile.
	// Experimental.
	InferenceProfileId() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The ID or Amazon Resource Name (ARN) of the inference profile.
	// Experimental.
	Type() InferenceProfileType
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grants appropriate permissions to use the cross-region inference profile.
	//
	// Does not grant permissions to use the model in the profile.
	// Experimental.
	GrantProfileUsage(grantee awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Abstract base class for a ApplicationInferenceProfile.

Contains methods and attributes valid for ApplicationInferenceProfiles either created with CDK or imported. Experimental.

type InferenceProfileType added in v0.1.283

type InferenceProfileType string

These are the values used by the API when using aws bedrock get-inference-profile --inference-profile-identifier XXXXXXX. Experimental.

const (
	// An inference profile that is created by AWS.
	//
	// These are profiles such as cross-region
	// which help you distributed traffic across a geographic region.
	// Experimental.
	InferenceProfileType_SYSTEM_DEFINED InferenceProfileType = "SYSTEM_DEFINED"
	// An inference profile that is user-created.
	//
	// These are profiles that help
	// you track costs or metrics.
	// Experimental.
	InferenceProfileType_APPLICATION InferenceProfileType = "APPLICATION"
)

type InlineApiSchema

type InlineApiSchema interface {
	ApiSchema
	// Experimental.
	InlineSchema() *string
	// Experimental.
	S3File() *awss3.Location
}

Experimental.

func ApiSchema_FromInline

func ApiSchema_FromInline(schema *string) InlineApiSchema

Creates an API Schema from an inline string. Experimental.

func ApiSchema_FromLocalAsset added in v0.1.290

func ApiSchema_FromLocalAsset(path *string) InlineApiSchema

Creates an API Schema from a local file. Experimental.

func InlineApiSchema_FromInline

func InlineApiSchema_FromInline(schema *string) InlineApiSchema

Creates an API Schema from an inline string. Experimental.

func InlineApiSchema_FromLocalAsset added in v0.1.290

func InlineApiSchema_FromLocalAsset(path *string) InlineApiSchema

Creates an API Schema from a local file. Experimental.

func NewInlineApiSchema

func NewInlineApiSchema(schema *string) InlineApiSchema

Experimental.

func S3ApiSchema_FromInline

func S3ApiSchema_FromInline(schema *string) InlineApiSchema

Creates an API Schema from an inline string. Experimental.

func S3ApiSchema_FromLocalAsset added in v0.1.290

func S3ApiSchema_FromLocalAsset(path *string) InlineApiSchema

Creates an API Schema from a local file. Experimental.

type KendraKnowledgeBase added in v0.1.292

type KendraKnowledgeBase interface {
	KendraKnowledgeBaseBase
	// The description of the knowledge base.
	// Experimental.
	Description() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// A narrative instruction of the knowledge base.
	//
	// A Bedrock Agent can use this instruction to determine if it should
	// query this Knowledge Base.
	// Experimental.
	Instruction() *string
	// The GenAI Kendra Index.
	// Experimental.
	KendraIndex() kendra.IKendraGenAiIndex
	// The ARN of the knowledge base.
	// Experimental.
	KnowledgeBaseArn() *string
	// The ID of the knowledge base.
	// Experimental.
	KnowledgeBaseId() *string
	// The name of the knowledge base.
	// Experimental.
	Name() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The role associated with the knowledge base.
	// Experimental.
	Role() awsiam.IRole
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The type of Knowledge Base.
	// Experimental.
	Type() KnowledgeBaseType
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the given principal identity permissions to perform actions on this knowledge base.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to query the knowledge base.
	//
	// This contains:
	// - Retrieve
	// - RetrieveAndGenerate.
	// Experimental.
	GrantQuery(grantee awsiam.IGrantable) awsiam.Grant
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieve(grantee awsiam.IGrantable) awsiam.Grant
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieveAndGenerate(grantee awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

**************************************************************************** CONSTRUCT ***************************************************************************. Experimental.

func NewKendraKnowledgeBase added in v0.1.292

func NewKendraKnowledgeBase(scope constructs.Construct, id *string, props *KendraKnowledgeBaseProps) KendraKnowledgeBase

Experimental.

type KendraKnowledgeBaseAttributes added in v0.1.292

type KendraKnowledgeBaseAttributes struct {
	// The Service Execution Role associated with the knowledge base.
	//
	// Example:
	//   "arn:aws:iam::123456789012:role/AmazonBedrockExecutionRoleForKnowledgeBaseawscdkbdgeBaseKB12345678"
	//
	// Experimental.
	ExecutionRoleArn *string `field:"required" json:"executionRoleArn" yaml:"executionRoleArn"`
	// The ID of the knowledge base.
	//
	// Example:
	//   "KB12345678"
	//
	// Experimental.
	KnowledgeBaseId *string `field:"required" json:"knowledgeBaseId" yaml:"knowledgeBaseId"`
	// The description of the knowledge base.
	// Default: - No description provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Instructions for agents based on the design and type of information of the Knowledge Base.
	//
	// This will impact how Agents interact with the Knowledge Base.
	// Default: - No description provided.
	//
	// Experimental.
	Instruction *string `field:"optional" json:"instruction" yaml:"instruction"`
	// Specifies whether to use the knowledge base or not when sending an InvokeAgent request.
	// Default: - ENABLED.
	//
	// Experimental.
	KnowledgeBaseState *string `field:"optional" json:"knowledgeBaseState" yaml:"knowledgeBaseState"`
	// The GenAI Kendra Index ARN.
	// Experimental.
	KendraIndex kendra.IKendraGenAiIndex `field:"required" json:"kendraIndex" yaml:"kendraIndex"`
}

Properties for importing a knowledge base outside of this stack. Experimental.

type KendraKnowledgeBaseBase added in v0.1.292

type KendraKnowledgeBaseBase interface {
	KnowledgeBaseBase
	// The description of the knowledge base.
	// Experimental.
	Description() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// A narrative instruction of the knowledge base.
	//
	// A Bedrock Agent can use this instruction to determine if it should
	// query this Knowledge Base.
	// Experimental.
	Instruction() *string
	// Experimental.
	KendraIndex() kendra.IKendraGenAiIndex
	// The ARN of the knowledge base.
	// Experimental.
	KnowledgeBaseArn() *string
	// The ID of the knowledge base.
	// Experimental.
	KnowledgeBaseId() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The role associated with the knowledge base.
	// Experimental.
	Role() awsiam.IRole
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The type of knowledge base.
	// Experimental.
	Type() KnowledgeBaseType
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the given principal identity permissions to perform actions on this knowledge base.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to query the knowledge base.
	//
	// This contains:
	// - Retrieve
	// - RetrieveAndGenerate.
	// Experimental.
	GrantQuery(grantee awsiam.IGrantable) awsiam.Grant
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieve(grantee awsiam.IGrantable) awsiam.Grant
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieveAndGenerate(grantee awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

**************************************************************************** ABSTRACT CLASS ***************************************************************************. Experimental.

type KendraKnowledgeBaseProps added in v0.1.292

type KendraKnowledgeBaseProps struct {
	// The description of the knowledge base.
	// Default: - No description provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Existing IAM role with policy statements granting appropriate permissions to invoke the specific embeddings models.
	//
	// 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.
	// Experimental.
	ExistingRole awsiam.IRole `field:"optional" json:"existingRole" yaml:"existingRole"`
	// 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.
	//
	// Experimental.
	Instruction *string `field:"optional" json:"instruction" yaml:"instruction"`
	// The name of the knowledge base.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The Kendra Index to use for the knowledge base.
	// Experimental.
	KendraIndex kendra.IKendraGenAiIndex `field:"required" json:"kendraIndex" yaml:"kendraIndex"`
}

Properties for creating a Kendra Index Knowledge Base. Experimental.

type KnowledgeBaseBase added in v0.1.292

type KnowledgeBaseBase interface {
	awscdk.Resource
	IKnowledgeBase
	// The description of the knowledge base.
	// Experimental.
	Description() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// A narrative instruction of the knowledge base.
	//
	// A Bedrock Agent can use this instruction to determine if it should
	// query this Knowledge Base.
	// Experimental.
	Instruction() *string
	// The ARN of the knowledge base.
	// Experimental.
	KnowledgeBaseArn() *string
	// The ID of the knowledge base.
	// Experimental.
	KnowledgeBaseId() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The role associated with the knowledge base.
	// Experimental.
	Role() awsiam.IRole
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The type of knowledge base.
	// Experimental.
	Type() KnowledgeBaseType
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the given principal identity permissions to perform actions on this knowledge base.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to query the knowledge base.
	//
	// This contains:
	// - Retrieve
	// - RetrieveAndGenerate.
	// Experimental.
	GrantQuery(grantee awsiam.IGrantable) awsiam.Grant
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieve(grantee awsiam.IGrantable) awsiam.Grant
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieveAndGenerate(grantee awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Abstract base class for Knowledge Base (regarless the type).

Contains methods valid for KBs either created with CDK or imported and applicable to Knowledge Bases of any type. Experimental.

type KnowledgeBaseType added in v0.1.292

type KnowledgeBaseType string

Types of possible knowledge bases supported by Amazon Bedrock Knowledge Bases. Experimental.

const (
	// Vector database with emebeddings vectors.
	// See: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-how-it-works.html
	//
	// Experimental.
	KnowledgeBaseType_VECTOR KnowledgeBaseType = "VECTOR"
	// Kendra GenAI Index.
	// See: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-kendra-genai-index.html
	//
	// Experimental.
	KnowledgeBaseType_KENDRA KnowledgeBaseType = "KENDRA"
	// Structured data store (e.g. REDSHIFT).
	// See: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html
	//
	// Experimental.
	KnowledgeBaseType_SQL KnowledgeBaseType = "SQL"
)

type LambdaCustomTransformationProps added in v0.1.270

type LambdaCustomTransformationProps struct {
	// The Lambda function to use for custom document processing.
	// Experimental.
	LambdaFunction awslambda.IFunction `field:"required" json:"lambdaFunction" yaml:"lambdaFunction"`
	// An S3 bucket URL/path to store input documents for Lambda processing and to store the output of the processed documents.
	//
	// Example:
	//   "s3://my-bucket/chunk-processor/"
	//
	// Experimental.
	S3BucketUri *string `field:"required" json:"s3BucketUri" yaml:"s3BucketUri"`
}

Properties for configuring a Lambda-based custom transformation. Experimental.

type ManagedWordFilterType added in v0.1.276

type ManagedWordFilterType string

The managed word type filter available for guardrails. Experimental.

const (
	// Experimental.
	ManagedWordFilterType_PROFANITY ManagedWordFilterType = "PROFANITY"
)

type Memory added in v0.1.295

type Memory interface {
}

Memory class for managing Bedrock Agent memory configurations.

Enables conversational context retention across multiple sessions through session identifiers. Memory context is stored with unique memory IDs per user, allowing access to conversation history and summaries. Supports viewing stored sessions and clearing memory. See: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-memory.html

Experimental.

func NewMemory added in v0.1.295

func NewMemory() Memory

Experimental.

type PIIFilter added in v0.1.276

type PIIFilter struct {
	// The action to take when PII is detected.
	// Experimental.
	Action GuardrailAction `field:"required" json:"action" yaml:"action"`
	// The type of PII to filter.
	// Experimental.
	Type interface{} `field:"required" json:"type" yaml:"type"`
}

Interface to define a PII Filter. Experimental.

type ParentActionGroupSignature added in v0.1.290

type ParentActionGroupSignature interface {
	// Experimental.
	Value() *string
	// Experimental.
	ToString() *string
}

AWS Defined signatures for enabling certain capabilities in your agent. Experimental.

func NewParentActionGroupSignature added in v0.1.290

func NewParentActionGroupSignature(value *string) ParentActionGroupSignature

Constructor should be used as a temporary solution when a new signature is supported but its implementation in CDK hasn't been added yet. Experimental.

func ParentActionGroupSignature_CODE_INTERPRETER added in v0.1.290

func ParentActionGroupSignature_CODE_INTERPRETER() ParentActionGroupSignature

func ParentActionGroupSignature_USER_INPUT added in v0.1.290

func ParentActionGroupSignature_USER_INPUT() ParentActionGroupSignature

type ParsingModality added in v0.1.292

type ParsingModality string

Experimental.

const (
	// Specifies whether to enable parsing of multimodal data, including both text and/or images.
	// Experimental.
	ParsingModality_MULTIMODAL ParsingModality = "MULTIMODAL"
)

type ParsingStategy added in v0.1.270

type ParsingStategy interface {
	// The CloudFormation property representation of this configuration.
	// Experimental.
	Configuration() *awsbedrock.CfnDataSource_ParsingConfigurationProperty
	// Experimental.
	SetConfiguration(val *awsbedrock.CfnDataSource_ParsingConfigurationProperty)
	// Experimental.
	GeneratePolicyStatements() *[]awsiam.PolicyStatement
}

Represents an advanced parsing strategy configuration for Knowledge Base ingestion. See: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-chunking-parsing.html#kb-advanced-parsing

Experimental.

func ParsingStategy_FoundationModel added in v0.1.270

func ParsingStategy_FoundationModel(props *FoundationModelParsingStategyProps) ParsingStategy

Creates a Foundation Model-based parsing strategy for extracting non-textual information from documents such as tables and charts.

- Additional costs apply when using advanced parsing due to foundation model usage. - There are limits on file types (PDF) and total data that can be parsed using advanced parsing. See: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-ds.html#kb-ds-supported-doc-formats-limits

Experimental.

type ParsingStategyType added in v0.1.292

type ParsingStategyType string

Enum representing the types of parsing strategies available for Amazon Bedrock Knowledge Bases. See: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-advanced-parsing.html

Experimental.

const (
	// Uses a Bedrock Foundation Model for advanced parsing of non-textual information from documents.
	// Experimental.
	ParsingStategyType_FOUNDATION_MODEL ParsingStategyType = "FOUNDATION_MODEL"
	// Processes multimodal data using Bedrock Data Automation (BDA).
	//
	// It leverages
	// generative AI to automate the transformation of multi-modal data into structured formats.
	// If you choose a foundation model or Amazon Bedrock Data Automation for parsing and it fails
	// to parse a file, the Amazon Bedrock default parser is used instead.
	// Experimental.
	ParsingStategyType_DATA_AUTOMATION ParsingStategyType = "DATA_AUTOMATION"
)

type Prompt added in v0.1.262

type Prompt interface {
	constructs.Construct
	IPrompt
	// The KMS key that the prompt is encrypted with.
	// Experimental.
	KmsKey() awskms.IKey
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// The ARN of the prompt.
	//
	// Example:
	//   "arn:aws:bedrock:us-east-1:123456789012:prompt/PROMPT12345"
	//
	// Experimental.
	PromptArn() *string
	// The ID of the prompt.
	//
	// Example:
	//   "PROMPT12345"
	//
	// Experimental.
	PromptId() *string
	// The name of the prompt.
	// Experimental.
	PromptName() *string
	// The version of the prompt.
	// Experimental.
	PromptVersion() *string
	// Experimental.
	SetPromptVersion(val *string)
	// The variants of the prompt.
	// Experimental.
	Variants() *[]PromptVariant
	// Adds a prompt variant.
	// Experimental.
	AddVariant(variant PromptVariant)
	// Creates a prompt version, a static snapshot of your prompt that can be deployed to production.
	// Experimental.
	CreateVersion(description *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Prompts are a specific set of inputs that guide FMs on Amazon Bedrock to generate an appropriate response or output for a given task or instruction.

You can optimize the prompt for specific use cases and models. See: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html

Experimental.

func NewPrompt added in v0.1.262

func NewPrompt(scope constructs.Construct, id *string, props *PromptProps) Prompt

Experimental.

type PromptAttributes added in v0.1.279

type PromptAttributes struct {
	// The ARN of the prompt.
	//
	// Example:
	//   "arn:aws:bedrock:us-east-1:123456789012:prompt/PROMPT12345"
	//
	// Experimental.
	PromptArn *string `field:"required" json:"promptArn" yaml:"promptArn"`
	// Optional KMS encryption key associated with this prompt.
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The version of the prompt.
	// Default: - "DRAFT".
	//
	// Experimental.
	PromptVersion *string `field:"optional" json:"promptVersion" yaml:"promptVersion"`
}

**************************************************************************** ATTRS FOR IMPORTED CONSTRUCT ***************************************************************************. Experimental.

type PromptBase added in v0.1.279

type PromptBase interface {
	awscdk.Resource
	IPrompt
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// Optional KMS encryption key associated with this prompt.
	// Experimental.
	KmsKey() awskms.IKey
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The ARN of the prompt.
	// Experimental.
	PromptArn() *string
	// The ID of the prompt.
	// Experimental.
	PromptId() *string
	// The version of the prompt.
	// Experimental.
	PromptVersion() *string
	// Experimental.
	SetPromptVersion(val *string)
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the given identity permissions to get the prompt.
	// Experimental.
	GrantGet(grantee awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Abstract base class for a Prompt.

Contains methods and attributes valid for Promtps either created with CDK or imported. Experimental.

type PromptOverrideConfiguration

type PromptOverrideConfiguration interface {
	// The custom Lambda parser function to use.
	//
	// The Lambda parser processes and interprets the raw foundation model output.
	// It receives an input event with:
	// - messageVersion: Version of message format (1.0)
	// - agent: Info about the agent (name, id, alias, version)
	// - invokeModelRawResponse: Raw model output to parse
	// - promptType: Type of prompt being parsed
	// - overrideType: Type of override (OUTPUT_PARSER)
	//
	// The Lambda must return a response that the agent uses for next actions.
	// See: https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html
	//
	// Experimental.
	Parser() awslambda.IFunction
	// The prompt configurations to override the prompt templates in the agent sequence.
	// Default: - No prompt configuration will be overridden.
	//
	// Experimental.
	Steps() *[]*PromptStepConfigurationCustomParser
}

Experimental.

func PromptOverrideConfiguration_FromSteps added in v0.1.290

func PromptOverrideConfiguration_FromSteps(steps *[]*PromptStepConfiguration) PromptOverrideConfiguration

Experimental.

func PromptOverrideConfiguration_WithCustomParser added in v0.1.290

func PromptOverrideConfiguration_WithCustomParser(props *CustomParserProps) PromptOverrideConfiguration

Creates a PromptOverrideConfiguration with a custom Lambda parser function. Experimental.

type PromptProps added in v0.1.262

type PromptProps struct {
	// The name of the prompt.
	// Experimental.
	PromptName *string `field:"required" json:"promptName" yaml:"promptName"`
	// The Prompt Variant that will be used by default.
	// Default: - No default variant provided.
	//
	// Experimental.
	DefaultVariant PromptVariant `field:"optional" json:"defaultVariant" yaml:"defaultVariant"`
	// A description of what the prompt does.
	// Default: - No description provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key that the prompt is encrypted with.
	// Default: - AWS owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The variants of your prompt.
	//
	// Variants can use different messages, models,
	// or configurations so that you can compare their outputs to decide the best
	// variant for your use case. Maximum of 3 variants.
	// Experimental.
	Variants *[]PromptVariant `field:"optional" json:"variants" yaml:"variants"`
}

**************************************************************************** PROPS FOR NEW CONSTRUCT ***************************************************************************. Experimental.

type PromptRouter added in v0.1.289

type PromptRouter interface {
	IInvokable
	IPromptRouter
	// The ARN of the Bedrock invokable abstraction.
	// Experimental.
	InvokableArn() *string
	// The ARN of the prompt router.
	// Experimental.
	PromptRouterArn() *string
	// The Id of the prompt router.
	// Experimental.
	PromptRouterId() *string
	// The foundation models / profiles this router will route to.
	// Experimental.
	RoutingEndpoints() *[]IInvokable
	// Gives the appropriate policies to invoke and use the invokable abstraction.
	// Experimental.
	GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
}

Experimental.

func NewPromptRouter added in v0.1.289

func NewPromptRouter(props *PromptRouterProps, region *string) PromptRouter

Experimental.

func PromptRouter_FromDefaultId added in v0.1.289

func PromptRouter_FromDefaultId(defaultRouter DefaultPromptRouterIdentifier, region *string) PromptRouter

Experimental.

type PromptRouterProps added in v0.1.289

type PromptRouterProps struct {
	// Prompt Router Id.
	// Experimental.
	PromptRouterId *string `field:"required" json:"promptRouterId" yaml:"promptRouterId"`
	// The foundation models this router will route to.
	// Experimental.
	RoutingModels *[]BedrockFoundationModel `field:"required" json:"routingModels" yaml:"routingModels"`
}

Experimental.

type PromptStepConfiguration added in v0.1.290

type PromptStepConfiguration struct {
	// The step in the agent sequence where to set a specific prompt configuration.
	// Experimental.
	StepType AgentStepType `field:"required" json:"stepType" yaml:"stepType"`
	// The custom prompt template to be used.
	// See: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html
	//
	// Default: - The default prompt template will be used.
	//
	// Experimental.
	CustomPromptTemplate *string `field:"optional" json:"customPromptTemplate" yaml:"customPromptTemplate"`
	// The inference configuration parameters to use.
	// Experimental.
	InferenceConfig *InferenceConfiguration `field:"optional" json:"inferenceConfig" yaml:"inferenceConfig"`
	// Whether to enable or skip this step in the agent sequence.
	// Default: - The default state for each step type is as follows.
	//
	// PRE_PROCESSING – ENABLED
	// ORCHESTRATION – ENABLED
	// KNOWLEDGE_BASE_RESPONSE_GENERATION – ENABLED
	// POST_PROCESSING – DISABLED.
	//
	// Experimental.
	StepEnabled *bool `field:"optional" json:"stepEnabled" yaml:"stepEnabled"`
}

Contains configurations to override a prompt template in one part of an agent sequence. Experimental.

type PromptStepConfigurationCustomParser added in v0.1.290

type PromptStepConfigurationCustomParser struct {
	// The step in the agent sequence where to set a specific prompt configuration.
	// Experimental.
	StepType AgentStepType `field:"required" json:"stepType" yaml:"stepType"`
	// The custom prompt template to be used.
	// See: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html
	//
	// Default: - The default prompt template will be used.
	//
	// Experimental.
	CustomPromptTemplate *string `field:"optional" json:"customPromptTemplate" yaml:"customPromptTemplate"`
	// The inference configuration parameters to use.
	// Experimental.
	InferenceConfig *InferenceConfiguration `field:"optional" json:"inferenceConfig" yaml:"inferenceConfig"`
	// Whether to enable or skip this step in the agent sequence.
	// Default: - The default state for each step type is as follows.
	//
	// PRE_PROCESSING – ENABLED
	// ORCHESTRATION – ENABLED
	// KNOWLEDGE_BASE_RESPONSE_GENERATION – ENABLED
	// POST_PROCESSING – DISABLED.
	//
	// Experimental.
	StepEnabled *bool `field:"optional" json:"stepEnabled" yaml:"stepEnabled"`
	// Whether to use the custom Lambda parser defined for the sequence.
	// Default: - false.
	//
	// Experimental.
	UseCustomParser *bool `field:"optional" json:"useCustomParser" yaml:"useCustomParser"`
}

Experimental.

type PromptTemplateType added in v0.1.262

type PromptTemplateType string

Experimental.

const (
	// Experimental.
	PromptTemplateType_TEXT PromptTemplateType = "TEXT"
	// Experimental.
	PromptTemplateType_CHAT PromptTemplateType = "CHAT"
)

type PromptVariant added in v0.1.262

type PromptVariant interface {
	// The template configuration.
	// Experimental.
	GenAiResource() *awsbedrock.CfnPrompt_PromptGenAiResourceProperty
	// Experimental.
	SetGenAiResource(val *awsbedrock.CfnPrompt_PromptGenAiResourceProperty)
	// The inference configuration.
	// Experimental.
	InferenceConfiguration() *awsbedrock.CfnPrompt_PromptInferenceConfigurationProperty
	// Experimental.
	SetInferenceConfiguration(val *awsbedrock.CfnPrompt_PromptInferenceConfigurationProperty)
	// The unique identifier of the model with which to run inference on the prompt.
	// Experimental.
	ModelId() *string
	// Experimental.
	SetModelId(val *string)
	// The name of the prompt variant.
	// Experimental.
	Name() *string
	// Experimental.
	SetName(val *string)
	// The template configuration.
	// Experimental.
	TemplateConfiguration() *awsbedrock.CfnPrompt_PromptTemplateConfigurationProperty
	// Experimental.
	SetTemplateConfiguration(val *awsbedrock.CfnPrompt_PromptTemplateConfigurationProperty)
	// The type of prompt template.
	// Experimental.
	TemplateType() PromptTemplateType
	// Experimental.
	SetTemplateType(val PromptTemplateType)
}

Variants are specific sets of inputs that guide FMs on Amazon Bedrock to generate an appropriate response or output for a given task or instruction.

You can optimize the prompt for specific use cases and models. Experimental.

func PromptVariant_Agent added in v0.1.289

func PromptVariant_Agent(props *AgentPromptVariantProps) PromptVariant

Static method to create an agent prompt template. Experimental.

func PromptVariant_Chat added in v0.1.289

func PromptVariant_Chat(props *ChatPromptVariantProps) PromptVariant

Static method to create a chat template.

Use this template type when the model supports the Converse API or the AnthropicClaude Messages API. This allows you to include a System prompt and previous User messages and Assistant messages for context. Experimental.

func PromptVariant_Text added in v0.1.262

func PromptVariant_Text(props *TextPromptVariantProps) PromptVariant

Static method to create a text template. Experimental.

type PromptVersion added in v0.1.262

type PromptVersion interface {
	constructs.Construct
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// The prompt used by this version.
	// Experimental.
	Prompt() Prompt
	// The version of the prompt that was created.
	// Experimental.
	Version() *string
	// The Amazon Resource Name (ARN) of the prompt version.
	//
	// Example:
	//   "arn:aws:bedrock:us-east-1:123456789012:prompt/PROMPT12345:1"
	//
	// Experimental.
	VersionArn() *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Creates a version of the prompt.

Use this to create a static snapshot of your prompt that can be deployed to production. Versions allow you to easily switch between different configurations for your prompt and update your application with the most appropriate version for your use-case. See: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html

Experimental.

func NewPromptVersion added in v0.1.262

func NewPromptVersion(scope constructs.Construct, id *string, props *PromptVersionProps) PromptVersion

Experimental.

type PromptVersionProps added in v0.1.262

type PromptVersionProps struct {
	// The prompt to use for this version.
	// Experimental.
	Prompt Prompt `field:"required" json:"prompt" yaml:"prompt"`
	// The description of the prompt version.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
}

Experimental.

type RegexFilter added in v0.1.276

type RegexFilter struct {
	// The action to take when a regex match is detected.
	// Experimental.
	Action GuardrailAction `field:"required" json:"action" yaml:"action"`
	// The name of the regex filter.
	// Experimental.
	Name *string `field:"required" json:"name" yaml:"name"`
	// The regular expression pattern to match.
	// Experimental.
	Pattern *string `field:"required" json:"pattern" yaml:"pattern"`
	// The description of the regex filter.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
}

A Regular expression (regex) filter for sensitive information.

Example:

const regexFilter: RegexFilter = {
  name: "my-custom-filter",
  action: SensitiveInfoGuardrailAction.BLOCK,
  pattern: "\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b",
};

Experimental.

type S3ApiSchema

type S3ApiSchema interface {
	ApiSchema
	// Experimental.
	InlineSchema() *string
	// Experimental.
	S3File() *awss3.Location
}

Class to define an API Schema from an S3 object. Experimental.

func ApiSchema_FromS3File added in v0.1.290

func ApiSchema_FromS3File(bucket awss3.IBucket, objectKey *string) S3ApiSchema

Creates an API Schema from an S3 File. Experimental.

func InlineApiSchema_FromS3File added in v0.1.290

func InlineApiSchema_FromS3File(bucket awss3.IBucket, objectKey *string) S3ApiSchema

Creates an API Schema from an S3 File. Experimental.

func NewS3ApiSchema

func NewS3ApiSchema(location *awss3.Location) S3ApiSchema

Experimental.

func S3ApiSchema_FromS3File added in v0.1.290

func S3ApiSchema_FromS3File(bucket awss3.IBucket, objectKey *string) S3ApiSchema

Creates an API Schema from an S3 File. Experimental.

type S3DataSource

type S3DataSource interface {
	DataSourceNew
	// The bucket associated with the data source.
	// Experimental.
	Bucket() awss3.IBucket
	// The unique identifier of the data source.
	//
	// Example:
	//   'JHUEVXUZMU'
	//
	// Experimental.
	DataSourceId() *string
	// The name of the data source.
	// Experimental.
	DataSourceName() *string
	// The type of data source.
	// Experimental.
	DataSourceType() DataSourceType
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The KMS key to use to encrypt the data source.
	// Experimental.
	KmsKey() awskms.IKey
	// The knowledge base associated with the data source.
	// Experimental.
	KnowledgeBase() IKnowledgeBase
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Formats the data source configuration properties for CloudFormation.
	// Experimental.
	FormatAsCfnProps(props *DataSourceAssociationProps, dataSourceConfiguration *awsbedrock.CfnDataSource_DataSourceConfigurationProperty) *awsbedrock.CfnDataSourceProps
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds appropriate permissions to the KB execution role needed by the data source.
	// Experimental.
	HandleCommonPermissions(props *DataSourceAssociationProps)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Sets up an S3 Data Source to be added to a knowledge base. Experimental.

func NewS3DataSource

func NewS3DataSource(scope constructs.Construct, id *string, props *S3DataSourceProps) S3DataSource

Experimental.

type S3DataSourceAssociationProps added in v0.1.270

type S3DataSourceAssociationProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The bucket that contains the data source.
	// Experimental.
	Bucket awss3.IBucket `field:"required" json:"bucket" yaml:"bucket"`
	// The prefixes of the objects in the bucket that should be included in the data source.
	// Default: - All objects in the bucket.
	//
	// Experimental.
	InclusionPrefixes *[]*string `field:"optional" json:"inclusionPrefixes" yaml:"inclusionPrefixes"`
}

Interface to add a new S3DataSource to an existing KB. Experimental.

type S3DataSourceProps

type S3DataSourceProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The bucket that contains the data source.
	// Experimental.
	Bucket awss3.IBucket `field:"required" json:"bucket" yaml:"bucket"`
	// The prefixes of the objects in the bucket that should be included in the data source.
	// Default: - All objects in the bucket.
	//
	// Experimental.
	InclusionPrefixes *[]*string `field:"optional" json:"inclusionPrefixes" yaml:"inclusionPrefixes"`
	// The knowledge base to associate with the data source.
	// Experimental.
	KnowledgeBase IKnowledgeBase `field:"required" json:"knowledgeBase" yaml:"knowledgeBase"`
}

Interface to create a new S3 Data Source object. Experimental.

type SalesforceCrawlingFilters added in v0.1.270

type SalesforceCrawlingFilters struct {
	// The Salesforce object type to which this filter applies.
	// Experimental.
	ObjectType SalesforceObjectType `field:"required" json:"objectType" yaml:"objectType"`
	// Regular expression patterns to exclude specific content.
	// Experimental.
	ExcludePatterns *[]*string `field:"optional" json:"excludePatterns" yaml:"excludePatterns"`
	// Regular expression patterns to include specific content.
	// Experimental.
	IncludePatterns *[]*string `field:"optional" json:"includePatterns" yaml:"includePatterns"`
}

Defines the crawling filters for Salesforce data ingestion. Experimental.

type SalesforceDataSource added in v0.1.270

type SalesforceDataSource interface {
	DataSourceNew
	// The AWS Secrets Manager secret that stores your authentication credentials.
	// Experimental.
	AuthSecret() awssecretsmanager.ISecret
	// The unique identifier of the data source.
	//
	// Example:
	//   'JHUEVXUZMU'
	//
	// Experimental.
	DataSourceId() *string
	// The name of the data source.
	// Experimental.
	DataSourceName() *string
	// The type of data source.
	// Experimental.
	DataSourceType() DataSourceType
	// The Salesforce host URL or instance URL.
	// Experimental.
	Endpoint() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The KMS key to use to encrypt the data source.
	// Experimental.
	KmsKey() awskms.IKey
	// The knowledge base associated with the data source.
	// Experimental.
	KnowledgeBase() IKnowledgeBase
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Formats the data source configuration properties for CloudFormation.
	// Experimental.
	FormatAsCfnProps(props *DataSourceAssociationProps, dataSourceConfiguration *awsbedrock.CfnDataSource_DataSourceConfigurationProperty) *awsbedrock.CfnDataSourceProps
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds appropriate permissions to the KB execution role needed by the data source.
	// Experimental.
	HandleCommonPermissions(props *DataSourceAssociationProps)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Sets up an data source to be added to a knowledge base. Experimental.

func NewSalesforceDataSource added in v0.1.270

func NewSalesforceDataSource(scope constructs.Construct, id *string, props *SalesforceDataSourceProps) SalesforceDataSource

Experimental.

type SalesforceDataSourceAssociationProps added in v0.1.270

type SalesforceDataSourceAssociationProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The AWS Secrets Manager secret that stores your authentication credentials for your Salesforce instance URL.
	//
	// Secret must start with "AmazonBedrock-".
	// Experimental.
	AuthSecret awssecretsmanager.ISecret `field:"required" json:"authSecret" yaml:"authSecret"`
	// The Salesforce host URL or instance URL.
	//
	// Example:
	//   "https://company.salesforce.com/"
	//
	// Experimental.
	Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"`
	// The filters (regular expression patterns) for the crawling.
	//
	// If there's a conflict, the exclude pattern takes precedence.
	// Default: None - all your content is crawled.
	//
	// Experimental.
	Filters *[]*SalesforceCrawlingFilters `field:"optional" json:"filters" yaml:"filters"`
}

Interface to add a new data source to an existing KB. Experimental.

type SalesforceDataSourceAuthType added in v0.1.270

type SalesforceDataSourceAuthType string

Represents the authentication types available for connecting to a Salesforce data source. Experimental.

const (
	// Your secret authentication credentials in AWS Secrets Manager should include: - `consumerKey` (app client ID) - `consumerSecret` (client secret) - `authenticationUrl`.
	// Experimental.
	SalesforceDataSourceAuthType_OAUTH2_CLIENT_CREDENTIALS SalesforceDataSourceAuthType = "OAUTH2_CLIENT_CREDENTIALS"
)

type SalesforceDataSourceProps added in v0.1.270

type SalesforceDataSourceProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The AWS Secrets Manager secret that stores your authentication credentials for your Salesforce instance URL.
	//
	// Secret must start with "AmazonBedrock-".
	// Experimental.
	AuthSecret awssecretsmanager.ISecret `field:"required" json:"authSecret" yaml:"authSecret"`
	// The Salesforce host URL or instance URL.
	//
	// Example:
	//   "https://company.salesforce.com/"
	//
	// Experimental.
	Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"`
	// The filters (regular expression patterns) for the crawling.
	//
	// If there's a conflict, the exclude pattern takes precedence.
	// Default: None - all your content is crawled.
	//
	// Experimental.
	Filters *[]*SalesforceCrawlingFilters `field:"optional" json:"filters" yaml:"filters"`
	// The knowledge base to associate with the data source.
	// Experimental.
	KnowledgeBase IKnowledgeBase `field:"required" json:"knowledgeBase" yaml:"knowledgeBase"`
}

Interface to create a new standalone data source object. Experimental.

type SalesforceObjectType added in v0.1.270

type SalesforceObjectType string

Represents the Salesforce object types that can be accessed by the data source connector. Experimental.

const (
	// Experimental.
	SalesforceObjectType_ACCOUNT SalesforceObjectType = "ACCOUNT"
	// Experimental.
	SalesforceObjectType_ATTACHMENT SalesforceObjectType = "ATTACHMENT"
	// Experimental.
	SalesforceObjectType_CAMPAIGN SalesforceObjectType = "CAMPAIGN"
	// Experimental.
	SalesforceObjectType_CONTENT_VERSION SalesforceObjectType = "CONTENT_VERSION"
	// Experimental.
	SalesforceObjectType_PARTNER SalesforceObjectType = "PARTNER"
	// Experimental.
	SalesforceObjectType_PRICEBOOK_2 SalesforceObjectType = "PRICEBOOK_2"
	// Experimental.
	SalesforceObjectType_CASE SalesforceObjectType = "CASE"
	// Experimental.
	SalesforceObjectType_CONTACT SalesforceObjectType = "CONTACT"
	// Experimental.
	SalesforceObjectType_CONTRACT SalesforceObjectType = "CONTRACT"
	// Experimental.
	SalesforceObjectType_DOCUMENT SalesforceObjectType = "DOCUMENT"
	// Experimental.
	SalesforceObjectType_IDEA SalesforceObjectType = "IDEA"
	// Experimental.
	SalesforceObjectType_LEAD SalesforceObjectType = "LEAD"
	// Experimental.
	SalesforceObjectType_OPPORTUNITY SalesforceObjectType = "OPPORTUNITY"
	// Experimental.
	SalesforceObjectType_PRODUCT_2 SalesforceObjectType = "PRODUCT_2"
	// Experimental.
	SalesforceObjectType_SOLUTION SalesforceObjectType = "SOLUTION"
	// Experimental.
	SalesforceObjectType_TASK SalesforceObjectType = "TASK"
	// Experimental.
	SalesforceObjectType_FEED_ITEM SalesforceObjectType = "FEED_ITEM"
	// Experimental.
	SalesforceObjectType_FEED_COMMENT SalesforceObjectType = "FEED_COMMENT"
	// Experimental.
	SalesforceObjectType_KNOWLEDGE_KAV SalesforceObjectType = "KNOWLEDGE_KAV"
	// Experimental.
	SalesforceObjectType_USER SalesforceObjectType = "USER"
	// Experimental.
	SalesforceObjectType_COLLABORATION_GROUP SalesforceObjectType = "COLLABORATION_GROUP"
)

type SessionSummaryMemoryProps added in v0.1.295

type SessionSummaryMemoryProps struct {
	// Maximum number of recent session summaries to include (min 1).
	// Default: 20.
	//
	// Experimental.
	MaxRecentSessions *float64 `field:"optional" json:"maxRecentSessions" yaml:"maxRecentSessions"`
	// Duration in days for which session summaries are retained (1-365).
	// Default: 30.
	//
	// Experimental.
	MemoryDurationDays *float64 `field:"optional" json:"memoryDurationDays" yaml:"memoryDurationDays"`
}

Experimental.

type SharePointCrawlingFilters added in v0.1.270

type SharePointCrawlingFilters struct {
	// The SharePoint object type this filter applies to.
	// Experimental.
	ObjectType SharePointObjectType `field:"required" json:"objectType" yaml:"objectType"`
	// Optional array of regular expression patterns to exclude specific content.
	//
	// Content matching these patterns will be skipped during crawling.
	//
	// Example:
	//   ['.*private.*', '.*confidential.*']
	//
	// Experimental.
	ExcludePatterns *[]*string `field:"optional" json:"excludePatterns" yaml:"excludePatterns"`
	// Optional array of regular expression patterns to include specific content.
	//
	// Only content matching these patterns will be crawled.
	//
	// Example:
	//   ['.*public.*', '.*shared.*']
	//
	// Experimental.
	IncludePatterns *[]*string `field:"optional" json:"includePatterns" yaml:"includePatterns"`
}

Defines the crawling filters for SharePoint data ingestion.

These filters allow you to specify which content should be included or excluded during the crawling process. If you specify an inclusion and exclusion filter and both match a document, the exclusion filter takes precedence and the document isn’t crawled. Experimental.

type SharePointDataSource added in v0.1.270

type SharePointDataSource interface {
	DataSourceNew
	// The AWS Secrets Manager secret that stores your authentication credentials.
	// Experimental.
	AuthSecret() awssecretsmanager.ISecret
	// The unique identifier of the data source.
	//
	// Example:
	//   'JHUEVXUZMU'
	//
	// Experimental.
	DataSourceId() *string
	// The name of the data source.
	// Experimental.
	DataSourceName() *string
	// The type of data source.
	// Experimental.
	DataSourceType() DataSourceType
	// The domain name of your SharePoint instance.
	// Experimental.
	Domain() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The KMS key to use to encrypt the data source.
	// Experimental.
	KmsKey() awskms.IKey
	// The knowledge base associated with the data source.
	// Experimental.
	KnowledgeBase() IKnowledgeBase
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The SharePoint site URL/URLs.
	// Experimental.
	SiteUrls() *[]*string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Formats the data source configuration properties for CloudFormation.
	// Experimental.
	FormatAsCfnProps(props *DataSourceAssociationProps, dataSourceConfiguration *awsbedrock.CfnDataSource_DataSourceConfigurationProperty) *awsbedrock.CfnDataSourceProps
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds appropriate permissions to the KB execution role needed by the data source.
	// Experimental.
	HandleCommonPermissions(props *DataSourceAssociationProps)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Sets up an data source to be added to a knowledge base. Experimental.

func NewSharePointDataSource added in v0.1.270

func NewSharePointDataSource(scope constructs.Construct, id *string, props *SharePointDataSourceProps) SharePointDataSource

Experimental.

type SharePointDataSourceAssociationProps added in v0.1.270

type SharePointDataSourceAssociationProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The AWS Secrets Manager secret that stores your authentication credentials for your Sharepoint instance URL.
	//
	// Secret must start with "AmazonBedrock-".
	// Experimental.
	AuthSecret awssecretsmanager.ISecret `field:"required" json:"authSecret" yaml:"authSecret"`
	// The domain of your SharePoint instance or site URL/URLs.
	//
	// Example:
	//   "yourdomain"
	//
	// Experimental.
	Domain *string `field:"required" json:"domain" yaml:"domain"`
	// The SharePoint site URL/URLs.
	//
	// Must start with “https”. All URLs must start with same protocol.
	//
	// Example:
	//   ["https://yourdomain.sharepoint.com/sites/mysite"]
	//
	// Experimental.
	SiteUrls *[]*string `field:"required" json:"siteUrls" yaml:"siteUrls"`
	// The identifier of your Microsoft 365 tenant.
	//
	// Example:
	//   "d1c035a6-1dcf-457d-97e3"
	//
	// Experimental.
	TenantId *string `field:"required" json:"tenantId" yaml:"tenantId"`
	// The filters (regular expression patterns) for the crawling.
	//
	// If there's a conflict, the exclude pattern takes precedence.
	// Default: None - all your content is crawled.
	//
	// Experimental.
	Filters *[]*SharePointCrawlingFilters `field:"optional" json:"filters" yaml:"filters"`
}

Interface to add a new data source to an existing KB. Experimental.

type SharePointDataSourceAuthType added in v0.1.270

type SharePointDataSourceAuthType string

Represents the authentication types available for connecting to a SharePoint data source. Experimental.

const (
	// OAuth 2.0 Client Credentials flow for authentication with SharePoint. Your secret authentication credentials in AWS Secrets Manager should include: - `username`: The admin username for SharePoint authentication - `password`: The admin password associated with the username - `clientId`: The client ID (also known as application ID) - `clientSecret`: The client secret.
	// Experimental.
	SharePointDataSourceAuthType_OAUTH2_CLIENT_CREDENTIALS SharePointDataSourceAuthType = "OAUTH2_CLIENT_CREDENTIALS"
)

type SharePointDataSourceProps added in v0.1.270

type SharePointDataSourceProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The AWS Secrets Manager secret that stores your authentication credentials for your Sharepoint instance URL.
	//
	// Secret must start with "AmazonBedrock-".
	// Experimental.
	AuthSecret awssecretsmanager.ISecret `field:"required" json:"authSecret" yaml:"authSecret"`
	// The domain of your SharePoint instance or site URL/URLs.
	//
	// Example:
	//   "yourdomain"
	//
	// Experimental.
	Domain *string `field:"required" json:"domain" yaml:"domain"`
	// The SharePoint site URL/URLs.
	//
	// Must start with “https”. All URLs must start with same protocol.
	//
	// Example:
	//   ["https://yourdomain.sharepoint.com/sites/mysite"]
	//
	// Experimental.
	SiteUrls *[]*string `field:"required" json:"siteUrls" yaml:"siteUrls"`
	// The identifier of your Microsoft 365 tenant.
	//
	// Example:
	//   "d1c035a6-1dcf-457d-97e3"
	//
	// Experimental.
	TenantId *string `field:"required" json:"tenantId" yaml:"tenantId"`
	// The filters (regular expression patterns) for the crawling.
	//
	// If there's a conflict, the exclude pattern takes precedence.
	// Default: None - all your content is crawled.
	//
	// Experimental.
	Filters *[]*SharePointCrawlingFilters `field:"optional" json:"filters" yaml:"filters"`
	// The knowledge base to associate with the data source.
	// Experimental.
	KnowledgeBase IKnowledgeBase `field:"required" json:"knowledgeBase" yaml:"knowledgeBase"`
}

Interface to create a new standalone data source object. Experimental.

type SharePointObjectType added in v0.1.270

type SharePointObjectType string

Represents the SharePoint object types that can be accessed by the data source connector. Experimental.

const (
	// Represents a SharePoint page, which typically contains web parts and content.
	// Experimental.
	SharePointObjectType_PAGE SharePointObjectType = "PAGE"
	// Represents a calendar event in SharePoint.
	// Experimental.
	SharePointObjectType_EVENT SharePointObjectType = "EVENT"
	// Represents a file stored in SharePoint document libraries.
	// Experimental.
	SharePointObjectType_FILE SharePointObjectType = "FILE"
)

type TextPromptVariantProps added in v0.1.262

type TextPromptVariantProps struct {
	// The model which is used to run the prompt.
	//
	// The model could be a foundation
	// model, a custom model, or a provisioned model.
	// Experimental.
	Model IInvokable `field:"required" json:"model" yaml:"model"`
	// The name of the prompt variant.
	// Experimental.
	VariantName *string `field:"required" json:"variantName" yaml:"variantName"`
	// The variables in the prompt template that can be filled in at runtime.
	// Experimental.
	PromptVariables *[]*string `field:"optional" json:"promptVariables" yaml:"promptVariables"`
	// The text prompt.
	//
	// Variables are used by enclosing its name with double curly braces
	// as in `{{variable_name}}`.
	// Experimental.
	PromptText *string `field:"required" json:"promptText" yaml:"promptText"`
	// Inference configuration for the Text Prompt.
	// Experimental.
	InferenceConfiguration *awsbedrock.CfnPrompt_PromptModelInferenceConfigurationProperty `field:"optional" json:"inferenceConfiguration" yaml:"inferenceConfiguration"`
}

Experimental.

type ToolChoice added in v0.1.289

type ToolChoice interface {
	// Experimental.
	Any() interface{}
	// Experimental.
	Auto() interface{}
	// Experimental.
	Tool() *string
}

Experimental.

func NewToolChoice added in v0.1.289

func NewToolChoice(any interface{}, auto interface{}, tool *string) ToolChoice

Experimental.

func ToolChoice_ANY added in v0.1.289

func ToolChoice_ANY() ToolChoice

func ToolChoice_AUTO added in v0.1.289

func ToolChoice_AUTO() ToolChoice

func ToolChoice_SpecificTool added in v0.1.289

func ToolChoice_SpecificTool(toolName *string) ToolChoice

The Model must request the specified tool.

Only supported by some models like Anthropic Claude 3 models. Experimental.

type ToolConfiguration added in v0.1.289

type ToolConfiguration struct {
	// Experimental.
	ToolChoice ToolChoice `field:"required" json:"toolChoice" yaml:"toolChoice"`
	// Experimental.
	Tools *[]*awsbedrock.CfnPrompt_ToolProperty `field:"required" json:"tools" yaml:"tools"`
}

Experimental.

type Topic

type Topic interface {
	// Definition of the topic.
	// Experimental.
	Definition() *string
	// Representative phrases that refer to the topic.
	// Experimental.
	Examples() *[]*string
	// The name of the topic to deny.
	// Experimental.
	Name() *string
}

Defines a topic to deny. Experimental.

func NewTopic

func NewTopic(props *CustomTopicProps) Topic

Experimental.

func Topic_Custom added in v0.1.276

func Topic_Custom(props *CustomTopicProps) Topic

Experimental.

func Topic_FINANCIAL_ADVICE added in v0.1.276

func Topic_FINANCIAL_ADVICE() Topic

func Topic_INAPPROPRIATE_CONTENT added in v0.1.293

func Topic_INAPPROPRIATE_CONTENT() Topic
func Topic_LEGAL_ADVICE() Topic

func Topic_MEDICAL_ADVICE added in v0.1.276

func Topic_MEDICAL_ADVICE() Topic

func Topic_POLITICAL_ADVICE added in v0.1.276

func Topic_POLITICAL_ADVICE() Topic

type TransformationStep added in v0.1.270

type TransformationStep string

Defines the step in the ingestion process where the custom transformation is applied. Experimental.

const (
	// Processes documents after they have been converted into chunks.
	//
	// This allows for custom chunk-level metadata addition or custom post-chunking logic.
	// Experimental.
	TransformationStep_POST_CHUNKING TransformationStep = "POST_CHUNKING"
)

type VectorKnowledgeBase added in v0.1.292

type VectorKnowledgeBase interface {
	KnowledgeBaseBase
	IVectorKnowledgeBase
	// A description of the knowledge base.
	// Experimental.
	Description() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// Instructions for agents based on the design and type of information of the Knowledge Base.
	//
	// This will impact how Agents interact with the Knowledge Base.
	// Experimental.
	Instruction() *string
	// The ARN of the knowledge base.
	// Experimental.
	KnowledgeBaseArn() *string
	// The ID of the knowledge base.
	// Experimental.
	KnowledgeBaseId() *string
	// Instance of knowledge base.
	// Experimental.
	KnowledgeBaseInstance() awsbedrock.CfnKnowledgeBase
	// The name of the knowledge base.
	// Experimental.
	Name() *string
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The role the Knowledge Base uses to access the vector store and data source.
	// Experimental.
	Role() awsiam.IRole
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The type of knowledge base.
	// Experimental.
	Type() KnowledgeBaseType
	// The vector store for the knowledge base.
	// Experimental.
	VectorStore() interface{}
	// Add a Confluence data source to the knowledge base.
	// Experimental.
	AddConfluenceDataSource(props *ConfluenceDataSourceAssociationProps) ConfluenceDataSource
	// Add an S3 data source to the knowledge base.
	// Experimental.
	AddS3DataSource(props *S3DataSourceAssociationProps) S3DataSource
	// Add a Salesforce data source to the knowledge base.
	// Experimental.
	AddSalesforceDataSource(props *SalesforceDataSourceAssociationProps) SalesforceDataSource
	// Add a SharePoint data source to the knowledge base.
	// Experimental.
	AddSharePointDataSource(props *SharePointDataSourceAssociationProps) SharePointDataSource
	// Add a web crawler data source to the knowledge base.
	// Experimental.
	AddWebCrawlerDataSource(props *WebCrawlerDataSourceAssociationProps) WebCrawlerDataSource
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Associate knowledge base with an agent.
	// Experimental.
	AssociateToAgent(agent Agent)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the given principal identity permissions to perform actions on this knowledge base.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant the given identity permissions to query the knowledge base.
	//
	// This contains:
	// - Retrieve
	// - RetrieveAndGenerate.
	// Experimental.
	GrantQuery(grantee awsiam.IGrantable) awsiam.Grant
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieve(grantee awsiam.IGrantable) awsiam.Grant
	// Grant the given identity permissions to retrieve content from the knowledge base.
	// Experimental.
	GrantRetrieveAndGenerate(grantee awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Deploys a Bedrock Knowledge Base and configures a backend by OpenSearch Serverless, Pinecone, Redis Enterprise Cloud or Amazon Aurora PostgreSQL. Experimental.

func NewVectorKnowledgeBase added in v0.1.292

func NewVectorKnowledgeBase(scope constructs.Construct, id *string, props *VectorKnowledgeBaseProps) VectorKnowledgeBase

Experimental.

type VectorKnowledgeBaseAttributes added in v0.1.292

type VectorKnowledgeBaseAttributes struct {
	// The Service Execution Role associated with the knowledge base.
	//
	// Example:
	//   "arn:aws:iam::123456789012:role/AmazonBedrockExecutionRoleForKnowledgeBaseawscdkbdgeBaseKB12345678"
	//
	// Experimental.
	ExecutionRoleArn *string `field:"required" json:"executionRoleArn" yaml:"executionRoleArn"`
	// The ID of the knowledge base.
	//
	// Example:
	//   "KB12345678"
	//
	// Experimental.
	KnowledgeBaseId *string `field:"required" json:"knowledgeBaseId" yaml:"knowledgeBaseId"`
	// The description of the knowledge base.
	// Default: - No description provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Instructions for agents based on the design and type of information of the Knowledge Base.
	//
	// This will impact how Agents interact with the Knowledge Base.
	// Default: - No description provided.
	//
	// Experimental.
	Instruction *string `field:"optional" json:"instruction" yaml:"instruction"`
	// Specifies whether to use the knowledge base or not when sending an InvokeAgent request.
	// Default: - ENABLED.
	//
	// Experimental.
	KnowledgeBaseState *string `field:"optional" json:"knowledgeBaseState" yaml:"knowledgeBaseState"`
}

Properties for importing a knowledge base outside of this stack. Experimental.

type VectorKnowledgeBaseProps added in v0.1.292

type VectorKnowledgeBaseProps struct {
	// The description of the knowledge base.
	// Default: - No description provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Existing IAM role with policy statements granting appropriate permissions to invoke the specific embeddings models.
	//
	// 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.
	// Experimental.
	ExistingRole awsiam.IRole `field:"optional" json:"existingRole" yaml:"existingRole"`
	// 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.
	//
	// Experimental.
	Instruction *string `field:"optional" json:"instruction" yaml:"instruction"`
	// The name of the knowledge base.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The embeddings model for the knowledge base.
	// Experimental.
	EmbeddingsModel BedrockFoundationModel `field:"required" json:"embeddingsModel" yaml:"embeddingsModel"`
	// 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'.
	//
	// Experimental.
	IndexName *string `field:"optional" json:"indexName" yaml:"indexName"`
	// 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'.
	//
	// Experimental.
	VectorField *string `field:"optional" json:"vectorField" yaml:"vectorField"`
	// 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.
	//
	// Experimental.
	VectorIndex opensearchvectorindex.VectorIndex `field:"optional" json:"vectorIndex" yaml:"vectorIndex"`
	// The vector store for the knowledge base.
	//
	// Must be either of
	// type `VectorCollection`, `RedisEnterpriseVectorStore`,
	// `PineconeVectorStore` or `AmazonAuroraVectorStore`.
	// Default: - A new OpenSearch Serverless vector collection is created.
	//
	// Experimental.
	VectorStore interface{} `field:"optional" json:"vectorStore" yaml:"vectorStore"`
	// The vector type to store vector embeddings.
	// Default: - VectorType.FLOATING_POINT
	//
	// Experimental.
	VectorType VectorType `field:"optional" json:"vectorType" yaml:"vectorType"`
}

Properties for a knowledge base. Experimental.

type VectorType added in v0.1.293

type VectorType string

The data type for the vectors when using a model to convert text into vector embeddings.

The model must support the specified data type for vector embeddings. Floating-point (float32) is the default data type, and is supported by most models for vector embeddings. See Supported embeddings models for information on the available models and their vector data types. Experimental.

const (
	// `FLOATING_POINT` convert the data to floating-point (float32) vector embeddings (more precise, but more costly).
	// Experimental.
	VectorType_FLOATING_POINT VectorType = "FLOATING_POINT"
	// `BINARY` convert the data to binary vector embeddings (less precise, but less costly).
	// Experimental.
	VectorType_BINARY VectorType = "BINARY"
)

type WebCrawlerDataSource added in v0.1.270

type WebCrawlerDataSource interface {
	DataSourceNew
	// The max rate at which pages are crawled.
	// Experimental.
	CrawlingRate() *float64
	// The unique identifier of the data source.
	//
	// Example:
	//   'JHUEVXUZMU'
	//
	// Experimental.
	DataSourceId() *string
	// The name of the data source.
	// Experimental.
	DataSourceName() *string
	// The type of data source.
	// Experimental.
	DataSourceType() DataSourceType
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The KMS key to use to encrypt the data source.
	// Experimental.
	KmsKey() awskms.IKey
	// The knowledge base associated with the data source.
	// Experimental.
	KnowledgeBase() IKnowledgeBase
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The max rate at which pages are crawled.
	// Experimental.
	SiteUrls() *[]*string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Formats the data source configuration properties for CloudFormation.
	// Experimental.
	FormatAsCfnProps(props *DataSourceAssociationProps, dataSourceConfiguration *awsbedrock.CfnDataSource_DataSourceConfigurationProperty) *awsbedrock.CfnDataSourceProps
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds appropriate permissions to the KB execution role needed by the data source.
	// Experimental.
	HandleCommonPermissions(props *DataSourceAssociationProps)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Sets up a web crawler data source to be added to a knowledge base. Experimental.

func NewWebCrawlerDataSource added in v0.1.270

func NewWebCrawlerDataSource(scope constructs.Construct, id *string, props *WebCrawlerDataSourceProps) WebCrawlerDataSource

Experimental.

type WebCrawlerDataSourceAssociationProps added in v0.1.270

type WebCrawlerDataSourceAssociationProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The source urls in the format `https://www.sitename.com`. Maximum of 100 URLs.
	// Experimental.
	SourceUrls *[]*string `field:"required" json:"sourceUrls" yaml:"sourceUrls"`
	// The max rate at which pages are crawled, up to 300 per minute per host.
	//
	// Higher values will decrease sync time but increase the load on the host.
	// Default: 300.
	//
	// Experimental.
	CrawlingRate *float64 `field:"optional" json:"crawlingRate" yaml:"crawlingRate"`
	// The scope of the crawling.
	// Default: - CrawlingScope.DEFAULT
	//
	// Experimental.
	CrawlingScope CrawlingScope `field:"optional" json:"crawlingScope" yaml:"crawlingScope"`
	// The filters (regular expression patterns) for the crawling.
	//
	// If there's a conflict, the exclude pattern takes precedence.
	// Default: None.
	//
	// Experimental.
	Filters *CrawlingFilters `field:"optional" json:"filters" yaml:"filters"`
}

Interface to add a new data source to an existing KB. Experimental.

type WebCrawlerDataSourceProps added in v0.1.270

type WebCrawlerDataSourceProps struct {
	// The chunking stategy to use for splitting your documents or content.
	//
	// The chunks are then converted to embeddings and written to the vector
	// index allowing for similarity search and retrieval of the content.
	// Default: ChunkingStrategy.DEFAULT
	//
	// Experimental.
	ChunkingStrategy ChunkingStrategy `field:"optional" json:"chunkingStrategy" yaml:"chunkingStrategy"`
	// The custom transformation strategy to use.
	// Default: - No custom transformation is used.
	//
	// Experimental.
	CustomTransformation CustomTransformation `field:"optional" json:"customTransformation" yaml:"customTransformation"`
	// The data deletion policy to apply to the data source.
	// Default: - Sets the data deletion policy to the default of the data source type.
	//
	// Experimental.
	DataDeletionPolicy DataDeletionPolicy `field:"optional" json:"dataDeletionPolicy" yaml:"dataDeletionPolicy"`
	// The name of the data source.
	// Default: - A new name will be generated.
	//
	// Experimental.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// A description of the data source.
	// Default: - No description is provided.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The KMS key to use to encrypt the data source.
	// Default: - Service owned and managed key.
	//
	// Experimental.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The parsing strategy to use.
	// Default: - No Parsing Stategy is used.
	//
	// Experimental.
	ParsingStrategy ParsingStategy `field:"optional" json:"parsingStrategy" yaml:"parsingStrategy"`
	// The source urls in the format `https://www.sitename.com`. Maximum of 100 URLs.
	// Experimental.
	SourceUrls *[]*string `field:"required" json:"sourceUrls" yaml:"sourceUrls"`
	// The max rate at which pages are crawled, up to 300 per minute per host.
	//
	// Higher values will decrease sync time but increase the load on the host.
	// Default: 300.
	//
	// Experimental.
	CrawlingRate *float64 `field:"optional" json:"crawlingRate" yaml:"crawlingRate"`
	// The scope of the crawling.
	// Default: - CrawlingScope.DEFAULT
	//
	// Experimental.
	CrawlingScope CrawlingScope `field:"optional" json:"crawlingScope" yaml:"crawlingScope"`
	// The filters (regular expression patterns) for the crawling.
	//
	// If there's a conflict, the exclude pattern takes precedence.
	// Default: None.
	//
	// Experimental.
	Filters *CrawlingFilters `field:"optional" json:"filters" yaml:"filters"`
	// The knowledge base to associate with the data source.
	// Experimental.
	KnowledgeBase IKnowledgeBase `field:"required" json:"knowledgeBase" yaml:"knowledgeBase"`
}

Interface to create a new standalone data source object. Experimental.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL