(tx, parent_uuid, properties)
| 185 | return tx.run(query, {"doc_uuid": doc_uuid, **properties}).single()["p"] |
| 186 | |
| 187 | def add_chunk(tx, parent_uuid, properties): |
| 188 | query = ( |
| 189 | "MATCH (p {uuid: $parent_uuid}) " |
| 190 | "CREATE (cu:Child {uuid: $uuid, name: $name, text: $text}) " |
| 191 | "MERGE (p)-[:HAS_CHILD]->(cu) " |
| 192 | "with cu CALL db.create.setVectorProperty(cu, 'embedding', $embedding) YIELD node as c " |
| 193 | "RETURN c" |
| 194 | ) |
| 195 | return tx.run(query, {"parent_uuid": parent_uuid, **properties}).single()["c"] |
| 196 | |
| 197 | def setupSourceChunks(tx): |
| 198 | query1="""match (c:Chunk)-[]-(p:Page)-[]-(d:Document) where c.source is null |
nothing calls this directly
no outgoing calls
no test coverage detected