hermes-client-python 1.7.43__tar.gz → 1.7.44__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hermes-client-python
3
- Version: 1.7.43
3
+ Version: 1.7.44
4
4
  Summary: Async Python client for Hermes search server
5
5
  Project-URL: Homepage, https://github.com/SpaceFrontiers/hermes
6
6
  Project-URL: Repository, https://github.com/SpaceFrontiers/hermes
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hermes-client-python"
7
- version = "1.7.43"
7
+ version = "1.7.44"
8
8
  description = "Async Python client for Hermes search server"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -11,6 +11,7 @@ from .types import (
11
11
  Document,
12
12
  IndexInfo,
13
13
  MatchQuery,
14
+ OrdinalScore,
14
15
  RangeQuery,
15
16
  Reranker,
16
17
  SearchHit,
@@ -32,6 +33,7 @@ __all__ = [
32
33
  "Document",
33
34
  "IndexInfo",
34
35
  "MatchQuery",
36
+ "OrdinalScore",
35
37
  "RangeQuery",
36
38
  "Reranker",
37
39
  "SearchHit",
@@ -19,6 +19,7 @@ from .types import (
19
19
  DocAddress,
20
20
  Document,
21
21
  IndexInfo,
22
+ OrdinalScore,
22
23
  SearchHit,
23
24
  SearchResponse,
24
25
  SearchTimings,
@@ -403,6 +404,10 @@ class HermesClient:
403
404
  ),
404
405
  score=hit.score,
405
406
  fields={k: _from_field_value_list(v) for k, v in hit.fields.items()},
407
+ ordinal_scores=[
408
+ OrdinalScore(ordinal=os.ordinal, score=os.score)
409
+ for os in hit.ordinal_scores
410
+ ],
406
411
  )
407
412
  for hit in response.hits
408
413
  ]
@@ -128,6 +128,14 @@ class DocAddress:
128
128
  doc_id: int
129
129
 
130
130
 
131
+ @dataclass
132
+ class OrdinalScore:
133
+ """Score contribution from a specific ordinal in a multi-valued field."""
134
+
135
+ ordinal: int
136
+ score: float
137
+
138
+
131
139
  @dataclass
132
140
  class SearchHit:
133
141
  """A single search result."""
@@ -135,6 +143,7 @@ class SearchHit:
135
143
  address: DocAddress
136
144
  score: float
137
145
  fields: dict[str, Any] = field(default_factory=dict)
146
+ ordinal_scores: list[OrdinalScore] = field(default_factory=list)
138
147
 
139
148
 
140
149
  @dataclass