@@ -4,12 +4,44 @@ isort:skip_file
44"""
55
66import builtins
7+ import collections .abc
78import google .protobuf .descriptor
9+ import google .protobuf .internal .containers
10+ import google .protobuf .internal .enum_type_wrapper
811import google .protobuf .message
12+ import google .protobuf .wrappers_pb2
13+ import sys
914import typing
1015
16+ if sys .version_info >= (3 , 10 ):
17+ import typing as typing_extensions
18+ else :
19+ import typing_extensions
20+
1121DESCRIPTOR : google .protobuf .descriptor .FileDescriptor
1222
23+ class _NormalizationStrategy :
24+ ValueType = typing .NewType ("ValueType" , builtins .int )
25+ V : typing_extensions .TypeAlias = ValueType
26+
27+ class _NormalizationStrategyEnumTypeWrapper (google .protobuf .internal .enum_type_wrapper ._EnumTypeWrapper [_NormalizationStrategy .ValueType ], builtins .type ):
28+ DESCRIPTOR : google .protobuf .descriptor .EnumDescriptor
29+ NORMALIZATION_STRATEGY_UNSPECIFIED : _NormalizationStrategy .ValueType # 0
30+ MIN_MAX : _NormalizationStrategy .ValueType # 1
31+ """https://en.wikipedia.org/wiki/Feature_scaling#Rescaling_(min-max_normalization)"""
32+ L2 : _NormalizationStrategy .ValueType # 2
33+ """https://en.wikipedia.org/wiki/Cosine_similarity#L2-normalized_Euclidean_distance"""
34+
35+ class NormalizationStrategy (_NormalizationStrategy , metaclass = _NormalizationStrategyEnumTypeWrapper ):
36+ """Normalization strategy for relevance scores from different indices"""
37+
38+ NORMALIZATION_STRATEGY_UNSPECIFIED : NormalizationStrategy .ValueType # 0
39+ MIN_MAX : NormalizationStrategy .ValueType # 1
40+ """https://en.wikipedia.org/wiki/Feature_scaling#Rescaling_(min-max_normalization)"""
41+ L2 : NormalizationStrategy .ValueType # 2
42+ """https://en.wikipedia.org/wiki/Cosine_similarity#L2-normalized_Euclidean_distance"""
43+ global___NormalizationStrategy = NormalizationStrategy
44+
1345@typing .final
1446class StaticChunkingStrategy (google .protobuf .message .Message ):
1547 """Defines a chunking strategy where chunks are created with a fixed maximum chunk size and an overlap between consecutive chunks."""
@@ -60,3 +92,120 @@ class ChunkingStrategy(google.protobuf.message.Message):
6092 def WhichOneof (self , oneof_group : typing .Literal ["Strategy" , b"Strategy" ]) -> typing .Literal ["static_strategy" ] | None : ...
6193
6294global___ChunkingStrategy = ChunkingStrategy
95+
96+ @typing .final
97+ class MeanCombinationStrategy (google .protobuf .message .Message ):
98+ DESCRIPTOR : google .protobuf .descriptor .Descriptor
99+
100+ class _MeanEvaluationTechnique :
101+ ValueType = typing .NewType ("ValueType" , builtins .int )
102+ V : typing_extensions .TypeAlias = ValueType
103+
104+ class _MeanEvaluationTechniqueEnumTypeWrapper (google .protobuf .internal .enum_type_wrapper ._EnumTypeWrapper [MeanCombinationStrategy ._MeanEvaluationTechnique .ValueType ], builtins .type ):
105+ DESCRIPTOR : google .protobuf .descriptor .EnumDescriptor
106+ MEAN_EVALUATION_TECHNIQUE_UNSPECIFIED : MeanCombinationStrategy ._MeanEvaluationTechnique .ValueType # 0
107+ ARITHMETIC : MeanCombinationStrategy ._MeanEvaluationTechnique .ValueType # 1
108+ """https://en.wikipedia.org/wiki/Arithmetic_mean"""
109+ GEOMETRIC : MeanCombinationStrategy ._MeanEvaluationTechnique .ValueType # 2
110+ """https://en.wikipedia.org/wiki/Geometric_mean"""
111+ HARMONIC : MeanCombinationStrategy ._MeanEvaluationTechnique .ValueType # 3
112+ """https://en.wikipedia.org/wiki/Harmonic_mean"""
113+
114+ class MeanEvaluationTechnique (_MeanEvaluationTechnique , metaclass = _MeanEvaluationTechniqueEnumTypeWrapper ): ...
115+ MEAN_EVALUATION_TECHNIQUE_UNSPECIFIED : MeanCombinationStrategy .MeanEvaluationTechnique .ValueType # 0
116+ ARITHMETIC : MeanCombinationStrategy .MeanEvaluationTechnique .ValueType # 1
117+ """https://en.wikipedia.org/wiki/Arithmetic_mean"""
118+ GEOMETRIC : MeanCombinationStrategy .MeanEvaluationTechnique .ValueType # 2
119+ """https://en.wikipedia.org/wiki/Geometric_mean"""
120+ HARMONIC : MeanCombinationStrategy .MeanEvaluationTechnique .ValueType # 3
121+ """https://en.wikipedia.org/wiki/Harmonic_mean"""
122+
123+ MEAN_EVALUATION_TECHNIQUE_FIELD_NUMBER : builtins .int
124+ WEIGHTS_FIELD_NUMBER : builtins .int
125+ mean_evaluation_technique : global___MeanCombinationStrategy .MeanEvaluationTechnique .ValueType
126+ """Technique for averaging relevance scores from different indices. Default is ARITHMETIC"""
127+ @property
128+ def weights (self ) -> google .protobuf .internal .containers .RepeatedScalarFieldContainer [builtins .float ]:
129+ """Weights used for evaluating the weighted mean of relevance scores. The sum of the values must equal 1.0
130+ If not provided, all scores are given equal weight
131+ """
132+
133+ def __init__ (
134+ self ,
135+ * ,
136+ mean_evaluation_technique : global___MeanCombinationStrategy .MeanEvaluationTechnique .ValueType = ...,
137+ weights : collections .abc .Iterable [builtins .float ] | None = ...,
138+ ) -> None : ...
139+ def ClearField (self , field_name : typing .Literal ["mean_evaluation_technique" , b"mean_evaluation_technique" , "weights" , b"weights" ]) -> None : ...
140+
141+ global___MeanCombinationStrategy = MeanCombinationStrategy
142+
143+ @typing .final
144+ class ReciprocalRankFusionCombinationStrategy (google .protobuf .message .Message ):
145+ """https://plg.uwaterloo.ca/~gvcormac/cormacksigir09-rrf.pdf"""
146+
147+ DESCRIPTOR : google .protobuf .descriptor .Descriptor
148+
149+ K_FIELD_NUMBER : builtins .int
150+ @property
151+ def k (self ) -> google .protobuf .wrappers_pb2 .Int64Value :
152+ """The parameter k for RRFscore. Default is 60"""
153+
154+ def __init__ (
155+ self ,
156+ * ,
157+ k : google .protobuf .wrappers_pb2 .Int64Value | None = ...,
158+ ) -> None : ...
159+ def HasField (self , field_name : typing .Literal ["k" , b"k" ]) -> builtins .bool : ...
160+ def ClearField (self , field_name : typing .Literal ["k" , b"k" ]) -> None : ...
161+
162+ global___ReciprocalRankFusionCombinationStrategy = ReciprocalRankFusionCombinationStrategy
163+
164+ @typing .final
165+ class CombinationStrategy (google .protobuf .message .Message ):
166+ """Combination strategy for merging rankings from different indices"""
167+
168+ DESCRIPTOR : google .protobuf .descriptor .Descriptor
169+
170+ MEAN_COMBINATION_FIELD_NUMBER : builtins .int
171+ RRF_COMBINATION_FIELD_NUMBER : builtins .int
172+ @property
173+ def mean_combination (self ) -> global___MeanCombinationStrategy : ...
174+ @property
175+ def rrf_combination (self ) -> global___ReciprocalRankFusionCombinationStrategy : ...
176+ def __init__ (
177+ self ,
178+ * ,
179+ mean_combination : global___MeanCombinationStrategy | None = ...,
180+ rrf_combination : global___ReciprocalRankFusionCombinationStrategy | None = ...,
181+ ) -> None : ...
182+ def HasField (self , field_name : typing .Literal ["Strategy" , b"Strategy" , "mean_combination" , b"mean_combination" , "rrf_combination" , b"rrf_combination" ]) -> builtins .bool : ...
183+ def ClearField (self , field_name : typing .Literal ["Strategy" , b"Strategy" , "mean_combination" , b"mean_combination" , "rrf_combination" , b"rrf_combination" ]) -> None : ...
184+ def WhichOneof (self , oneof_group : typing .Literal ["Strategy" , b"Strategy" ]) -> typing .Literal ["mean_combination" , "rrf_combination" ] | None : ...
185+
186+ global___CombinationStrategy = CombinationStrategy
187+
188+ @typing .final
189+ class NgramTokenizer (google .protobuf .message .Message ):
190+ DESCRIPTOR : google .protobuf .descriptor .Descriptor
191+
192+ MIN_GRAM_FIELD_NUMBER : builtins .int
193+ MAX_GRAM_FIELD_NUMBER : builtins .int
194+ @property
195+ def min_gram (self ) -> google .protobuf .wrappers_pb2 .Int64Value :
196+ """Minimum length of characters in a gram. Defaults to 3"""
197+
198+ @property
199+ def max_gram (self ) -> google .protobuf .wrappers_pb2 .Int64Value :
200+ """Maximum length of characters in a gram. Defaults to 4"""
201+
202+ def __init__ (
203+ self ,
204+ * ,
205+ min_gram : google .protobuf .wrappers_pb2 .Int64Value | None = ...,
206+ max_gram : google .protobuf .wrappers_pb2 .Int64Value | None = ...,
207+ ) -> None : ...
208+ def HasField (self , field_name : typing .Literal ["max_gram" , b"max_gram" , "min_gram" , b"min_gram" ]) -> builtins .bool : ...
209+ def ClearField (self , field_name : typing .Literal ["max_gram" , b"max_gram" , "min_gram" , b"min_gram" ]) -> None : ...
210+
211+ global___NgramTokenizer = NgramTokenizer
0 commit comments