Skip to content

Commit 8ffe735

Browse files
committed
Updated docs
1 parent f7061ae commit 8ffe735

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ Note that the below example is not the only way you can upsert data into your Ne
148148

149149

150150
.. code:: python
151-
152151
from neo4j import GraphDatabase
153152
from neo4j_graphrag.indexes import upsert_vectors
153+
from neo4j_graphrag.types import EntityType
154154
155155
URI = "neo4j://localhost:7687"
156156
AUTH = ("neo4j", "password")
@@ -165,7 +165,7 @@ Note that the below example is not the only way you can upsert data into your Ne
165165
ids=["1234"],
166166
embedding_property="vectorProperty",
167167
embeddings=[vector],
168-
entity_type="NODE"
168+
entity_type=EntityType.NODE,
169169
)
170170
171171

docs/source/user_guide_rag.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -917,10 +917,11 @@ Populate a Vector Index
917917
==========================
918918

919919
.. code:: python
920+
from random import random
920921
921922
from neo4j import GraphDatabase
922-
from random import random
923923
from neo4j_graphrag.indexes import upsert_vectors
924+
from neo4j_graphrag.types import EntityType
924925
925926
URI = "neo4j://localhost:7687"
926927
AUTH = ("neo4j", "password")
@@ -929,15 +930,15 @@ Populate a Vector Index
929930
driver = GraphDatabase.driver(URI, auth=AUTH)
930931
931932
# Upsert the vector
933+
DIMENSION = 1536
932934
vector = [random() for _ in range(DIMENSION)]
933-
upsert_vectors(
935+
upsert_vectors(
934936
driver,
935937
ids=["1234"],
936938
embedding_property="vectorProperty",
937939
embeddings=[vector],
938-
entity_type="NODE"
940+
entity_type=EntityType.NODE,
939941
)
940-
upsert_vectors(driver, node_id="1234", embedding_property="embedding", vector=vector)
941942
942943
This will update the node with `id(node)=1234` to add (or update) a `node.vectorProperty` property.
943944
This property will also be added to the vector index.

0 commit comments

Comments
 (0)