@@ -92,12 +92,12 @@ The embeddings are stored as properties on nodes or relationships with the type
9292====
9393
9494.Create an embedding property for the Godfather
95- [source,cypher,role=test-skip ]
95+ [source,cypher]
9696----
9797MATCH (m:Movie {title:'Godfather, The'})
9898WHERE m.plot IS NOT NULL AND m.title IS NOT NULL
9999WITH m, m.title || ' ' || m.plot AS titleAndPlot // <1>
100- WITH m, genai.vector.encode(titleAndPlot, 'OpenAI', { token: $token }) AS propertyVector // <2>
100+ WITH m, genai.vector.encode(titleAndPlot, 'OpenAI', { token: $openaiToken }) AS propertyVector // <2>
101101CALL db.create.setNodeVectorProperty(m, 'embedding', propertyVector) // <3>
102102RETURN m.embedding AS embedding
103103----
@@ -155,14 +155,14 @@ Each returned row contains the following columns:
155155.Create embeddings from a limited number of properties and store them
156156====
157157
158- [source, cypher, role=test-skip ]
158+ [source, cypher]
159159----
160160MATCH (m:Movie WHERE m.plot IS NOT NULL)
161161WITH m
162162LIMIT 20
163163WITH collect(m) AS moviesList // <1>
164164WITH moviesList, [movie IN moviesList | movie.title || ': ' || movie.plot] AS batch // <2>
165- CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $token }) YIELD index, vector
165+ CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $openaiToken }) YIELD index, vector
166166WITH moviesList, index, vector
167167CALL db.create.setNodeVectorProperty(moviesList[index], 'embedding', vector) // <3>
168168----
@@ -174,7 +174,7 @@ CALL db.create.setNodeVectorProperty(moviesList[index], 'embedding', vector) //
174174
175175.Create embeddings from a large number of properties and store them
176176====
177- [source, cypher, role=test-skip ]
177+ [source, cypher]
178178----
179179MATCH (m:Movie WHERE m.plot IS NOT NULL)
180180WITH collect(m) AS moviesList, // <1>
@@ -183,9 +183,9 @@ WITH collect(m) AS moviesList, // <1>
183183UNWIND range(0, total-1, batchSize) AS batchStart // <3>
184184CALL (moviesList, batchStart, batchSize) { // <4>
185185 WITH [movie IN moviesList[batchStart .. batchStart + batchSize] | movie.title || ': ' || movie.plot] AS batch // <5>
186- CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $token }) YIELD index, vector
186+ CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $openaiToken }) YIELD index, vector
187187 CALL db.create.setNodeVectorProperty(moviesList[batchStart + index], 'embedding', vector) // <6>
188- } IN CONCURRENT TRANSACTIONS OF 1 ROW <7>
188+ } IN CONCURRENT TRANSACTIONS OF 1 ROW // <7>
189189----
190190
191191<1> xref:functions/aggregating.adoc#functions-collect[Collect] all returned `Movie` nodes into a `LIST<NODE>`.
0 commit comments