Skip to content

Commit 24ca5e9

Browse files
Put examples with OpenAI tokens under testing (#1362)
Possible as of neo4j/docs-testing@0c084e3
1 parent f105f35 commit 24ca5e9

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
@@ -95,12 +95,12 @@ The embeddings are stored as properties on nodes or relationships with the type
9595
====
9696
9797
.Create an embedding property for the Godfather
98-
[source,cypher,role=test-skip]
98+
[source,cypher]
9999
----
100100
MATCH (m:Movie {title:'Godfather, The'})
101101
WHERE m.plot IS NOT NULL AND m.title IS NOT NULL
102102
WITH m, m.title || ' ' || m.plot AS titleAndPlot // <1>
103-
WITH m, genai.vector.encode(titleAndPlot, 'OpenAI', { token: $token }) AS propertyVector // <2>
103+
WITH m, genai.vector.encode(titleAndPlot, 'OpenAI', { token: $openaiToken }) AS propertyVector // <2>
104104
CALL db.create.setNodeVectorProperty(m, 'embedding', propertyVector) // <3>
105105
RETURN m.embedding AS embedding
106106
----
@@ -158,14 +158,14 @@ Each returned row contains the following columns:
158158
.Create embeddings from a limited number of properties and store them
159159
====
160160
161-
[source, cypher, role=test-skip]
161+
[source, cypher]
162162
----
163163
MATCH (m:Movie WHERE m.plot IS NOT NULL)
164164
WITH m
165165
LIMIT 20
166166
WITH collect(m) AS moviesList // <1>
167167
WITH moviesList, [movie IN moviesList | movie.title || ': ' || movie.plot] AS batch // <2>
168-
CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $token }) YIELD index, vector
168+
CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $openaiToken }) YIELD index, vector
169169
WITH moviesList, index, vector
170170
CALL db.create.setNodeVectorProperty(moviesList[index], 'embedding', vector) // <3>
171171
----
@@ -177,7 +177,7 @@ CALL db.create.setNodeVectorProperty(moviesList[index], 'embedding', vector) //
177177

178178
.Create embeddings from a large number of properties and store them
179179
====
180-
[source, cypher, role=test-skip]
180+
[source, cypher]
181181
----
182182
MATCH (m:Movie WHERE m.plot IS NOT NULL)
183183
WITH collect(m) AS moviesList, // <1>
@@ -186,9 +186,9 @@ WITH collect(m) AS moviesList, // <1>
186186
UNWIND range(0, total-1, batchSize) AS batchStart // <3>
187187
CALL (moviesList, batchStart, batchSize) { // <4>
188188
WITH [movie IN moviesList[batchStart .. batchStart + batchSize] | movie.title || ': ' || movie.plot] AS batch // <5>
189-
CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $token }) YIELD index, vector
189+
CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $openaiToken }) YIELD index, vector
190190
CALL db.create.setNodeVectorProperty(moviesList[batchStart + index], 'embedding', vector) // <6>
191-
} IN CONCURRENT TRANSACTIONS OF 1 ROW <7>
191+
} IN CONCURRENT TRANSACTIONS OF 1 ROW // <7>
192192
----
193193
194194
<1> xref:functions/aggregating.adoc#functions-collect[Collect] all returned `Movie` nodes into a `LIST<NODE>`.

0 commit comments

Comments
 (0)