Skip to content

Index

This class encapsulates and extends the ROS resource type ALIYUN::Bailian::Index.

Initializers

import ros_cdk_bailian
ros_cdk_bailian.Index(
  scope: Construct,
  id: str,
  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,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No 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.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

nameRequired

  • 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

  • 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

  • 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

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property workspaceId: Workspace ID.

The knowledge base will be created in this workspace.


category_idsOptional

  • 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

  • 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

  • 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

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property connectId: Connection ID.

Replaces the deprecated datasourceCode parameter.


databaseOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property database: Database name for structured knowledge base.


dense_similarity_top_kOptional

  • 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

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property description: Knowledge base description.

0-1000 characters.


document_idsOptional

  • 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

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property embeddingModelName: Embedding model used by the knowledge base.

Defaults to text-embedding-v3.


enable_headersOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property enableHeaders: Whether to enable headers for document parsing.

Defaults to false.


enable_rewriteOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property enableRewrite: Whether to enable multi-turn dialogue rewriting.

Defaults to true.


knowledge_sceneOptional

  • 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

  • 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

Property metaExtractColumns: Metadata extraction configuration.


overlap_sizeOptional

  • 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

  • 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

  • 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

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property pipelineRetrieveRateLimitStrategy: Retrieval rate limit strategy for enterprise edition.

Defaults to downgrade.


rerank_instructOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property rerankInstruct: Custom rerank instruction.

Required when RerankMode is custom.


rerank_min_scoreOptional

  • 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

  • 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

  • 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

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property separator: Separator for chunking.

Only effective when ChunkMode is regex.


sink_instance_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property sinkInstanceId: Vector storage instance ID.

Required when SinkType is ADB.


sink_regionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property sinkRegion: Region of the vector storage instance.

Required when SinkType is ADB.


sink_typeOptional

  • 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

  • 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

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property table: Table name for structured knowledge base.


table_idsOptional

  • 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.


enable_resource_property_constraintOptional

  • Type: bool

Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
fetch_condition No description.
fetch_dependency No description.
fetch_resource_desc No description.
get_att No description.
set_metadata No description.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: ros_cdk_core.ISynthesisSession

The synthesis session.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired

  • Type: ros_cdk_core.RosCondition

add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired

  • Type: ros_cdk_core.Resource

add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired

  • Type: ros_cdk_core.RemovalPolicy

fetch_condition

def fetch_condition() -> RosCondition

fetch_dependency

def fetch_dependency() -> typing.List[str]

fetch_resource_desc

def fetch_resource_desc() -> str

get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.

is_construct

import ros_cdk_bailian
ros_cdk_bailian.Index.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
env ros_cdk_core.IResourceEnvironment The environment this resource belongs to.
ref str No description.
stack ros_cdk_core.Stack The stack in which this resource is defined.
resource ros_cdk_core.RosResource No description.
attr_id typing.Union[str, ros_cdk_core.IResolvable] Attribute Id: The unique ID of the knowledge base index.
props IndexProps No description.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


envRequired

env: IResourceEnvironment
  • Type: ros_cdk_core.IResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


refRequired

ref: str
  • Type: str

stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource
  • Type: ros_cdk_core.RosResource

attr_idRequired

attr_id: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute Id: The unique ID of the knowledge base index.


propsRequired

props: IndexProps