appmod-catalog-blueprints 1.6.0__py3-none-any.whl → 1.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- appmod_catalog_blueprints/__init__.py +1895 -35
- appmod_catalog_blueprints/_jsii/__init__.py +2 -2
- appmod_catalog_blueprints/_jsii/cdk-appmod-catalog-blueprints@1.7.0.jsii.tgz +0 -0
- {appmod_catalog_blueprints-1.6.0.dist-info → appmod_catalog_blueprints-1.7.0.dist-info}/METADATA +1 -1
- appmod_catalog_blueprints-1.7.0.dist-info/RECORD +9 -0
- appmod_catalog_blueprints/_jsii/cdk-appmod-catalog-blueprints@1.6.0.jsii.tgz +0 -0
- appmod_catalog_blueprints-1.6.0.dist-info/RECORD +0 -9
- {appmod_catalog_blueprints-1.6.0.dist-info → appmod_catalog_blueprints-1.7.0.dist-info}/LICENSE +0 -0
- {appmod_catalog_blueprints-1.6.0.dist-info → appmod_catalog_blueprints-1.7.0.dist-info}/WHEEL +0 -0
- {appmod_catalog_blueprints-1.6.0.dist-info → appmod_catalog_blueprints-1.7.0.dist-info}/top_level.txt +0 -0
|
@@ -417,6 +417,80 @@ class AccessLogProps:
|
|
|
417
417
|
)
|
|
418
418
|
|
|
419
419
|
|
|
420
|
+
@jsii.data_type(
|
|
421
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.AclConfiguration",
|
|
422
|
+
jsii_struct_bases=[],
|
|
423
|
+
name_mapping={"enabled": "enabled", "metadata_field": "metadataField"},
|
|
424
|
+
)
|
|
425
|
+
class AclConfiguration:
|
|
426
|
+
def __init__(
|
|
427
|
+
self,
|
|
428
|
+
*,
|
|
429
|
+
enabled: builtins.bool,
|
|
430
|
+
metadata_field: typing.Optional[builtins.str] = None,
|
|
431
|
+
) -> None:
|
|
432
|
+
'''(experimental) Configuration for Access Control List (ACL) based filtering.
|
|
433
|
+
|
|
434
|
+
When enabled, retrieval queries will be filtered based on user identity
|
|
435
|
+
context, ensuring users only retrieve documents they have permission to access.
|
|
436
|
+
|
|
437
|
+
:param enabled: (experimental) Enable ACL-based filtering for retrieval queries. When true, the retrieval tool will require user context and apply metadata filters based on user permissions. Default: false
|
|
438
|
+
:param metadata_field: (experimental) Metadata field containing access permissions. This field in the document metadata should contain the group or permission identifier that controls access. The retrieval tool will filter results where this field matches the user's permissions. Default: 'group'
|
|
439
|
+
|
|
440
|
+
:stability: experimental
|
|
441
|
+
'''
|
|
442
|
+
if __debug__:
|
|
443
|
+
type_hints = typing.get_type_hints(_typecheckingstub__899807b7dca2d7be5f310df5984cd7a0c5fe3c612a8995f0927c15acbec703da)
|
|
444
|
+
check_type(argname="argument enabled", value=enabled, expected_type=type_hints["enabled"])
|
|
445
|
+
check_type(argname="argument metadata_field", value=metadata_field, expected_type=type_hints["metadata_field"])
|
|
446
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
447
|
+
"enabled": enabled,
|
|
448
|
+
}
|
|
449
|
+
if metadata_field is not None:
|
|
450
|
+
self._values["metadata_field"] = metadata_field
|
|
451
|
+
|
|
452
|
+
@builtins.property
|
|
453
|
+
def enabled(self) -> builtins.bool:
|
|
454
|
+
'''(experimental) Enable ACL-based filtering for retrieval queries.
|
|
455
|
+
|
|
456
|
+
When true, the retrieval tool will require user context and apply
|
|
457
|
+
metadata filters based on user permissions.
|
|
458
|
+
|
|
459
|
+
:default: false
|
|
460
|
+
|
|
461
|
+
:stability: experimental
|
|
462
|
+
'''
|
|
463
|
+
result = self._values.get("enabled")
|
|
464
|
+
assert result is not None, "Required property 'enabled' is missing"
|
|
465
|
+
return typing.cast(builtins.bool, result)
|
|
466
|
+
|
|
467
|
+
@builtins.property
|
|
468
|
+
def metadata_field(self) -> typing.Optional[builtins.str]:
|
|
469
|
+
'''(experimental) Metadata field containing access permissions.
|
|
470
|
+
|
|
471
|
+
This field in the document metadata should contain the group or
|
|
472
|
+
permission identifier that controls access. The retrieval tool
|
|
473
|
+
will filter results where this field matches the user's permissions.
|
|
474
|
+
|
|
475
|
+
:default: 'group'
|
|
476
|
+
|
|
477
|
+
:stability: experimental
|
|
478
|
+
'''
|
|
479
|
+
result = self._values.get("metadata_field")
|
|
480
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
481
|
+
|
|
482
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
483
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
484
|
+
|
|
485
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
486
|
+
return not (rhs == self)
|
|
487
|
+
|
|
488
|
+
def __repr__(self) -> str:
|
|
489
|
+
return "AclConfiguration(%s)" % ", ".join(
|
|
490
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
|
|
420
494
|
@jsii.data_type(
|
|
421
495
|
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.AdditionalDistributionProps",
|
|
422
496
|
jsii_struct_bases=[],
|
|
@@ -517,7 +591,9 @@ class AdditionalDistributionProps:
|
|
|
517
591
|
name_mapping={
|
|
518
592
|
"bedrock_model": "bedrockModel",
|
|
519
593
|
"system_prompt": "systemPrompt",
|
|
594
|
+
"additional_policy_statements_for_knowledge_bases": "additionalPolicyStatementsForKnowledgeBases",
|
|
520
595
|
"additional_policy_statements_for_tools": "additionalPolicyStatementsForTools",
|
|
596
|
+
"knowledge_bases": "knowledgeBases",
|
|
521
597
|
"lambda_layers": "lambdaLayers",
|
|
522
598
|
"tools": "tools",
|
|
523
599
|
},
|
|
@@ -528,7 +604,9 @@ class AgentDefinitionProps:
|
|
|
528
604
|
*,
|
|
529
605
|
bedrock_model: typing.Union["BedrockModelProps", typing.Dict[builtins.str, typing.Any]],
|
|
530
606
|
system_prompt: "_aws_cdk_aws_s3_assets_ceddda9d.Asset",
|
|
607
|
+
additional_policy_statements_for_knowledge_bases: typing.Optional[typing.Sequence["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]] = None,
|
|
531
608
|
additional_policy_statements_for_tools: typing.Optional[typing.Sequence["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]] = None,
|
|
609
|
+
knowledge_bases: typing.Optional[typing.Sequence["IKnowledgeBase"]] = None,
|
|
532
610
|
lambda_layers: typing.Optional[typing.Sequence["_aws_cdk_aws_lambda_ceddda9d.LayerVersion"]] = None,
|
|
533
611
|
tools: typing.Optional[typing.Sequence["_aws_cdk_aws_s3_assets_ceddda9d.Asset"]] = None,
|
|
534
612
|
) -> None:
|
|
@@ -536,7 +614,9 @@ class AgentDefinitionProps:
|
|
|
536
614
|
|
|
537
615
|
:param bedrock_model: (experimental) Configuration for the Bedrock Model to be used.
|
|
538
616
|
:param system_prompt: (experimental) The system prompt of the agent.
|
|
617
|
+
:param additional_policy_statements_for_knowledge_bases: (experimental) Additional IAM policy statements for knowledge base access. Use this when knowledge bases require permissions beyond what is automatically generated by the IKnowledgeBase implementations. These statements will be added to the agent's IAM role in addition to the auto-generated permissions. Default: - Only auto-generated permissions from knowledge bases
|
|
539
618
|
:param additional_policy_statements_for_tools: (experimental) If tools need additional IAM permissions, these statements would be attached to the Agent's IAM role.
|
|
619
|
+
:param knowledge_bases: (experimental) Knowledge bases available to the agent for Retrieval-Augmented Generation (RAG). When configured, the agent will have access to a built-in retrieval tool that can query these knowledge bases. The agent's system prompt will be automatically augmented with information about available knowledge bases. Each knowledge base must implement the IKnowledgeBase interface, which handles IAM permission generation and runtime configuration. Default: - No knowledge bases configured
|
|
540
620
|
:param lambda_layers: (experimental) Any dependencies needed by the provided tools.
|
|
541
621
|
:param tools: (experimental) List of tools defined in python files. This tools would automatically be loaded by the agent. You can also use this to incorporate other specialized agents as tools.
|
|
542
622
|
|
|
@@ -548,15 +628,21 @@ class AgentDefinitionProps:
|
|
|
548
628
|
type_hints = typing.get_type_hints(_typecheckingstub__4a2d1deab0cc9bf96473ffb32138a2c564c47ae7382fe5d2d1f0e43da3324272)
|
|
549
629
|
check_type(argname="argument bedrock_model", value=bedrock_model, expected_type=type_hints["bedrock_model"])
|
|
550
630
|
check_type(argname="argument system_prompt", value=system_prompt, expected_type=type_hints["system_prompt"])
|
|
631
|
+
check_type(argname="argument additional_policy_statements_for_knowledge_bases", value=additional_policy_statements_for_knowledge_bases, expected_type=type_hints["additional_policy_statements_for_knowledge_bases"])
|
|
551
632
|
check_type(argname="argument additional_policy_statements_for_tools", value=additional_policy_statements_for_tools, expected_type=type_hints["additional_policy_statements_for_tools"])
|
|
633
|
+
check_type(argname="argument knowledge_bases", value=knowledge_bases, expected_type=type_hints["knowledge_bases"])
|
|
552
634
|
check_type(argname="argument lambda_layers", value=lambda_layers, expected_type=type_hints["lambda_layers"])
|
|
553
635
|
check_type(argname="argument tools", value=tools, expected_type=type_hints["tools"])
|
|
554
636
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
555
637
|
"bedrock_model": bedrock_model,
|
|
556
638
|
"system_prompt": system_prompt,
|
|
557
639
|
}
|
|
640
|
+
if additional_policy_statements_for_knowledge_bases is not None:
|
|
641
|
+
self._values["additional_policy_statements_for_knowledge_bases"] = additional_policy_statements_for_knowledge_bases
|
|
558
642
|
if additional_policy_statements_for_tools is not None:
|
|
559
643
|
self._values["additional_policy_statements_for_tools"] = additional_policy_statements_for_tools
|
|
644
|
+
if knowledge_bases is not None:
|
|
645
|
+
self._values["knowledge_bases"] = knowledge_bases
|
|
560
646
|
if lambda_layers is not None:
|
|
561
647
|
self._values["lambda_layers"] = lambda_layers
|
|
562
648
|
if tools is not None:
|
|
@@ -582,6 +668,24 @@ class AgentDefinitionProps:
|
|
|
582
668
|
assert result is not None, "Required property 'system_prompt' is missing"
|
|
583
669
|
return typing.cast("_aws_cdk_aws_s3_assets_ceddda9d.Asset", result)
|
|
584
670
|
|
|
671
|
+
@builtins.property
|
|
672
|
+
def additional_policy_statements_for_knowledge_bases(
|
|
673
|
+
self,
|
|
674
|
+
) -> typing.Optional[typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]]:
|
|
675
|
+
'''(experimental) Additional IAM policy statements for knowledge base access.
|
|
676
|
+
|
|
677
|
+
Use this when knowledge bases require permissions beyond what is
|
|
678
|
+
automatically generated by the IKnowledgeBase implementations.
|
|
679
|
+
These statements will be added to the agent's IAM role in addition
|
|
680
|
+
to the auto-generated permissions.
|
|
681
|
+
|
|
682
|
+
:default: - Only auto-generated permissions from knowledge bases
|
|
683
|
+
|
|
684
|
+
:stability: experimental
|
|
685
|
+
'''
|
|
686
|
+
result = self._values.get("additional_policy_statements_for_knowledge_bases")
|
|
687
|
+
return typing.cast(typing.Optional[typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]], result)
|
|
688
|
+
|
|
585
689
|
@builtins.property
|
|
586
690
|
def additional_policy_statements_for_tools(
|
|
587
691
|
self,
|
|
@@ -593,6 +697,24 @@ class AgentDefinitionProps:
|
|
|
593
697
|
result = self._values.get("additional_policy_statements_for_tools")
|
|
594
698
|
return typing.cast(typing.Optional[typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]], result)
|
|
595
699
|
|
|
700
|
+
@builtins.property
|
|
701
|
+
def knowledge_bases(self) -> typing.Optional[typing.List["IKnowledgeBase"]]:
|
|
702
|
+
'''(experimental) Knowledge bases available to the agent for Retrieval-Augmented Generation (RAG).
|
|
703
|
+
|
|
704
|
+
When configured, the agent will have access to a built-in retrieval tool
|
|
705
|
+
that can query these knowledge bases. The agent's system prompt will be
|
|
706
|
+
automatically augmented with information about available knowledge bases.
|
|
707
|
+
|
|
708
|
+
Each knowledge base must implement the IKnowledgeBase interface, which
|
|
709
|
+
handles IAM permission generation and runtime configuration.
|
|
710
|
+
|
|
711
|
+
:default: - No knowledge bases configured
|
|
712
|
+
|
|
713
|
+
:stability: experimental
|
|
714
|
+
'''
|
|
715
|
+
result = self._values.get("knowledge_bases")
|
|
716
|
+
return typing.cast(typing.Optional[typing.List["IKnowledgeBase"]], result)
|
|
717
|
+
|
|
596
718
|
@builtins.property
|
|
597
719
|
def lambda_layers(
|
|
598
720
|
self,
|
|
@@ -1029,6 +1151,19 @@ class BaseAgent(
|
|
|
1029
1151
|
'''
|
|
1030
1152
|
return typing.cast("_aws_cdk_aws_kms_ceddda9d.Key", jsii.get(self, "encryptionKey"))
|
|
1031
1153
|
|
|
1154
|
+
@builtins.property
|
|
1155
|
+
@jsii.member(jsii_name="knowledgeBaseConfigs")
|
|
1156
|
+
def _knowledge_base_configs(self) -> typing.List["KnowledgeBaseRuntimeConfig"]:
|
|
1157
|
+
'''(experimental) Knowledge base configurations for runtime use.
|
|
1158
|
+
|
|
1159
|
+
This array contains the exported configurations from all configured
|
|
1160
|
+
knowledge bases. Subclasses use this to set the KNOWLEDGE_BASES_CONFIG
|
|
1161
|
+
environment variable on the agent Lambda function.
|
|
1162
|
+
|
|
1163
|
+
:stability: experimental
|
|
1164
|
+
'''
|
|
1165
|
+
return typing.cast(typing.List["KnowledgeBaseRuntimeConfig"], jsii.get(self, "knowledgeBaseConfigs"))
|
|
1166
|
+
|
|
1032
1167
|
@builtins.property
|
|
1033
1168
|
@jsii.member(jsii_name="logGroupDataProtection")
|
|
1034
1169
|
def _log_group_data_protection(self) -> "LogGroupDataProtectionProps":
|
|
@@ -1046,6 +1181,20 @@ class BaseAgent(
|
|
|
1046
1181
|
'''
|
|
1047
1182
|
return typing.cast(typing.Optional["BedrockModelProps"], jsii.get(self, "bedrockModel"))
|
|
1048
1183
|
|
|
1184
|
+
@builtins.property
|
|
1185
|
+
@jsii.member(jsii_name="knowledgeBaseToolAsset")
|
|
1186
|
+
def _knowledge_base_tool_asset(
|
|
1187
|
+
self,
|
|
1188
|
+
) -> typing.Optional["_aws_cdk_aws_s3_assets_ceddda9d.Asset"]:
|
|
1189
|
+
'''(experimental) Asset containing the knowledge base retrieval tool.
|
|
1190
|
+
|
|
1191
|
+
This is automatically created when knowledge bases are configured.
|
|
1192
|
+
The asset is added to the agent's tools and granted read access.
|
|
1193
|
+
|
|
1194
|
+
:stability: experimental
|
|
1195
|
+
'''
|
|
1196
|
+
return typing.cast(typing.Optional["_aws_cdk_aws_s3_assets_ceddda9d.Asset"], jsii.get(self, "knowledgeBaseToolAsset"))
|
|
1197
|
+
|
|
1049
1198
|
|
|
1050
1199
|
class _BaseAgentProxy(BaseAgent):
|
|
1051
1200
|
@builtins.property
|
|
@@ -1062,6 +1211,132 @@ class _BaseAgentProxy(BaseAgent):
|
|
|
1062
1211
|
typing.cast(typing.Any, BaseAgent).__jsii_proxy_class__ = lambda : _BaseAgentProxy
|
|
1063
1212
|
|
|
1064
1213
|
|
|
1214
|
+
@jsii.data_type(
|
|
1215
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.BaseKnowledgeBaseProps",
|
|
1216
|
+
jsii_struct_bases=[],
|
|
1217
|
+
name_mapping={
|
|
1218
|
+
"description": "description",
|
|
1219
|
+
"name": "name",
|
|
1220
|
+
"acl": "acl",
|
|
1221
|
+
"retrieval": "retrieval",
|
|
1222
|
+
},
|
|
1223
|
+
)
|
|
1224
|
+
class BaseKnowledgeBaseProps:
|
|
1225
|
+
def __init__(
|
|
1226
|
+
self,
|
|
1227
|
+
*,
|
|
1228
|
+
description: builtins.str,
|
|
1229
|
+
name: builtins.str,
|
|
1230
|
+
acl: typing.Optional[typing.Union["AclConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1231
|
+
retrieval: typing.Optional[typing.Union["RetrievalConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1232
|
+
) -> None:
|
|
1233
|
+
'''(experimental) Base configuration for all knowledge base implementations.
|
|
1234
|
+
|
|
1235
|
+
This interface defines the common properties shared by all knowledge
|
|
1236
|
+
base types. Specific implementations (like BedrockKnowledgeBase) extend
|
|
1237
|
+
this with additional properties.
|
|
1238
|
+
|
|
1239
|
+
:param description: (experimental) Description of what this knowledge base contains and when to use it. This description is shown to the agent in its system prompt to help it decide when to query this knowledge base. Be specific about the type of information contained and appropriate use cases.
|
|
1240
|
+
:param name: (experimental) Human-readable name/identifier for this knowledge base. Used for logging, display purposes, and to help the agent identify which knowledge base to query. Should be unique within the set of knowledge bases configured for an agent.
|
|
1241
|
+
:param acl: (experimental) Access control configuration for identity-aware retrieval. When enabled, retrieval queries will be filtered based on user identity context to ensure users only access permitted documents. Default: - ACL disabled
|
|
1242
|
+
:param retrieval: (experimental) Retrieval configuration options. Controls the number of results returned and optional metadata filtering. Default: { numberOfResults: 5 }
|
|
1243
|
+
|
|
1244
|
+
:stability: experimental
|
|
1245
|
+
'''
|
|
1246
|
+
if isinstance(acl, dict):
|
|
1247
|
+
acl = AclConfiguration(**acl)
|
|
1248
|
+
if isinstance(retrieval, dict):
|
|
1249
|
+
retrieval = RetrievalConfiguration(**retrieval)
|
|
1250
|
+
if __debug__:
|
|
1251
|
+
type_hints = typing.get_type_hints(_typecheckingstub__40fa4a59f1a0502756f07aba8d6cba5255e1743cbc160af92ff68cb3b17fef23)
|
|
1252
|
+
check_type(argname="argument description", value=description, expected_type=type_hints["description"])
|
|
1253
|
+
check_type(argname="argument name", value=name, expected_type=type_hints["name"])
|
|
1254
|
+
check_type(argname="argument acl", value=acl, expected_type=type_hints["acl"])
|
|
1255
|
+
check_type(argname="argument retrieval", value=retrieval, expected_type=type_hints["retrieval"])
|
|
1256
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
1257
|
+
"description": description,
|
|
1258
|
+
"name": name,
|
|
1259
|
+
}
|
|
1260
|
+
if acl is not None:
|
|
1261
|
+
self._values["acl"] = acl
|
|
1262
|
+
if retrieval is not None:
|
|
1263
|
+
self._values["retrieval"] = retrieval
|
|
1264
|
+
|
|
1265
|
+
@builtins.property
|
|
1266
|
+
def description(self) -> builtins.str:
|
|
1267
|
+
'''(experimental) Description of what this knowledge base contains and when to use it.
|
|
1268
|
+
|
|
1269
|
+
This description is shown to the agent in its system prompt to help
|
|
1270
|
+
it decide when to query this knowledge base. Be specific about the
|
|
1271
|
+
type of information contained and appropriate use cases.
|
|
1272
|
+
|
|
1273
|
+
:stability: experimental
|
|
1274
|
+
|
|
1275
|
+
Example::
|
|
1276
|
+
|
|
1277
|
+
'Contains product documentation, user guides, and FAQs. Use when answering questions about product features or troubleshooting.'
|
|
1278
|
+
'''
|
|
1279
|
+
result = self._values.get("description")
|
|
1280
|
+
assert result is not None, "Required property 'description' is missing"
|
|
1281
|
+
return typing.cast(builtins.str, result)
|
|
1282
|
+
|
|
1283
|
+
@builtins.property
|
|
1284
|
+
def name(self) -> builtins.str:
|
|
1285
|
+
'''(experimental) Human-readable name/identifier for this knowledge base.
|
|
1286
|
+
|
|
1287
|
+
Used for logging, display purposes, and to help the agent identify
|
|
1288
|
+
which knowledge base to query. Should be unique within the set of
|
|
1289
|
+
knowledge bases configured for an agent.
|
|
1290
|
+
|
|
1291
|
+
:stability: experimental
|
|
1292
|
+
|
|
1293
|
+
Example::
|
|
1294
|
+
|
|
1295
|
+
'product-documentation'
|
|
1296
|
+
'''
|
|
1297
|
+
result = self._values.get("name")
|
|
1298
|
+
assert result is not None, "Required property 'name' is missing"
|
|
1299
|
+
return typing.cast(builtins.str, result)
|
|
1300
|
+
|
|
1301
|
+
@builtins.property
|
|
1302
|
+
def acl(self) -> typing.Optional["AclConfiguration"]:
|
|
1303
|
+
'''(experimental) Access control configuration for identity-aware retrieval.
|
|
1304
|
+
|
|
1305
|
+
When enabled, retrieval queries will be filtered based on user
|
|
1306
|
+
identity context to ensure users only access permitted documents.
|
|
1307
|
+
|
|
1308
|
+
:default: - ACL disabled
|
|
1309
|
+
|
|
1310
|
+
:stability: experimental
|
|
1311
|
+
'''
|
|
1312
|
+
result = self._values.get("acl")
|
|
1313
|
+
return typing.cast(typing.Optional["AclConfiguration"], result)
|
|
1314
|
+
|
|
1315
|
+
@builtins.property
|
|
1316
|
+
def retrieval(self) -> typing.Optional["RetrievalConfiguration"]:
|
|
1317
|
+
'''(experimental) Retrieval configuration options.
|
|
1318
|
+
|
|
1319
|
+
Controls the number of results returned and optional metadata filtering.
|
|
1320
|
+
|
|
1321
|
+
:default: { numberOfResults: 5 }
|
|
1322
|
+
|
|
1323
|
+
:stability: experimental
|
|
1324
|
+
'''
|
|
1325
|
+
result = self._values.get("retrieval")
|
|
1326
|
+
return typing.cast(typing.Optional["RetrievalConfiguration"], result)
|
|
1327
|
+
|
|
1328
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
1329
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
1330
|
+
|
|
1331
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
1332
|
+
return not (rhs == self)
|
|
1333
|
+
|
|
1334
|
+
def __repr__(self) -> str:
|
|
1335
|
+
return "BaseKnowledgeBaseProps(%s)" % ", ".join(
|
|
1336
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
1337
|
+
)
|
|
1338
|
+
|
|
1339
|
+
|
|
1065
1340
|
class BatchAgent(
|
|
1066
1341
|
BaseAgent,
|
|
1067
1342
|
metaclass=jsii.JSIIMeta,
|
|
@@ -1078,6 +1353,7 @@ class BatchAgent(
|
|
|
1078
1353
|
*,
|
|
1079
1354
|
prompt: builtins.str,
|
|
1080
1355
|
expect_json: typing.Optional[builtins.bool] = None,
|
|
1356
|
+
invoke_type: typing.Optional["InvokeType"] = None,
|
|
1081
1357
|
agent_definition: typing.Union["AgentDefinitionProps", typing.Dict[builtins.str, typing.Any]],
|
|
1082
1358
|
agent_name: builtins.str,
|
|
1083
1359
|
enable_observability: typing.Optional[builtins.bool] = None,
|
|
@@ -1093,6 +1369,7 @@ class BatchAgent(
|
|
|
1093
1369
|
:param id: -
|
|
1094
1370
|
:param prompt:
|
|
1095
1371
|
:param expect_json:
|
|
1372
|
+
:param invoke_type: (experimental) Agent invocation type. Defines how the agent is invoked and what processing mode to use. Default: InvokeType.BATCH
|
|
1096
1373
|
:param agent_definition: (experimental) Agent related parameters.
|
|
1097
1374
|
:param agent_name: (experimental) Name of the agent.
|
|
1098
1375
|
:param enable_observability: (experimental) Enable observability. Default: false
|
|
@@ -1112,6 +1389,7 @@ class BatchAgent(
|
|
|
1112
1389
|
props = BatchAgentProps(
|
|
1113
1390
|
prompt=prompt,
|
|
1114
1391
|
expect_json=expect_json,
|
|
1392
|
+
invoke_type=invoke_type,
|
|
1115
1393
|
agent_definition=agent_definition,
|
|
1116
1394
|
agent_name=agent_name,
|
|
1117
1395
|
enable_observability=enable_observability,
|
|
@@ -1159,6 +1437,243 @@ class BedrockCrossRegionInferencePrefix(enum.Enum):
|
|
|
1159
1437
|
'''
|
|
1160
1438
|
|
|
1161
1439
|
|
|
1440
|
+
@jsii.data_type(
|
|
1441
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.BedrockKnowledgeBaseProps",
|
|
1442
|
+
jsii_struct_bases=[BaseKnowledgeBaseProps],
|
|
1443
|
+
name_mapping={
|
|
1444
|
+
"description": "description",
|
|
1445
|
+
"name": "name",
|
|
1446
|
+
"acl": "acl",
|
|
1447
|
+
"retrieval": "retrieval",
|
|
1448
|
+
"knowledge_base_id": "knowledgeBaseId",
|
|
1449
|
+
"create": "create",
|
|
1450
|
+
"guardrail": "guardrail",
|
|
1451
|
+
"knowledge_base_arn": "knowledgeBaseArn",
|
|
1452
|
+
"vector_store": "vectorStore",
|
|
1453
|
+
},
|
|
1454
|
+
)
|
|
1455
|
+
class BedrockKnowledgeBaseProps(BaseKnowledgeBaseProps):
|
|
1456
|
+
def __init__(
|
|
1457
|
+
self,
|
|
1458
|
+
*,
|
|
1459
|
+
description: builtins.str,
|
|
1460
|
+
name: builtins.str,
|
|
1461
|
+
acl: typing.Optional[typing.Union["AclConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1462
|
+
retrieval: typing.Optional[typing.Union["RetrievalConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1463
|
+
knowledge_base_id: builtins.str,
|
|
1464
|
+
create: typing.Optional[typing.Union["CreateKnowledgeBaseConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1465
|
+
guardrail: typing.Optional[typing.Union["GuardrailConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1466
|
+
knowledge_base_arn: typing.Optional[builtins.str] = None,
|
|
1467
|
+
vector_store: typing.Optional[typing.Union["VectorStoreConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1468
|
+
) -> None:
|
|
1469
|
+
'''(experimental) Configuration for Amazon Bedrock Knowledge Base.
|
|
1470
|
+
|
|
1471
|
+
This interface extends the base configuration with Bedrock-specific
|
|
1472
|
+
properties for connecting to an existing Bedrock Knowledge Base.
|
|
1473
|
+
|
|
1474
|
+
:param description: (experimental) Description of what this knowledge base contains and when to use it. This description is shown to the agent in its system prompt to help it decide when to query this knowledge base. Be specific about the type of information contained and appropriate use cases.
|
|
1475
|
+
:param name: (experimental) Human-readable name/identifier for this knowledge base. Used for logging, display purposes, and to help the agent identify which knowledge base to query. Should be unique within the set of knowledge bases configured for an agent.
|
|
1476
|
+
:param acl: (experimental) Access control configuration for identity-aware retrieval. When enabled, retrieval queries will be filtered based on user identity context to ensure users only access permitted documents. Default: - ACL disabled
|
|
1477
|
+
:param retrieval: (experimental) Retrieval configuration options. Controls the number of results returned and optional metadata filtering. Default: { numberOfResults: 5 }
|
|
1478
|
+
:param knowledge_base_id: (experimental) Unique identifier for the Bedrock Knowledge Base. This is the ID assigned by Bedrock when the knowledge base was created. You can find this in the Bedrock console or via the AWS CLI. Required when referencing an existing knowledge base. Not required when using the ``create`` property to create a new KB.
|
|
1479
|
+
:param create: (experimental) Configuration for creating a new knowledge base. When provided, a new Bedrock Knowledge Base will be created with the specified data source and embedding configuration. Note: This is an advanced feature that creates AWS resources. For most use cases, referencing an existing knowledge base by ID is recommended. Default: - Reference existing KB only (no creation)
|
|
1480
|
+
:param guardrail: (experimental) Guardrail configuration for content filtering. When configured, the guardrail will be applied during retrieval operations to filter inappropriate or sensitive content. Default: - No guardrail applied
|
|
1481
|
+
:param knowledge_base_arn: (experimental) ARN of the Bedrock Knowledge Base. If not provided, the ARN will be constructed from the knowledgeBaseId using the current region and account. Default: - Constructed from knowledgeBaseId
|
|
1482
|
+
:param vector_store: (experimental) Vector store configuration. Defines the type of vector store used by this knowledge base. This is informational and used for generating appropriate IAM permissions when needed. Default: - S3 Vectors (type: 's3-vectors')
|
|
1483
|
+
|
|
1484
|
+
:stability: experimental
|
|
1485
|
+
'''
|
|
1486
|
+
if isinstance(acl, dict):
|
|
1487
|
+
acl = AclConfiguration(**acl)
|
|
1488
|
+
if isinstance(retrieval, dict):
|
|
1489
|
+
retrieval = RetrievalConfiguration(**retrieval)
|
|
1490
|
+
if isinstance(create, dict):
|
|
1491
|
+
create = CreateKnowledgeBaseConfiguration(**create)
|
|
1492
|
+
if isinstance(guardrail, dict):
|
|
1493
|
+
guardrail = GuardrailConfiguration(**guardrail)
|
|
1494
|
+
if isinstance(vector_store, dict):
|
|
1495
|
+
vector_store = VectorStoreConfiguration(**vector_store)
|
|
1496
|
+
if __debug__:
|
|
1497
|
+
type_hints = typing.get_type_hints(_typecheckingstub__fa5a5937a282e8ddfa91598805b072febd3483c7f6ad9ed8eed9f52e4f0912e9)
|
|
1498
|
+
check_type(argname="argument description", value=description, expected_type=type_hints["description"])
|
|
1499
|
+
check_type(argname="argument name", value=name, expected_type=type_hints["name"])
|
|
1500
|
+
check_type(argname="argument acl", value=acl, expected_type=type_hints["acl"])
|
|
1501
|
+
check_type(argname="argument retrieval", value=retrieval, expected_type=type_hints["retrieval"])
|
|
1502
|
+
check_type(argname="argument knowledge_base_id", value=knowledge_base_id, expected_type=type_hints["knowledge_base_id"])
|
|
1503
|
+
check_type(argname="argument create", value=create, expected_type=type_hints["create"])
|
|
1504
|
+
check_type(argname="argument guardrail", value=guardrail, expected_type=type_hints["guardrail"])
|
|
1505
|
+
check_type(argname="argument knowledge_base_arn", value=knowledge_base_arn, expected_type=type_hints["knowledge_base_arn"])
|
|
1506
|
+
check_type(argname="argument vector_store", value=vector_store, expected_type=type_hints["vector_store"])
|
|
1507
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
1508
|
+
"description": description,
|
|
1509
|
+
"name": name,
|
|
1510
|
+
"knowledge_base_id": knowledge_base_id,
|
|
1511
|
+
}
|
|
1512
|
+
if acl is not None:
|
|
1513
|
+
self._values["acl"] = acl
|
|
1514
|
+
if retrieval is not None:
|
|
1515
|
+
self._values["retrieval"] = retrieval
|
|
1516
|
+
if create is not None:
|
|
1517
|
+
self._values["create"] = create
|
|
1518
|
+
if guardrail is not None:
|
|
1519
|
+
self._values["guardrail"] = guardrail
|
|
1520
|
+
if knowledge_base_arn is not None:
|
|
1521
|
+
self._values["knowledge_base_arn"] = knowledge_base_arn
|
|
1522
|
+
if vector_store is not None:
|
|
1523
|
+
self._values["vector_store"] = vector_store
|
|
1524
|
+
|
|
1525
|
+
@builtins.property
|
|
1526
|
+
def description(self) -> builtins.str:
|
|
1527
|
+
'''(experimental) Description of what this knowledge base contains and when to use it.
|
|
1528
|
+
|
|
1529
|
+
This description is shown to the agent in its system prompt to help
|
|
1530
|
+
it decide when to query this knowledge base. Be specific about the
|
|
1531
|
+
type of information contained and appropriate use cases.
|
|
1532
|
+
|
|
1533
|
+
:stability: experimental
|
|
1534
|
+
|
|
1535
|
+
Example::
|
|
1536
|
+
|
|
1537
|
+
'Contains product documentation, user guides, and FAQs. Use when answering questions about product features or troubleshooting.'
|
|
1538
|
+
'''
|
|
1539
|
+
result = self._values.get("description")
|
|
1540
|
+
assert result is not None, "Required property 'description' is missing"
|
|
1541
|
+
return typing.cast(builtins.str, result)
|
|
1542
|
+
|
|
1543
|
+
@builtins.property
|
|
1544
|
+
def name(self) -> builtins.str:
|
|
1545
|
+
'''(experimental) Human-readable name/identifier for this knowledge base.
|
|
1546
|
+
|
|
1547
|
+
Used for logging, display purposes, and to help the agent identify
|
|
1548
|
+
which knowledge base to query. Should be unique within the set of
|
|
1549
|
+
knowledge bases configured for an agent.
|
|
1550
|
+
|
|
1551
|
+
:stability: experimental
|
|
1552
|
+
|
|
1553
|
+
Example::
|
|
1554
|
+
|
|
1555
|
+
'product-documentation'
|
|
1556
|
+
'''
|
|
1557
|
+
result = self._values.get("name")
|
|
1558
|
+
assert result is not None, "Required property 'name' is missing"
|
|
1559
|
+
return typing.cast(builtins.str, result)
|
|
1560
|
+
|
|
1561
|
+
@builtins.property
|
|
1562
|
+
def acl(self) -> typing.Optional["AclConfiguration"]:
|
|
1563
|
+
'''(experimental) Access control configuration for identity-aware retrieval.
|
|
1564
|
+
|
|
1565
|
+
When enabled, retrieval queries will be filtered based on user
|
|
1566
|
+
identity context to ensure users only access permitted documents.
|
|
1567
|
+
|
|
1568
|
+
:default: - ACL disabled
|
|
1569
|
+
|
|
1570
|
+
:stability: experimental
|
|
1571
|
+
'''
|
|
1572
|
+
result = self._values.get("acl")
|
|
1573
|
+
return typing.cast(typing.Optional["AclConfiguration"], result)
|
|
1574
|
+
|
|
1575
|
+
@builtins.property
|
|
1576
|
+
def retrieval(self) -> typing.Optional["RetrievalConfiguration"]:
|
|
1577
|
+
'''(experimental) Retrieval configuration options.
|
|
1578
|
+
|
|
1579
|
+
Controls the number of results returned and optional metadata filtering.
|
|
1580
|
+
|
|
1581
|
+
:default: { numberOfResults: 5 }
|
|
1582
|
+
|
|
1583
|
+
:stability: experimental
|
|
1584
|
+
'''
|
|
1585
|
+
result = self._values.get("retrieval")
|
|
1586
|
+
return typing.cast(typing.Optional["RetrievalConfiguration"], result)
|
|
1587
|
+
|
|
1588
|
+
@builtins.property
|
|
1589
|
+
def knowledge_base_id(self) -> builtins.str:
|
|
1590
|
+
'''(experimental) Unique identifier for the Bedrock Knowledge Base.
|
|
1591
|
+
|
|
1592
|
+
This is the ID assigned by Bedrock when the knowledge base was created.
|
|
1593
|
+
You can find this in the Bedrock console or via the AWS CLI.
|
|
1594
|
+
|
|
1595
|
+
Required when referencing an existing knowledge base.
|
|
1596
|
+
Not required when using the ``create`` property to create a new KB.
|
|
1597
|
+
|
|
1598
|
+
:stability: experimental
|
|
1599
|
+
'''
|
|
1600
|
+
result = self._values.get("knowledge_base_id")
|
|
1601
|
+
assert result is not None, "Required property 'knowledge_base_id' is missing"
|
|
1602
|
+
return typing.cast(builtins.str, result)
|
|
1603
|
+
|
|
1604
|
+
@builtins.property
|
|
1605
|
+
def create(self) -> typing.Optional["CreateKnowledgeBaseConfiguration"]:
|
|
1606
|
+
'''(experimental) Configuration for creating a new knowledge base.
|
|
1607
|
+
|
|
1608
|
+
When provided, a new Bedrock Knowledge Base will be created with
|
|
1609
|
+
the specified data source and embedding configuration.
|
|
1610
|
+
|
|
1611
|
+
Note: This is an advanced feature that creates AWS resources.
|
|
1612
|
+
For most use cases, referencing an existing knowledge base by ID
|
|
1613
|
+
is recommended.
|
|
1614
|
+
|
|
1615
|
+
:default: - Reference existing KB only (no creation)
|
|
1616
|
+
|
|
1617
|
+
:stability: experimental
|
|
1618
|
+
'''
|
|
1619
|
+
result = self._values.get("create")
|
|
1620
|
+
return typing.cast(typing.Optional["CreateKnowledgeBaseConfiguration"], result)
|
|
1621
|
+
|
|
1622
|
+
@builtins.property
|
|
1623
|
+
def guardrail(self) -> typing.Optional["GuardrailConfiguration"]:
|
|
1624
|
+
'''(experimental) Guardrail configuration for content filtering.
|
|
1625
|
+
|
|
1626
|
+
When configured, the guardrail will be applied during retrieval
|
|
1627
|
+
operations to filter inappropriate or sensitive content.
|
|
1628
|
+
|
|
1629
|
+
:default: - No guardrail applied
|
|
1630
|
+
|
|
1631
|
+
:stability: experimental
|
|
1632
|
+
'''
|
|
1633
|
+
result = self._values.get("guardrail")
|
|
1634
|
+
return typing.cast(typing.Optional["GuardrailConfiguration"], result)
|
|
1635
|
+
|
|
1636
|
+
@builtins.property
|
|
1637
|
+
def knowledge_base_arn(self) -> typing.Optional[builtins.str]:
|
|
1638
|
+
'''(experimental) ARN of the Bedrock Knowledge Base.
|
|
1639
|
+
|
|
1640
|
+
If not provided, the ARN will be constructed from the knowledgeBaseId
|
|
1641
|
+
using the current region and account.
|
|
1642
|
+
|
|
1643
|
+
:default: - Constructed from knowledgeBaseId
|
|
1644
|
+
|
|
1645
|
+
:stability: experimental
|
|
1646
|
+
'''
|
|
1647
|
+
result = self._values.get("knowledge_base_arn")
|
|
1648
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
1649
|
+
|
|
1650
|
+
@builtins.property
|
|
1651
|
+
def vector_store(self) -> typing.Optional["VectorStoreConfiguration"]:
|
|
1652
|
+
'''(experimental) Vector store configuration.
|
|
1653
|
+
|
|
1654
|
+
Defines the type of vector store used by this knowledge base.
|
|
1655
|
+
This is informational and used for generating appropriate IAM
|
|
1656
|
+
permissions when needed.
|
|
1657
|
+
|
|
1658
|
+
:default: - S3 Vectors (type: 's3-vectors')
|
|
1659
|
+
|
|
1660
|
+
:stability: experimental
|
|
1661
|
+
'''
|
|
1662
|
+
result = self._values.get("vector_store")
|
|
1663
|
+
return typing.cast(typing.Optional["VectorStoreConfiguration"], result)
|
|
1664
|
+
|
|
1665
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
1666
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
1667
|
+
|
|
1668
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
1669
|
+
return not (rhs == self)
|
|
1670
|
+
|
|
1671
|
+
def __repr__(self) -> str:
|
|
1672
|
+
return "BedrockKnowledgeBaseProps(%s)" % ", ".join(
|
|
1673
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
1674
|
+
)
|
|
1675
|
+
|
|
1676
|
+
|
|
1162
1677
|
@jsii.data_type(
|
|
1163
1678
|
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.BedrockModelProps",
|
|
1164
1679
|
jsii_struct_bases=[],
|
|
@@ -2739,34 +3254,187 @@ class CloudfrontDistributionObservabilityPropertyInjector(
|
|
|
2739
3254
|
|
|
2740
3255
|
|
|
2741
3256
|
@jsii.data_type(
|
|
2742
|
-
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.
|
|
3257
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.CreateKnowledgeBaseConfiguration",
|
|
2743
3258
|
jsii_struct_bases=[],
|
|
2744
3259
|
name_mapping={
|
|
2745
|
-
"
|
|
2746
|
-
"
|
|
2747
|
-
"
|
|
3260
|
+
"data_source_bucket_name": "dataSourceBucketName",
|
|
3261
|
+
"chunking_strategy": "chunkingStrategy",
|
|
3262
|
+
"data_source_prefix": "dataSourcePrefix",
|
|
3263
|
+
"embedding_model_id": "embeddingModelId",
|
|
3264
|
+
"max_tokens": "maxTokens",
|
|
3265
|
+
"overlap_tokens": "overlapTokens",
|
|
2748
3266
|
},
|
|
2749
3267
|
)
|
|
2750
|
-
class
|
|
3268
|
+
class CreateKnowledgeBaseConfiguration:
|
|
2751
3269
|
def __init__(
|
|
2752
3270
|
self,
|
|
2753
3271
|
*,
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
3272
|
+
data_source_bucket_name: builtins.str,
|
|
3273
|
+
chunking_strategy: typing.Optional[builtins.str] = None,
|
|
3274
|
+
data_source_prefix: typing.Optional[builtins.str] = None,
|
|
3275
|
+
embedding_model_id: typing.Optional[builtins.str] = None,
|
|
3276
|
+
max_tokens: typing.Optional[jsii.Number] = None,
|
|
3277
|
+
overlap_tokens: typing.Optional[jsii.Number] = None,
|
|
2757
3278
|
) -> None:
|
|
2758
|
-
'''(experimental)
|
|
3279
|
+
'''(experimental) Configuration for creating a new Bedrock Knowledge Base.
|
|
2759
3280
|
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
3281
|
+
When provided to BedrockKnowledgeBase, a new knowledge base will be
|
|
3282
|
+
created with the specified data source and embedding configuration.
|
|
3283
|
+
|
|
3284
|
+
Note: This is an advanced feature. For most use cases, referencing
|
|
3285
|
+
an existing knowledge base by ID is recommended.
|
|
3286
|
+
|
|
3287
|
+
:param data_source_bucket_name: (experimental) S3 bucket name containing source documents. The bucket must exist and contain the documents to be indexed.
|
|
3288
|
+
:param chunking_strategy: (experimental) Chunking strategy for document processing. - 'fixed-size': Split documents into fixed-size chunks - 'semantic': Use semantic boundaries for chunking - 'none': No chunking (use entire documents) Default: 'fixed-size'
|
|
3289
|
+
:param data_source_prefix: (experimental) S3 prefix for source documents within the bucket. Only documents under this prefix will be indexed. Default: - Root of bucket (all documents)
|
|
3290
|
+
:param embedding_model_id: (experimental) Embedding model to use for vectorization. Must be a valid Bedrock embedding model ID. Default: 'amazon.titan-embed-text-v2:0'
|
|
3291
|
+
:param max_tokens: (experimental) Maximum chunk size in tokens (for fixed-size chunking). Only used when chunkingStrategy is 'fixed-size'. Default: 300
|
|
3292
|
+
:param overlap_tokens: (experimental) Overlap between chunks in tokens (for fixed-size chunking). Only used when chunkingStrategy is 'fixed-size'. Default: 20
|
|
2763
3293
|
|
|
2764
3294
|
:stability: experimental
|
|
2765
3295
|
'''
|
|
2766
3296
|
if __debug__:
|
|
2767
|
-
type_hints = typing.get_type_hints(
|
|
2768
|
-
check_type(argname="argument
|
|
2769
|
-
check_type(argname="argument
|
|
3297
|
+
type_hints = typing.get_type_hints(_typecheckingstub__5a66ad6b4c71f08ad11270f15622825326a8ae23d1f4b8349ee45ee1997ed029)
|
|
3298
|
+
check_type(argname="argument data_source_bucket_name", value=data_source_bucket_name, expected_type=type_hints["data_source_bucket_name"])
|
|
3299
|
+
check_type(argname="argument chunking_strategy", value=chunking_strategy, expected_type=type_hints["chunking_strategy"])
|
|
3300
|
+
check_type(argname="argument data_source_prefix", value=data_source_prefix, expected_type=type_hints["data_source_prefix"])
|
|
3301
|
+
check_type(argname="argument embedding_model_id", value=embedding_model_id, expected_type=type_hints["embedding_model_id"])
|
|
3302
|
+
check_type(argname="argument max_tokens", value=max_tokens, expected_type=type_hints["max_tokens"])
|
|
3303
|
+
check_type(argname="argument overlap_tokens", value=overlap_tokens, expected_type=type_hints["overlap_tokens"])
|
|
3304
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
3305
|
+
"data_source_bucket_name": data_source_bucket_name,
|
|
3306
|
+
}
|
|
3307
|
+
if chunking_strategy is not None:
|
|
3308
|
+
self._values["chunking_strategy"] = chunking_strategy
|
|
3309
|
+
if data_source_prefix is not None:
|
|
3310
|
+
self._values["data_source_prefix"] = data_source_prefix
|
|
3311
|
+
if embedding_model_id is not None:
|
|
3312
|
+
self._values["embedding_model_id"] = embedding_model_id
|
|
3313
|
+
if max_tokens is not None:
|
|
3314
|
+
self._values["max_tokens"] = max_tokens
|
|
3315
|
+
if overlap_tokens is not None:
|
|
3316
|
+
self._values["overlap_tokens"] = overlap_tokens
|
|
3317
|
+
|
|
3318
|
+
@builtins.property
|
|
3319
|
+
def data_source_bucket_name(self) -> builtins.str:
|
|
3320
|
+
'''(experimental) S3 bucket name containing source documents.
|
|
3321
|
+
|
|
3322
|
+
The bucket must exist and contain the documents to be indexed.
|
|
3323
|
+
|
|
3324
|
+
:stability: experimental
|
|
3325
|
+
'''
|
|
3326
|
+
result = self._values.get("data_source_bucket_name")
|
|
3327
|
+
assert result is not None, "Required property 'data_source_bucket_name' is missing"
|
|
3328
|
+
return typing.cast(builtins.str, result)
|
|
3329
|
+
|
|
3330
|
+
@builtins.property
|
|
3331
|
+
def chunking_strategy(self) -> typing.Optional[builtins.str]:
|
|
3332
|
+
'''(experimental) Chunking strategy for document processing.
|
|
3333
|
+
|
|
3334
|
+
- 'fixed-size': Split documents into fixed-size chunks
|
|
3335
|
+
- 'semantic': Use semantic boundaries for chunking
|
|
3336
|
+
- 'none': No chunking (use entire documents)
|
|
3337
|
+
|
|
3338
|
+
:default: 'fixed-size'
|
|
3339
|
+
|
|
3340
|
+
:stability: experimental
|
|
3341
|
+
'''
|
|
3342
|
+
result = self._values.get("chunking_strategy")
|
|
3343
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
3344
|
+
|
|
3345
|
+
@builtins.property
|
|
3346
|
+
def data_source_prefix(self) -> typing.Optional[builtins.str]:
|
|
3347
|
+
'''(experimental) S3 prefix for source documents within the bucket.
|
|
3348
|
+
|
|
3349
|
+
Only documents under this prefix will be indexed.
|
|
3350
|
+
|
|
3351
|
+
:default: - Root of bucket (all documents)
|
|
3352
|
+
|
|
3353
|
+
:stability: experimental
|
|
3354
|
+
'''
|
|
3355
|
+
result = self._values.get("data_source_prefix")
|
|
3356
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
3357
|
+
|
|
3358
|
+
@builtins.property
|
|
3359
|
+
def embedding_model_id(self) -> typing.Optional[builtins.str]:
|
|
3360
|
+
'''(experimental) Embedding model to use for vectorization.
|
|
3361
|
+
|
|
3362
|
+
Must be a valid Bedrock embedding model ID.
|
|
3363
|
+
|
|
3364
|
+
:default: 'amazon.titan-embed-text-v2:0'
|
|
3365
|
+
|
|
3366
|
+
:stability: experimental
|
|
3367
|
+
'''
|
|
3368
|
+
result = self._values.get("embedding_model_id")
|
|
3369
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
3370
|
+
|
|
3371
|
+
@builtins.property
|
|
3372
|
+
def max_tokens(self) -> typing.Optional[jsii.Number]:
|
|
3373
|
+
'''(experimental) Maximum chunk size in tokens (for fixed-size chunking).
|
|
3374
|
+
|
|
3375
|
+
Only used when chunkingStrategy is 'fixed-size'.
|
|
3376
|
+
|
|
3377
|
+
:default: 300
|
|
3378
|
+
|
|
3379
|
+
:stability: experimental
|
|
3380
|
+
'''
|
|
3381
|
+
result = self._values.get("max_tokens")
|
|
3382
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
3383
|
+
|
|
3384
|
+
@builtins.property
|
|
3385
|
+
def overlap_tokens(self) -> typing.Optional[jsii.Number]:
|
|
3386
|
+
'''(experimental) Overlap between chunks in tokens (for fixed-size chunking).
|
|
3387
|
+
|
|
3388
|
+
Only used when chunkingStrategy is 'fixed-size'.
|
|
3389
|
+
|
|
3390
|
+
:default: 20
|
|
3391
|
+
|
|
3392
|
+
:stability: experimental
|
|
3393
|
+
'''
|
|
3394
|
+
result = self._values.get("overlap_tokens")
|
|
3395
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
3396
|
+
|
|
3397
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
3398
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
3399
|
+
|
|
3400
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
3401
|
+
return not (rhs == self)
|
|
3402
|
+
|
|
3403
|
+
def __repr__(self) -> str:
|
|
3404
|
+
return "CreateKnowledgeBaseConfiguration(%s)" % ", ".join(
|
|
3405
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
3406
|
+
)
|
|
3407
|
+
|
|
3408
|
+
|
|
3409
|
+
@jsii.data_type(
|
|
3410
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.CustomDomainConfig",
|
|
3411
|
+
jsii_struct_bases=[],
|
|
3412
|
+
name_mapping={
|
|
3413
|
+
"certificate": "certificate",
|
|
3414
|
+
"domain_name": "domainName",
|
|
3415
|
+
"hosted_zone": "hostedZone",
|
|
3416
|
+
},
|
|
3417
|
+
)
|
|
3418
|
+
class CustomDomainConfig:
|
|
3419
|
+
def __init__(
|
|
3420
|
+
self,
|
|
3421
|
+
*,
|
|
3422
|
+
certificate: "_aws_cdk_aws_certificatemanager_ceddda9d.ICertificate",
|
|
3423
|
+
domain_name: builtins.str,
|
|
3424
|
+
hosted_zone: typing.Optional["_aws_cdk_aws_route53_ceddda9d.IHostedZone"] = None,
|
|
3425
|
+
) -> None:
|
|
3426
|
+
'''(experimental) Custom domain configuration for the frontend.
|
|
3427
|
+
|
|
3428
|
+
:param certificate: (experimental) SSL certificate for the domain (required when domainName is provided).
|
|
3429
|
+
:param domain_name: (experimental) Domain name for the frontend (e.g., 'app.example.com').
|
|
3430
|
+
:param hosted_zone: (experimental) Optional hosted zone for automatic DNS record creation.
|
|
3431
|
+
|
|
3432
|
+
:stability: experimental
|
|
3433
|
+
'''
|
|
3434
|
+
if __debug__:
|
|
3435
|
+
type_hints = typing.get_type_hints(_typecheckingstub__45e622c5dc8075e1ee5cdf9df72ea9b7ca33e0a7cf348dfaf54f93e635e9dde8)
|
|
3436
|
+
check_type(argname="argument certificate", value=certificate, expected_type=type_hints["certificate"])
|
|
3437
|
+
check_type(argname="argument domain_name", value=domain_name, expected_type=type_hints["domain_name"])
|
|
2770
3438
|
check_type(argname="argument hosted_zone", value=hosted_zone, expected_type=type_hints["hosted_zone"])
|
|
2771
3439
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
2772
3440
|
"certificate": certificate,
|
|
@@ -4239,6 +4907,78 @@ class FrontendProps:
|
|
|
4239
4907
|
)
|
|
4240
4908
|
|
|
4241
4909
|
|
|
4910
|
+
@jsii.data_type(
|
|
4911
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.GuardrailConfiguration",
|
|
4912
|
+
jsii_struct_bases=[],
|
|
4913
|
+
name_mapping={
|
|
4914
|
+
"guardrail_id": "guardrailId",
|
|
4915
|
+
"guardrail_version": "guardrailVersion",
|
|
4916
|
+
},
|
|
4917
|
+
)
|
|
4918
|
+
class GuardrailConfiguration:
|
|
4919
|
+
def __init__(
|
|
4920
|
+
self,
|
|
4921
|
+
*,
|
|
4922
|
+
guardrail_id: builtins.str,
|
|
4923
|
+
guardrail_version: typing.Optional[builtins.str] = None,
|
|
4924
|
+
) -> None:
|
|
4925
|
+
'''(experimental) Configuration for Bedrock Guardrails.
|
|
4926
|
+
|
|
4927
|
+
Guardrails filter content during retrieval operations to prevent
|
|
4928
|
+
inappropriate or sensitive content from being returned.
|
|
4929
|
+
|
|
4930
|
+
:param guardrail_id: (experimental) ID of the Bedrock Guardrail to apply. The guardrail must exist in the same region as the knowledge base.
|
|
4931
|
+
:param guardrail_version: (experimental) Version of the guardrail to use. Use 'DRAFT' for testing or a specific version number for production. Default: 'DRAFT'
|
|
4932
|
+
|
|
4933
|
+
:stability: experimental
|
|
4934
|
+
'''
|
|
4935
|
+
if __debug__:
|
|
4936
|
+
type_hints = typing.get_type_hints(_typecheckingstub__d604d1407a674dc8a1780469f6fca800816236372c95a3b5438a97e1c9faff32)
|
|
4937
|
+
check_type(argname="argument guardrail_id", value=guardrail_id, expected_type=type_hints["guardrail_id"])
|
|
4938
|
+
check_type(argname="argument guardrail_version", value=guardrail_version, expected_type=type_hints["guardrail_version"])
|
|
4939
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
4940
|
+
"guardrail_id": guardrail_id,
|
|
4941
|
+
}
|
|
4942
|
+
if guardrail_version is not None:
|
|
4943
|
+
self._values["guardrail_version"] = guardrail_version
|
|
4944
|
+
|
|
4945
|
+
@builtins.property
|
|
4946
|
+
def guardrail_id(self) -> builtins.str:
|
|
4947
|
+
'''(experimental) ID of the Bedrock Guardrail to apply.
|
|
4948
|
+
|
|
4949
|
+
The guardrail must exist in the same region as the knowledge base.
|
|
4950
|
+
|
|
4951
|
+
:stability: experimental
|
|
4952
|
+
'''
|
|
4953
|
+
result = self._values.get("guardrail_id")
|
|
4954
|
+
assert result is not None, "Required property 'guardrail_id' is missing"
|
|
4955
|
+
return typing.cast(builtins.str, result)
|
|
4956
|
+
|
|
4957
|
+
@builtins.property
|
|
4958
|
+
def guardrail_version(self) -> typing.Optional[builtins.str]:
|
|
4959
|
+
'''(experimental) Version of the guardrail to use.
|
|
4960
|
+
|
|
4961
|
+
Use 'DRAFT' for testing or a specific version number for production.
|
|
4962
|
+
|
|
4963
|
+
:default: 'DRAFT'
|
|
4964
|
+
|
|
4965
|
+
:stability: experimental
|
|
4966
|
+
'''
|
|
4967
|
+
result = self._values.get("guardrail_version")
|
|
4968
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
4969
|
+
|
|
4970
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
4971
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
4972
|
+
|
|
4973
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
4974
|
+
return not (rhs == self)
|
|
4975
|
+
|
|
4976
|
+
def __repr__(self) -> str:
|
|
4977
|
+
return "GuardrailConfiguration(%s)" % ", ".join(
|
|
4978
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
4979
|
+
)
|
|
4980
|
+
|
|
4981
|
+
|
|
4242
4982
|
@jsii.data_type(
|
|
4243
4983
|
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.HybridConfig",
|
|
4244
4984
|
jsii_struct_bases=[],
|
|
@@ -4699,6 +5439,210 @@ class _IAdapterProxy:
|
|
|
4699
5439
|
typing.cast(typing.Any, IAdapter).__jsii_proxy_class__ = lambda : _IAdapterProxy
|
|
4700
5440
|
|
|
4701
5441
|
|
|
5442
|
+
@jsii.interface(jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.IKnowledgeBase")
|
|
5443
|
+
class IKnowledgeBase(typing_extensions.Protocol):
|
|
5444
|
+
'''(experimental) Interface for knowledge base implementations.
|
|
5445
|
+
|
|
5446
|
+
This interface defines the contract that all knowledge base implementations must satisfy,
|
|
5447
|
+
allowing different KB backends (Bedrock KB, OpenSearch, custom) to be used interchangeably
|
|
5448
|
+
with the agent framework.
|
|
5449
|
+
|
|
5450
|
+
Implementations of this interface are responsible for:
|
|
5451
|
+
|
|
5452
|
+
- Providing metadata about the knowledge base (name, description)
|
|
5453
|
+
- Generating the IAM permissions required for the agent to access the KB
|
|
5454
|
+
- Exporting runtime configuration for the retrieval tool
|
|
5455
|
+
- Optionally providing a custom retrieval tool implementation
|
|
5456
|
+
|
|
5457
|
+
:stability: experimental
|
|
5458
|
+
'''
|
|
5459
|
+
|
|
5460
|
+
@builtins.property
|
|
5461
|
+
@jsii.member(jsii_name="description")
|
|
5462
|
+
def description(self) -> builtins.str:
|
|
5463
|
+
'''(experimental) Human-readable description of what this knowledge base contains.
|
|
5464
|
+
|
|
5465
|
+
This description is included in the agent's system prompt to help
|
|
5466
|
+
the agent decide when to query this knowledge base. It should clearly
|
|
5467
|
+
indicate what type of information the KB contains and when it should
|
|
5468
|
+
be used.
|
|
5469
|
+
|
|
5470
|
+
:stability: experimental
|
|
5471
|
+
|
|
5472
|
+
Example::
|
|
5473
|
+
|
|
5474
|
+
'Contains product documentation, user guides, and FAQs. Use when answering questions about product features or troubleshooting.'
|
|
5475
|
+
'''
|
|
5476
|
+
...
|
|
5477
|
+
|
|
5478
|
+
@builtins.property
|
|
5479
|
+
@jsii.member(jsii_name="name")
|
|
5480
|
+
def name(self) -> builtins.str:
|
|
5481
|
+
'''(experimental) Human-readable name for this knowledge base.
|
|
5482
|
+
|
|
5483
|
+
This name is used for logging, display purposes, and to help the agent
|
|
5484
|
+
identify which knowledge base to query. It should be unique within
|
|
5485
|
+
the set of knowledge bases configured for an agent.
|
|
5486
|
+
|
|
5487
|
+
:stability: experimental
|
|
5488
|
+
|
|
5489
|
+
Example::
|
|
5490
|
+
|
|
5491
|
+
'product-documentation'
|
|
5492
|
+
'''
|
|
5493
|
+
...
|
|
5494
|
+
|
|
5495
|
+
@jsii.member(jsii_name="exportConfiguration")
|
|
5496
|
+
def export_configuration(self) -> "KnowledgeBaseRuntimeConfig":
|
|
5497
|
+
'''(experimental) Export configuration for runtime use by the retrieval tool.
|
|
5498
|
+
|
|
5499
|
+
This method returns a configuration object that will be serialized
|
|
5500
|
+
and passed to the retrieval tool via environment variables. The
|
|
5501
|
+
configuration includes all information needed to query the KB at runtime.
|
|
5502
|
+
|
|
5503
|
+
:return: Runtime configuration object for the retrieval tool
|
|
5504
|
+
|
|
5505
|
+
:stability: experimental
|
|
5506
|
+
'''
|
|
5507
|
+
...
|
|
5508
|
+
|
|
5509
|
+
@jsii.member(jsii_name="generateIamPermissions")
|
|
5510
|
+
def generate_iam_permissions(
|
|
5511
|
+
self,
|
|
5512
|
+
) -> typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]:
|
|
5513
|
+
'''(experimental) Generate IAM policy statements required for accessing this knowledge base.
|
|
5514
|
+
|
|
5515
|
+
This method returns the IAM permissions that the agent's Lambda function
|
|
5516
|
+
role needs to query this knowledge base. The permissions should follow
|
|
5517
|
+
the principle of least privilege, scoped to the specific resources.
|
|
5518
|
+
|
|
5519
|
+
:return: Array of IAM PolicyStatement objects granting necessary permissions
|
|
5520
|
+
|
|
5521
|
+
:stability: experimental
|
|
5522
|
+
'''
|
|
5523
|
+
...
|
|
5524
|
+
|
|
5525
|
+
@jsii.member(jsii_name="retrievalToolAsset")
|
|
5526
|
+
def retrieval_tool_asset(
|
|
5527
|
+
self,
|
|
5528
|
+
) -> typing.Optional["_aws_cdk_aws_s3_assets_ceddda9d.Asset"]:
|
|
5529
|
+
'''(experimental) Provide the retrieval tool asset for this knowledge base type.
|
|
5530
|
+
|
|
5531
|
+
This optional method allows knowledge base implementations to provide
|
|
5532
|
+
a custom retrieval tool. If not implemented or returns undefined,
|
|
5533
|
+
the framework's default retrieval tool will be used.
|
|
5534
|
+
|
|
5535
|
+
:return: S3 Asset containing the retrieval tool code, or undefined to use the default
|
|
5536
|
+
|
|
5537
|
+
:stability: experimental
|
|
5538
|
+
'''
|
|
5539
|
+
...
|
|
5540
|
+
|
|
5541
|
+
|
|
5542
|
+
class _IKnowledgeBaseProxy:
|
|
5543
|
+
'''(experimental) Interface for knowledge base implementations.
|
|
5544
|
+
|
|
5545
|
+
This interface defines the contract that all knowledge base implementations must satisfy,
|
|
5546
|
+
allowing different KB backends (Bedrock KB, OpenSearch, custom) to be used interchangeably
|
|
5547
|
+
with the agent framework.
|
|
5548
|
+
|
|
5549
|
+
Implementations of this interface are responsible for:
|
|
5550
|
+
|
|
5551
|
+
- Providing metadata about the knowledge base (name, description)
|
|
5552
|
+
- Generating the IAM permissions required for the agent to access the KB
|
|
5553
|
+
- Exporting runtime configuration for the retrieval tool
|
|
5554
|
+
- Optionally providing a custom retrieval tool implementation
|
|
5555
|
+
|
|
5556
|
+
:stability: experimental
|
|
5557
|
+
'''
|
|
5558
|
+
|
|
5559
|
+
__jsii_type__: typing.ClassVar[str] = "@cdklabs/cdk-appmod-catalog-blueprints.IKnowledgeBase"
|
|
5560
|
+
|
|
5561
|
+
@builtins.property
|
|
5562
|
+
@jsii.member(jsii_name="description")
|
|
5563
|
+
def description(self) -> builtins.str:
|
|
5564
|
+
'''(experimental) Human-readable description of what this knowledge base contains.
|
|
5565
|
+
|
|
5566
|
+
This description is included in the agent's system prompt to help
|
|
5567
|
+
the agent decide when to query this knowledge base. It should clearly
|
|
5568
|
+
indicate what type of information the KB contains and when it should
|
|
5569
|
+
be used.
|
|
5570
|
+
|
|
5571
|
+
:stability: experimental
|
|
5572
|
+
|
|
5573
|
+
Example::
|
|
5574
|
+
|
|
5575
|
+
'Contains product documentation, user guides, and FAQs. Use when answering questions about product features or troubleshooting.'
|
|
5576
|
+
'''
|
|
5577
|
+
return typing.cast(builtins.str, jsii.get(self, "description"))
|
|
5578
|
+
|
|
5579
|
+
@builtins.property
|
|
5580
|
+
@jsii.member(jsii_name="name")
|
|
5581
|
+
def name(self) -> builtins.str:
|
|
5582
|
+
'''(experimental) Human-readable name for this knowledge base.
|
|
5583
|
+
|
|
5584
|
+
This name is used for logging, display purposes, and to help the agent
|
|
5585
|
+
identify which knowledge base to query. It should be unique within
|
|
5586
|
+
the set of knowledge bases configured for an agent.
|
|
5587
|
+
|
|
5588
|
+
:stability: experimental
|
|
5589
|
+
|
|
5590
|
+
Example::
|
|
5591
|
+
|
|
5592
|
+
'product-documentation'
|
|
5593
|
+
'''
|
|
5594
|
+
return typing.cast(builtins.str, jsii.get(self, "name"))
|
|
5595
|
+
|
|
5596
|
+
@jsii.member(jsii_name="exportConfiguration")
|
|
5597
|
+
def export_configuration(self) -> "KnowledgeBaseRuntimeConfig":
|
|
5598
|
+
'''(experimental) Export configuration for runtime use by the retrieval tool.
|
|
5599
|
+
|
|
5600
|
+
This method returns a configuration object that will be serialized
|
|
5601
|
+
and passed to the retrieval tool via environment variables. The
|
|
5602
|
+
configuration includes all information needed to query the KB at runtime.
|
|
5603
|
+
|
|
5604
|
+
:return: Runtime configuration object for the retrieval tool
|
|
5605
|
+
|
|
5606
|
+
:stability: experimental
|
|
5607
|
+
'''
|
|
5608
|
+
return typing.cast("KnowledgeBaseRuntimeConfig", jsii.invoke(self, "exportConfiguration", []))
|
|
5609
|
+
|
|
5610
|
+
@jsii.member(jsii_name="generateIamPermissions")
|
|
5611
|
+
def generate_iam_permissions(
|
|
5612
|
+
self,
|
|
5613
|
+
) -> typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]:
|
|
5614
|
+
'''(experimental) Generate IAM policy statements required for accessing this knowledge base.
|
|
5615
|
+
|
|
5616
|
+
This method returns the IAM permissions that the agent's Lambda function
|
|
5617
|
+
role needs to query this knowledge base. The permissions should follow
|
|
5618
|
+
the principle of least privilege, scoped to the specific resources.
|
|
5619
|
+
|
|
5620
|
+
:return: Array of IAM PolicyStatement objects granting necessary permissions
|
|
5621
|
+
|
|
5622
|
+
:stability: experimental
|
|
5623
|
+
'''
|
|
5624
|
+
return typing.cast(typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"], jsii.invoke(self, "generateIamPermissions", []))
|
|
5625
|
+
|
|
5626
|
+
@jsii.member(jsii_name="retrievalToolAsset")
|
|
5627
|
+
def retrieval_tool_asset(
|
|
5628
|
+
self,
|
|
5629
|
+
) -> typing.Optional["_aws_cdk_aws_s3_assets_ceddda9d.Asset"]:
|
|
5630
|
+
'''(experimental) Provide the retrieval tool asset for this knowledge base type.
|
|
5631
|
+
|
|
5632
|
+
This optional method allows knowledge base implementations to provide
|
|
5633
|
+
a custom retrieval tool. If not implemented or returns undefined,
|
|
5634
|
+
the framework's default retrieval tool will be used.
|
|
5635
|
+
|
|
5636
|
+
:return: S3 Asset containing the retrieval tool code, or undefined to use the default
|
|
5637
|
+
|
|
5638
|
+
:stability: experimental
|
|
5639
|
+
'''
|
|
5640
|
+
return typing.cast(typing.Optional["_aws_cdk_aws_s3_assets_ceddda9d.Asset"], jsii.invoke(self, "retrievalToolAsset", []))
|
|
5641
|
+
|
|
5642
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
5643
|
+
typing.cast(typing.Any, IKnowledgeBase).__jsii_proxy_class__ = lambda : _IKnowledgeBaseProxy
|
|
5644
|
+
|
|
5645
|
+
|
|
4702
5646
|
@jsii.interface(jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.IObservable")
|
|
4703
5647
|
class IObservable(typing_extensions.Protocol):
|
|
4704
5648
|
'''(experimental) Interface providing configuration parameters for constructs that support Observability.
|
|
@@ -4781,6 +5725,247 @@ class _IObservableProxy:
|
|
|
4781
5725
|
typing.cast(typing.Any, IObservable).__jsii_proxy_class__ = lambda : _IObservableProxy
|
|
4782
5726
|
|
|
4783
5727
|
|
|
5728
|
+
@jsii.enum(jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.InvokeType")
|
|
5729
|
+
class InvokeType(enum.Enum):
|
|
5730
|
+
'''(experimental) Agent invocation type enumeration.
|
|
5731
|
+
|
|
5732
|
+
Defines the processing mode for the agent.
|
|
5733
|
+
Must match the Python InvokeType enum in batch.py.
|
|
5734
|
+
|
|
5735
|
+
:stability: experimental
|
|
5736
|
+
'''
|
|
5737
|
+
|
|
5738
|
+
BATCH = "BATCH"
|
|
5739
|
+
'''(experimental) Batch processing mode - processes one document at a time.
|
|
5740
|
+
|
|
5741
|
+
Default mode for most agent operations.
|
|
5742
|
+
|
|
5743
|
+
:stability: experimental
|
|
5744
|
+
'''
|
|
5745
|
+
INTERACTIVE = "INTERACTIVE"
|
|
5746
|
+
'''(experimental) Interactive conversation mode (future).
|
|
5747
|
+
|
|
5748
|
+
For real-time chat and conversational interfaces.
|
|
5749
|
+
|
|
5750
|
+
:stability: experimental
|
|
5751
|
+
'''
|
|
5752
|
+
ATTACH_DIRECTLY = "ATTACH_DIRECTLY"
|
|
5753
|
+
'''(experimental) Direct invocation mode.
|
|
5754
|
+
|
|
5755
|
+
Used for RAG applications, API endpoints, and direct agent calls.
|
|
5756
|
+
|
|
5757
|
+
:stability: experimental
|
|
5758
|
+
'''
|
|
5759
|
+
CLASSIFICATION = "CLASSIFICATION"
|
|
5760
|
+
'''(experimental) Document classification step.
|
|
5761
|
+
|
|
5762
|
+
Used in document processing workflows for classification phase.
|
|
5763
|
+
|
|
5764
|
+
:stability: experimental
|
|
5765
|
+
'''
|
|
5766
|
+
PROCESSING = "PROCESSING"
|
|
5767
|
+
'''(experimental) Document processing step.
|
|
5768
|
+
|
|
5769
|
+
Used in document processing workflows for extraction/processing phase.
|
|
5770
|
+
|
|
5771
|
+
:stability: experimental
|
|
5772
|
+
'''
|
|
5773
|
+
AGGREGATION = "AGGREGATION"
|
|
5774
|
+
'''(experimental) Document aggregation step.
|
|
5775
|
+
|
|
5776
|
+
Used in document processing workflows for aggregating chunked results.
|
|
5777
|
+
|
|
5778
|
+
:stability: experimental
|
|
5779
|
+
'''
|
|
5780
|
+
|
|
5781
|
+
|
|
5782
|
+
@jsii.data_type(
|
|
5783
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.KnowledgeBaseRuntimeConfig",
|
|
5784
|
+
jsii_struct_bases=[],
|
|
5785
|
+
name_mapping={
|
|
5786
|
+
"description": "description",
|
|
5787
|
+
"name": "name",
|
|
5788
|
+
"retrieval": "retrieval",
|
|
5789
|
+
"acl": "acl",
|
|
5790
|
+
"guardrail": "guardrail",
|
|
5791
|
+
"knowledge_base_arn": "knowledgeBaseArn",
|
|
5792
|
+
"knowledge_base_id": "knowledgeBaseId",
|
|
5793
|
+
"type": "type",
|
|
5794
|
+
"vector_store": "vectorStore",
|
|
5795
|
+
},
|
|
5796
|
+
)
|
|
5797
|
+
class KnowledgeBaseRuntimeConfig:
|
|
5798
|
+
def __init__(
|
|
5799
|
+
self,
|
|
5800
|
+
*,
|
|
5801
|
+
description: builtins.str,
|
|
5802
|
+
name: builtins.str,
|
|
5803
|
+
retrieval: typing.Union["RetrievalConfiguration", typing.Dict[builtins.str, typing.Any]],
|
|
5804
|
+
acl: typing.Optional[typing.Union["AclConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5805
|
+
guardrail: typing.Optional[typing.Union["GuardrailConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5806
|
+
knowledge_base_arn: typing.Optional[builtins.str] = None,
|
|
5807
|
+
knowledge_base_id: typing.Optional[builtins.str] = None,
|
|
5808
|
+
type: typing.Optional[builtins.str] = None,
|
|
5809
|
+
vector_store: typing.Optional[typing.Union["VectorStoreConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5810
|
+
) -> None:
|
|
5811
|
+
'''(experimental) Runtime configuration exported for the retrieval tool.
|
|
5812
|
+
|
|
5813
|
+
This interface defines the structure of the configuration object
|
|
5814
|
+
that is serialized and passed to the retrieval tool via environment
|
|
5815
|
+
variables. It contains all information needed to query the knowledge
|
|
5816
|
+
base at runtime.
|
|
5817
|
+
|
|
5818
|
+
:param description: (experimental) Description of what this knowledge base contains.
|
|
5819
|
+
:param name: (experimental) Human-readable name for this knowledge base.
|
|
5820
|
+
:param retrieval: (experimental) Retrieval configuration.
|
|
5821
|
+
:param acl: (experimental) ACL configuration for identity-aware retrieval.
|
|
5822
|
+
:param guardrail: (experimental) Guardrail configuration (for Bedrock implementations).
|
|
5823
|
+
:param knowledge_base_arn: (experimental) Bedrock Knowledge Base ARN (for Bedrock implementations).
|
|
5824
|
+
:param knowledge_base_id: (experimental) Bedrock Knowledge Base ID (for Bedrock implementations).
|
|
5825
|
+
:param type: (experimental) Type of knowledge base implementation. Used by the retrieval tool to determine how to query the KB.
|
|
5826
|
+
:param vector_store: (experimental) Vector store configuration (for Bedrock implementations).
|
|
5827
|
+
|
|
5828
|
+
:stability: experimental
|
|
5829
|
+
'''
|
|
5830
|
+
if isinstance(retrieval, dict):
|
|
5831
|
+
retrieval = RetrievalConfiguration(**retrieval)
|
|
5832
|
+
if isinstance(acl, dict):
|
|
5833
|
+
acl = AclConfiguration(**acl)
|
|
5834
|
+
if isinstance(guardrail, dict):
|
|
5835
|
+
guardrail = GuardrailConfiguration(**guardrail)
|
|
5836
|
+
if isinstance(vector_store, dict):
|
|
5837
|
+
vector_store = VectorStoreConfiguration(**vector_store)
|
|
5838
|
+
if __debug__:
|
|
5839
|
+
type_hints = typing.get_type_hints(_typecheckingstub__eba4c5624b16f91d89be2a09eeaf9e99f078cde0dfdfdaa2d50e663d366ce5a1)
|
|
5840
|
+
check_type(argname="argument description", value=description, expected_type=type_hints["description"])
|
|
5841
|
+
check_type(argname="argument name", value=name, expected_type=type_hints["name"])
|
|
5842
|
+
check_type(argname="argument retrieval", value=retrieval, expected_type=type_hints["retrieval"])
|
|
5843
|
+
check_type(argname="argument acl", value=acl, expected_type=type_hints["acl"])
|
|
5844
|
+
check_type(argname="argument guardrail", value=guardrail, expected_type=type_hints["guardrail"])
|
|
5845
|
+
check_type(argname="argument knowledge_base_arn", value=knowledge_base_arn, expected_type=type_hints["knowledge_base_arn"])
|
|
5846
|
+
check_type(argname="argument knowledge_base_id", value=knowledge_base_id, expected_type=type_hints["knowledge_base_id"])
|
|
5847
|
+
check_type(argname="argument type", value=type, expected_type=type_hints["type"])
|
|
5848
|
+
check_type(argname="argument vector_store", value=vector_store, expected_type=type_hints["vector_store"])
|
|
5849
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
5850
|
+
"description": description,
|
|
5851
|
+
"name": name,
|
|
5852
|
+
"retrieval": retrieval,
|
|
5853
|
+
}
|
|
5854
|
+
if acl is not None:
|
|
5855
|
+
self._values["acl"] = acl
|
|
5856
|
+
if guardrail is not None:
|
|
5857
|
+
self._values["guardrail"] = guardrail
|
|
5858
|
+
if knowledge_base_arn is not None:
|
|
5859
|
+
self._values["knowledge_base_arn"] = knowledge_base_arn
|
|
5860
|
+
if knowledge_base_id is not None:
|
|
5861
|
+
self._values["knowledge_base_id"] = knowledge_base_id
|
|
5862
|
+
if type is not None:
|
|
5863
|
+
self._values["type"] = type
|
|
5864
|
+
if vector_store is not None:
|
|
5865
|
+
self._values["vector_store"] = vector_store
|
|
5866
|
+
|
|
5867
|
+
@builtins.property
|
|
5868
|
+
def description(self) -> builtins.str:
|
|
5869
|
+
'''(experimental) Description of what this knowledge base contains.
|
|
5870
|
+
|
|
5871
|
+
:stability: experimental
|
|
5872
|
+
'''
|
|
5873
|
+
result = self._values.get("description")
|
|
5874
|
+
assert result is not None, "Required property 'description' is missing"
|
|
5875
|
+
return typing.cast(builtins.str, result)
|
|
5876
|
+
|
|
5877
|
+
@builtins.property
|
|
5878
|
+
def name(self) -> builtins.str:
|
|
5879
|
+
'''(experimental) Human-readable name for this knowledge base.
|
|
5880
|
+
|
|
5881
|
+
:stability: experimental
|
|
5882
|
+
'''
|
|
5883
|
+
result = self._values.get("name")
|
|
5884
|
+
assert result is not None, "Required property 'name' is missing"
|
|
5885
|
+
return typing.cast(builtins.str, result)
|
|
5886
|
+
|
|
5887
|
+
@builtins.property
|
|
5888
|
+
def retrieval(self) -> "RetrievalConfiguration":
|
|
5889
|
+
'''(experimental) Retrieval configuration.
|
|
5890
|
+
|
|
5891
|
+
:stability: experimental
|
|
5892
|
+
'''
|
|
5893
|
+
result = self._values.get("retrieval")
|
|
5894
|
+
assert result is not None, "Required property 'retrieval' is missing"
|
|
5895
|
+
return typing.cast("RetrievalConfiguration", result)
|
|
5896
|
+
|
|
5897
|
+
@builtins.property
|
|
5898
|
+
def acl(self) -> typing.Optional["AclConfiguration"]:
|
|
5899
|
+
'''(experimental) ACL configuration for identity-aware retrieval.
|
|
5900
|
+
|
|
5901
|
+
:stability: experimental
|
|
5902
|
+
'''
|
|
5903
|
+
result = self._values.get("acl")
|
|
5904
|
+
return typing.cast(typing.Optional["AclConfiguration"], result)
|
|
5905
|
+
|
|
5906
|
+
@builtins.property
|
|
5907
|
+
def guardrail(self) -> typing.Optional["GuardrailConfiguration"]:
|
|
5908
|
+
'''(experimental) Guardrail configuration (for Bedrock implementations).
|
|
5909
|
+
|
|
5910
|
+
:stability: experimental
|
|
5911
|
+
'''
|
|
5912
|
+
result = self._values.get("guardrail")
|
|
5913
|
+
return typing.cast(typing.Optional["GuardrailConfiguration"], result)
|
|
5914
|
+
|
|
5915
|
+
@builtins.property
|
|
5916
|
+
def knowledge_base_arn(self) -> typing.Optional[builtins.str]:
|
|
5917
|
+
'''(experimental) Bedrock Knowledge Base ARN (for Bedrock implementations).
|
|
5918
|
+
|
|
5919
|
+
:stability: experimental
|
|
5920
|
+
'''
|
|
5921
|
+
result = self._values.get("knowledge_base_arn")
|
|
5922
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
5923
|
+
|
|
5924
|
+
@builtins.property
|
|
5925
|
+
def knowledge_base_id(self) -> typing.Optional[builtins.str]:
|
|
5926
|
+
'''(experimental) Bedrock Knowledge Base ID (for Bedrock implementations).
|
|
5927
|
+
|
|
5928
|
+
:stability: experimental
|
|
5929
|
+
'''
|
|
5930
|
+
result = self._values.get("knowledge_base_id")
|
|
5931
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
5932
|
+
|
|
5933
|
+
@builtins.property
|
|
5934
|
+
def type(self) -> typing.Optional[builtins.str]:
|
|
5935
|
+
'''(experimental) Type of knowledge base implementation.
|
|
5936
|
+
|
|
5937
|
+
Used by the retrieval tool to determine how to query the KB.
|
|
5938
|
+
|
|
5939
|
+
:stability: experimental
|
|
5940
|
+
|
|
5941
|
+
Example::
|
|
5942
|
+
|
|
5943
|
+
'bedrock'
|
|
5944
|
+
'''
|
|
5945
|
+
result = self._values.get("type")
|
|
5946
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
5947
|
+
|
|
5948
|
+
@builtins.property
|
|
5949
|
+
def vector_store(self) -> typing.Optional["VectorStoreConfiguration"]:
|
|
5950
|
+
'''(experimental) Vector store configuration (for Bedrock implementations).
|
|
5951
|
+
|
|
5952
|
+
:stability: experimental
|
|
5953
|
+
'''
|
|
5954
|
+
result = self._values.get("vector_store")
|
|
5955
|
+
return typing.cast(typing.Optional["VectorStoreConfiguration"], result)
|
|
5956
|
+
|
|
5957
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
5958
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
5959
|
+
|
|
5960
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
5961
|
+
return not (rhs == self)
|
|
5962
|
+
|
|
5963
|
+
def __repr__(self) -> str:
|
|
5964
|
+
return "KnowledgeBaseRuntimeConfig(%s)" % ", ".join(
|
|
5965
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
5966
|
+
)
|
|
5967
|
+
|
|
5968
|
+
|
|
4784
5969
|
class LambdaIamUtils(
|
|
4785
5970
|
metaclass=jsii.JSIIMeta,
|
|
4786
5971
|
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.LambdaIamUtils",
|
|
@@ -6386,6 +7571,84 @@ class QueuedS3AdapterProps:
|
|
|
6386
7571
|
)
|
|
6387
7572
|
|
|
6388
7573
|
|
|
7574
|
+
@jsii.data_type(
|
|
7575
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.RetrievalConfiguration",
|
|
7576
|
+
jsii_struct_bases=[],
|
|
7577
|
+
name_mapping={
|
|
7578
|
+
"number_of_results": "numberOfResults",
|
|
7579
|
+
"retrieval_filter": "retrievalFilter",
|
|
7580
|
+
},
|
|
7581
|
+
)
|
|
7582
|
+
class RetrievalConfiguration:
|
|
7583
|
+
def __init__(
|
|
7584
|
+
self,
|
|
7585
|
+
*,
|
|
7586
|
+
number_of_results: typing.Optional[jsii.Number] = None,
|
|
7587
|
+
retrieval_filter: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
|
|
7588
|
+
) -> None:
|
|
7589
|
+
'''(experimental) Configuration for retrieval operations.
|
|
7590
|
+
|
|
7591
|
+
Controls how many results are returned and optional metadata filtering
|
|
7592
|
+
applied to all queries against the knowledge base.
|
|
7593
|
+
|
|
7594
|
+
:param number_of_results: (experimental) Number of results to return per query. Higher values provide more context but increase token usage. Lower values are faster but may miss relevant information. Default: 5
|
|
7595
|
+
:param retrieval_filter: (experimental) Metadata filter to apply to all queries. This filter is applied in addition to any ACL filters. Use this for static filtering based on document metadata (e.g., document type, category, or date range). Default: - No filter applied
|
|
7596
|
+
|
|
7597
|
+
:stability: experimental
|
|
7598
|
+
'''
|
|
7599
|
+
if __debug__:
|
|
7600
|
+
type_hints = typing.get_type_hints(_typecheckingstub__0389e881defd6b748c16712149b25f1d6a9c2415742f6287f9424ffee6d97ac9)
|
|
7601
|
+
check_type(argname="argument number_of_results", value=number_of_results, expected_type=type_hints["number_of_results"])
|
|
7602
|
+
check_type(argname="argument retrieval_filter", value=retrieval_filter, expected_type=type_hints["retrieval_filter"])
|
|
7603
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
7604
|
+
if number_of_results is not None:
|
|
7605
|
+
self._values["number_of_results"] = number_of_results
|
|
7606
|
+
if retrieval_filter is not None:
|
|
7607
|
+
self._values["retrieval_filter"] = retrieval_filter
|
|
7608
|
+
|
|
7609
|
+
@builtins.property
|
|
7610
|
+
def number_of_results(self) -> typing.Optional[jsii.Number]:
|
|
7611
|
+
'''(experimental) Number of results to return per query.
|
|
7612
|
+
|
|
7613
|
+
Higher values provide more context but increase token usage.
|
|
7614
|
+
Lower values are faster but may miss relevant information.
|
|
7615
|
+
|
|
7616
|
+
:default: 5
|
|
7617
|
+
|
|
7618
|
+
:stability: experimental
|
|
7619
|
+
'''
|
|
7620
|
+
result = self._values.get("number_of_results")
|
|
7621
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
7622
|
+
|
|
7623
|
+
@builtins.property
|
|
7624
|
+
def retrieval_filter(
|
|
7625
|
+
self,
|
|
7626
|
+
) -> typing.Optional[typing.Mapping[builtins.str, typing.Any]]:
|
|
7627
|
+
'''(experimental) Metadata filter to apply to all queries.
|
|
7628
|
+
|
|
7629
|
+
This filter is applied in addition to any ACL filters. Use this
|
|
7630
|
+
for static filtering based on document metadata (e.g., document type,
|
|
7631
|
+
category, or date range).
|
|
7632
|
+
|
|
7633
|
+
:default: - No filter applied
|
|
7634
|
+
|
|
7635
|
+
:stability: experimental
|
|
7636
|
+
'''
|
|
7637
|
+
result = self._values.get("retrieval_filter")
|
|
7638
|
+
return typing.cast(typing.Optional[typing.Mapping[builtins.str, typing.Any]], result)
|
|
7639
|
+
|
|
7640
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
7641
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
7642
|
+
|
|
7643
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
7644
|
+
return not (rhs == self)
|
|
7645
|
+
|
|
7646
|
+
def __repr__(self) -> str:
|
|
7647
|
+
return "RetrievalConfiguration(%s)" % ", ".join(
|
|
7648
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
7649
|
+
)
|
|
7650
|
+
|
|
7651
|
+
|
|
6389
7652
|
@jsii.implements(_aws_cdk_ceddda9d.IPropertyInjector)
|
|
6390
7653
|
class StateMachineObservabilityPropertyInjector(
|
|
6391
7654
|
metaclass=jsii.JSIIMeta,
|
|
@@ -6593,43 +7856,135 @@ class TokenBasedConfig:
|
|
|
6593
7856
|
self._values["token_threshold"] = token_threshold
|
|
6594
7857
|
|
|
6595
7858
|
@builtins.property
|
|
6596
|
-
def max_tokens_per_chunk(self) -> typing.Optional[jsii.Number]:
|
|
6597
|
-
'''(experimental) Maximum tokens per chunk.
|
|
7859
|
+
def max_tokens_per_chunk(self) -> typing.Optional[jsii.Number]:
|
|
7860
|
+
'''(experimental) Maximum tokens per chunk.
|
|
7861
|
+
|
|
7862
|
+
Ensures no chunk exceeds model token limits.
|
|
7863
|
+
|
|
7864
|
+
:default: 100000
|
|
7865
|
+
|
|
7866
|
+
:stability: experimental
|
|
7867
|
+
'''
|
|
7868
|
+
result = self._values.get("max_tokens_per_chunk")
|
|
7869
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
7870
|
+
|
|
7871
|
+
@builtins.property
|
|
7872
|
+
def overlap_tokens(self) -> typing.Optional[jsii.Number]:
|
|
7873
|
+
'''(experimental) Number of overlapping tokens between consecutive chunks.
|
|
7874
|
+
|
|
7875
|
+
Provides context continuity across chunks.
|
|
7876
|
+
|
|
7877
|
+
:default: 5000
|
|
7878
|
+
|
|
7879
|
+
:stability: experimental
|
|
7880
|
+
'''
|
|
7881
|
+
result = self._values.get("overlap_tokens")
|
|
7882
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
7883
|
+
|
|
7884
|
+
@builtins.property
|
|
7885
|
+
def token_threshold(self) -> typing.Optional[jsii.Number]:
|
|
7886
|
+
'''(experimental) Threshold for triggering chunking based on token count.
|
|
7887
|
+
|
|
7888
|
+
Documents with tokens > threshold will be chunked.
|
|
7889
|
+
|
|
7890
|
+
:default: 150000
|
|
7891
|
+
|
|
7892
|
+
:stability: experimental
|
|
7893
|
+
'''
|
|
7894
|
+
result = self._values.get("token_threshold")
|
|
7895
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
7896
|
+
|
|
7897
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
7898
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
7899
|
+
|
|
7900
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
7901
|
+
return not (rhs == self)
|
|
7902
|
+
|
|
7903
|
+
def __repr__(self) -> str:
|
|
7904
|
+
return "TokenBasedConfig(%s)" % ", ".join(
|
|
7905
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
7906
|
+
)
|
|
7907
|
+
|
|
7908
|
+
|
|
7909
|
+
@jsii.data_type(
|
|
7910
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.VectorStoreConfiguration",
|
|
7911
|
+
jsii_struct_bases=[],
|
|
7912
|
+
name_mapping={"bucket_name": "bucketName", "prefix": "prefix", "type": "type"},
|
|
7913
|
+
)
|
|
7914
|
+
class VectorStoreConfiguration:
|
|
7915
|
+
def __init__(
|
|
7916
|
+
self,
|
|
7917
|
+
*,
|
|
7918
|
+
bucket_name: typing.Optional[builtins.str] = None,
|
|
7919
|
+
prefix: typing.Optional[builtins.str] = None,
|
|
7920
|
+
type: typing.Optional[builtins.str] = None,
|
|
7921
|
+
) -> None:
|
|
7922
|
+
'''(experimental) Configuration for vector store used by the knowledge base.
|
|
7923
|
+
|
|
7924
|
+
Defines the type of vector store and any type-specific configuration.
|
|
7925
|
+
S3 Vectors is the default and recommended option for most use cases.
|
|
7926
|
+
|
|
7927
|
+
:param bucket_name: (experimental) S3 bucket name for S3 Vectors storage. Only used when type is 's3-vectors'. If not provided, the default bucket created by Bedrock will be used. Default: - Uses Bedrock's default bucket
|
|
7928
|
+
:param prefix: (experimental) S3 prefix for vectors within the bucket. Only used when type is 's3-vectors'. Default: 'vectors/'
|
|
7929
|
+
:param type: (experimental) Type of vector store. - 's3-vectors': Amazon S3 vector storage (default, recommended) - 'opensearch-serverless': Amazon OpenSearch Serverless - 'pinecone': Pinecone vector database - 'rds': Amazon RDS with pgvector Default: 's3-vectors'
|
|
7930
|
+
|
|
7931
|
+
:stability: experimental
|
|
7932
|
+
'''
|
|
7933
|
+
if __debug__:
|
|
7934
|
+
type_hints = typing.get_type_hints(_typecheckingstub__98230924b191ba0192b7d818a592221249c2b38f4ddd572cfc62d08a37b84b42)
|
|
7935
|
+
check_type(argname="argument bucket_name", value=bucket_name, expected_type=type_hints["bucket_name"])
|
|
7936
|
+
check_type(argname="argument prefix", value=prefix, expected_type=type_hints["prefix"])
|
|
7937
|
+
check_type(argname="argument type", value=type, expected_type=type_hints["type"])
|
|
7938
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
7939
|
+
if bucket_name is not None:
|
|
7940
|
+
self._values["bucket_name"] = bucket_name
|
|
7941
|
+
if prefix is not None:
|
|
7942
|
+
self._values["prefix"] = prefix
|
|
7943
|
+
if type is not None:
|
|
7944
|
+
self._values["type"] = type
|
|
7945
|
+
|
|
7946
|
+
@builtins.property
|
|
7947
|
+
def bucket_name(self) -> typing.Optional[builtins.str]:
|
|
7948
|
+
'''(experimental) S3 bucket name for S3 Vectors storage.
|
|
6598
7949
|
|
|
6599
|
-
|
|
7950
|
+
Only used when type is 's3-vectors'. If not provided, the default
|
|
7951
|
+
bucket created by Bedrock will be used.
|
|
6600
7952
|
|
|
6601
|
-
:default:
|
|
7953
|
+
:default: - Uses Bedrock's default bucket
|
|
6602
7954
|
|
|
6603
7955
|
:stability: experimental
|
|
6604
7956
|
'''
|
|
6605
|
-
result = self._values.get("
|
|
6606
|
-
return typing.cast(typing.Optional[
|
|
7957
|
+
result = self._values.get("bucket_name")
|
|
7958
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
6607
7959
|
|
|
6608
7960
|
@builtins.property
|
|
6609
|
-
def
|
|
6610
|
-
'''(experimental)
|
|
7961
|
+
def prefix(self) -> typing.Optional[builtins.str]:
|
|
7962
|
+
'''(experimental) S3 prefix for vectors within the bucket.
|
|
6611
7963
|
|
|
6612
|
-
|
|
7964
|
+
Only used when type is 's3-vectors'.
|
|
6613
7965
|
|
|
6614
|
-
:default:
|
|
7966
|
+
:default: 'vectors/'
|
|
6615
7967
|
|
|
6616
7968
|
:stability: experimental
|
|
6617
7969
|
'''
|
|
6618
|
-
result = self._values.get("
|
|
6619
|
-
return typing.cast(typing.Optional[
|
|
7970
|
+
result = self._values.get("prefix")
|
|
7971
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
6620
7972
|
|
|
6621
7973
|
@builtins.property
|
|
6622
|
-
def
|
|
6623
|
-
'''(experimental)
|
|
7974
|
+
def type(self) -> typing.Optional[builtins.str]:
|
|
7975
|
+
'''(experimental) Type of vector store.
|
|
6624
7976
|
|
|
6625
|
-
|
|
7977
|
+
- 's3-vectors': Amazon S3 vector storage (default, recommended)
|
|
7978
|
+
- 'opensearch-serverless': Amazon OpenSearch Serverless
|
|
7979
|
+
- 'pinecone': Pinecone vector database
|
|
7980
|
+
- 'rds': Amazon RDS with pgvector
|
|
6626
7981
|
|
|
6627
|
-
:default:
|
|
7982
|
+
:default: 's3-vectors'
|
|
6628
7983
|
|
|
6629
7984
|
:stability: experimental
|
|
6630
7985
|
'''
|
|
6631
|
-
result = self._values.get("
|
|
6632
|
-
return typing.cast(typing.Optional[
|
|
7986
|
+
result = self._values.get("type")
|
|
7987
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
6633
7988
|
|
|
6634
7989
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
6635
7990
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
@@ -6638,7 +7993,7 @@ class TokenBasedConfig:
|
|
|
6638
7993
|
return not (rhs == self)
|
|
6639
7994
|
|
|
6640
7995
|
def __repr__(self) -> str:
|
|
6641
|
-
return "
|
|
7996
|
+
return "VectorStoreConfiguration(%s)" % ", ".join(
|
|
6642
7997
|
k + "=" + repr(v) for k, v in self._values.items()
|
|
6643
7998
|
)
|
|
6644
7999
|
|
|
@@ -7484,6 +8839,210 @@ class BaseDocumentProcessingProps(ObservableProps):
|
|
|
7484
8839
|
)
|
|
7485
8840
|
|
|
7486
8841
|
|
|
8842
|
+
@jsii.implements(IKnowledgeBase)
|
|
8843
|
+
class BaseKnowledgeBase(
|
|
8844
|
+
_constructs_77d1e7e8.Construct,
|
|
8845
|
+
metaclass=jsii.JSIIAbstractClass,
|
|
8846
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.BaseKnowledgeBase",
|
|
8847
|
+
):
|
|
8848
|
+
'''(experimental) Abstract base class for knowledge base implementations.
|
|
8849
|
+
|
|
8850
|
+
This class provides common functionality for all knowledge base implementations,
|
|
8851
|
+
including configuration management, validation, and default behaviors. Concrete
|
|
8852
|
+
implementations (like BedrockKnowledgeBase) extend this class and implement
|
|
8853
|
+
the abstract methods.
|
|
8854
|
+
|
|
8855
|
+
The base class handles:
|
|
8856
|
+
|
|
8857
|
+
- Props validation (name and description are required)
|
|
8858
|
+
- Default retrieval configuration (numberOfResults defaults to 5)
|
|
8859
|
+
- ACL configuration storage
|
|
8860
|
+
- Base runtime configuration export
|
|
8861
|
+
|
|
8862
|
+
Subclasses must implement:
|
|
8863
|
+
|
|
8864
|
+
- ``generateIamPermissions()``: Return IAM permissions specific to the KB type
|
|
8865
|
+
|
|
8866
|
+
:stability: experimental
|
|
8867
|
+
'''
|
|
8868
|
+
|
|
8869
|
+
def __init__(
|
|
8870
|
+
self,
|
|
8871
|
+
scope: "_constructs_77d1e7e8.Construct",
|
|
8872
|
+
id: builtins.str,
|
|
8873
|
+
*,
|
|
8874
|
+
description: builtins.str,
|
|
8875
|
+
name: builtins.str,
|
|
8876
|
+
acl: typing.Optional[typing.Union["AclConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
8877
|
+
retrieval: typing.Optional[typing.Union["RetrievalConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
8878
|
+
) -> None:
|
|
8879
|
+
'''(experimental) Creates a new BaseKnowledgeBase instance.
|
|
8880
|
+
|
|
8881
|
+
:param scope: - The scope in which to define this construct.
|
|
8882
|
+
:param id: - The scoped construct ID.
|
|
8883
|
+
:param description: (experimental) Description of what this knowledge base contains and when to use it. This description is shown to the agent in its system prompt to help it decide when to query this knowledge base. Be specific about the type of information contained and appropriate use cases.
|
|
8884
|
+
:param name: (experimental) Human-readable name/identifier for this knowledge base. Used for logging, display purposes, and to help the agent identify which knowledge base to query. Should be unique within the set of knowledge bases configured for an agent.
|
|
8885
|
+
:param acl: (experimental) Access control configuration for identity-aware retrieval. When enabled, retrieval queries will be filtered based on user identity context to ensure users only access permitted documents. Default: - ACL disabled
|
|
8886
|
+
:param retrieval: (experimental) Retrieval configuration options. Controls the number of results returned and optional metadata filtering. Default: { numberOfResults: 5 }
|
|
8887
|
+
|
|
8888
|
+
:stability: experimental
|
|
8889
|
+
:throws: Error if description is empty or not provided
|
|
8890
|
+
'''
|
|
8891
|
+
if __debug__:
|
|
8892
|
+
type_hints = typing.get_type_hints(_typecheckingstub__1ffdc1300a392d74aedab074831b812725fc7d9f0b3c025e42cefd06be3e3273)
|
|
8893
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
8894
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
8895
|
+
props = BaseKnowledgeBaseProps(
|
|
8896
|
+
description=description, name=name, acl=acl, retrieval=retrieval
|
|
8897
|
+
)
|
|
8898
|
+
|
|
8899
|
+
jsii.create(self.__class__, self, [scope, id, props])
|
|
8900
|
+
|
|
8901
|
+
@jsii.member(jsii_name="exportConfiguration")
|
|
8902
|
+
def export_configuration(self) -> "KnowledgeBaseRuntimeConfig":
|
|
8903
|
+
'''(experimental) Export configuration for runtime use by the retrieval tool.
|
|
8904
|
+
|
|
8905
|
+
Returns a configuration object containing the base knowledge base
|
|
8906
|
+
settings. Subclasses should override this method to add implementation-
|
|
8907
|
+
specific configuration, calling super.exportConfiguration() to include
|
|
8908
|
+
the base configuration.
|
|
8909
|
+
|
|
8910
|
+
:return: Runtime configuration object for the retrieval tool
|
|
8911
|
+
|
|
8912
|
+
:stability: experimental
|
|
8913
|
+
'''
|
|
8914
|
+
return typing.cast("KnowledgeBaseRuntimeConfig", jsii.invoke(self, "exportConfiguration", []))
|
|
8915
|
+
|
|
8916
|
+
@jsii.member(jsii_name="generateIamPermissions")
|
|
8917
|
+
@abc.abstractmethod
|
|
8918
|
+
def generate_iam_permissions(
|
|
8919
|
+
self,
|
|
8920
|
+
) -> typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]:
|
|
8921
|
+
'''(experimental) Generate IAM policy statements required for accessing this knowledge base.
|
|
8922
|
+
|
|
8923
|
+
This abstract method must be implemented by subclasses to return the
|
|
8924
|
+
specific IAM permissions needed for their knowledge base type.
|
|
8925
|
+
|
|
8926
|
+
:return: Array of IAM PolicyStatement objects granting necessary permissions
|
|
8927
|
+
|
|
8928
|
+
:stability: experimental
|
|
8929
|
+
'''
|
|
8930
|
+
...
|
|
8931
|
+
|
|
8932
|
+
@jsii.member(jsii_name="retrievalToolAsset")
|
|
8933
|
+
def retrieval_tool_asset(
|
|
8934
|
+
self,
|
|
8935
|
+
) -> typing.Optional["_aws_cdk_aws_s3_assets_ceddda9d.Asset"]:
|
|
8936
|
+
'''(experimental) Provide the retrieval tool asset for this knowledge base type.
|
|
8937
|
+
|
|
8938
|
+
By default, returns undefined to use the framework's default retrieval
|
|
8939
|
+
tool. Subclasses can override this method to provide a custom retrieval
|
|
8940
|
+
tool implementation.
|
|
8941
|
+
|
|
8942
|
+
:return: undefined to use the default retrieval tool
|
|
8943
|
+
|
|
8944
|
+
:stability: experimental
|
|
8945
|
+
'''
|
|
8946
|
+
return typing.cast(typing.Optional["_aws_cdk_aws_s3_assets_ceddda9d.Asset"], jsii.invoke(self, "retrievalToolAsset", []))
|
|
8947
|
+
|
|
8948
|
+
@jsii.member(jsii_name="validateProps")
|
|
8949
|
+
def _validate_props(
|
|
8950
|
+
self,
|
|
8951
|
+
*,
|
|
8952
|
+
description: builtins.str,
|
|
8953
|
+
name: builtins.str,
|
|
8954
|
+
acl: typing.Optional[typing.Union["AclConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
8955
|
+
retrieval: typing.Optional[typing.Union["RetrievalConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
8956
|
+
) -> None:
|
|
8957
|
+
'''(experimental) Validates the provided props at construction time.
|
|
8958
|
+
|
|
8959
|
+
Ensures that required fields (name and description) are provided
|
|
8960
|
+
and not empty. Subclasses can override this method to add additional
|
|
8961
|
+
validation, but should call super.validateProps() first.
|
|
8962
|
+
|
|
8963
|
+
:param description: (experimental) Description of what this knowledge base contains and when to use it. This description is shown to the agent in its system prompt to help it decide when to query this knowledge base. Be specific about the type of information contained and appropriate use cases.
|
|
8964
|
+
:param name: (experimental) Human-readable name/identifier for this knowledge base. Used for logging, display purposes, and to help the agent identify which knowledge base to query. Should be unique within the set of knowledge bases configured for an agent.
|
|
8965
|
+
:param acl: (experimental) Access control configuration for identity-aware retrieval. When enabled, retrieval queries will be filtered based on user identity context to ensure users only access permitted documents. Default: - ACL disabled
|
|
8966
|
+
:param retrieval: (experimental) Retrieval configuration options. Controls the number of results returned and optional metadata filtering. Default: { numberOfResults: 5 }
|
|
8967
|
+
|
|
8968
|
+
:stability: experimental
|
|
8969
|
+
:throws: Error if description is empty or not provided
|
|
8970
|
+
'''
|
|
8971
|
+
props = BaseKnowledgeBaseProps(
|
|
8972
|
+
description=description, name=name, acl=acl, retrieval=retrieval
|
|
8973
|
+
)
|
|
8974
|
+
|
|
8975
|
+
return typing.cast(None, jsii.invoke(self, "validateProps", [props]))
|
|
8976
|
+
|
|
8977
|
+
@builtins.property
|
|
8978
|
+
@jsii.member(jsii_name="description")
|
|
8979
|
+
def description(self) -> builtins.str:
|
|
8980
|
+
'''(experimental) Human-readable description of what this knowledge base contains.
|
|
8981
|
+
|
|
8982
|
+
This description is included in the agent's system prompt to help
|
|
8983
|
+
the agent decide when to query this knowledge base.
|
|
8984
|
+
|
|
8985
|
+
:stability: experimental
|
|
8986
|
+
'''
|
|
8987
|
+
return typing.cast(builtins.str, jsii.get(self, "description"))
|
|
8988
|
+
|
|
8989
|
+
@builtins.property
|
|
8990
|
+
@jsii.member(jsii_name="name")
|
|
8991
|
+
def name(self) -> builtins.str:
|
|
8992
|
+
'''(experimental) Human-readable name for this knowledge base.
|
|
8993
|
+
|
|
8994
|
+
This name is used for logging, display purposes, and to help the agent
|
|
8995
|
+
identify which knowledge base to query.
|
|
8996
|
+
|
|
8997
|
+
:stability: experimental
|
|
8998
|
+
'''
|
|
8999
|
+
return typing.cast(builtins.str, jsii.get(self, "name"))
|
|
9000
|
+
|
|
9001
|
+
@builtins.property
|
|
9002
|
+
@jsii.member(jsii_name="retrievalConfig")
|
|
9003
|
+
def _retrieval_config(self) -> "RetrievalConfiguration":
|
|
9004
|
+
'''(experimental) Retrieval configuration for this knowledge base.
|
|
9005
|
+
|
|
9006
|
+
Contains settings like numberOfResults and optional metadata filters.
|
|
9007
|
+
Defaults to { numberOfResults: 5 } if not provided.
|
|
9008
|
+
|
|
9009
|
+
:stability: experimental
|
|
9010
|
+
'''
|
|
9011
|
+
return typing.cast("RetrievalConfiguration", jsii.get(self, "retrievalConfig"))
|
|
9012
|
+
|
|
9013
|
+
@builtins.property
|
|
9014
|
+
@jsii.member(jsii_name="aclConfig")
|
|
9015
|
+
def _acl_config(self) -> typing.Optional["AclConfiguration"]:
|
|
9016
|
+
'''(experimental) ACL configuration for identity-aware retrieval.
|
|
9017
|
+
|
|
9018
|
+
When enabled, retrieval queries will be filtered based on user
|
|
9019
|
+
identity context.
|
|
9020
|
+
|
|
9021
|
+
:stability: experimental
|
|
9022
|
+
'''
|
|
9023
|
+
return typing.cast(typing.Optional["AclConfiguration"], jsii.get(self, "aclConfig"))
|
|
9024
|
+
|
|
9025
|
+
|
|
9026
|
+
class _BaseKnowledgeBaseProxy(BaseKnowledgeBase):
|
|
9027
|
+
@jsii.member(jsii_name="generateIamPermissions")
|
|
9028
|
+
def generate_iam_permissions(
|
|
9029
|
+
self,
|
|
9030
|
+
) -> typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]:
|
|
9031
|
+
'''(experimental) Generate IAM policy statements required for accessing this knowledge base.
|
|
9032
|
+
|
|
9033
|
+
This abstract method must be implemented by subclasses to return the
|
|
9034
|
+
specific IAM permissions needed for their knowledge base type.
|
|
9035
|
+
|
|
9036
|
+
:return: Array of IAM PolicyStatement objects granting necessary permissions
|
|
9037
|
+
|
|
9038
|
+
:stability: experimental
|
|
9039
|
+
'''
|
|
9040
|
+
return typing.cast(typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"], jsii.invoke(self, "generateIamPermissions", []))
|
|
9041
|
+
|
|
9042
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class
|
|
9043
|
+
typing.cast(typing.Any, BaseKnowledgeBase).__jsii_proxy_class__ = lambda : _BaseKnowledgeBaseProxy
|
|
9044
|
+
|
|
9045
|
+
|
|
7487
9046
|
@jsii.data_type(
|
|
7488
9047
|
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.BatchAgentProps",
|
|
7489
9048
|
jsii_struct_bases=[BaseAgentProps],
|
|
@@ -7499,6 +9058,7 @@ class BaseDocumentProcessingProps(ObservableProps):
|
|
|
7499
9058
|
"removal_policy": "removalPolicy",
|
|
7500
9059
|
"prompt": "prompt",
|
|
7501
9060
|
"expect_json": "expectJson",
|
|
9061
|
+
"invoke_type": "invokeType",
|
|
7502
9062
|
},
|
|
7503
9063
|
)
|
|
7504
9064
|
class BatchAgentProps(BaseAgentProps):
|
|
@@ -7516,6 +9076,7 @@ class BatchAgentProps(BaseAgentProps):
|
|
|
7516
9076
|
removal_policy: typing.Optional["_aws_cdk_ceddda9d.RemovalPolicy"] = None,
|
|
7517
9077
|
prompt: builtins.str,
|
|
7518
9078
|
expect_json: typing.Optional[builtins.bool] = None,
|
|
9079
|
+
invoke_type: typing.Optional["InvokeType"] = None,
|
|
7519
9080
|
) -> None:
|
|
7520
9081
|
'''
|
|
7521
9082
|
:param log_group_data_protection: (experimental) Data protection related configuration. Default: a new KMS key would be generated
|
|
@@ -7529,6 +9090,7 @@ class BatchAgentProps(BaseAgentProps):
|
|
|
7529
9090
|
:param removal_policy: (experimental) Removal policy for resources created by this construct. Default: RemovalPolicy.DESTROY
|
|
7530
9091
|
:param prompt:
|
|
7531
9092
|
:param expect_json:
|
|
9093
|
+
:param invoke_type: (experimental) Agent invocation type. Defines how the agent is invoked and what processing mode to use. Default: InvokeType.BATCH
|
|
7532
9094
|
|
|
7533
9095
|
:stability: experimental
|
|
7534
9096
|
'''
|
|
@@ -7549,6 +9111,7 @@ class BatchAgentProps(BaseAgentProps):
|
|
|
7549
9111
|
check_type(argname="argument removal_policy", value=removal_policy, expected_type=type_hints["removal_policy"])
|
|
7550
9112
|
check_type(argname="argument prompt", value=prompt, expected_type=type_hints["prompt"])
|
|
7551
9113
|
check_type(argname="argument expect_json", value=expect_json, expected_type=type_hints["expect_json"])
|
|
9114
|
+
check_type(argname="argument invoke_type", value=invoke_type, expected_type=type_hints["invoke_type"])
|
|
7552
9115
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
7553
9116
|
"agent_definition": agent_definition,
|
|
7554
9117
|
"agent_name": agent_name,
|
|
@@ -7570,6 +9133,8 @@ class BatchAgentProps(BaseAgentProps):
|
|
|
7570
9133
|
self._values["removal_policy"] = removal_policy
|
|
7571
9134
|
if expect_json is not None:
|
|
7572
9135
|
self._values["expect_json"] = expect_json
|
|
9136
|
+
if invoke_type is not None:
|
|
9137
|
+
self._values["invoke_type"] = invoke_type
|
|
7573
9138
|
|
|
7574
9139
|
@builtins.property
|
|
7575
9140
|
def log_group_data_protection(
|
|
@@ -7687,6 +9252,19 @@ class BatchAgentProps(BaseAgentProps):
|
|
|
7687
9252
|
result = self._values.get("expect_json")
|
|
7688
9253
|
return typing.cast(typing.Optional[builtins.bool], result)
|
|
7689
9254
|
|
|
9255
|
+
@builtins.property
|
|
9256
|
+
def invoke_type(self) -> typing.Optional["InvokeType"]:
|
|
9257
|
+
'''(experimental) Agent invocation type.
|
|
9258
|
+
|
|
9259
|
+
Defines how the agent is invoked and what processing mode to use.
|
|
9260
|
+
|
|
9261
|
+
:default: InvokeType.BATCH
|
|
9262
|
+
|
|
9263
|
+
:stability: experimental
|
|
9264
|
+
'''
|
|
9265
|
+
result = self._values.get("invoke_type")
|
|
9266
|
+
return typing.cast(typing.Optional["InvokeType"], result)
|
|
9267
|
+
|
|
7690
9268
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
7691
9269
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
7692
9270
|
|
|
@@ -8504,6 +10082,158 @@ class BedrockDocumentProcessingProps(BaseDocumentProcessingProps):
|
|
|
8504
10082
|
)
|
|
8505
10083
|
|
|
8506
10084
|
|
|
10085
|
+
class BedrockKnowledgeBase(
|
|
10086
|
+
BaseKnowledgeBase,
|
|
10087
|
+
metaclass=jsii.JSIIMeta,
|
|
10088
|
+
jsii_type="@cdklabs/cdk-appmod-catalog-blueprints.BedrockKnowledgeBase",
|
|
10089
|
+
):
|
|
10090
|
+
'''(experimental) Amazon Bedrock Knowledge Base implementation.
|
|
10091
|
+
|
|
10092
|
+
This class provides integration with Amazon Bedrock Knowledge Bases,
|
|
10093
|
+
which use vector stores (S3 Vectors by default) for semantic search.
|
|
10094
|
+
It is the default knowledge base implementation when none is specified.
|
|
10095
|
+
|
|
10096
|
+
The implementation handles:
|
|
10097
|
+
|
|
10098
|
+
- ARN construction from knowledge base ID (if ARN not provided)
|
|
10099
|
+
- IAM permission generation for Bedrock Retrieve and RetrieveAndGenerate APIs
|
|
10100
|
+
- Optional guardrail configuration for content filtering
|
|
10101
|
+
- Runtime configuration export for the retrieval tool
|
|
10102
|
+
|
|
10103
|
+
:stability: experimental
|
|
10104
|
+
'''
|
|
10105
|
+
|
|
10106
|
+
def __init__(
|
|
10107
|
+
self,
|
|
10108
|
+
scope: "_constructs_77d1e7e8.Construct",
|
|
10109
|
+
id: builtins.str,
|
|
10110
|
+
*,
|
|
10111
|
+
knowledge_base_id: builtins.str,
|
|
10112
|
+
create: typing.Optional[typing.Union["CreateKnowledgeBaseConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
10113
|
+
guardrail: typing.Optional[typing.Union["GuardrailConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
10114
|
+
knowledge_base_arn: typing.Optional[builtins.str] = None,
|
|
10115
|
+
vector_store: typing.Optional[typing.Union["VectorStoreConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
10116
|
+
description: builtins.str,
|
|
10117
|
+
name: builtins.str,
|
|
10118
|
+
acl: typing.Optional[typing.Union["AclConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
10119
|
+
retrieval: typing.Optional[typing.Union["RetrievalConfiguration", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
10120
|
+
) -> None:
|
|
10121
|
+
'''(experimental) Creates a new BedrockKnowledgeBase instance.
|
|
10122
|
+
|
|
10123
|
+
:param scope: - The scope in which to define this construct.
|
|
10124
|
+
:param id: - The scoped construct ID.
|
|
10125
|
+
:param knowledge_base_id: (experimental) Unique identifier for the Bedrock Knowledge Base. This is the ID assigned by Bedrock when the knowledge base was created. You can find this in the Bedrock console or via the AWS CLI. Required when referencing an existing knowledge base. Not required when using the ``create`` property to create a new KB.
|
|
10126
|
+
:param create: (experimental) Configuration for creating a new knowledge base. When provided, a new Bedrock Knowledge Base will be created with the specified data source and embedding configuration. Note: This is an advanced feature that creates AWS resources. For most use cases, referencing an existing knowledge base by ID is recommended. Default: - Reference existing KB only (no creation)
|
|
10127
|
+
:param guardrail: (experimental) Guardrail configuration for content filtering. When configured, the guardrail will be applied during retrieval operations to filter inappropriate or sensitive content. Default: - No guardrail applied
|
|
10128
|
+
:param knowledge_base_arn: (experimental) ARN of the Bedrock Knowledge Base. If not provided, the ARN will be constructed from the knowledgeBaseId using the current region and account. Default: - Constructed from knowledgeBaseId
|
|
10129
|
+
:param vector_store: (experimental) Vector store configuration. Defines the type of vector store used by this knowledge base. This is informational and used for generating appropriate IAM permissions when needed. Default: - S3 Vectors (type: 's3-vectors')
|
|
10130
|
+
:param description: (experimental) Description of what this knowledge base contains and when to use it. This description is shown to the agent in its system prompt to help it decide when to query this knowledge base. Be specific about the type of information contained and appropriate use cases.
|
|
10131
|
+
:param name: (experimental) Human-readable name/identifier for this knowledge base. Used for logging, display purposes, and to help the agent identify which knowledge base to query. Should be unique within the set of knowledge bases configured for an agent.
|
|
10132
|
+
:param acl: (experimental) Access control configuration for identity-aware retrieval. When enabled, retrieval queries will be filtered based on user identity context to ensure users only access permitted documents. Default: - ACL disabled
|
|
10133
|
+
:param retrieval: (experimental) Retrieval configuration options. Controls the number of results returned and optional metadata filtering. Default: { numberOfResults: 5 }
|
|
10134
|
+
|
|
10135
|
+
:stability: experimental
|
|
10136
|
+
:throws: Error if knowledgeBaseId is empty or not provided
|
|
10137
|
+
'''
|
|
10138
|
+
if __debug__:
|
|
10139
|
+
type_hints = typing.get_type_hints(_typecheckingstub__881273bf12c7a325cf85df5cec4c868a102b3e1454218addb9ce294190f2a295)
|
|
10140
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
10141
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
10142
|
+
props = BedrockKnowledgeBaseProps(
|
|
10143
|
+
knowledge_base_id=knowledge_base_id,
|
|
10144
|
+
create=create,
|
|
10145
|
+
guardrail=guardrail,
|
|
10146
|
+
knowledge_base_arn=knowledge_base_arn,
|
|
10147
|
+
vector_store=vector_store,
|
|
10148
|
+
description=description,
|
|
10149
|
+
name=name,
|
|
10150
|
+
acl=acl,
|
|
10151
|
+
retrieval=retrieval,
|
|
10152
|
+
)
|
|
10153
|
+
|
|
10154
|
+
jsii.create(self.__class__, self, [scope, id, props])
|
|
10155
|
+
|
|
10156
|
+
@jsii.member(jsii_name="exportConfiguration")
|
|
10157
|
+
def export_configuration(self) -> "KnowledgeBaseRuntimeConfig":
|
|
10158
|
+
'''(experimental) Export configuration for runtime use by the retrieval tool.
|
|
10159
|
+
|
|
10160
|
+
Returns a configuration object containing all Bedrock-specific
|
|
10161
|
+
settings needed to query the knowledge base at runtime, including:
|
|
10162
|
+
|
|
10163
|
+
- Base configuration (name, description, retrieval, acl)
|
|
10164
|
+
- Knowledge base type ('bedrock')
|
|
10165
|
+
- Knowledge base ID and ARN
|
|
10166
|
+
- Vector store configuration
|
|
10167
|
+
- Guardrail configuration (if present)
|
|
10168
|
+
|
|
10169
|
+
:return: Runtime configuration object for the retrieval tool
|
|
10170
|
+
|
|
10171
|
+
:stability: experimental
|
|
10172
|
+
'''
|
|
10173
|
+
return typing.cast("KnowledgeBaseRuntimeConfig", jsii.invoke(self, "exportConfiguration", []))
|
|
10174
|
+
|
|
10175
|
+
@jsii.member(jsii_name="generateIamPermissions")
|
|
10176
|
+
def generate_iam_permissions(
|
|
10177
|
+
self,
|
|
10178
|
+
) -> typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"]:
|
|
10179
|
+
'''(experimental) Generate IAM policy statements required for accessing this Bedrock Knowledge Base.
|
|
10180
|
+
|
|
10181
|
+
Returns permissions for:
|
|
10182
|
+
|
|
10183
|
+
- bedrock:Retrieve - Query the knowledge base
|
|
10184
|
+
- bedrock:RetrieveAndGenerate - Query and generate responses
|
|
10185
|
+
- bedrock:ApplyGuardrail - Apply guardrail (if configured)
|
|
10186
|
+
- s3:GetObject - Access S3 vectors (if using S3 Vectors with custom bucket)
|
|
10187
|
+
- s3:GetObject - Access data source bucket (if create config provided)
|
|
10188
|
+
|
|
10189
|
+
All permissions are scoped to the specific knowledge base ARN
|
|
10190
|
+
following the principle of least privilege.
|
|
10191
|
+
|
|
10192
|
+
:return: Array of IAM PolicyStatement objects granting necessary permissions
|
|
10193
|
+
|
|
10194
|
+
:stability: experimental
|
|
10195
|
+
'''
|
|
10196
|
+
return typing.cast(typing.List["_aws_cdk_aws_iam_ceddda9d.PolicyStatement"], jsii.invoke(self, "generateIamPermissions", []))
|
|
10197
|
+
|
|
10198
|
+
@jsii.member(jsii_name="retrievalToolAsset")
|
|
10199
|
+
def retrieval_tool_asset(self) -> "_aws_cdk_aws_s3_assets_ceddda9d.Asset":
|
|
10200
|
+
'''(experimental) Provide the Bedrock-specific retrieval tool asset.
|
|
10201
|
+
|
|
10202
|
+
Returns an Asset containing the Python retrieval tool that uses
|
|
10203
|
+
the Amazon Bedrock Agent Runtime API to query knowledge bases.
|
|
10204
|
+
This tool is automatically added to agents that use Bedrock
|
|
10205
|
+
knowledge bases.
|
|
10206
|
+
|
|
10207
|
+
:return: Asset containing the Bedrock retrieval tool
|
|
10208
|
+
|
|
10209
|
+
:stability: experimental
|
|
10210
|
+
'''
|
|
10211
|
+
return typing.cast("_aws_cdk_aws_s3_assets_ceddda9d.Asset", jsii.invoke(self, "retrievalToolAsset", []))
|
|
10212
|
+
|
|
10213
|
+
@builtins.property
|
|
10214
|
+
@jsii.member(jsii_name="knowledgeBaseArn")
|
|
10215
|
+
def knowledge_base_arn(self) -> builtins.str:
|
|
10216
|
+
'''(experimental) The ARN of the Bedrock Knowledge Base.
|
|
10217
|
+
|
|
10218
|
+
If not provided in props, this is constructed from the knowledgeBaseId
|
|
10219
|
+
using the current region and account.
|
|
10220
|
+
|
|
10221
|
+
:stability: experimental
|
|
10222
|
+
'''
|
|
10223
|
+
return typing.cast(builtins.str, jsii.get(self, "knowledgeBaseArn"))
|
|
10224
|
+
|
|
10225
|
+
@builtins.property
|
|
10226
|
+
@jsii.member(jsii_name="knowledgeBaseId")
|
|
10227
|
+
def knowledge_base_id(self) -> builtins.str:
|
|
10228
|
+
'''(experimental) The unique identifier for the Bedrock Knowledge Base.
|
|
10229
|
+
|
|
10230
|
+
This is the ID assigned by Bedrock when the knowledge base was created.
|
|
10231
|
+
|
|
10232
|
+
:stability: experimental
|
|
10233
|
+
'''
|
|
10234
|
+
return typing.cast(builtins.str, jsii.get(self, "knowledgeBaseId"))
|
|
10235
|
+
|
|
10236
|
+
|
|
8507
10237
|
class AgenticDocumentProcessing(
|
|
8508
10238
|
BedrockDocumentProcessing,
|
|
8509
10239
|
metaclass=jsii.JSIIMeta,
|
|
@@ -9101,6 +10831,7 @@ class AgenticDocumentProcessingProps(BedrockDocumentProcessingProps):
|
|
|
9101
10831
|
__all__ = [
|
|
9102
10832
|
"AccessLog",
|
|
9103
10833
|
"AccessLogProps",
|
|
10834
|
+
"AclConfiguration",
|
|
9104
10835
|
"AdditionalDistributionProps",
|
|
9105
10836
|
"AgentDefinitionProps",
|
|
9106
10837
|
"AgentToolsLocationDefinition",
|
|
@@ -9112,11 +10843,15 @@ __all__ = [
|
|
|
9112
10843
|
"BaseAgentProps",
|
|
9113
10844
|
"BaseDocumentProcessing",
|
|
9114
10845
|
"BaseDocumentProcessingProps",
|
|
10846
|
+
"BaseKnowledgeBase",
|
|
10847
|
+
"BaseKnowledgeBaseProps",
|
|
9115
10848
|
"BatchAgent",
|
|
9116
10849
|
"BatchAgentProps",
|
|
9117
10850
|
"BedrockCrossRegionInferencePrefix",
|
|
9118
10851
|
"BedrockDocumentProcessing",
|
|
9119
10852
|
"BedrockDocumentProcessingProps",
|
|
10853
|
+
"BedrockKnowledgeBase",
|
|
10854
|
+
"BedrockKnowledgeBaseProps",
|
|
9120
10855
|
"BedrockModelProps",
|
|
9121
10856
|
"BedrockModelUtils",
|
|
9122
10857
|
"ChunkClassificationResult",
|
|
@@ -9131,6 +10866,7 @@ __all__ = [
|
|
|
9131
10866
|
"CleanupRequest",
|
|
9132
10867
|
"CleanupResponse",
|
|
9133
10868
|
"CloudfrontDistributionObservabilityPropertyInjector",
|
|
10869
|
+
"CreateKnowledgeBaseConfiguration",
|
|
9134
10870
|
"CustomDomainConfig",
|
|
9135
10871
|
"DataLoader",
|
|
9136
10872
|
"DataLoaderProps",
|
|
@@ -9149,9 +10885,13 @@ __all__ = [
|
|
|
9149
10885
|
"FixedPagesConfig",
|
|
9150
10886
|
"Frontend",
|
|
9151
10887
|
"FrontendProps",
|
|
10888
|
+
"GuardrailConfiguration",
|
|
9152
10889
|
"HybridConfig",
|
|
9153
10890
|
"IAdapter",
|
|
10891
|
+
"IKnowledgeBase",
|
|
9154
10892
|
"IObservable",
|
|
10893
|
+
"InvokeType",
|
|
10894
|
+
"KnowledgeBaseRuntimeConfig",
|
|
9155
10895
|
"LambdaIamUtils",
|
|
9156
10896
|
"LambdaIamUtilsStackInfo",
|
|
9157
10897
|
"LambdaLogsPermissionsProps",
|
|
@@ -9166,9 +10906,11 @@ __all__ = [
|
|
|
9166
10906
|
"PowertoolsConfig",
|
|
9167
10907
|
"QueuedS3Adapter",
|
|
9168
10908
|
"QueuedS3AdapterProps",
|
|
10909
|
+
"RetrievalConfiguration",
|
|
9169
10910
|
"StateMachineObservabilityPropertyInjector",
|
|
9170
10911
|
"TokenAnalysis",
|
|
9171
10912
|
"TokenBasedConfig",
|
|
10913
|
+
"VectorStoreConfiguration",
|
|
9172
10914
|
]
|
|
9173
10915
|
|
|
9174
10916
|
publication.publish()
|
|
@@ -9209,6 +10951,14 @@ def _typecheckingstub__b0d5807bf69e9243b9fd452b7437cfe9f4102d78752673f223f3ae140
|
|
|
9209
10951
|
"""Type checking stubs"""
|
|
9210
10952
|
pass
|
|
9211
10953
|
|
|
10954
|
+
def _typecheckingstub__899807b7dca2d7be5f310df5984cd7a0c5fe3c612a8995f0927c15acbec703da(
|
|
10955
|
+
*,
|
|
10956
|
+
enabled: builtins.bool,
|
|
10957
|
+
metadata_field: typing.Optional[builtins.str] = None,
|
|
10958
|
+
) -> None:
|
|
10959
|
+
"""Type checking stubs"""
|
|
10960
|
+
pass
|
|
10961
|
+
|
|
9212
10962
|
def _typecheckingstub__14d3ed5928e5166082cd47a907ab754473c20bb045dc424135b4690811543601(
|
|
9213
10963
|
*,
|
|
9214
10964
|
comment: typing.Optional[builtins.str] = None,
|
|
@@ -9223,7 +10973,9 @@ def _typecheckingstub__4a2d1deab0cc9bf96473ffb32138a2c564c47ae7382fe5d2d1f0e43da
|
|
|
9223
10973
|
*,
|
|
9224
10974
|
bedrock_model: typing.Union[BedrockModelProps, typing.Dict[builtins.str, typing.Any]],
|
|
9225
10975
|
system_prompt: _aws_cdk_aws_s3_assets_ceddda9d.Asset,
|
|
10976
|
+
additional_policy_statements_for_knowledge_bases: typing.Optional[typing.Sequence[_aws_cdk_aws_iam_ceddda9d.PolicyStatement]] = None,
|
|
9226
10977
|
additional_policy_statements_for_tools: typing.Optional[typing.Sequence[_aws_cdk_aws_iam_ceddda9d.PolicyStatement]] = None,
|
|
10978
|
+
knowledge_bases: typing.Optional[typing.Sequence[IKnowledgeBase]] = None,
|
|
9227
10979
|
lambda_layers: typing.Optional[typing.Sequence[_aws_cdk_aws_lambda_ceddda9d.LayerVersion]] = None,
|
|
9228
10980
|
tools: typing.Optional[typing.Sequence[_aws_cdk_aws_s3_assets_ceddda9d.Asset]] = None,
|
|
9229
10981
|
) -> None:
|
|
@@ -9278,12 +11030,23 @@ def _typecheckingstub__71b734ed2750632299f59fd7513ccde0ee5f9974b68f8c52b53e2255c
|
|
|
9278
11030
|
"""Type checking stubs"""
|
|
9279
11031
|
pass
|
|
9280
11032
|
|
|
11033
|
+
def _typecheckingstub__40fa4a59f1a0502756f07aba8d6cba5255e1743cbc160af92ff68cb3b17fef23(
|
|
11034
|
+
*,
|
|
11035
|
+
description: builtins.str,
|
|
11036
|
+
name: builtins.str,
|
|
11037
|
+
acl: typing.Optional[typing.Union[AclConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11038
|
+
retrieval: typing.Optional[typing.Union[RetrievalConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11039
|
+
) -> None:
|
|
11040
|
+
"""Type checking stubs"""
|
|
11041
|
+
pass
|
|
11042
|
+
|
|
9281
11043
|
def _typecheckingstub__c2677306b18b77c5114d824ae734b83ac837c5ea4a5b8805948f0388f1dd7995(
|
|
9282
11044
|
scope: _constructs_77d1e7e8.Construct,
|
|
9283
11045
|
id: builtins.str,
|
|
9284
11046
|
*,
|
|
9285
11047
|
prompt: builtins.str,
|
|
9286
11048
|
expect_json: typing.Optional[builtins.bool] = None,
|
|
11049
|
+
invoke_type: typing.Optional[InvokeType] = None,
|
|
9287
11050
|
agent_definition: typing.Union[AgentDefinitionProps, typing.Dict[builtins.str, typing.Any]],
|
|
9288
11051
|
agent_name: builtins.str,
|
|
9289
11052
|
enable_observability: typing.Optional[builtins.bool] = None,
|
|
@@ -9297,6 +11060,21 @@ def _typecheckingstub__c2677306b18b77c5114d824ae734b83ac837c5ea4a5b8805948f0388f
|
|
|
9297
11060
|
"""Type checking stubs"""
|
|
9298
11061
|
pass
|
|
9299
11062
|
|
|
11063
|
+
def _typecheckingstub__fa5a5937a282e8ddfa91598805b072febd3483c7f6ad9ed8eed9f52e4f0912e9(
|
|
11064
|
+
*,
|
|
11065
|
+
description: builtins.str,
|
|
11066
|
+
name: builtins.str,
|
|
11067
|
+
acl: typing.Optional[typing.Union[AclConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11068
|
+
retrieval: typing.Optional[typing.Union[RetrievalConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11069
|
+
knowledge_base_id: builtins.str,
|
|
11070
|
+
create: typing.Optional[typing.Union[CreateKnowledgeBaseConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11071
|
+
guardrail: typing.Optional[typing.Union[GuardrailConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11072
|
+
knowledge_base_arn: typing.Optional[builtins.str] = None,
|
|
11073
|
+
vector_store: typing.Optional[typing.Union[VectorStoreConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11074
|
+
) -> None:
|
|
11075
|
+
"""Type checking stubs"""
|
|
11076
|
+
pass
|
|
11077
|
+
|
|
9300
11078
|
def _typecheckingstub__e45242c855c6631d66b287b02966cc10c7006e63b282779a6fdb35ce0a2a7a67(
|
|
9301
11079
|
*,
|
|
9302
11080
|
cross_region_inference_prefix: typing.Optional[BedrockCrossRegionInferencePrefix] = None,
|
|
@@ -9450,6 +11228,18 @@ def _typecheckingstub__2270aedab8c9db027e16b28fd9de8610d0f7e47778cdf1d501539d0e4
|
|
|
9450
11228
|
"""Type checking stubs"""
|
|
9451
11229
|
pass
|
|
9452
11230
|
|
|
11231
|
+
def _typecheckingstub__5a66ad6b4c71f08ad11270f15622825326a8ae23d1f4b8349ee45ee1997ed029(
|
|
11232
|
+
*,
|
|
11233
|
+
data_source_bucket_name: builtins.str,
|
|
11234
|
+
chunking_strategy: typing.Optional[builtins.str] = None,
|
|
11235
|
+
data_source_prefix: typing.Optional[builtins.str] = None,
|
|
11236
|
+
embedding_model_id: typing.Optional[builtins.str] = None,
|
|
11237
|
+
max_tokens: typing.Optional[jsii.Number] = None,
|
|
11238
|
+
overlap_tokens: typing.Optional[jsii.Number] = None,
|
|
11239
|
+
) -> None:
|
|
11240
|
+
"""Type checking stubs"""
|
|
11241
|
+
pass
|
|
11242
|
+
|
|
9453
11243
|
def _typecheckingstub__45e622c5dc8075e1ee5cdf9df72ea9b7ca33e0a7cf348dfaf54f93e635e9dde8(
|
|
9454
11244
|
*,
|
|
9455
11245
|
certificate: _aws_cdk_aws_certificatemanager_ceddda9d.ICertificate,
|
|
@@ -9608,6 +11398,14 @@ def _typecheckingstub__2648a6f2c6f02177f5b324264b7de549aa23b0c1d93c8d6cccbc307a8
|
|
|
9608
11398
|
"""Type checking stubs"""
|
|
9609
11399
|
pass
|
|
9610
11400
|
|
|
11401
|
+
def _typecheckingstub__d604d1407a674dc8a1780469f6fca800816236372c95a3b5438a97e1c9faff32(
|
|
11402
|
+
*,
|
|
11403
|
+
guardrail_id: builtins.str,
|
|
11404
|
+
guardrail_version: typing.Optional[builtins.str] = None,
|
|
11405
|
+
) -> None:
|
|
11406
|
+
"""Type checking stubs"""
|
|
11407
|
+
pass
|
|
11408
|
+
|
|
9611
11409
|
def _typecheckingstub__d99de61f167223b9a43c96878ed271835a461896851550035527119e8b896dfb(
|
|
9612
11410
|
*,
|
|
9613
11411
|
max_pages_per_chunk: typing.Optional[jsii.Number] = None,
|
|
@@ -9677,6 +11475,21 @@ def _typecheckingstub__17f7e7f35ea8e49cf6ded248435aa1e1dcf416e61c549f3e7b74baad3
|
|
|
9677
11475
|
"""Type checking stubs"""
|
|
9678
11476
|
pass
|
|
9679
11477
|
|
|
11478
|
+
def _typecheckingstub__eba4c5624b16f91d89be2a09eeaf9e99f078cde0dfdfdaa2d50e663d366ce5a1(
|
|
11479
|
+
*,
|
|
11480
|
+
description: builtins.str,
|
|
11481
|
+
name: builtins.str,
|
|
11482
|
+
retrieval: typing.Union[RetrievalConfiguration, typing.Dict[builtins.str, typing.Any]],
|
|
11483
|
+
acl: typing.Optional[typing.Union[AclConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11484
|
+
guardrail: typing.Optional[typing.Union[GuardrailConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11485
|
+
knowledge_base_arn: typing.Optional[builtins.str] = None,
|
|
11486
|
+
knowledge_base_id: typing.Optional[builtins.str] = None,
|
|
11487
|
+
type: typing.Optional[builtins.str] = None,
|
|
11488
|
+
vector_store: typing.Optional[typing.Union[VectorStoreConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11489
|
+
) -> None:
|
|
11490
|
+
"""Type checking stubs"""
|
|
11491
|
+
pass
|
|
11492
|
+
|
|
9680
11493
|
def _typecheckingstub__8fea74c9846ad0c5bdddcbfe10063247cb7bcf58aac91e0be80d1226246784e4(
|
|
9681
11494
|
table_arn: builtins.str,
|
|
9682
11495
|
actions: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
@@ -9947,6 +11760,14 @@ def _typecheckingstub__c2db7ec0d4b3e93062e1f20f29f9821e5a0fd526ecf05f9ccaa6db663
|
|
|
9947
11760
|
"""Type checking stubs"""
|
|
9948
11761
|
pass
|
|
9949
11762
|
|
|
11763
|
+
def _typecheckingstub__0389e881defd6b748c16712149b25f1d6a9c2415742f6287f9424ffee6d97ac9(
|
|
11764
|
+
*,
|
|
11765
|
+
number_of_results: typing.Optional[jsii.Number] = None,
|
|
11766
|
+
retrieval_filter: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
|
|
11767
|
+
) -> None:
|
|
11768
|
+
"""Type checking stubs"""
|
|
11769
|
+
pass
|
|
11770
|
+
|
|
9950
11771
|
def _typecheckingstub__011b55520774139b52c951d9cc59273f686e377b5415ee42a57650da571d43e7(
|
|
9951
11772
|
original_props: typing.Any,
|
|
9952
11773
|
*,
|
|
@@ -9975,6 +11796,15 @@ def _typecheckingstub__a334bfb54e6a69272a4fe5b2f56f0a97d104fadd629c1aeb6ce670eb3
|
|
|
9975
11796
|
"""Type checking stubs"""
|
|
9976
11797
|
pass
|
|
9977
11798
|
|
|
11799
|
+
def _typecheckingstub__98230924b191ba0192b7d818a592221249c2b38f4ddd572cfc62d08a37b84b42(
|
|
11800
|
+
*,
|
|
11801
|
+
bucket_name: typing.Optional[builtins.str] = None,
|
|
11802
|
+
prefix: typing.Optional[builtins.str] = None,
|
|
11803
|
+
type: typing.Optional[builtins.str] = None,
|
|
11804
|
+
) -> None:
|
|
11805
|
+
"""Type checking stubs"""
|
|
11806
|
+
pass
|
|
11807
|
+
|
|
9978
11808
|
def _typecheckingstub__feb650555d9014f75886d26d16787c0c2e83a042e7e61844bf4d21c890ce479c(
|
|
9979
11809
|
*,
|
|
9980
11810
|
log_group_data_protection: typing.Optional[typing.Union[LogGroupDataProtectionProps, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
@@ -10038,6 +11868,18 @@ def _typecheckingstub__75e07bce24d48571be58cad69f751b10a17a738fdb9db601acdc689ff
|
|
|
10038
11868
|
"""Type checking stubs"""
|
|
10039
11869
|
pass
|
|
10040
11870
|
|
|
11871
|
+
def _typecheckingstub__1ffdc1300a392d74aedab074831b812725fc7d9f0b3c025e42cefd06be3e3273(
|
|
11872
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
11873
|
+
id: builtins.str,
|
|
11874
|
+
*,
|
|
11875
|
+
description: builtins.str,
|
|
11876
|
+
name: builtins.str,
|
|
11877
|
+
acl: typing.Optional[typing.Union[AclConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11878
|
+
retrieval: typing.Optional[typing.Union[RetrievalConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11879
|
+
) -> None:
|
|
11880
|
+
"""Type checking stubs"""
|
|
11881
|
+
pass
|
|
11882
|
+
|
|
10041
11883
|
def _typecheckingstub__30511d5990f52f2808903d144bad5a5c502c00b0b8c98b4fd52a3df61c18b19d(
|
|
10042
11884
|
*,
|
|
10043
11885
|
log_group_data_protection: typing.Optional[typing.Union[LogGroupDataProtectionProps, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
@@ -10051,6 +11893,7 @@ def _typecheckingstub__30511d5990f52f2808903d144bad5a5c502c00b0b8c98b4fd52a3df61
|
|
|
10051
11893
|
removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
|
|
10052
11894
|
prompt: builtins.str,
|
|
10053
11895
|
expect_json: typing.Optional[builtins.bool] = None,
|
|
11896
|
+
invoke_type: typing.Optional[InvokeType] = None,
|
|
10054
11897
|
) -> None:
|
|
10055
11898
|
"""Type checking stubs"""
|
|
10056
11899
|
pass
|
|
@@ -10121,6 +11964,23 @@ def _typecheckingstub__9606a6418d69bde20176ec33b27eaa22c0e0cdb6b105d382e9d038566
|
|
|
10121
11964
|
"""Type checking stubs"""
|
|
10122
11965
|
pass
|
|
10123
11966
|
|
|
11967
|
+
def _typecheckingstub__881273bf12c7a325cf85df5cec4c868a102b3e1454218addb9ce294190f2a295(
|
|
11968
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
11969
|
+
id: builtins.str,
|
|
11970
|
+
*,
|
|
11971
|
+
knowledge_base_id: builtins.str,
|
|
11972
|
+
create: typing.Optional[typing.Union[CreateKnowledgeBaseConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11973
|
+
guardrail: typing.Optional[typing.Union[GuardrailConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11974
|
+
knowledge_base_arn: typing.Optional[builtins.str] = None,
|
|
11975
|
+
vector_store: typing.Optional[typing.Union[VectorStoreConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11976
|
+
description: builtins.str,
|
|
11977
|
+
name: builtins.str,
|
|
11978
|
+
acl: typing.Optional[typing.Union[AclConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11979
|
+
retrieval: typing.Optional[typing.Union[RetrievalConfiguration, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
11980
|
+
) -> None:
|
|
11981
|
+
"""Type checking stubs"""
|
|
11982
|
+
pass
|
|
11983
|
+
|
|
10124
11984
|
def _typecheckingstub__b7f396236f637ec7234d81b355cf773497392b537455f3d888c4b7170ceed70a(
|
|
10125
11985
|
scope: _constructs_77d1e7e8.Construct,
|
|
10126
11986
|
id: builtins.str,
|
|
@@ -10179,5 +12039,5 @@ def _typecheckingstub__da9ccab0035a06d18b5aa3f2de69201b3bbd6e30f7707a291977a0e4f
|
|
|
10179
12039
|
"""Type checking stubs"""
|
|
10180
12040
|
pass
|
|
10181
12041
|
|
|
10182
|
-
for cls in [IAdapter, IObservable]:
|
|
12042
|
+
for cls in [IAdapter, IKnowledgeBase, IObservable]:
|
|
10183
12043
|
typing.cast(typing.Any, cls).__protocol_attrs__ = typing.cast(typing.Any, cls).__protocol_attrs__ - set(['__jsii_proxy_class__', '__jsii_type__'])
|