Skip to content

Commit 702f2af

Browse files
JMHReifJPryce-Aklundh
authored andcommitted
Correct genai batchEncode example syntax (#1148)
1 parent d5aeaec commit 702f2af

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
@@ -185,7 +185,7 @@ WITH collect(m) AS moviesList // <1>
185185
100 AS batchSize // <2>
186186
UNWIND range(0, total, batchSize) AS batchStart // <3>
187187
CALL (moviesList, batchStart, batchSize) { // <4>
188-
WITH [movie IN moviesList[batchStart .. batchStart + batchSize] | movie.title || ': ' || movie.plot] AS resources // <5>
188+
WITH [movie IN moviesList[batchStart .. batchStart + batchSize] | movie.title || ': ' || movie.plot] AS batch // <5>
189189
CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $token }) YIELD index, vector
190190
CALL db.create.setNodeVectorProperty(moviesList[batchStart + index], 'embedding', vector) // <6>
191191
} IN TRANSACTIONS OF 1 ROW <7>
@@ -199,7 +199,7 @@ Too large a batch size may also exceed the provider's threshold.
199199
<4> A xref:subqueries/subqueries-in-transactions.adoc[`CALL` subquery] executes a separate transaction for each batch.
200200
Note that this `CALL` subquery uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause] (introduced in Neo4j 5.23) to import variables.
201201
If you are using an older version of Neo4j, use an xref:subqueries/call-subquery.adoc#importing-with[importing `WITH` clause] instead.
202-
<5> `resources` is a list of strings, each being the concatenation of `title` and `plot` of one movie.
202+
<5> `batch` is a list of strings, each being the concatenation of `title` and `plot` of one movie.
203203
<6> The procedure sets `vector` as value for the property named `embedding` for the node at position `batchStart + index` in the `moviesList`.
204204
<7> Set to `1` the amount of batches to be processed at once.
205205

0 commit comments

Comments
 (0)