Skip to content

Commit 219ff14

Browse files
Put examples with OpenAI tokens under testing (#1362)
Possible as of neo4j/docs-testing@0c084e3
1 parent 83341f0 commit 219ff14

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

modules/ROOT/pages/genai-integrations.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
----
9797
MATCH (m:Movie {title:'Godfather, The'})
9898
WHERE m.plot IS NOT NULL AND m.title IS NOT NULL
9999
WITH 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>
101101
CALL db.create.setNodeVectorProperty(m, 'embedding', propertyVector) // <3>
102102
RETURN 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
----
160160
MATCH (m:Movie WHERE m.plot IS NOT NULL)
161161
WITH m
162162
LIMIT 20
163163
WITH collect(m) AS moviesList // <1>
164164
WITH 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
166166
WITH moviesList, index, vector
167167
CALL 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
----
179179
MATCH (m:Movie WHERE m.plot IS NOT NULL)
180180
WITH collect(m) AS moviesList, // <1>
@@ -183,9 +183,9 @@ WITH collect(m) AS moviesList, // <1>
183183
UNWIND range(0, total-1, batchSize) AS batchStart // <3>
184184
CALL (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

Comments
 (0)