IndexProps
Properties for defining a Index.
See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-bailian-index
Initializer
import ros_cdk_bailian
ros_cdk_bailian.IndexProps(
name: typing.Union[str, IResolvable],
source_type: typing.Union[str, IResolvable],
structure_type: typing.Union[str, IResolvable],
workspace_id: typing.Union[str, IResolvable],
category_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
chunk_mode: typing.Union[str, IResolvable] = None,
chunk_size: typing.Union[typing.Union[int, float], IResolvable] = None,
connect_id: typing.Union[str, IResolvable] = None,
database: typing.Union[str, IResolvable] = None,
dense_similarity_top_k: typing.Union[typing.Union[int, float], IResolvable] = None,
description: typing.Union[str, IResolvable] = None,
document_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
embedding_model_name: typing.Union[str, IResolvable] = None,
enable_headers: typing.Union[bool, IResolvable] = None,
enable_rewrite: typing.Union[bool, IResolvable] = None,
knowledge_scene: typing.Union[str, IResolvable] = None,
knowledge_type: typing.Union[str, IResolvable] = None,
meta_extract_columns: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, MetaExtractColumnsProperty]]] = None,
overlap_size: typing.Union[typing.Union[int, float], IResolvable] = None,
pipeline_commercial_cu: typing.Union[typing.Union[int, float], IResolvable] = None,
pipeline_commercial_type: typing.Union[str, IResolvable] = None,
pipeline_retrieve_rate_limit_strategy: typing.Union[str, IResolvable] = None,
rerank_instruct: typing.Union[str, IResolvable] = None,
rerank_min_score: typing.Union[typing.Union[int, float], IResolvable] = None,
rerank_mode: typing.Union[str, IResolvable] = None,
rerank_model_name: typing.Union[str, IResolvable] = None,
separator: typing.Union[str, IResolvable] = None,
sink_instance_id: typing.Union[str, IResolvable] = None,
sink_region: typing.Union[str, IResolvable] = None,
sink_type: typing.Union[str, IResolvable] = None,
sparse_similarity_top_k: typing.Union[typing.Union[int, float], IResolvable] = None,
table: typing.Union[str, IResolvable] = None,
table_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None
)
Properties
| Name | Type | Description |
|---|---|---|
name | typing.Union[str, ros_cdk_core.IResolvable] | Property name: Knowledge base name. |
source_type | typing.Union[str, ros_cdk_core.IResolvable] | Property sourceType: Data source type. |
structure_type | typing.Union[str, ros_cdk_core.IResolvable] | Property structureType: Knowledge base type. |
workspace_id | typing.Union[str, ros_cdk_core.IResolvable] | Property workspaceId: Workspace ID. |
category_ids | typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] | Property categoryIds: Category IDs to import when creating the knowledge base. |
chunk_mode | typing.Union[str, ros_cdk_core.IResolvable] | Property chunkMode: Chunk strategy. |
chunk_size | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property chunkSize: Chunk size, the maximum number of characters per text slice. |
connect_id | typing.Union[str, ros_cdk_core.IResolvable] | Property connectId: Connection ID. |
database | typing.Union[str, ros_cdk_core.IResolvable] | Property database: Database name for structured knowledge base. |
dense_similarity_top_k | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property denseSimilarityTopK: Vector retrieval Top K. |
description | typing.Union[str, ros_cdk_core.IResolvable] | Property description: Knowledge base description. |
document_ids | typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] | Property documentIds: Document IDs to import when creating the knowledge base. |
embedding_model_name | typing.Union[str, ros_cdk_core.IResolvable] | Property embeddingModelName: Embedding model used by the knowledge base. |
enable_headers | typing.Union[bool, ros_cdk_core.IResolvable] | Property enableHeaders: Whether to enable headers for document parsing. |
enable_rewrite | typing.Union[bool, ros_cdk_core.IResolvable] | Property enableRewrite: Whether to enable multi-turn dialogue rewriting. |
knowledge_scene | typing.Union[str, ros_cdk_core.IResolvable] | Property knowledgeScene: Knowledge base scene. |
knowledge_type | typing.Union[str, ros_cdk_core.IResolvable] | Property knowledgeType: Knowledge base type classification. |
meta_extract_columns | typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, MetaExtractColumnsProperty]]] | Property metaExtractColumns: Metadata extraction configuration. |
overlap_size | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property overlapSize: Overlap size, the number of overlapping characters between adjacent text slices. |
pipeline_commercial_cu | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property pipelineCommercialCu: RCU count for enterprise edition. |
pipeline_commercial_type | typing.Union[str, ros_cdk_core.IResolvable] | Property pipelineCommercialType: Knowledge base specification type. |
pipeline_retrieve_rate_limit_strategy | typing.Union[str, ros_cdk_core.IResolvable] | Property pipelineRetrieveRateLimitStrategy: Retrieval rate limit strategy for enterprise edition. |
rerank_instruct | typing.Union[str, ros_cdk_core.IResolvable] | Property rerankInstruct: Custom rerank instruction. |
rerank_min_score | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property rerankMinScore: Similarity threshold. |
rerank_mode | typing.Union[str, ros_cdk_core.IResolvable] | Property rerankMode: Rerank mode. |
rerank_model_name | typing.Union[str, ros_cdk_core.IResolvable] | Property rerankModelName: Rerank model used by the knowledge base. |
separator | typing.Union[str, ros_cdk_core.IResolvable] | Property separator: Separator for chunking. |
sink_instance_id | typing.Union[str, ros_cdk_core.IResolvable] | Property sinkInstanceId: Vector storage instance ID. |
sink_region | typing.Union[str, ros_cdk_core.IResolvable] | Property sinkRegion: Region of the vector storage instance. |
sink_type | typing.Union[str, ros_cdk_core.IResolvable] | Property sinkType: Vector storage type. |
sparse_similarity_top_k | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property sparseSimilarityTopK: Keyword retrieval Top K. |
table | typing.Union[str, ros_cdk_core.IResolvable] | Property table: Table name for structured knowledge base. |
table_ids | typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] | Property tableIds: Table IDs to import when creating the knowledge base. |
nameRequired
name: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property name: Knowledge base name.
1-20 characters. Supports Chinese, English, numbers, underscores (_), hyphens (-), periods (.) and colons (:).
source_typeRequired
source_type: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property sourceType: Data source type.
DATA_CENTER_CATEGORY: import files from specified categories. DATA_CENTER_FILE: import specified files.
structure_typeRequired
structure_type: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property structureType: Knowledge base type.
unstructured: document search or audio/video knowledge base. structured: data query or image Q&A knowledge base.
workspace_idRequired
workspace_id: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property workspaceId: Workspace ID.
The knowledge base will be created in this workspace.
category_idsOptional
category_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]]
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]
Property categoryIds: Category IDs to import when creating the knowledge base.
Required when SourceType is DATA_CENTER_CATEGORY.
chunk_modeOptional
chunk_mode: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property chunkMode: Chunk strategy.
If not specified, smart chunking is used. When set to regex, Separator must also be provided.
chunk_sizeOptional
chunk_size: typing.Union[typing.Union[int, float], IResolvable]
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property chunkSize: Chunk size, the maximum number of characters per text slice.
Range [1-6000]. Defaults to 500. If ChunkSize is less than 100, OverlapSize must also be set.
connect_idOptional
connect_id: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property connectId: Connection ID.
Replaces the deprecated datasourceCode parameter.
databaseOptional
database: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property database: Database name for structured knowledge base.
dense_similarity_top_kOptional
dense_similarity_top_k: typing.Union[typing.Union[int, float], IResolvable]
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property denseSimilarityTopK: Vector retrieval Top K.
Retrieves the K most similar text slices by vector similarity. Range [0-100]. Defaults to 100. DenseSimilarityTopK + SparseSimilarityTopK must be <= 200. Only supported in UpdateIndex, not in CreateIndex.
descriptionOptional
description: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property description: Knowledge base description.
0-1000 characters.
document_idsOptional
document_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]]
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]
Property documentIds: Document IDs to import when creating the knowledge base.
Required when SourceType is DATA_CENTER_FILE.
embedding_model_nameOptional
embedding_model_name: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property embeddingModelName: Embedding model used by the knowledge base.
Defaults to text-embedding-v3.
enable_headersOptional
enable_headers: typing.Union[bool, IResolvable]
- Type: typing.Union[bool, ros_cdk_core.IResolvable]
Property enableHeaders: Whether to enable headers for document parsing.
Defaults to false.
enable_rewriteOptional
enable_rewrite: typing.Union[bool, IResolvable]
- Type: typing.Union[bool, ros_cdk_core.IResolvable]
Property enableRewrite: Whether to enable multi-turn dialogue rewriting.
Defaults to true.
knowledge_sceneOptional
knowledge_scene: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property knowledgeScene: Knowledge base scene.
Must be provided together with KnowledgeType. The valid values depend on KnowledgeType.
knowledge_typeOptional
knowledge_type: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property knowledgeType: Knowledge base type classification.
Must be provided together with KnowledgeScene. If both are omitted, the system uses default based on StructureType.
meta_extract_columnsOptional
meta_extract_columns: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, MetaExtractColumnsProperty]]]
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, MetaExtractColumnsProperty]]]
Property metaExtractColumns: Metadata extraction configuration.
overlap_sizeOptional
overlap_size: typing.Union[typing.Union[int, float], IResolvable]
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property overlapSize: Overlap size, the number of overlapping characters between adjacent text slices.
Range [0-1024]. Defaults to 100. Must be less than ChunkSize.
pipeline_commercial_cuOptional
pipeline_commercial_cu: typing.Union[typing.Union[int, float], IResolvable]
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property pipelineCommercialCu: RCU count for enterprise edition.
Only required when PipelineCommercialType is enterprise. Range [1-200].
pipeline_commercial_typeOptional
pipeline_commercial_type: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property pipelineCommercialType: Knowledge base specification type.
standard: Standard edition. enterprise: Enterprise edition. Defaults to standard.
pipeline_retrieve_rate_limit_strategyOptional
pipeline_retrieve_rate_limit_strategy: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property pipelineRetrieveRateLimitStrategy: Retrieval rate limit strategy for enterprise edition.
Defaults to downgrade.
rerank_instructOptional
rerank_instruct: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property rerankInstruct: Custom rerank instruction.
Required when RerankMode is custom.
rerank_min_scoreOptional
rerank_min_score: typing.Union[typing.Union[int, float], IResolvable]
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property rerankMinScore: Similarity threshold.
Only text slices with similarity score exceeding this value will be recalled. Range [0.01-1.00]. Defaults to 0.01.
rerank_modeOptional
rerank_mode: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property rerankMode: Rerank mode.
qa: Q&A scenario (default). similar: similarity scenario. custom: custom rerank instruction, requires RerankInstruct.
rerank_model_nameOptional
rerank_model_name: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property rerankModelName: Rerank model used by the knowledge base.
Defaults to qwen3-rerank when not specified.
separatorOptional
separator: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property separator: Separator for chunking.
Only effective when ChunkMode is regex.
sink_instance_idOptional
sink_instance_id: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property sinkInstanceId: Vector storage instance ID.
Required when SinkType is ADB.
sink_regionOptional
sink_region: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property sinkRegion: Region of the vector storage instance.
Required when SinkType is ADB.
sink_typeOptional
sink_type: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property sinkType: Vector storage type.
BUILT_IN: managed by Bailian platform. ADB: AnalyticDB for PostgreSQL. Defaults to BUILT_IN. When set to ADB, SinkInstanceId and SinkRegion are required.
sparse_similarity_top_kOptional
sparse_similarity_top_k: typing.Union[typing.Union[int, float], IResolvable]
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property sparseSimilarityTopK: Keyword retrieval Top K.
Retrieves text slices by exact keyword matching. Range [0-100]. Defaults to 100. DenseSimilarityTopK + SparseSimilarityTopK must be <= 200. Only supported in UpdateIndex, not in CreateIndex.
tableOptional
table: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property table: Table name for structured knowledge base.
table_idsOptional
table_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]]
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]
Property tableIds: Table IDs to import when creating the knowledge base.