|
159 | 159 | "text/plain": [ |
160 | 160 | "['paneer',\n", |
161 | 161 | " 'basmati rice',\n", |
| 162 | + " 'yogurt',\n", |
162 | 163 | " 'onions',\n", |
163 | 164 | " 'tomatoes',\n", |
164 | | - " 'yogurt',\n", |
165 | 165 | " 'ginger',\n", |
166 | 166 | " 'garlic',\n", |
167 | 167 | " 'green chilies',\n", |
168 | 168 | " 'spices (such as cumin',\n", |
169 | 169 | " 'coriander',\n", |
170 | 170 | " 'turmeric',\n", |
171 | 171 | " 'garam masala)',\n", |
| 172 | + " 'cilantro',\n", |
| 173 | + " 'mint',\n", |
172 | 174 | " 'ghee',\n", |
173 | | - " 'vegetable oil',\n", |
174 | | - " 'fresh coriander leaves',\n", |
175 | | - " 'mint leaves',\n", |
176 | | - " 'saffron',\n", |
| 175 | + " 'salt',\n", |
177 | 176 | " 'water']" |
178 | 177 | ] |
179 | 178 | }, |
|
185 | 184 | "source": [ |
186 | 185 | "input = {\"dish_name\": \"paneer biryani\", \"output_format_instructions\": csv_output_parser.get_format_instructions()}\n", |
187 | 186 | "\n", |
188 | | - "chain.invoke(input)" |
| 187 | + "response = chain.invoke(input)\n", |
| 188 | + "\n", |
| 189 | + "response" |
| 190 | + ] |
| 191 | + }, |
| 192 | + { |
| 193 | + "cell_type": "code", |
| 194 | + "execution_count": 8, |
| 195 | + "id": "d895f2a1-c08a-4582-b9da-393410cd63dc", |
| 196 | + "metadata": {}, |
| 197 | + "outputs": [ |
| 198 | + { |
| 199 | + "name": "stdout", |
| 200 | + "output_type": "stream", |
| 201 | + "text": [ |
| 202 | + "<class 'list'>\n" |
| 203 | + ] |
| 204 | + } |
| 205 | + ], |
| 206 | + "source": [ |
| 207 | + "print(type(response))" |
189 | 208 | ] |
190 | 209 | }, |
191 | 210 | { |
|
198 | 217 | }, |
199 | 218 | { |
200 | 219 | "cell_type": "code", |
201 | | - "execution_count": 8, |
| 220 | + "execution_count": 9, |
202 | 221 | "id": "f999b0d3-839b-4b60-ae6a-ebf8390008c7", |
203 | 222 | "metadata": {}, |
204 | 223 | "outputs": [], |
|
210 | 229 | }, |
211 | 230 | { |
212 | 231 | "cell_type": "code", |
213 | | - "execution_count": 9, |
| 232 | + "execution_count": 10, |
214 | 233 | "id": "2c3e7a50-9db7-4941-9c94-da1ac833cda1", |
215 | 234 | "metadata": {}, |
216 | 235 | "outputs": [], |
|
220 | 239 | }, |
221 | 240 | { |
222 | 241 | "cell_type": "code", |
223 | | - "execution_count": 10, |
| 242 | + "execution_count": 11, |
224 | 243 | "id": "7ef84474-2fa0-42b4-88b7-990662dad134", |
225 | 244 | "metadata": {}, |
226 | 245 | "outputs": [ |
227 | 246 | { |
228 | 247 | "data": { |
229 | 248 | "text/plain": [ |
230 | | - "{'paneerBiryani': {'ingredients': ['1 cup basmati rice',\n", |
231 | | - " '200g paneer, cut into cubes',\n", |
232 | | - " '1 onion, thinly sliced',\n", |
233 | | - " '1 tomato, chopped',\n", |
234 | | - " '1/2 cup yogurt',\n", |
235 | | - " '1/2 cup fried onions',\n", |
236 | | - " '1/4 cup chopped coriander leaves',\n", |
237 | | - " '1/4 cup chopped mint leaves',\n", |
238 | | - " '2 tablespoons biryani masala',\n", |
239 | | - " '1 tablespoon ginger-garlic paste',\n", |
240 | | - " '1 teaspoon red chili powder',\n", |
241 | | - " '1/2 teaspoon turmeric powder',\n", |
242 | | - " '1/2 teaspoon garam masala',\n", |
243 | | - " '2 tablespoons ghee',\n", |
244 | | - " '2 tablespoons oil',\n", |
245 | | - " 'Salt to taste',\n", |
246 | | - " 'Water']}}" |
| 249 | + "{'Main Ingredients': ['Paneer (Indian cottage cheese)',\n", |
| 250 | + " 'Basmati rice',\n", |
| 251 | + " 'Onion',\n", |
| 252 | + " 'Tomato',\n", |
| 253 | + " 'Green chili',\n", |
| 254 | + " 'Ginger',\n", |
| 255 | + " 'Garlic',\n", |
| 256 | + " 'Yogurt',\n", |
| 257 | + " 'Fresh cilantro',\n", |
| 258 | + " 'Mint leaves',\n", |
| 259 | + " 'Spices (such as cumin, coriander, turmeric, garam masala)',\n", |
| 260 | + " 'Oil or ghee',\n", |
| 261 | + " 'Salt'],\n", |
| 262 | + " 'Optional Ingredients': ['Mixed vegetables (like carrots, peas, bell peppers)',\n", |
| 263 | + " 'Cashews',\n", |
| 264 | + " 'Raisins']}" |
247 | 265 | ] |
248 | 266 | }, |
249 | | - "execution_count": 10, |
| 267 | + "execution_count": 11, |
250 | 268 | "metadata": {}, |
251 | 269 | "output_type": "execute_result" |
252 | 270 | } |
253 | 271 | ], |
254 | 272 | "source": [ |
255 | 273 | "input = {\"dish_name\": \"paneer biryani\", \"output_format_instructions\": json_output_parser.get_format_instructions()}\n", |
256 | 274 | "\n", |
257 | | - "chain.invoke(input)" |
| 275 | + "response = chain.invoke(input)\n", |
| 276 | + "\n", |
| 277 | + "response" |
| 278 | + ] |
| 279 | + }, |
| 280 | + { |
| 281 | + "cell_type": "code", |
| 282 | + "execution_count": 12, |
| 283 | + "id": "6193c287-1341-4d08-8482-b9d34b0b2f5e", |
| 284 | + "metadata": {}, |
| 285 | + "outputs": [ |
| 286 | + { |
| 287 | + "name": "stdout", |
| 288 | + "output_type": "stream", |
| 289 | + "text": [ |
| 290 | + "<class 'dict'>\n" |
| 291 | + ] |
| 292 | + } |
| 293 | + ], |
| 294 | + "source": [ |
| 295 | + "print(type(response))" |
258 | 296 | ] |
259 | 297 | }, |
260 | 298 | { |
|
269 | 307 | }, |
270 | 308 | { |
271 | 309 | "cell_type": "code", |
272 | | - "execution_count": 11, |
| 310 | + "execution_count": 13, |
273 | 311 | "id": "072bd02b-c06d-4d05-97b2-f62862e8dcc2", |
274 | 312 | "metadata": {}, |
275 | 313 | "outputs": [], |
|
281 | 319 | }, |
282 | 320 | { |
283 | 321 | "cell_type": "code", |
284 | | - "execution_count": 12, |
| 322 | + "execution_count": 14, |
285 | 323 | "id": "00755d45-e38a-4c09-8412-c12eb4540175", |
286 | 324 | "metadata": {}, |
287 | 325 | "outputs": [ |
288 | 326 | { |
289 | 327 | "data": { |
290 | 328 | "text/plain": [ |
291 | | - "\"Write a datetime string that matches the following pattern: '%Y-%m-%dT%H:%M:%S.%fZ'.\\n\\nExamples: 1892-01-30T12:13:48.068611Z, 0561-05-13T02:27:55.160011Z, 1699-05-11T04:40:29.696518Z\\n\\nReturn ONLY this string, no other words!\"" |
| 329 | + "\"Write a datetime string that matches the following pattern: '%Y-%m-%dT%H:%M:%S.%fZ'.\\n\\nExamples: 0766-08-12T18:44:49.184246Z, 1953-02-26T13:12:24.798157Z, 1621-07-14T00:16:29.137230Z\\n\\nReturn ONLY this string, no other words!\"" |
292 | 330 | ] |
293 | 331 | }, |
294 | | - "execution_count": 12, |
| 332 | + "execution_count": 14, |
295 | 333 | "metadata": {}, |
296 | 334 | "output_type": "execute_result" |
297 | 335 | } |
|
304 | 342 | }, |
305 | 343 | { |
306 | 344 | "cell_type": "code", |
307 | | - "execution_count": 13, |
| 345 | + "execution_count": 15, |
308 | 346 | "id": "3bd3acd4-2cda-4776-a90c-968e87133d9f", |
309 | 347 | "metadata": {}, |
310 | 348 | "outputs": [], |
|
322 | 360 | }, |
323 | 361 | { |
324 | 362 | "cell_type": "code", |
325 | | - "execution_count": 14, |
| 363 | + "execution_count": 16, |
326 | 364 | "id": "c18efe6f-b8d4-4839-b8d0-8cfc01fc3587", |
327 | 365 | "metadata": {}, |
328 | 366 | "outputs": [], |
|
335 | 373 | }, |
336 | 374 | { |
337 | 375 | "cell_type": "code", |
338 | | - "execution_count": 15, |
| 376 | + "execution_count": 17, |
339 | 377 | "id": "69182c25-2ba5-4ad4-9287-41b31011880f", |
340 | 378 | "metadata": {}, |
341 | 379 | "outputs": [ |
|
345 | 383 | "datetime.datetime(1947, 8, 15, 0, 0)" |
346 | 384 | ] |
347 | 385 | }, |
348 | | - "execution_count": 15, |
| 386 | + "execution_count": 17, |
349 | 387 | "metadata": {}, |
350 | 388 | "output_type": "execute_result" |
351 | 389 | } |
|
355 | 393 | "\n", |
356 | 394 | "input = {\"question\": \"What is Indian Independence Day?\", \"output_format_instructions\": output_parser.get_format_instructions()}\n", |
357 | 395 | "\n", |
358 | | - "chain.invoke(input)" |
| 396 | + "response = chain.invoke(input)\n", |
| 397 | + "\n", |
| 398 | + "response" |
| 399 | + ] |
| 400 | + }, |
| 401 | + { |
| 402 | + "cell_type": "code", |
| 403 | + "execution_count": 18, |
| 404 | + "id": "0520093c-fd7c-4ab0-9c28-bd3aa8a64e6c", |
| 405 | + "metadata": {}, |
| 406 | + "outputs": [ |
| 407 | + { |
| 408 | + "name": "stdout", |
| 409 | + "output_type": "stream", |
| 410 | + "text": [ |
| 411 | + "<class 'datetime.datetime'>\n" |
| 412 | + ] |
| 413 | + } |
| 414 | + ], |
| 415 | + "source": [ |
| 416 | + "print(type(response))" |
359 | 417 | ] |
360 | 418 | }, |
361 | 419 | { |
|
376 | 434 | }, |
377 | 435 | { |
378 | 436 | "cell_type": "code", |
379 | | - "execution_count": 14, |
| 437 | + "execution_count": 19, |
380 | 438 | "id": "88654381-1109-4e7d-a095-181623aea87d", |
381 | 439 | "metadata": {}, |
382 | 440 | "outputs": [], |
|
394 | 452 | }, |
395 | 453 | { |
396 | 454 | "cell_type": "code", |
397 | | - "execution_count": 15, |
| 455 | + "execution_count": 20, |
398 | 456 | "id": "d7617763-9a91-48fb-b34f-89ee49951bde", |
399 | 457 | "metadata": {}, |
400 | 458 | "outputs": [ |
|
420 | 478 | }, |
421 | 479 | { |
422 | 480 | "cell_type": "code", |
423 | | - "execution_count": 16, |
| 481 | + "execution_count": 21, |
424 | 482 | "id": "aeae8a81-db61-498a-8a5a-f50af164b3d0", |
425 | 483 | "metadata": {}, |
426 | 484 | "outputs": [], |
|
441 | 499 | }, |
442 | 500 | { |
443 | 501 | "cell_type": "code", |
444 | | - "execution_count": 17, |
| 502 | + "execution_count": 22, |
445 | 503 | "id": "fe0a8de3-da21-46f5-8a07-a2872d420b66", |
446 | 504 | "metadata": {}, |
447 | 505 | "outputs": [], |
|
453 | 511 | }, |
454 | 512 | { |
455 | 513 | "cell_type": "code", |
456 | | - "execution_count": 18, |
| 514 | + "execution_count": 23, |
457 | 515 | "id": "b39be662-5ddf-449b-8c2a-c6269dcc4971", |
458 | 516 | "metadata": {}, |
459 | 517 | "outputs": [ |
|
463 | 521 | "Song(name='Kal Ho Naa Ho', geners=['Bollywood', 'Romantic'])" |
464 | 522 | ] |
465 | 523 | }, |
466 | | - "execution_count": 18, |
| 524 | + "execution_count": 23, |
467 | 525 | "metadata": {}, |
468 | 526 | "output_type": "execute_result" |
469 | 527 | } |
|
0 commit comments