Skip to content

Commit 4dfc644

Browse files
committed
improve queries/data
1 parent 4049be4 commit 4dfc644

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ai-integrations/langchain-self-query-retrieval.ipynb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
" metadata={\"year\": 1993, \"rating\": 7.7, \"genre\": \"action\"},\n",
117117
" ),\n",
118118
" Document(\n",
119+
" page_content=\"A fight club that is not a fight club, but is a fight club\",\n",
120+
" metadata={\"year\": 1994, \"rating\": 8.7, \"genre\": \"action\"},\n",
121+
" ),\n",
122+
" Document(\n",
119123
" page_content=\"Leo DiCaprio gets lost in a dream within a dream within a dream within a ...\",\n",
120124
" metadata={\"year\": 2010, \"genre\": \"thriller\", \"rating\": 8.2},\n",
121125
" ),\n",
@@ -135,6 +139,10 @@
135139
" page_content=\"Toys come alive and have a blast doing so\",\n",
136140
" metadata={\"year\": 1995, \"genre\": \"animated\", \"rating\": 9.3},\n",
137141
" ),\n",
142+
" Document(\n",
143+
" page_content=\"The toys come together to save their friend from a kid who doesn't know how to play with them\",\n",
144+
" metadata={\"year\": 1997, \"genre\": \"animated\", \"rating\": 9.1},\n",
145+
" ),\n",
138146
"]\n",
139147
"\n",
140148
"# Add data to the vector store, which automaticaly embeds the documents\n",
@@ -298,7 +306,7 @@
298306
"# This example specifies a query and composite filter (year > 1990 and year < 2005 and genre = action)\n",
299307
"retriever.invoke(\n",
300308
" \"What's a movie after 1990 but before 2005 that's all about dinosaurs, \" +\n",
301-
" \"and preferably has a lot of action\"\n",
309+
" \"and preferably has the action genre\"\n",
302310
")"
303311
]
304312
},
@@ -367,7 +375,7 @@
367375
")\n",
368376
"\n",
369377
"# Prompt the chain\n",
370-
"question = \"What are two movies about dinosaurs after 1990?\" # year > 1990 and document limit of 2\n",
378+
"question = \"What are two movies about toys after 1990?\" # year > 1990 and document limit of 2\n",
371379
"answer = chain.invoke(question)\n",
372380
"\n",
373381
"print(\"Question: \" + question)\n",

0 commit comments

Comments
 (0)