MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / embed_one

Method embed_one

atomic-repository/src/ai/mod.rs:152–155  ·  view source on GitHub ↗

Embed a single text.

(&self, text: &str)

Source from the content-addressed store, hash-verified

150
151 /// Embed a single text.
152 pub async fn embed_one(&self, text: &str) -> Result<Vec<f32>, AiError> {
153 let results = self.embed(&[text.to_string()]).await?;
154 results.into_iter().next().ok_or(AiError::EmptyResponse)
155 }
156
157 /// Synchronous embed using a throwaway tokio runtime (for use in non-async contexts).
158 ///

Callers

nothing calls this directly

Calls 3

embedMethod · 0.80
nextMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected