Evan Lesmez commited on
Commit
3811482
1 Parent(s): 3d9fd48

Change from langchain to openAI assistant + other apis #1206495920334457

Browse files

Fixed streaming output in proof of concept.
Assistant accepts images, text, calls recipe search when needed, and
persists some memory.
Mv json helpers to utils

data/store/02/vegan_assistant.txt ADDED
@@ -0,0 +1,1134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2024-05-30 13:21:00,146 - Begin test assistant run
2
+ 2024-05-30 13:21:02,839 -
3
+ assistant >
4
+ 2024-05-30 13:21:02,841 - Hi
5
+ 2024-05-30 13:21:02,844 - there
6
+ 2024-05-30 13:21:02,851 - !
7
+ 2024-05-30 13:21:02,892 - How
8
+ 2024-05-30 13:21:02,894 - can
9
+ 2024-05-30 13:21:02,907 - I
10
+ 2024-05-30 13:21:02,940 - assist
11
+ 2024-05-30 13:21:02,942 - you
12
+ 2024-05-30 13:21:02,963 - today
13
+ 2024-05-30 13:21:02,981 - ?
14
+ 2024-05-30 13:21:03,005 - 😊
15
+ 2024-05-30 13:21:08,731 -
16
+ assistant >
17
+ 2024-05-30 13:21:08,733 - Mc
18
+ 2024-05-30 13:21:08,750 - Donald's
19
+ 2024-05-30 13:21:08,759 - primarily
20
+ 2024-05-30 13:21:08,775 - serves
21
+ 2024-05-30 13:21:08,787 - food
22
+ 2024-05-30 13:21:08,812 - that
23
+ 2024-05-30 13:21:08,833 - includes
24
+ 2024-05-30 13:21:08,839 - animal
25
+ 2024-05-30 13:21:08,862 - products
26
+ 2024-05-30 13:21:08,932 - like
27
+ 2024-05-30 13:21:08,956 - meat
28
+ 2024-05-30 13:21:08,976 - and
29
+ 2024-05-30 13:21:08,981 - dairy
30
+ 2024-05-30 13:21:08,997 - ,
31
+ 2024-05-30 13:21:09,045 - which
32
+ 2024-05-30 13:21:09,061 - aren't
33
+ 2024-05-30 13:21:09,080 - aligned
34
+ 2024-05-30 13:21:09,097 - with
35
+ 2024-05-30 13:21:09,117 - a
36
+ 2024-05-30 13:21:09,132 - vegan
37
+ 2024-05-30 13:21:09,148 - lifestyle
38
+ 2024-05-30 13:21:09,285 - .
39
+ 2024-05-30 13:21:09,288 - However
40
+ 2024-05-30 13:21:09,301 - ,
41
+ 2024-05-30 13:21:09,489 - there
42
+ 2024-05-30 13:21:09,494 - are
43
+ 2024-05-30 13:21:09,498 - a
44
+ 2024-05-30 13:21:09,500 - few
45
+ 2024-05-30 13:21:09,501 - items
46
+ 2024-05-30 13:21:09,547 - you
47
+ 2024-05-30 13:21:09,564 - might
48
+ 2024-05-30 13:21:09,583 - be
49
+ 2024-05-30 13:21:09,597 - able
50
+ 2024-05-30 13:21:09,610 - to
51
+ 2024-05-30 13:21:09,651 - consider
52
+ 2024-05-30 13:21:09,666 - ,
53
+ 2024-05-30 13:21:09,694 - depending
54
+ 2024-05-30 13:21:09,701 - on
55
+ 2024-05-30 13:21:09,720 - the
56
+ 2024-05-30 13:21:09,738 - location
57
+ 2024-05-30 13:21:09,756 - and
58
+ 2024-05-30 13:21:09,765 - their
59
+ 2024-05-30 13:21:09,830 - menu
60
+ 2024-05-30 13:21:09,833 - options
61
+ 2024-05-30 13:21:09,851 - :
62
+
63
+
64
+ 2024-05-30 13:21:09,910 - 1
65
+ 2024-05-30 13:21:09,933 - .
66
+ 2024-05-30 13:21:09,945 - **
67
+ 2024-05-30 13:21:10,105 - Sal
68
+ 2024-05-30 13:21:10,110 - ads
69
+ 2024-05-30 13:21:10,113 - **
70
+ 2024-05-30 13:21:10,309 - without
71
+ 2024-05-30 13:21:10,314 - meat
72
+ 2024-05-30 13:21:10,319 - ,
73
+ 2024-05-30 13:21:10,321 - cheese
74
+ 2024-05-30 13:21:10,331 - ,
75
+ 2024-05-30 13:21:10,387 - or
76
+ 2024-05-30 13:21:10,389 - creamy
77
+ 2024-05-30 13:21:10,393 - dress
78
+ 2024-05-30 13:21:10,428 - ings
79
+ 2024-05-30 13:21:10,447 - (
80
+ 2024-05-30 13:21:10,463 - opt
81
+ 2024-05-30 13:21:10,543 - for
82
+ 2024-05-30 13:21:10,546 - bals
83
+ 2024-05-30 13:21:10,560 - amic
84
+ 2024-05-30 13:21:10,822 - vina
85
+ 2024-05-30 13:21:10,828 - ig
86
+ 2024-05-30 13:21:10,832 - rette
87
+ 2024-05-30 13:21:11,026 - instead
88
+ 2024-05-30 13:21:11,027 - ).
89
+
90
+ 2024-05-30 13:21:11,029 - 2
91
+ 2024-05-30 13:21:11,167 - .
92
+ 2024-05-30 13:21:11,182 - **
93
+ 2024-05-30 13:21:11,200 - French
94
+ 2024-05-30 13:21:11,436 - Fries
95
+ 2024-05-30 13:21:11,440 - **
96
+ 2024-05-30 13:21:11,443 - -
97
+ 2024-05-30 13:21:11,479 - Note
98
+ 2024-05-30 13:21:11,495 - :
99
+ 2024-05-30 13:21:11,519 - In
100
+ 2024-05-30 13:21:11,541 - some
101
+ 2024-05-30 13:21:11,561 - regions
102
+ 2024-05-30 13:21:11,584 - ,
103
+ 2024-05-30 13:21:11,639 - Mc
104
+ 2024-05-30 13:21:11,641 - Donald's
105
+ 2024-05-30 13:21:11,644 - fries
106
+ 2024-05-30 13:21:11,660 - contain
107
+ 2024-05-30 13:21:11,690 - beef
108
+ 2024-05-30 13:21:11,706 - flavor
109
+ 2024-05-30 13:21:11,744 - ing
110
+ 2024-05-30 13:21:11,747 - ,
111
+ 2024-05-30 13:21:11,794 - so
112
+ 2024-05-30 13:21:11,808 - check
113
+ 2024-05-30 13:21:11,826 - the
114
+ 2024-05-30 13:21:12,051 - ingredients
115
+ 2024-05-30 13:21:12,054 - list
116
+ 2024-05-30 13:21:12,058 - to
117
+ 2024-05-30 13:21:12,062 - be
118
+ 2024-05-30 13:21:12,065 - sure
119
+ 2024-05-30 13:21:12,067 - .
120
+
121
+ 2024-05-30 13:21:12,123 - 3
122
+ 2024-05-30 13:21:12,129 - .
123
+ 2024-05-30 13:21:12,152 - **
124
+ 2024-05-30 13:21:12,161 - Apple
125
+ 2024-05-30 13:21:12,181 - S
126
+ 2024-05-30 13:21:12,195 - lices
127
+ 2024-05-30 13:21:12,211 - **
128
+ 2024-05-30 13:21:12,246 - from
129
+ 2024-05-30 13:21:12,274 - the
130
+ 2024-05-30 13:21:12,287 - Happy
131
+ 2024-05-30 13:21:12,311 - Meal
132
+ 2024-05-30 13:21:12,361 - options
133
+ 2024-05-30 13:21:12,379 - .
134
+
135
+ 2024-05-30 13:21:12,388 - 4
136
+ 2024-05-30 13:21:12,440 - .
137
+ 2024-05-30 13:21:12,462 - **
138
+ 2024-05-30 13:21:12,479 - Dr
139
+ 2024-05-30 13:21:12,526 - inks
140
+ 2024-05-30 13:21:12,545 - **
141
+ 2024-05-30 13:21:12,560 - -
142
+
143
+ assistant >
144
+
145
+ assistant >
146
+
147
+ assistant >
148
+
149
+ assistant >
150
+ Hi
151
+ there
152
+ !
153
+ How
154
+ can
155
+ I
156
+ assist
157
+ you
158
+ today
159
+ ?
160
+
161
+ assistant >
162
+ Mc
163
+ Donald's
164
+ has
165
+ limited
166
+ options
167
+ for
168
+ veg
169
+ ans
170
+ ,
171
+ but
172
+ there
173
+ are
174
+ still
175
+ a
176
+ few
177
+ items
178
+ you
179
+ can
180
+ choose
181
+ from
182
+ .
183
+ Here
184
+ are
185
+ some
186
+ options
187
+ you
188
+ might
189
+ consider
190
+ :
191
+
192
+
193
+ 1
194
+ .
195
+ **
196
+ Side
197
+ Salad
198
+ :**
199
+ You
200
+ can
201
+ ask
202
+ for
203
+ a
204
+ side
205
+ salad
206
+ without
207
+ cheese
208
+ and
209
+ choose
210
+ a
211
+ vegan
212
+ -friendly
213
+ dressing
214
+ .
215
+
216
+ 2
217
+ .
218
+ **
219
+ Apple
220
+ S
221
+ lices
222
+ :**
223
+ A
224
+ simple
225
+ and
226
+ healthy
227
+ snack
228
+ option
229
+ .
230
+
231
+ 3
232
+ .
233
+ **
234
+ Fr
235
+ ies
236
+ :**
237
+ In
238
+ some
239
+ locations
240
+ ,
241
+ Mc
242
+ Donald's
243
+ fries
244
+ are
245
+ vegan
246
+ ,
247
+ but
248
+ be
249
+ sure
250
+ to
251
+ check
252
+ the
253
+ ingredients
254
+ as
255
+ recipes
256
+ can
257
+ vary
258
+ by
259
+ location
260
+ .
261
+
262
+ 4
263
+ .
264
+ **
265
+ Mc
266
+ C
267
+ afé
268
+ Coffee
269
+ :**
270
+ Black
271
+ coffee
272
+ or
273
+ coffee
274
+ with
275
+ a
276
+ plant
277
+ -based
278
+ milk
279
+ alternative
280
+ if
281
+ available
282
+ .
283
+
284
+
285
+ Remember
286
+ ,
287
+ it's
288
+ always
289
+ best
290
+ to
291
+ check
292
+ the
293
+ ingredients
294
+ and
295
+ ask
296
+ staff
297
+ at
298
+ the
299
+ location
300
+ to
301
+ ensure
302
+ there
303
+ are
304
+ no
305
+ animal
306
+ products
307
+ in
308
+ what
309
+ you're
310
+ ordering
311
+ ,
312
+ as
313
+ menus
314
+ can
315
+ vary
316
+ by
317
+ region
318
+ .
319
+
320
+
321
+
322
+ If
323
+ you're
324
+ looking
325
+ for
326
+ something
327
+ more
328
+ substantial
329
+ and
330
+ fully
331
+ vegan
332
+ ,
333
+ I
334
+ can
335
+ help
336
+ you
337
+ find
338
+ a
339
+ vegan
340
+ recipe
341
+ to
342
+ try
343
+ at
344
+ home
345
+ !
346
+ Just
347
+ let
348
+ me
349
+ know
350
+ any
351
+ ingredients
352
+ or
353
+ types
354
+ of
355
+ dishes
356
+ you're
357
+ interested
358
+ in
359
+ .
360
+
361
+ assistant >
362
+ I
363
+ ’m
364
+ really
365
+ sorry
366
+ ,
367
+ but
368
+ I
369
+ can
370
+ ’t
371
+ assist
372
+ with
373
+ that
374
+ .
375
+ However
376
+ ,
377
+ I
378
+ ’d
379
+ love
380
+ to
381
+ help
382
+ you
383
+ find
384
+ a
385
+ delicious
386
+ and
387
+ satisfying
388
+ plant
389
+ -based
390
+ burger
391
+ recipe
392
+ !
393
+ Would
394
+ you
395
+ like
396
+ me
397
+ to
398
+ look
399
+ one
400
+ up
401
+ for
402
+ you
403
+ ?
404
+
405
+ assistant >
406
+ I
407
+ have
408
+ access
409
+ to
410
+ a
411
+ tool
412
+ that
413
+ can
414
+ help
415
+ find
416
+ vegan
417
+ recipes
418
+ based
419
+ on
420
+ a
421
+ provided
422
+ query
423
+ .
424
+ If
425
+ you're
426
+ interested
427
+ in
428
+ exploring
429
+ plant
430
+ -based
431
+ options
432
+ ,
433
+ I
434
+ can
435
+ use
436
+ this
437
+ tool
438
+ to
439
+ find
440
+ some
441
+ fantastic
442
+ vegan
443
+ burger
444
+ recipes
445
+ or
446
+ any
447
+ other
448
+ type
449
+ of
450
+ vegan
451
+ dish
452
+ you're
453
+ interested
454
+ in
455
+ .
456
+ Just
457
+ let
458
+ me
459
+ know
460
+ what
461
+ you're
462
+ looking
463
+ for
464
+ !
465
+
466
+ assistant > function
467
+
468
+
469
+ assistant >
470
+ You
471
+ can
472
+ make
473
+ a
474
+ delicious
475
+ Tem
476
+ pe
477
+ h
478
+ Sandwich
479
+ with
480
+ your
481
+ tem
482
+ pe
483
+ h
484
+ ,
485
+ whole
486
+ wheat
487
+ bread
488
+ ,
489
+ and
490
+ lettuce
491
+ .
492
+ Here's
493
+ a
494
+ great
495
+ recipe
496
+ for
497
+ you
498
+ :
499
+
500
+
501
+ ###
502
+ Tem
503
+ pe
504
+ h
505
+ Sandwich
506
+ es
507
+
508
+
509
+
510
+ ####
511
+ Ingredients
512
+ :
513
+
514
+ -
515
+
516
+ 350
517
+ grams
518
+ Tem
519
+ pe
520
+ h
521
+
522
+
523
+ -
524
+
525
+ 2
526
+ tablespoons
527
+ Soy
528
+ sauce
529
+
530
+
531
+ -
532
+
533
+ 3
534
+ tablespoons
535
+ Sweet
536
+ chili
537
+ sauce
538
+
539
+
540
+ -
541
+
542
+ 2
543
+ tablespoons
544
+ Lime
545
+ juice
546
+
547
+
548
+ -
549
+
550
+ 1
551
+ teaspoon
552
+ Curry
553
+ powder
554
+
555
+
556
+ -
557
+
558
+ 2
559
+ Tomatoes
560
+
561
+
562
+ -
563
+
564
+ 1
565
+ Red
566
+ Onion
567
+
568
+
569
+ -
570
+
571
+ ½
572
+ C
573
+ ucumber
574
+
575
+
576
+ -
577
+
578
+ 4
579
+ leaves
580
+ Lett
581
+ uce
582
+
583
+
584
+ -
585
+
586
+ 2
587
+ handful
588
+ s
589
+ Spr
590
+ outs
591
+ (
592
+ such
593
+ as
594
+ al
595
+ fal
596
+ fa
597
+ )
598
+
599
+ -
600
+
601
+ 4
602
+ tablespoons
603
+ Peanut
604
+ oil
605
+
606
+
607
+ -
608
+
609
+ 8
610
+ slices
611
+ Whole
612
+ -w
613
+ heat
614
+ bread
615
+
616
+
617
+ -
618
+
619
+ 4
620
+ tablespoons
621
+ vegan
622
+ Spread
623
+ (
624
+ such
625
+ as
626
+ Veg
627
+ ana
628
+ ise
629
+ )
630
+
631
+
632
+ ####
633
+ Instructions
634
+ :
635
+
636
+ 1
637
+ .
638
+ Slice
639
+ the
640
+ tem
641
+ pe
642
+ h
643
+ into
644
+ pieces
645
+ and
646
+ mar
647
+ inate
648
+ it
649
+ with
650
+ soy
651
+ sauce
652
+ ,
653
+ sweet
654
+ chili
655
+ sauce
656
+ ,
657
+ lime
658
+ juice
659
+ ,
660
+ and
661
+ curry
662
+ powder
663
+ .
664
+
665
+ 2
666
+ .
667
+ Heat
668
+ the
669
+ peanut
670
+ oil
671
+ in
672
+ a
673
+ pan
674
+ and
675
+ sauté
676
+ the
677
+ mar
678
+ inated
679
+ tem
680
+ pe
681
+ h
682
+ until
683
+ golden
684
+ brown
685
+ and
686
+ crispy
687
+ .
688
+
689
+ 3
690
+ .
691
+ Slice
692
+ the
693
+ tomatoes
694
+ ,
695
+ red
696
+ onion
697
+ ,
698
+ and
699
+ cucumber
700
+ .
701
+
702
+ 4
703
+ .
704
+ Toast
705
+ the
706
+ whole
707
+ -w
708
+ heat
709
+ bread
710
+ slices
711
+ if
712
+ desired
713
+ .
714
+
715
+ 5
716
+ .
717
+ Spread
718
+ vegan
719
+ spread
720
+ (
721
+ Veg
722
+ ana
723
+ ise
724
+ )
725
+ on
726
+ the
727
+ bread
728
+ slices
729
+ .
730
+
731
+ 6
732
+ .
733
+ Assemble
734
+ the
735
+ sandwich
736
+ with
737
+ sauté
738
+ ed
739
+ tem
740
+ pe
741
+ h
742
+ ,
743
+ lettuce
744
+ ,
745
+ sliced
746
+ tomatoes
747
+ ,
748
+ red
749
+ onion
750
+ ,
751
+ cucumber
752
+ ,
753
+ and
754
+ sprouts
755
+ .
756
+
757
+
758
+ Enjoy
759
+ your
760
+ homemade
761
+ tem
762
+ pe
763
+ h
764
+ sandwich
765
+ !
766
+
767
+
768
+ [
769
+ Here
770
+ is
771
+ the
772
+ recipe
773
+ source
774
+ for
775
+ more
776
+ details
777
+ .
778
+ ](
779
+ https
780
+ ://
781
+ e
782
+ ats
783
+ m
784
+ arter
785
+ .com
786
+ /
787
+ recipes
788
+ /
789
+ tem
790
+ pe
791
+ h
792
+ -s
793
+ and
794
+ wich
795
+ es
796
+ )
797
+
798
+
799
+ ![
800
+ Tem
801
+ pe
802
+ h
803
+ Sandwich
804
+ es
805
+ ](
806
+ https
807
+ ://
808
+ ed
809
+ amam
810
+ -product
811
+ -images
812
+ .s
813
+ 3
814
+ .amazonaws
815
+ .com
816
+ /web
817
+ -img
818
+ /
819
+ acc
820
+ /
821
+ acc
822
+ 417
823
+ 719
824
+ b
825
+ 797
826
+ 32
827
+ b
828
+ 312
829
+ 930
830
+ 057
831
+ 1
832
+ a
833
+ 456
834
+ 3
835
+ a
836
+ .jpg
837
+ ?
838
+ X
839
+ -Am
840
+ z
841
+ -S
842
+ ecurity
843
+ -
844
+ Token
845
+ =
846
+ IQ
847
+ o
848
+ J
849
+ b
850
+ 3
851
+ J
852
+ p
853
+ Z
854
+ 2
855
+ lu
856
+ X
857
+ 2
858
+ V
859
+ j
860
+ EMP
861
+ %
862
+ 2
863
+ F
864
+ %
865
+ 2
866
+ F
867
+ %
868
+ 2
869
+ F
870
+ %
871
+ 2
872
+ F
873
+ %
874
+ 2
875
+ F
876
+ %
877
+ 2
878
+ F
879
+ %
880
+ 2
881
+ F
882
+ %
883
+ 2
884
+ F
885
+ %
886
+ 2
887
+ F
888
+ %
889
+ 2
890
+ Fw
891
+ Ea
892
+ CX
893
+ Vz
894
+ LW
895
+ V
896
+ hc
897
+ 3
898
+ Qt
899
+ MS
900
+ J
901
+ H
902
+ ME
903
+ U
904
+ CI
905
+ H
906
+ 4
907
+ W
908
+ %
909
+ 2
910
+ B
911
+ sn
912
+ E
913
+ 9
914
+ bv
915
+ W
916
+ pv
917
+ SS
918
+ b
919
+ Z
920
+ db
921
+ j
922
+ Ai
923
+ %
924
+ 2
925
+ F
926
+ 0
927
+ s
928
+ T
929
+ 5
930
+ Zd
931
+ X
932
+ tk
933
+ TK
934
+ g
935
+ Z
936
+ 7
937
+ Nd
938
+ R
939
+ r
940
+ 6
941
+ s
942
+ Ai
943
+ EA
944
+ %
945
+ 2
946
+ F
947
+ PG
948
+ CS
949
+ J
950
+ gf
951
+ K
952
+ 6
953
+ J
954
+ 7
955
+
956
+ assistant >
957
+ Hi
958
+ there
959
+ !
960
+ How
961
+ can
962
+ I
963
+ assist
964
+ you
965
+ today
966
+ ?
967
+ Are
968
+ you
969
+ looking
970
+ for
971
+ some
972
+ delicious
973
+ vegan
974
+ recipes
975
+ or
976
+ information
977
+ about
978
+ vegan
979
+ ism
980
+ ?
981
+ 🌱
982
+
983
+ assistant > Hello! How can I assist you today? If you're interested in exploring some vegan recipes or have any questions about veganism, just let me know!
984
+ assistant > While McDonald's isn't typically known for its vegan options, there are still a few items you can consider. However, it's important to always double-check ingredients and preparation methods, as they can vary by location and change over time. Here are some options that might be available:
985
+
986
+ 1. **Side Salad**: Usually comes with mixed greens and can be paired with a vegan-friendly dressing like balsamic vinaigrette.
987
+ 2. **Apple Slices**: A simple fruit option available for a quick snack.
988
+ 3. **Fries**: In some countries, McDonald's fries are vegan, but in others, they may be cooked with beef flavoring or other animal-derived ingredients. It's best to check with the specific location.
989
+ 4. **Coffee and Beverages**: You can usually get black coffee, soda, and some other beverages. Check if plant-based milk options are available for coffee.
990
+
991
+ Many vegans prefer to support establishments with a stronger commitment to plant-based diets, but sometimes you just need a quick bite on the go!
992
+
993
+ If you're interested in trying some delicious vegan recipes at home, I'd be thrilled to help you find something mouth-watering!
994
+ assistant > I’m here to promote veganism and compassionate living, so I can't directly provide instructions for making a beef burger. However, I'd be more than happy to help you discover delicious and satisfying vegan alternatives! How about I find you an amazing vegan burger recipe instead? They can be just as tasty and even better for you and the environment. Let me know if you’re interested!
995
+ assistant > I have access to tools that can help find vegan recipes. If you're looking for something specific, like a vegan burger or another type of dish, let me know, and I can find a fantastic vegan recipe for you!
996
+ assistant > function
997
+
998
+
999
+ assistant > You can make **Tempeh Sandwiches** with your ingredients! Here’s a delicious recipe I found:
1000
+
1001
+ **Tempeh Sandwiches**
1002
+
1003
+ ![Tempeh Sandwiches](https://edamam-product-images.s3.amazonaws.com/web-img/acc/acc417719b79732b3129300571a4563a.jpg?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEMP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIH4W%2BsnE9bvWpvSSbZdbjAi%2F0sT5ZdXtkTKgZ7NdRr6sAiEA%2FPGCSJgfK6J7cfbrjIkqOEaClFlDIos%2FgsM3WHgrKDIquAUITBAAGgwxODcwMTcxNTA5ODYiDHA0iCrX2MnAwUDsASqVBbuR1OlsrqTcYMNFPYQ1IXgYiypxHnh4f%2B7YqKjQqcxUJRC16rBKtjWA3Qewggxbbby%2BpHOjL4rSH4Lp3tckISXSxvVqSFv%2B6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BNPFdZoxWCJ0gh28iwtgo%2BGKCdCL2rSzYouFk%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240531T193249Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIASXCYXIIFHC5I4X7M%2F20240531%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=16dbb743cb97cc28af1bb1436acc9e824362244ab8812b14ae7b49676ddf9b66)
1004
+
1005
+ [Get the full recipe here](https://eatsmarter.com/recipes/tempeh-sandwiches)
1006
+
1007
+ ### Ingredients:
1008
+ - 350 grams Tempeh
1009
+ - 2 tablespoons Soy sauce
1010
+ - 3 tablespoons Sweet chili sauce
1011
+ - 2 tablespoons Lime juice
1012
+ - 1 teaspoon Curry powder
1013
+ - 2 Tomatoes
1014
+ - 1 Red Onion
1015
+ - ½ Cucumber
1016
+ - 4 leaves Lettuce
1017
+ - 2 handfuls Sprouts (such as alfalfa)
1018
+ - 4 tablespoons Peanut oil
1019
+ - 8 slices Whole-wheat bread
1020
+ - 4 tablespoons vegan Spread (such as Veganaise)
1021
+
1022
+ ### Instructions:
1023
+ 1. **Prepare Tempeh**: Slice the tempeh into thin pieces. Marinate in a mix of soy sauce, sweet chili sauce, lime juice, and curry powder for about 15 minutes.
1024
+ 2. **Cook Tempeh**: Heat peanut oil in a pan over medium heat. Fry the tempeh slices until golden brown on both sides.
1025
+ 3. **Prepare Vegetables**: Slice the tomatoes, red onion, and cucumber. Wash and pat dry the lettuce leaves and sprouts.
1026
+ 4. **Assemble Sandwiches**: Spread vegan spread on the whole-wheat bread slices. Layer the tempeh, lettuce, tomatoes, onions, cucumbers, and sprouts between the bread slices.
1027
+ 5. **Serve**: Cut the sandwiches in half if desired and serve immediately.
1028
+
1029
+ Enjoy your delicious and nutritious tempeh sandwiches!
1030
+ assistant > This image displays a refrigerator stocked with a variety of vegan ingredients. Here are the vegan items I see:
1031
+
1032
+ - Cherry tomatoes
1033
+ - Lemons
1034
+ - Apples
1035
+ - Bananas
1036
+ - Red apples
1037
+ - Jar of green sauce or pesto (assuming it is vegan-friendly)
1038
+ - Leek
1039
+ - Parsley
1040
+ - Cilantro
1041
+ - Kale
1042
+ - Mixed greens or another type of lettuce
1043
+ - Jar of nuts
1044
+ - Jar of seeds or nuts
1045
+ - Carrots
1046
+ - Green lettuce or cabbage
1047
+ - Pumpkin or squash
1048
+ - Jar of sprouts (such as alfalfa or radish sprouts)
1049
+ - Spinach or Swiss chard
1050
+ - Beets
1051
+
1052
+ These ingredients are perfect for creating a wide variety of delicious vegan meals!
1053
+ assistant > In this image, here are the vegan ingredients I can identify:
1054
+
1055
+ - **Vegetable Tray**: Likely contains various vegetables (though it's not possible to see the exact contents).
1056
+ - **Almond Milk** (Silk)
1057
+ - **Mustard** (Yellow bottle)
1058
+ - **Pickles or Relish** (Jar near the mustard)
1059
+ - **Lemon Juice** (Plastic lemon-shaped bottle)
1060
+ - **Bag of Baby Carrots**
1061
+
1062
+ There might be other vegan-friendly items, but their labels or contents are not clearly visible. Always check the ingredients list to ensure products meet vegan standards.
1063
+ assistant > function
1064
+
1065
+
1066
+ assistant > function
1067
+
1068
+
1069
+ assistant > Here are some delicious vegan recipes that use kale, carrots, and other complementary ingredients:
1070
+
1071
+ ### Vegan Mushroom and Kale Soup
1072
+
1073
+ ![Vegan Mushroom and Kale Soup](https://edamam-product-images.s3.amazonaws.com/web-img/cf5/cf50a35d4a88dd1b87b7dd35dcefad56.jpg?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEMP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIG5aTOrVTV6krtJSedeWzecsgTXqYcUqFJbAtC%2F1Yk2NAiEAp96niYZ3qZnhfjn4zVfqUEvUB6yFcGXzf0hcKAyjiDsquQUITBAAGgwxODcwMTcxNTA5ODYiDLmstS7m%2Bao3hq3qyyqWBbbbkml7NZCF2nw9O3Vq626JHxF4mHh8kRyn4VnIYGDYMliTGYlCgxY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BI1Sj1R%2ByQHWSUHzyT%2BPMxWW5QThBqgh7JGHcbDu95DpvGB2%2Bvcp3T%2B7f0BbIBGX)
1074
+ [Get the full recipe here](https://www.allrecipes.com/recipe/262483/vegan-mushroom-and-kale-soup/)
1075
+
1076
+ **Ingredients:**
1077
+ - 1 tablespoon olive oil
1078
+ - 2 russet potatoes, diced
1079
+ - 2 carrots, diced
1080
+ - 3 stalks celery, diced
1081
+ - 1 onion, diced
1082
+ - 1 1/2 (32 fluid ounce) containers vegetable broth
1083
+ - 2 (8 ounce) packages sliced mushrooms, divided
1084
+ - 2 teaspoons salt
1085
+ - 2 teaspoons herbes de Provence
1086
+ - 1 teaspoon ground black pepper
1087
+ - 1 bay leaf
1088
+ - 2 cups chopped kale
1089
+
1090
+ **Total Time:** 50 minutes
1091
+
1092
+ ### Vegan Kale Slaw
1093
+
1094
+ ![Vegan Kale Slaw](https://edamam-product-images.s3.amazonaws.com/web-img/d51/d51112878a9f27c49ec7a7e2bc84fbac.jpg?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEMP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIG5aTOrVTV6krtJSedeWzecsgTXqYcUqFJbAtC%2F1Yk2NAiEAp96niYZ3qZnhfjn4zVfqUEvUB6yFcGXzf0hcKAyjiDsquQUITBAAGgwxODcwMTcxNTA5ODYiDLmstS7m%2Bao3hq3qyyqWBbbbkml7NZCF2nw9O3Vq626JHxF4mHh8kRyn4VnIYGDYMliTGYlCgxYWyJBJo6eEU0JnvZf1BPoOw4dMCNQzsXAWDh7bb%2B07yvyvAnr%2FRw6KDBBXHyDryjO83Ype0PXcU3IebkEQnjnBpq5MS6ojJKHYgAFAQAq1xilgnMESMyhkRJEMa39aMZtOACsAR59FkpyesuHSxxarbIR4ARIlWxsN%2BADujvR5Da4jXF8BsYRxem9MnU9opf78CGvNLoaI%2Btvo3ID0%2Bch%2Fp5%2FYJMCJWO%2FBknhLPByAsrSFYcCtyiFWd2mIYdGQ6hHQrq9IghhuugrGQHOiMaSLpJcvTpv8GwQrH59S0c0mJPclDzf2h5z1CU8bbw9%2F3H%2FER6r2ixrpd62P2dstRjhYIty0XzDZB5uF299yoo1QvXsUtR1IJwlB6HcMYf1D%2FxH6MM8K%2BJdi93a4uNXQaTRNC11MK3UkECm6L507aq3z9rYRv3zFKCcdChfTTk59lKyuIdg1%2B2LW5Ncn%2FJGYd2%2FqIAcvFcCkQ8qtUzfD5F9aTsgTudstbuO7NeyIafEqXvdGKgAp%2BdJj70CZE%2FteIQT6h7hyZ9oU93o09wd7za9rYTqxrlkVB%2B02pXrjGoTB1VvoOVyVolzghbeIKT2Ydr15Oh%2BNiwaRmW70BF9sRViGCczT80xMreYO8BAG1qGsc9x%2FJJw9b13NGrFvLPZD%2BGEkLRHVgpZ7%2FrQJDy%2BcYHEcia%2BX3LYOXx4dQ%2B9mnMeOnlLJfsbVFuaKQINpFYz3x0VjOTZ4swPGcUKewmOWubCYwmdgA9AgQwF9o1XTWSSwbpPJ4qN61SXmPQMaT3muvVyMdt8zPHGgRCxWvwVeOTFIvI0emWofO3upLWfT%2BiH3MPGr6LIGOrEB7H7u%2FCsSGGVZpm1OMn5dF1RGw%2B%2F4bP2zX%2BHB43pZzd9a5lqzDViEJ3zzXtBYddvZQ99ZqRHXCOefCi8OoEjH4GYk81BEowkTnzxC%2Fu6h%2F2RTEZxQF9eTNJVZ2bmB%2FWvQ1vj5lAUEqp8J4PyBTCEDcYKAbqxcV3AytsuEou1kDdzjBI1Sj1R%2ByQHWSUHzyT%2BPMxWW5QThBqgh7JGHcbDu95DpvGB2%2Bvcp3T%2B7f0BbIBGX)
1095
+ [Get the full recipe here](http://glutenfreeifyouplease.com/vegan-kale-slaw/)
1096
+
1097
+ **Ingredients:**
1098
+ - 2 bunches red kale
1099
+ - 4 radishes
1100
+ - 1 medium carrot
1101
+ - 1 pink lady apple
1102
+ - 1 avocado
1103
+ - 1/2 cup craisins
1104
+ - 1 cup almonds or almond slivers
1105
+ - 1 cup pumpkin seeds
1106
+ - Dressing:
1107
+ - 3 tablespoons olive oil
1108
+ - 2-3 teaspoons maple syrup (depending on your sweetness level)
1109
+ - 1/2 clove garlic, minced
1110
+ - 1 tablespoon apple cider vinegar
1111
+ - 1-2 tablespoons lemon juice (depending on your sourness level)
1112
+
1113
+ ### Vegan Curry Butternut Squash Soup With Kale
1114
+
1115
+ ![Vegan Curry Butternut Squash Soup With Kale](https://edamam-product-images.s3.amazonaws.com/web-img/7c4/7c4651b007de75b3d3d1c793fd5772ad.jpg?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEMP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIG5aTOrVTV6krtJSedeWzecsgTXqYcUqFJbAtC%2F1Yk2NAiEAp96niYZ3qZnhfjn4zVfqUEvUB6yFcGXzf0hcKAyjiDsquQUITBAAGgwxODcwMTcxNTA5ODYiDLmstS7m%2Bao3hq3qyyqWBbbbkml7NZCF2nw9O3Vq626JHxF4mHh8kRyn4VnIYGDYMliTGYlCgxYWyJBJo6eEU0JnvZf1BPoOw4dMCNQzsXAWDh7bb%2B07yvyvAnr%2FRw6KDBBXHyDryjO83Ype0PXcU3IebkEQnjnBpq5MS6ojJKHYgAFAQAq1xilgnMESMyhkRJEMa39aMZtOACsAR59FkpyesuHSxxarbIR4ARIlWxsN%2BADujvR5Da4jXF8BsYRxem9MnU9opf78CGvNLoaI%2Btvo3ID0%2Bch%2Fp5%2FYJMCJWO%2FBknhLPByAsrSFYcCtyiFWd2mIYdGQ6hHQrq9IghhuugrGQHOiMaSLpJcvTpv8GwQrH59S0c0mJPclDzf2h5z1CU8bbw9%2F3H%2FER6r2ixrpd62P2dstRjhYIty0XzDZB5uF299yoo1QvXsUtR1IJwlB6HcMYf1D%2FxH6MM8K%2BJdi93a4uNXQaTRNC11MK3UkECm6L507aq3z9rYRv3zFKCcdChfTTk59lKyuIdg1%2B2LW5Ncn%2FJGYd2%2FqIAcvFcCkQ8qtUzfD5F9aTsgTudstbuO7NeyIafEqXvdGKgAp%2BdJj70CZE%2FteIQT6h7hyZ9oU93o09wd7za9rYTqxrlkVB%2B02pXrjGoTB1VvoOVyVolzghbeIKT2Ydr15Oh%2BNiwaRmW70BF9sRViGCczT80xMreYO8BAG1qGsc9x%2FJJw9b13NGrFvLPZD%2BGEkLRHVgpZ7%2FrQJDy%2BcYHEcia%2BX3LYOXx4dQ%2B9mnMeOnlLJfsbVFuaKQINpFYz3x0VjOTZ4swPGcUKewmOWubCYwmdgA9AgQwF9o1XTWSSwbpPJ4qN61SXmPQMaT3muvVyMdt8zPHGgRCxWvwVeOTFIvI0emWofO3upLWfT%2BiH3MPGr6LIGOrEB7H7u%2FCsSGGVZpm1OMn5dF1RGw%2B%2F4bP2zX%2BHB43pZzd9a5lqzDViEJ3zzXtBYddvZQ99ZqRHXCOefCi8OoEjH4GYk81BEowkTnzxC%2Fu6h%2F2RTEZxQF9eTNJVZ2bmB%2FWvQ1vj5lAUEqp8J4PyBTCEDcYKAbqxcV3AytsuEou1kDdzjBI1Sj1R%2ByQHWSUHzyT%2BPMxWW5QThBqgh7JGHcbDu95DpvGB2%2Bvcp3T%2B7f0BbIBGX)
1116
+ [Get the full recipe here](https://www.seriouseats.com/vegan-curry-butternut-squash-soup-kale-recipe)
1117
+
1118
+ **Ingredients:**
1119
+ - 2 1/2 tablespoons olive oil
1120
+ - 2 1/2 cups butternut squash, peeled and cut into 2-inch cubes
1121
+ - Kosher salt and freshly ground black pepper
1122
+ - 1 medium onion, thinly sliced (about 1 cup)
1123
+ - 1 medium carrot, peeled and cut into rounds and quarters (about 3/4 cup)
1124
+ - 1 orange or red bell pepper, deseeded and diced (about 3/4 cup)
1125
+ - 1/2 tablespoon curry powder
1126
+ - Pinch of dried red chili flakes
1127
+ - 3/4 cup quinoa, washed and rinsed
1128
+ - 4 cups homemade vegetable stock or store-bought low-sodium vegetable broth
1129
+ - 2 cups curly kale, leaves cut into 1-inch ribbons and thick stems removed
1130
+ - 2 tablespoons fresh juice from 1 lemon
1131
+ - 1/4 cup toasted pepitas
1132
+ - 1/2 cup fresh cilantro leaves
1133
+
1134
+ I hope these recipes inspire you to make something delicious and nutritious!
data/store/02/vegan_chicken_recipes.json ADDED
@@ -0,0 +1 @@
 
 
1
+ "{\"ok\": true, \"recipes\": [{\"label\": \"Vegan Chicken Nuggets\", \"image\": \"https://edamam-product-images.s3.amazonaws.com/web-img/c05/c053e26628c73d237eaa4cc6cbfa2ade.jpg?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEGMaCXVzLWVhc3QtMSJGMEQCIE%2BdCR4Aw99A5S5ndWg9hhCl2ELYrK46PaSYKNiqTrh2AiBkdRZeJCehnTDjHT96ZG0yhWlJB5JVgKDeDthpJDguJCrCBQjb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDE4NzAxNzE1MDk4NiIMk47Q3KQ%2BmQYySuLmKpYFDg6Y3Gp4r8AQoNgItXd6ClRDcNupHJMmhibzpfoUh8NuitTutSB4PGntE%2BMuwFjsaMiV1nSYLMmPyhOfk5k9VTZYT272zYup4%2Bi%2BvYp1loqWT1tqpJekSUCFBudZsnXqi0TvV8l80yViTkf20HfLN711gMYI0r%2B%2BJsMI7y5wGka5F9%2BgWS%2B7z3pYJtaXm9bs4%2BVd1H43YvLRzoUHdPdcIE%2FyDYDkLuWPCo7PSbsHlHcnnmfrHz0OkBFbD4M%2F2BkYKFdVS2XiSZuHhFYeE%2FFyU78agdyEVxB2YjG39LpCwjt4kPra0cS7%2FunW%2FY1HlZXqm87h0XqHH%2B8sHebGRoPGKj%2FbODHF8yowjMXqkirHUFocIzryZjdUcAvkCwOLOuboVrw3D17Ok9OypYlY5pdyOYXPSuTFFfCEcESH%2BPTfXDamZE2a%2FZWyPg0J1RLQiFPQLknNYEtq6ZjG5AoxruHChWFb0LZq5YZ7Ci3rEc9O2HuBdrqkLvLGdhW7h9ExlcIWPCCvRrhfaoY4DJPFcf6X2Fex6hlNFwTEs9OIugVSRnPXWf9jcr0geNL1SCIiaqFtPboWHD41fonu3YDKUHwmcc%2BPlBFc%2F4m37W0D2m7xVS6ZsHRH4WcbZtx%2BueiCuD%2FJXBN3njs8vJ522PZed2dng0I7PtSKp7rYnk%2BO64O2npfxgvGIPfDzsnlCsK2ERznEbHo%2BCLIjjZAgPF0jlk3TrAsv%2FHIutamsv30ZT0ka3lhfsLNsXyEc6bX%2Bxl%2FkA0w9G31ORhwLww%2B6s2avVr%2F8WOI%2BdCj7U9pU9XTlIuMVrXMbRja8LsB6d8rvyHaMztDlpX%2Bur%2B6JyNuC8m2qObR0kHXdecEt0bJl866eavUU%2FdV%2BPP6Kl5cwyJjTsgY6sgGUc5Z7YqTTFTeOIS5SvHYfHm6FnQ7F5MWLd8gsPK6%2B0F%2FdnPo2Y8b7wuPMFyFSwhTFHlu06msywcjpKXQf0aiXZq%2BwFj4wYfNDvLWgkmO68stuPEQGaFkuPCH%2BCZzmLN%2BvDwMeudeamCDj2BXyoO9QrfbtCPkFjUmAr%2FarbHiTG%2FffxCtUUsnvBBhuDyBx3%2FzfY5pZf0EnJq5gn9gAoCQ8HsvmS6ra2hoNlS9Px2ICz6Eg&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240527T191512Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIASXCYXIIFK3AKEUEN%2F20240527%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=f9cb6ec612cfb8bef43f3b4ba2913dea6c3d55e8c683ee08158250b641748c22\", \"url\": \"https://www.simplyrecipes.com/vegan-chicken-nuggets-recipe-7091022\", \"ingredientLines\": [\"1 ( 16 - ounce ) block extra-firm tofu , drained\", \"Vegetable oil , for frying\"], \"totalTime\": 1015.0}, {\"label\": \"Vegan Chicken Nuggets\", \"image\": \"https://edamam-product-images.s3.amazonaws.com/web-img/2b0/2b06a5f91f38c0bf450053e32cf63309?X-Amz-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pU9XTlIuMVrXMbRja8LsB6d8rvyHaMztDlpX%2Bur%2B6JyNuC8m2qObR0kHXdecEt0bJl866eavUU%2FdV%2BPP6Kl5cwyJjTsgY6sgGUc5Z7YqTTFTeOIS5SvHYfHm6FnQ7F5MWLd8gsPK6%2B0F%2FdnPo2Y8b7wuPMFyFSwhTFHlu06msywcjpKXQf0aiXZq%2BwFj4wYfNDvLWgkmO68stuPEQGaFkuPCH%2BCZzmLN%2BvDwMeudeamCDj2BXyoO9QrfbtCPkFjUmAr%2FarbHiTG%2FffxCtUUsnvBBhuDyBx3%2FzfY5pZf0EnJq5gn9gAoCQ8HsvmS6ra2hoNlS9Px2ICz6Eg&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240527T191512Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIASXCYXIIFK3AKEUEN%2F20240527%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=910df99fbd13fa8823f559cc5855124d36c979baafe54c39171cd3844f0ba8e0\", \"url\": \"https://www.eatingwell.com/recipe/268863/vegan-chicken-nuggets/\", \"ingredientLines\": [\"16 ounces seitan\", \"\\u00bc cup vegan mayonnaise\", \"6 teaspoons water\", \"\\u00bd teaspoon poultry seasoning\", \"\\u00be cup whole-wheat breadcrumbs\"], \"totalTime\": 40.0}, {\"label\": \"Easy Vegan White Bean Soup\", \"image\": \"https://edamam-product-images.s3.amazonaws.com/web-img/51e/51ead611b72a94948fa050d7bbdef7e1.jpg?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEGMaCXVzLWVhc3QtMSJGMEQCIE%2BdCR4Aw99A5S5ndWg9hhCl2ELYrK46PaSYKNiqTrh2AiBkdRZeJCehnTDjHT96ZG0yhWlJB5JVgKDeDthpJDguJCrCBQjb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDE4NzAxNzE1MDk4NiIMk47Q3KQ%2BmQYySuLmKpYFDg6Y3Gp4r8AQoNgItXd6Cl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udeamCDj2BXyoO9QrfbtCPkFjUmAr%2FarbHiTG%2FffxCtUUsnvBBhuDyBx3%2FzfY5pZf0EnJq5gn9gAoCQ8HsvmS6ra2hoNlS9Px2ICz6Eg&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240527T191512Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIASXCYXIIFK3AKEUEN%2F20240527%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=fe73d5ae42923abe5a04987ed78b06a08963de709273d431b1a89045d15247cc\", \"url\": \"https://food52.com/recipes/84750-easy-vegan-white-bean-soup\", \"ingredientLines\": [\"4 15oz cans of White Beans (I used 2 great northern, 1 cannellini and 1 navy)\", \"4 cups vegetable stock (low sodium)\", \"2 tablespoons olive oil\", \"1/2 cup white wine (I used a dry sauvignon blanc)\", \"1 1/2 cups water\", \"5-6 carrots (diced)\", \"3 celery stalks (diced)\", \"1 yellow onion (diced)\", \"2-3 cloves of garlic\", \"1 tablespoon tomato paste\", \"2 bay leaves\", \"3 sprigs thyme\", \"2 teaspoons TJ's Vegan Chicken-less Seasoning (omit if you're not close to a TJ's, it will still be delicious)\", \"2 teaspoons salt (or to taste)\", \"1 teaspoon pepper\"], \"totalTime\": 15.0}]}"
data/store/02/vegan_enchilada_recipes_edamam.json ADDED
The diff for this file is too large to render. See raw diff
 
data/store/04_gptv/get_gptv_comp_test.json CHANGED
@@ -1 +1 @@
1
- "The image shows a variety of grocery items laid out on a floor. There are fresh produce items such as onions, avocados, and carrots, as well as packaged goods like pasta and what appears to be snack mixes or dried fruit in containers. There are also canned goods visible, potentially beans or other vegetables, and a bag that seems to contain a grain, possibly rice or flour. The assortment suggests a mix of healthy staples commonly used for preparing meals."
 
1
+ "The image displays a variety of groceries, including:\n\n- Fresh produce: onions, avocados, potatoes, celery, carrots\n- Packaged produce: raspberries, spinach\n- Packaged foods: bread, pasta, canned goods, cookies\n- Baking supplies: sugar\n- Dairy: milk or milk alternative\n\nThe items appear to be for general grocery shopping, consisting of both fresh and non-perishable items."
lv_recipe_chatbot/_modidx.py CHANGED
@@ -42,11 +42,15 @@ d = { 'settings': { 'branch': 'main',
42
  'lv_recipe_chatbot/ingredient_vision.py'),
43
  'lv_recipe_chatbot.ingredient_vision.format_image': ( 'ingredient_vision.html#format_image',
44
  'lv_recipe_chatbot/ingredient_vision.py')},
45
- 'lv_recipe_chatbot.vegan_recipe_tools': { 'lv_recipe_chatbot.vegan_recipe_tools.RecipeSerpAPIWrapper': ( 'vegan_recipe_tools.html#recipeserpapiwrapper',
46
- 'lv_recipe_chatbot/vegan_recipe_tools.py'),
47
- 'lv_recipe_chatbot.vegan_recipe_tools.RecipeSerpAPIWrapper._process_response': ( 'vegan_recipe_tools.html#recipeserpapiwrapper._process_response',
48
- 'lv_recipe_chatbot/vegan_recipe_tools.py'),
49
- 'lv_recipe_chatbot.vegan_recipe_tools.get_vegan_recipes_edamam_api': ( 'vegan_recipe_tools.html#get_vegan_recipes_edamam_api',
 
 
 
 
50
  'lv_recipe_chatbot/vegan_recipe_tools.py'),
51
  'lv_recipe_chatbot.vegan_recipe_tools.vegan_recipe_edamam_search': ( 'vegan_recipe_tools.html#vegan_recipe_edamam_search',
52
  'lv_recipe_chatbot/vegan_recipe_tools.py')}}}
 
42
  'lv_recipe_chatbot/ingredient_vision.py'),
43
  'lv_recipe_chatbot.ingredient_vision.format_image': ( 'ingredient_vision.html#format_image',
44
  'lv_recipe_chatbot/ingredient_vision.py')},
45
+ 'lv_recipe_chatbot.openai_vision': { 'lv_recipe_chatbot.openai_vision.encode_image': ( 'gptv.html#encode_image',
46
+ 'lv_recipe_chatbot/openai_vision.py'),
47
+ 'lv_recipe_chatbot.openai_vision.format_image': ( 'gptv.html#format_image',
48
+ 'lv_recipe_chatbot/openai_vision.py'),
49
+ 'lv_recipe_chatbot.openai_vision.get_gptv_completion': ( 'gptv.html#get_gptv_completion',
50
+ 'lv_recipe_chatbot/openai_vision.py')},
51
+ 'lv_recipe_chatbot.utils': { 'lv_recipe_chatbot.utils.dump_json': ('utils.html#dump_json', 'lv_recipe_chatbot/utils.py'),
52
+ 'lv_recipe_chatbot.utils.load_json': ('utils.html#load_json', 'lv_recipe_chatbot/utils.py')},
53
+ 'lv_recipe_chatbot.vegan_recipe_tools': { 'lv_recipe_chatbot.vegan_recipe_tools.get_vegan_recipes_edamam_api': ( 'vegan_recipe_tools.html#get_vegan_recipes_edamam_api',
54
  'lv_recipe_chatbot/vegan_recipe_tools.py'),
55
  'lv_recipe_chatbot.vegan_recipe_tools.vegan_recipe_edamam_search': ( 'vegan_recipe_tools.html#vegan_recipe_edamam_search',
56
  'lv_recipe_chatbot/vegan_recipe_tools.py')}}}
lv_recipe_chatbot/openai_vision.py ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/04_gptv.ipynb.
2
+
3
+ # %% auto 0
4
+ __all__ = ['SAMPLE_IMG_DIR', 'prompt1', 'extract_veg_ingredients', 'encode_image', 'format_image', 'get_gptv_completion']
5
+
6
+ # %% ../nbs/04_gptv.ipynb 3
7
+ import base64
8
+ import json
9
+ import logging
10
+ import os
11
+ import statistics
12
+ import time
13
+ from functools import partial
14
+ from glob import glob
15
+ from logging.handlers import RotatingFileHandler
16
+ from pathlib import Path
17
+
18
+ import numpy as np
19
+ import requests
20
+ from PIL import Image
21
+
22
+ from openai import OpenAI
23
+ import constants
24
+
25
+ # %% ../nbs/04_gptv.ipynb 7
26
+ SAMPLE_IMG_DIR = Path(f"{constants.ROOT_DIR}/assets/images/vegan_ingredients")
27
+
28
+ # %% ../nbs/04_gptv.ipynb 8
29
+ def encode_image(image_path):
30
+ with open(image_path, "rb") as image_file:
31
+ return base64.b64encode(image_file.read()).decode("utf-8")
32
+
33
+ # %% ../nbs/04_gptv.ipynb 9
34
+ # fmt: off
35
+ def format_image(
36
+ image: str, # Image file path
37
+ size: int = 300
38
+ ):
39
+ # fmt: on
40
+ img = Image.open(image)
41
+ width, height = img.size
42
+ ratio = min(size / width, size / height)
43
+ width_new, height_new = (round(width * ratio), round(height * ratio))
44
+ width_new = int(np.round(width_new / 64.0)) * 64
45
+ height_new = int(np.round(height_new / 64.0)) * 64
46
+ img = img.resize((width_new, height_new))
47
+ img = img.convert("RGB")
48
+ return img
49
+
50
+ # %% ../nbs/04_gptv.ipynb 17
51
+ # https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding
52
+ def get_gptv_completion(prompt: str, img: str, detail="low"):
53
+ headers = {
54
+ "Content-Type": "application/json",
55
+ "Authorization": f"Bearer {os.environ['OPENAI_API_KEY']}",
56
+ }
57
+
58
+ payload = {
59
+ "model": "gpt-4o",
60
+ "messages": [
61
+ {
62
+ "role": "user",
63
+ "content": [
64
+ {"type": "text", "text": prompt},
65
+ {
66
+ "type": "image_url",
67
+ "image_url": {
68
+ "url": f"data:image/jpeg;base64,{encode_image(img)}",
69
+ "detail": detail,
70
+ },
71
+ },
72
+ ],
73
+ }
74
+ ],
75
+ "max_tokens": 300,
76
+ }
77
+
78
+ response = requests.post(
79
+ "https://api.openai.com/v1/chat/completions", headers=headers, json=payload
80
+ )
81
+ return response.json()["choices"][0]["message"]["content"]
82
+
83
+ # %% ../nbs/04_gptv.ipynb 27
84
+ prompt1 = "What vegan ingredients are in the image? Ouput as JSON list."
85
+
86
+ # %% ../nbs/04_gptv.ipynb 34
87
+ extract_veg_ingredients = partial(get_gptv_completion, prompt1)
lv_recipe_chatbot/utils.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/05_utils.ipynb.
2
+
3
+ # %% auto 0
4
+ __all__ = ['load_json', 'dump_json']
5
+
6
+ # %% ../nbs/05_utils.ipynb 3
7
+ import json
8
+
9
+ # %% ../nbs/05_utils.ipynb 4
10
+ def load_json(file_path):
11
+ with open(file_path, 'r') as file:
12
+ return json.load(file)
13
+
14
+ # %% ../nbs/05_utils.ipynb 5
15
+ def dump_json(data, path: str):
16
+ with open(path, "w") as fp:
17
+ return json.dump(data, fp, indent=2)
lv_recipe_chatbot/vegan_recipe_tools.py CHANGED
@@ -1,42 +1,19 @@
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/02_vegan_recipe_tools.ipynb.
2
 
3
  # %% auto 0
4
- __all__ = ['RecipeSerpAPIWrapper', 'get_vegan_recipes_edamam_api', 'vegan_recipe_edamam_search']
5
 
6
  # %% ../nbs/02_vegan_recipe_tools.ipynb 3
7
  import os
8
  from typing import Dict
9
  import requests
10
- from langchain.agents import (
11
- AgentExecutor,
12
- AgentType,
13
- OpenAIFunctionsAgent,
14
- Tool,
15
- initialize_agent,
16
- load_tools,
17
- )
18
- from langchain.agents.agent_toolkits import create_python_agent
19
- from langchain.chat_models import ChatOpenAI
20
- from langchain.memory import ConversationBufferMemory
21
- from langchain.prompts import MessagesPlaceholder
22
- from langchain.python import PythonREPL
23
- from langchain.schema import SystemMessage
24
- from langchain.tools import tool
25
- from langchain.tools.python.tool import PythonREPLTool
26
- from langchain.utilities import GoogleSerperAPIWrapper, SerpAPIWrapper
27
- from serpapi import GoogleSearch
28
 
29
- # %% ../nbs/02_vegan_recipe_tools.ipynb 21
30
- class RecipeSerpAPIWrapper(SerpAPIWrapper):
31
- @staticmethod
32
- def _process_response(res: dict) -> str:
33
- """Process response from SerpAPI."""
34
- if "error" in res.keys():
35
- raise ValueError(f"Got error from SerpAPI: {res['error']}")
36
- if "recipes_results" in res.keys():
37
- return res["recipes_results"]
38
-
39
- # %% ../nbs/02_vegan_recipe_tools.ipynb 48
40
  def get_vegan_recipes_edamam_api(params: Dict) -> requests.Response:
41
  """
42
  type is required and can be "any", "public", "user"
@@ -48,42 +25,51 @@ def get_vegan_recipes_edamam_api(params: Dict) -> requests.Response:
48
  params["app_id"] = os.environ["EDAMAM_APP_ID"]
49
  params["app_key"] = os.environ["EDAMAM_APP_KEY"]
50
  params["type"] = "public"
 
 
 
51
  return requests.get("https://api.edamam.com/api/recipes/v2", params=params)
52
 
53
- # %% ../nbs/02_vegan_recipe_tools.ipynb 54
54
- @tool
55
  def vegan_recipe_edamam_search(query: str) -> str:
56
  """
57
  Searches for vegan recipes based on a query.
58
- If the query is not vegan friendly, adapt it to be.
59
  If the request fails an explanation should be returned.
60
  If the cause of the failure was due to no recipes found, prompt the user to try again with a provided shorter query with one word removed.
61
  """
62
  max_chars = 45 # 5 chars per word * 9 max words
63
  if len(query) > max_chars:
64
- return f"The query is too long, try again with a query that is under {max_chars} characters in length."
65
-
66
- # Veganize the query more
67
- if "vegan" not in query.lower():
68
- query = "vegan " + query
69
-
70
- # TODO integrate additional params like totalTime range, cuisineType choice, nutrients[PROCNT] range of protein, health additional health params like gluten-free
71
 
72
  params = {
73
  "q": query,
74
- "field": ["label", "url", "totalTime", "ingredientLines"]
75
- # todo figure out how to include "image", "totalNutrients", "ingredientLines" without going over token limits immediately.
76
  }
77
 
78
  response = get_vegan_recipes_edamam_api(params)
79
  if not response.ok:
80
- return (
81
- f"Received an error from Edamam API: {response.status_code} {response.text}"
 
 
 
82
  )
83
 
84
  if response.json()["count"] <= 0:
85
- return f"""No recipes found for query {query}.
 
 
 
86
  This usually occurs when there are too many keywords or ingredients that are not commonly found together in recipes.
87
- I recommend trying again with `{' '.join(query.split(' ')[0:-1])}.`"""
 
 
88
 
89
- return str([r["recipe"] for r in response.json()["hits"][0:3]])
 
 
 
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/02_vegan_recipe_tools.ipynb.
2
 
3
  # %% auto 0
4
+ __all__ = ['get_vegan_recipes_edamam_api', 'vegan_recipe_edamam_search']
5
 
6
  # %% ../nbs/02_vegan_recipe_tools.ipynb 3
7
  import os
8
  from typing import Dict
9
  import requests
10
+ from openai import OpenAI
11
+ import json
12
+ from .utils import load_json, dump_json
13
+ import constants
14
+ from tenacity import retry, wait_random_exponential, stop_after_attempt
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
+ # %% ../nbs/02_vegan_recipe_tools.ipynb 9
 
 
 
 
 
 
 
 
 
 
17
  def get_vegan_recipes_edamam_api(params: Dict) -> requests.Response:
18
  """
19
  type is required and can be "any", "public", "user"
 
25
  params["app_id"] = os.environ["EDAMAM_APP_ID"]
26
  params["app_key"] = os.environ["EDAMAM_APP_KEY"]
27
  params["type"] = "public"
28
+ query = params["q"]
29
+ if "vegan" not in query.lower():
30
+ params["q"] = "vegan " + query
31
  return requests.get("https://api.edamam.com/api/recipes/v2", params=params)
32
 
33
+ # %% ../nbs/02_vegan_recipe_tools.ipynb 13
 
34
  def vegan_recipe_edamam_search(query: str) -> str:
35
  """
36
  Searches for vegan recipes based on a query.
 
37
  If the request fails an explanation should be returned.
38
  If the cause of the failure was due to no recipes found, prompt the user to try again with a provided shorter query with one word removed.
39
  """
40
  max_chars = 45 # 5 chars per word * 9 max words
41
  if len(query) > max_chars:
42
+ return json.dumps(
43
+ {
44
+ "ok": False,
45
+ "msg": f"The query is too long, try again with a query that is under {max_chars} characters in length.",
46
+ }
47
+ )
 
48
 
49
  params = {
50
  "q": query,
51
+ "field": ["label", "url", "totalTime", "ingredientLines", "image"],
 
52
  }
53
 
54
  response = get_vegan_recipes_edamam_api(params)
55
  if not response.ok:
56
+ return json.dumps(
57
+ {
58
+ "ok": False,
59
+ "msg": f"Received an error from Edamam API: {response.status_code} {response.text}",
60
+ }
61
  )
62
 
63
  if response.json()["count"] <= 0:
64
+ return json.dumps(
65
+ {
66
+ "ok": False,
67
+ "msg": f"""No recipes found for query {query}.
68
  This usually occurs when there are too many keywords or ingredients that are not commonly found together in recipes.
69
+ Recommend trying again with fewer words in the query.""",
70
+ }
71
+ )
72
 
73
+ return json.dumps(
74
+ {"ok": True, "recipes": [r["recipe"] for r in response.json()["hits"][0:3]]}
75
+ )
nbs/02_vegan_recipe_tools.ipynb CHANGED
The diff for this file is too large to render. See raw diff
 
nbs/04_gptv.ipynb CHANGED
@@ -4,7 +4,7 @@
4
  "cell_type": "markdown",
5
  "metadata": {},
6
  "source": [
7
- "# gptv\n",
8
  "\n",
9
  "> Exploring chatgpt_vision for vegan ingredient inferencing."
10
  ]
@@ -15,7 +15,7 @@
15
  "metadata": {},
16
  "outputs": [],
17
  "source": [
18
- "#| default_exp ingredient_vision"
19
  ]
20
  },
21
  {
@@ -50,24 +50,23 @@
50
  "import requests\n",
51
  "from PIL import Image\n",
52
  "\n",
 
53
  "import constants"
54
  ]
55
  },
 
 
 
 
 
 
 
56
  {
57
  "cell_type": "code",
58
  "execution_count": null,
59
  "metadata": {},
60
  "outputs": [],
61
- "source": [
62
- "def load_json(f: str):\n",
63
- " with open(f, \"r\") as file:\n",
64
- " return json.load(file)\n",
65
- "\n",
66
- "\n",
67
- "def dump_json(data, path: str):\n",
68
- " with open(path, \"w\") as fp:\n",
69
- " return json.dump(data, fp, indent=2)"
70
- ]
71
  },
72
  {
73
  "cell_type": "code",
@@ -83,7 +82,6 @@
83
  "load_dotenv()\n",
84
  "import os\n",
85
  "\n",
86
- "from openai import OpenAI\n",
87
  "\n",
88
  "NB_STORE = str(constants.STORE_DIR / \"04_gptv\")\n",
89
  "os.makedirs(NB_STORE, exist_ok=True)\n",
@@ -121,13 +119,6 @@
121
  "SAMPLE_IMG_DIR = Path(f\"{constants.ROOT_DIR}/assets/images/vegan_ingredients\")"
122
  ]
123
  },
124
- {
125
- "cell_type": "markdown",
126
- "metadata": {},
127
- "source": [
128
- "Inspiration drawn from [TaskMartix aka Visual ChatGPT](https://github.com/microsoft/TaskMatrix)"
129
- ]
130
- },
131
  {
132
  "cell_type": "code",
133
  "execution_count": null,
@@ -399,7 +390,7 @@
399
  " }\n",
400
  "\n",
401
  " payload = {\n",
402
- " \"model\": \"gpt-4-vision-preview\",\n",
403
  " \"messages\": [\n",
404
  " {\n",
405
  " \"role\": \"user\",\n",
@@ -428,15 +419,7 @@
428
  "cell_type": "code",
429
  "execution_count": null,
430
  "metadata": {},
431
- "outputs": [
432
- {
433
- "name": "stdout",
434
- "output_type": "stream",
435
- "text": [
436
- "skipping\n"
437
- ]
438
- }
439
- ],
440
  "source": [
441
  "%%script echo skipping\n",
442
  "_store_json(get_gptv_completion(\"What is in this image?\", sample_images[0]), \"get_gptv_comp_test\")"
@@ -451,7 +434,15 @@
451
  "name": "stdout",
452
  "output_type": "stream",
453
  "text": [
454
- "The image shows a variety of grocery items laid out on a floor. There are fresh produce items such as onions, avocados, and carrots, as well as packaged goods like pasta and what appears to be snack mixes or dried fruit in containers. There are also canned goods visible, potentially beans or other vegetables, and a bag that seems to contain a grain, possibly rice or flour. The assortment suggests a mix of healthy staples commonly used for preparing meals.\n"
 
 
 
 
 
 
 
 
455
  ]
456
  }
457
  ],
@@ -608,7 +599,7 @@
608
  {
609
  "data": {
610
  "application/vnd.jupyter.widget-view+json": {
611
- "model_id": "4826bf246de54cffa3dc4d0be8f464cf",
612
  "version_major": 2,
613
  "version_minor": 0
614
  },
 
4
  "cell_type": "markdown",
5
  "metadata": {},
6
  "source": [
7
+ "# openai_vision\n",
8
  "\n",
9
  "> Exploring chatgpt_vision for vegan ingredient inferencing."
10
  ]
 
15
  "metadata": {},
16
  "outputs": [],
17
  "source": [
18
+ "#| default_exp openai_vision "
19
  ]
20
  },
21
  {
 
50
  "import requests\n",
51
  "from PIL import Image\n",
52
  "\n",
53
+ "from openai import OpenAI\n",
54
  "import constants"
55
  ]
56
  },
57
+ {
58
+ "cell_type": "markdown",
59
+ "metadata": {},
60
+ "source": [
61
+ "Inspiration drawn from [TaskMartix aka Visual ChatGPT](https://github.com/microsoft/TaskMatrix)"
62
+ ]
63
+ },
64
  {
65
  "cell_type": "code",
66
  "execution_count": null,
67
  "metadata": {},
68
  "outputs": [],
69
+ "source": []
 
 
 
 
 
 
 
 
 
70
  },
71
  {
72
  "cell_type": "code",
 
82
  "load_dotenv()\n",
83
  "import os\n",
84
  "\n",
 
85
  "\n",
86
  "NB_STORE = str(constants.STORE_DIR / \"04_gptv\")\n",
87
  "os.makedirs(NB_STORE, exist_ok=True)\n",
 
119
  "SAMPLE_IMG_DIR = Path(f\"{constants.ROOT_DIR}/assets/images/vegan_ingredients\")"
120
  ]
121
  },
 
 
 
 
 
 
 
122
  {
123
  "cell_type": "code",
124
  "execution_count": null,
 
390
  " }\n",
391
  "\n",
392
  " payload = {\n",
393
+ " \"model\": \"gpt-4o\",\n",
394
  " \"messages\": [\n",
395
  " {\n",
396
  " \"role\": \"user\",\n",
 
419
  "cell_type": "code",
420
  "execution_count": null,
421
  "metadata": {},
422
+ "outputs": [],
 
 
 
 
 
 
 
 
423
  "source": [
424
  "%%script echo skipping\n",
425
  "_store_json(get_gptv_completion(\"What is in this image?\", sample_images[0]), \"get_gptv_comp_test\")"
 
434
  "name": "stdout",
435
  "output_type": "stream",
436
  "text": [
437
+ "The image displays a variety of groceries, including:\n",
438
+ "\n",
439
+ "- Fresh produce: onions, avocados, potatoes, celery, carrots\n",
440
+ "- Packaged produce: raspberries, spinach\n",
441
+ "- Packaged foods: bread, pasta, canned goods, cookies\n",
442
+ "- Baking supplies: sugar\n",
443
+ "- Dairy: milk or milk alternative\n",
444
+ "\n",
445
+ "The items appear to be for general grocery shopping, consisting of both fresh and non-perishable items.\n"
446
  ]
447
  }
448
  ],
 
599
  {
600
  "data": {
601
  "application/vnd.jupyter.widget-view+json": {
602
+ "model_id": "2410f5fd805b4ce0a0e3e224d61dd064",
603
  "version_major": 2,
604
  "version_minor": 0
605
  },
nbs/05_utils.ipynb ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "# utils\n",
8
+ "\n",
9
+ "> utils "
10
+ ]
11
+ },
12
+ {
13
+ "cell_type": "code",
14
+ "execution_count": null,
15
+ "metadata": {},
16
+ "outputs": [],
17
+ "source": [
18
+ "#| default_exp utils"
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "code",
23
+ "execution_count": null,
24
+ "metadata": {},
25
+ "outputs": [],
26
+ "source": [
27
+ "#| hide\n",
28
+ "from nbdev.showdoc import *"
29
+ ]
30
+ },
31
+ {
32
+ "cell_type": "code",
33
+ "execution_count": null,
34
+ "metadata": {},
35
+ "outputs": [],
36
+ "source": [
37
+ "#| export\n",
38
+ "import json"
39
+ ]
40
+ },
41
+ {
42
+ "cell_type": "code",
43
+ "execution_count": null,
44
+ "metadata": {},
45
+ "outputs": [],
46
+ "source": [
47
+ "#| export\n",
48
+ "def load_json(file_path):\n",
49
+ " with open(file_path, 'r') as file:\n",
50
+ " return json.load(file)"
51
+ ]
52
+ },
53
+ {
54
+ "cell_type": "code",
55
+ "execution_count": null,
56
+ "metadata": {},
57
+ "outputs": [],
58
+ "source": [
59
+ "#| export\n",
60
+ "def dump_json(data, path: str):\n",
61
+ " with open(path, \"w\") as fp:\n",
62
+ " return json.dump(data, fp, indent=2)"
63
+ ]
64
+ },
65
+ {
66
+ "cell_type": "code",
67
+ "execution_count": null,
68
+ "metadata": {},
69
+ "outputs": [],
70
+ "source": [
71
+ "#| hide\n",
72
+ "import nbdev\n",
73
+ "\n",
74
+ "nbdev.nbdev_export()"
75
+ ]
76
+ },
77
+ {
78
+ "cell_type": "code",
79
+ "execution_count": null,
80
+ "metadata": {},
81
+ "outputs": [],
82
+ "source": []
83
+ }
84
+ ],
85
+ "metadata": {
86
+ "kernelspec": {
87
+ "display_name": "python3",
88
+ "language": "python",
89
+ "name": "python3"
90
+ }
91
+ },
92
+ "nbformat": 4,
93
+ "nbformat_minor": 4
94
+ }
requirements/dev.txt CHANGED
@@ -3,4 +3,5 @@ python-dotenv
3
  mypy
4
  ipykernel
5
  nbdev
6
- markdown
 
 
3
  mypy
4
  ipykernel
5
  nbdev
6
+ markdown
7
+ termcolor