(
&self,
py: Python,
name: &str,
embeddings: PyOpenAIEmbeddings,
nodes: TemplateConfig,
edges: TemplateConfig,
)
| 144 | signature = (name, embeddings, nodes = TemplateConfig::Bool(true), edges = TemplateConfig::Bool(true)) |
| 145 | )] |
| 146 | fn vectorise_graph( |
| 147 | &self, |
| 148 | py: Python, |
| 149 | name: &str, |
| 150 | embeddings: PyOpenAIEmbeddings, |
| 151 | nodes: TemplateConfig, |
| 152 | edges: TemplateConfig, |
| 153 | ) -> PyResult<()> { |
| 154 | let template = template_from_python(nodes, edges)?; |
| 155 | // allow threads just in case the embedding server is using the same python runtime |
| 156 | py.detach(|| { |
| 157 | block_on(async move { |
| 158 | self.0 |
| 159 | .vectorise_graph(name, &template, embeddings.into()) |
| 160 | .await?; |
| 161 | Ok(()) |
| 162 | }) |
| 163 | }) |
| 164 | } |
| 165 | |
| 166 | /// Vectorise all graphs in the server working directory. |
| 167 | /// |
nothing calls this directly
no test coverage detected