MCPcopy Create free account
hub / github.com/Pometry/Raphtory / vectorise_folder

Method vectorise_folder

raphtory-graphql/src/data.rs:511–535  ·  view source on GitHub ↗
(
        &self,
        folder: &ExistingGraphFolder,
        template: &DocumentTemplate,
        model: CachedEmbeddingModel,
    )

Source from the content-addressed store, hash-verified

509 }
510
511 pub(crate) async fn vectorise_folder(
512 &self,
513 folder: &ExistingGraphFolder,
514 template: &DocumentTemplate,
515 model: CachedEmbeddingModel,
516 ) -> Result<(), GQLError> {
517 let cloned_folder = folder.clone();
518 self.cache
519 .insert_or_replace_with(folder.local_path(), move |old_graph| async {
520 let graph = match old_graph {
521 None => self
522 .read_graph_from_disk_inner(cloned_folder.clone())
523 .await?
524 .graph()
525 .clone(),
526 Some(old_graph) => old_graph.graph().clone(),
527 };
528 let vectors = self
529 .vectorise_with_template(graph.clone(), folder, template, model)
530 .await;
531 Ok::<_, GQLError>(GraphWithVectors::new(graph, vectors, cloned_folder))
532 })
533 .await?;
534 Ok(())
535 }
536
537 pub async fn get_all_graph_folders(&self) -> impl Iterator<Item = ExistingGraphFolder> {
538 let work_dir = self.work_dir_read().await;

Callers 4

vectorise_all_graphsMethod · 0.80
vectorise_graphMethod · 0.80
vectorise_graphMethod · 0.80
create_mutable_graphFunction · 0.80

Calls 6

cloneMethod · 0.45
local_pathMethod · 0.45
graphMethod · 0.45

Tested by

no test coverage detected