File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,9 @@ class Context(BaseModel):
216216 # or useful excerpts of text
217217 model_config = ConfigDict (extra = "allow" )
218218
219+ # Value was chosen to be below a 0-10 scale, making the 'unset' nature obvious
220+ UNSET_RELEVANCE : ClassVar [int ] = - 1
221+
219222 id : str = Field (
220223 default = AUTOPOPULATE_VALUE ,
221224 description = "Unique identifier for the context. Auto-generated if not provided." ,
@@ -236,7 +239,15 @@ class Context(BaseModel):
236239 ),
237240 )
238241 text : Text
239- score : int = 5
242+ score : int = Field (
243+ default = UNSET_RELEVANCE ,
244+ description = (
245+ "Relevance score for this context to the question."
246+ " The range used here is 0-10, where 0 is 'irrelevant',"
247+ " 1 is barely relevant, and 10 is most relevant."
248+ " The default is -1 to have a 'sorting safe' default as sub-relevant."
249+ ),
250+ )
240251
241252 CONTEXT_ENCODING_LENGTH : ClassVar [int ] = 500 # chars
242253 ID_HASH_LENGTH : ClassVar [int ] = 8 # chars
You can’t perform that action at this time.
0 commit comments