Skip to content

Commit c66b0c2

Browse files
Correct genai example (#1149)
Co-authored-by: Jennifer Reif <[email protected]>
1 parent 304124e commit c66b0c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/ROOT/pages/genai-integrations.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ WITH collect(m) AS moviesList // <1>
182182
100 AS batchSize // <2>
183183
UNWIND range(0, total, batchSize) AS batchStart // <3>
184184
CALL (moviesList, batchStart, batchSize) { // <4>
185-
WITH [movie IN moviesList[batchStart .. batchStart + batchSize] | movie.title || ': ' || movie.plot] AS resources // <5>
185+
WITH [movie IN moviesList[batchStart .. batchStart + batchSize] | movie.title || ': ' || movie.plot] AS batch // <5>
186186
CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $token }) YIELD index, vector
187187
CALL db.create.setNodeVectorProperty(moviesList[batchStart + index], 'embedding', vector) // <6>
188188
} IN TRANSACTIONS OF 1 ROW <7>
@@ -195,7 +195,7 @@ Too large a batch size may also exceed the provider's threshold.
195195
<3> Process `Movie` nodes in increments of `batchSize`.
196196
<4> A xref:subqueries/subqueries-in-transactions.adoc[`CALL` subquery] executes a separate transaction for each batch.
197197
Note that this `CALL` subquery uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause].
198-
<5> `resources` is a list of strings, each being the concatenation of `title` and `plot` of one movie.
198+
<5> `batch` is a list of strings, each being the concatenation of `title` and `plot` of one movie.
199199
<6> The procedure sets `vector` as value for the property named `embedding` for the node at position `batchStart + index` in the `moviesList`.
200200
<7> Set to `1` the amount of batches to be processed at once.
201201

0 commit comments

Comments
 (0)