|
116 | 116 | " metadata={\"year\": 1993, \"rating\": 7.7, \"genre\": \"action\"},\n",
|
117 | 117 | " ),\n",
|
118 | 118 | " 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", |
119 | 123 | " page_content=\"Leo DiCaprio gets lost in a dream within a dream within a dream within a ...\",\n",
|
120 | 124 | " metadata={\"year\": 2010, \"genre\": \"thriller\", \"rating\": 8.2},\n",
|
121 | 125 | " ),\n",
|
|
135 | 139 | " page_content=\"Toys come alive and have a blast doing so\",\n",
|
136 | 140 | " metadata={\"year\": 1995, \"genre\": \"animated\", \"rating\": 9.3},\n",
|
137 | 141 | " ),\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", |
138 | 146 | "]\n",
|
139 | 147 | "\n",
|
140 | 148 | "# Add data to the vector store, which automaticaly embeds the documents\n",
|
|
298 | 306 | "# This example specifies a query and composite filter (year > 1990 and year < 2005 and genre = action)\n",
|
299 | 307 | "retriever.invoke(\n",
|
300 | 308 | " \"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", |
302 | 310 | ")"
|
303 | 311 | ]
|
304 | 312 | },
|
|
367 | 375 | ")\n",
|
368 | 376 | "\n",
|
369 | 377 | "# 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", |
371 | 379 | "answer = chain.invoke(question)\n",
|
372 | 380 | "\n",
|
373 | 381 | "print(\"Question: \" + question)\n",
|
|
0 commit comments