move truncation to parsing step leveraging the EmbeddingProvider trait

This commit is contained in:
KCaverly 2023-08-30 12:13:26 -04:00
parent 76caea80f7
commit 9781047156
3 changed files with 45 additions and 41 deletions

View file

@ -1232,6 +1232,10 @@ impl EmbeddingProvider for FakeEmbeddingProvider {
false
}
fn truncate(&self, span: &str) -> String {
span.to_string()
}
async fn embed_batch(&self, spans: Vec<&str>) -> Result<Vec<Vec<f32>>> {
self.embedding_count
.fetch_add(spans.len(), atomic::Ordering::SeqCst);