Updated database calls to share single connection, and simplified top_k_search sorting.

Co-authored-by: maxbrunsfeld <max@zed.dev>
This commit is contained in:
KCaverly 2023-06-26 14:57:57 -04:00
parent 0f232e0ce2
commit 74b693d6b9
4 changed files with 148 additions and 124 deletions

View file

@ -94,16 +94,6 @@ impl EmbeddingProvider for OpenAIEmbeddings {
response.usage.total_tokens
);
// do we need to re-order these based on the `index` field?
eprintln!(
"indices: {:?}",
response
.data
.iter()
.map(|embedding| embedding.index)
.collect::<Vec<_>>()
);
Ok(response
.data
.into_iter()