Skip to content

Commit

Permalink
one last conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
agourlay committed Dec 4, 2023
1 parent 6a9b253 commit 1433fc3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,19 @@ impl From<HashMap<String, Vec<f32>>> for Vectors {
}
}

impl From<HashMap<String, Vector>> for Vectors {
fn from(named_vectors: HashMap<String, Vector>) -> Self {
Vectors {
vectors_options: Some(VectorsOptions::Vectors(NamedVectors {
vectors: named_vectors
.into_iter()
.map(|(k, v)| (k, v))
.collect(),
})),
}
}
}

impl From<HashMap<String, Vec<(u32, f32)>>> for Vectors {
fn from(named_vectors: HashMap<String, Vec<(u32, f32)>>) -> Self {
Vectors {
Expand Down

0 comments on commit 1433fc3

Please sign in to comment.