Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Jul 8, 2024
1 parent 4ebcd3d commit 6b51c89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion appflowy-local-ai/src/embedding_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl EmbeddingPluginOperation {
.ok_or(PluginError::Internal(anyhow!("Plugin is dropped")))?;
let metadata = json!(metadata);
let params =
json!({"method": "aindex_document", "params": {"input": message, "metadata": metadata }});
json!({"method": "index_document", "params": {"input": message, "metadata": metadata }});
plugin
.async_request::<DefaultResponseParser>("handle", &params)
.await
Expand Down
8 changes: 4 additions & 4 deletions appflowy-local-ai/src/llm_embedding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ impl LocalEmbedding {
"absolute_model_path":config.model_path,
});

if let Some(storage_path) = config.storage_path {
params["storage_path"] = json!(storage_path);
if let Some(persist_directory) = config.persist_directory {
params["persist_directory"] = json!(persist_directory);
}

let plugin = self.plugin_manager.init_plugin(plugin_id, params).await?;
Expand Down Expand Up @@ -157,7 +157,7 @@ impl LocalEmbedding {
pub struct EmbeddingPluginConfig {
pub bin_path: PathBuf,
pub model_path: PathBuf,
pub storage_path: Option<PathBuf>,
pub persist_directory: Option<PathBuf>,
}

impl EmbeddingPluginConfig {
Expand Down Expand Up @@ -192,7 +192,7 @@ impl EmbeddingPluginConfig {
Ok(Self {
bin_path,
model_path,
storage_path,
persist_directory: storage_path,
})
}
}

0 comments on commit 6b51c89

Please sign in to comment.