Skip to content

Commit c348d0c

Browse files
authored
Add docstrings for _search_indexes/index_type.py - v1
1 parent 80365b5 commit c348d0c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/yandex_cloud_ml_sdk/_search_indexes/index_type.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323

2424
@dataclass(frozen=True)
2525
class BaseSearchIndexType(abc.ABC):
26+
"""A class for search index types."""
2627
_proto_field_name: ClassVar[str]
28+
#: the strategy used for chunking the index
2729
chunking_strategy: BaseIndexChunkingStrategy | None = None
2830

2931
@classmethod
@@ -64,6 +66,7 @@ def _from_upper_proto(cls, proto: ProtoSearchIndex, sdk: BaseSDK) -> BaseSearchI
6466

6567
@dataclass(frozen=True)
6668
class TextSearchIndexType(BaseSearchIndexType):
69+
"""A class which represents a text search index type."""
6770
_proto_field_name: ClassVar[str] = 'text_search_index'
6871

6972
@classmethod
@@ -81,10 +84,12 @@ def _to_proto(self) -> TextSearchIndex:
8184

8285
@dataclass(frozen=True)
8386
class VectorSearchIndexType(BaseSearchIndexType):
84-
_proto_field_name: ClassVar[str] = 'vector_search_index'
87+
"""A class which represents a vector search index type."""
8588

89+
_proto_field_name: ClassVar[str] = 'vector_search_index'
90+
#: URI for the document embedder
8691
doc_embedder_uri: str | None = None
87-
92+
#: URI for the query embedder
8893
query_embedder_uri: str | None = None
8994

9095
@classmethod
@@ -106,11 +111,16 @@ def _to_proto(self) -> VectorSearchIndex:
106111

107112
@dataclass(frozen=True)
108113
class HybridSearchIndexType(BaseSearchIndexType):
109-
_proto_field_name: ClassVar[str] = 'hybrid_search_index'
114+
"""A class which represents a hybrid search index type combining text and vector search indices."""
110115

116+
_proto_field_name: ClassVar[str] = 'hybrid_search_index'
117+
#: the text search index associated with the hybrid index
111118
text_search_index: TextSearchIndexType | None = None
119+
#: the vector search index associated with the hybrid index
112120
vector_search_index: VectorSearchIndexType | None = None
121+
#: the strategy for normalizing index results
113122
normalization_strategy: IndexNormalizationStrategy | str | int | None = None
123+
#: the strategy for combining results from different indices
114124
combination_strategy: BaseIndexCombinationStrategy | None = None
115125

116126
@classmethod

0 commit comments

Comments
 (0)