hermes-client-python 1.7.39__tar.gz → 1.7.41__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.39
3
+ Version: 1.7.41
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.39"
7
+ version = "1.7.41"
8
8
  description = "Async Python client for Hermes search server"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -519,6 +519,22 @@ def _to_field_entries(doc: dict[str, Any]) -> list[pb.FieldEntry]:
519
519
  )
520
520
  entries.append(pb.FieldEntry(name=name, value=fv))
521
521
  continue
522
+ # Single sparse vector: [(idx, val), ...]
523
+ if _is_sparse_vector(value):
524
+ indices = [int(item[0]) for item in value]
525
+ values = [float(item[1]) for item in value]
526
+ fv = pb.FieldValue(
527
+ sparse_vector=pb.SparseVector(indices=indices, values=values)
528
+ )
529
+ entries.append(pb.FieldEntry(name=name, value=fv))
530
+ continue
531
+ # Single dense vector: [f1, f2, ...]
532
+ if _is_dense_vector(value):
533
+ fv = pb.FieldValue(
534
+ dense_vector=pb.DenseVector(values=[float(v) for v in value])
535
+ )
536
+ entries.append(pb.FieldEntry(name=name, value=fv))
537
+ continue
522
538
  # Multi-value plain field: ["val1", "val2", ...] -> separate entries
523
539
  for item in value:
524
540
  entries.append(pb.FieldEntry(name=name, value=_to_field_value(item)))