feat: Phase 1 handover - schema migration, correction mechanism, API fixes
Schema changes: dev.chunks->dev.chunk, remove old_chunk_id/chunk_index Correction: asr-1.json format, generate/apply scripts API: 37/37 endpoints fixed and tested Docs: HANDOVER_V2.0.md for M4
This commit is contained in:
@@ -43,8 +43,7 @@ impl Embedder {
|
||||
}
|
||||
|
||||
fn default_url() -> String {
|
||||
std::env::var("MOMENTRY_EMBED_URL")
|
||||
.unwrap_or_else(|_| "http://localhost:11434".to_string())
|
||||
std::env::var("MOMENTRY_EMBED_URL").unwrap_or_else(|_| "http://localhost:11434".to_string())
|
||||
}
|
||||
|
||||
pub async fn embed_text(&self, text: &str) -> Result<Vec<f32>> {
|
||||
@@ -91,7 +90,12 @@ impl Embedder {
|
||||
.await
|
||||
.context("Failed to parse embedding response")?;
|
||||
|
||||
Ok(result.data.into_iter().next().map(|d| d.embedding).unwrap_or_default())
|
||||
Ok(result
|
||||
.data
|
||||
.into_iter()
|
||||
.next()
|
||||
.map(|d| d.embedding)
|
||||
.unwrap_or_default())
|
||||
} else {
|
||||
let url = format!("{}/api/embeddings", self.base_url);
|
||||
let response = self
|
||||
|
||||
Reference in New Issue
Block a user