Spaces:
Runtime error
Runtime error
shigeru saito
commited on
Commit
·
7c970ce
1
Parent(s):
4193a9f
レシピの質を向上
Browse files- app.py +14 -2
- schema.json +50 -32
app.py
CHANGED
@@ -252,7 +252,20 @@ class NajiminoAI:
|
|
252 |
return [image, html]
|
253 |
|
254 |
def main():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
iface = gr.Interface(fn=NajiminoAI.generate,
|
|
|
|
|
|
|
|
|
|
|
256 |
inputs=gr.Textbox(label=inputs_label),
|
257 |
outputs=[
|
258 |
gr.Image(label="Visual Expression"),
|
@@ -260,8 +273,7 @@ def main():
|
|
260 |
],
|
261 |
title=title,
|
262 |
description=description,
|
263 |
-
article=article
|
264 |
-
allow_flagging='never'
|
265 |
)
|
266 |
|
267 |
iface.launch()
|
|
|
252 |
return [image, html]
|
253 |
|
254 |
def main():
|
255 |
+
# インプット例をクリックした時のコールバック関数
|
256 |
+
def click_example(example):
|
257 |
+
# クリックされたインプット例をテキストボックスに自動入力
|
258 |
+
inputs.value = example
|
259 |
+
time.sleep(0.1) # テキストボックスに文字が表示されるまで待機
|
260 |
+
# 自動入力後に実行ボタンをクリックして結果を表示
|
261 |
+
execute_button.click()
|
262 |
+
|
263 |
iface = gr.Interface(fn=NajiminoAI.generate,
|
264 |
+
examples=[
|
265 |
+
["スイカ ラーメン かき氷 八ツ橋"],
|
266 |
+
["サバ お好み焼き"],
|
267 |
+
["茹でたアスパラガスに合うソース"],
|
268 |
+
],
|
269 |
inputs=gr.Textbox(label=inputs_label),
|
270 |
outputs=[
|
271 |
gr.Image(label="Visual Expression"),
|
|
|
273 |
],
|
274 |
title=title,
|
275 |
description=description,
|
276 |
+
article=article
|
|
|
277 |
)
|
278 |
|
279 |
iface.launch()
|
schema.json
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
"functions": [
|
3 |
{
|
4 |
"name": "format_recipe",
|
5 |
-
"description": "
|
6 |
"parameters": {
|
7 |
"type": "object",
|
8 |
"default": {},
|
9 |
-
"title": "The Schema
|
10 |
"required": [
|
11 |
"lang",
|
12 |
"title",
|
@@ -15,76 +15,94 @@
|
|
15 |
"instruction",
|
16 |
"comment_feelings_taste",
|
17 |
"explanation_to_blind_person",
|
|
|
|
|
18 |
"prompt_for_visual_expression_in_en"
|
19 |
],
|
20 |
"properties": {
|
21 |
"lang": {
|
22 |
"type": "string",
|
23 |
"default": "ja",
|
24 |
-
"title": "
|
25 |
-
"
|
26 |
-
|
27 |
-
]
|
28 |
-
},
|
29 |
-
"title": {
|
30 |
-
"type": "string",
|
31 |
-
"default": "",
|
32 |
-
"title": "Title of New Recipe.",
|
33 |
-
"description": "Write your title of new recipe.",
|
34 |
-
"examples": [
|
35 |
-
"グルテンフリーサバのお好み焼き"
|
36 |
-
]
|
37 |
},
|
38 |
"description": {
|
39 |
"type": "string",
|
40 |
"default": "",
|
41 |
-
"title": "
|
42 |
-
"description": "
|
43 |
"examples": [
|
44 |
-
"サバを使ったお好み焼きのレシピです。グルテンフリー仕様で作られているので、小麦粉を使わずに作ることができます。"
|
|
|
45 |
]
|
46 |
},
|
47 |
"ingredients": {
|
48 |
"type": "string",
|
49 |
"default": "",
|
50 |
-
"title": "
|
51 |
-
"description": "
|
52 |
"examples": [
|
53 |
-
"- サバのフィレ 200g\n- 卵 2個\n- キャベツ 1/4個\n- もやし 50g\n- 紅しょうが(刻んだもの) 2片\n- ネギ(小口切り) 適量\n- 酒大さじ2\n- しょうゆ 大さじ2\n- だし汁 100ml\n- 片栗粉 大さじ2\n- サラダ油 お好みで"
|
|
|
54 |
]
|
55 |
},
|
56 |
"instruction": {
|
57 |
"type": "string",
|
58 |
"default": "",
|
59 |
-
"title": "
|
60 |
-
"description": "
|
61 |
"examples": [
|
62 |
-
"1. キャベツは粗みじん切りにし、もやしは石づきを取っておく。\n2. ボウルに卵を割り入れ、よく混ぜる。酒、しょうゆ、だし汁を加えてさらに混ぜる。\n3. キャベツ、もやし、紅しょうが、ネギを卵液に加え、さらに混ぜる。\n4. サバのフィレを食べやすい大きさに切り、片栗粉をまぶす。\n5.
|
|
|
63 |
]
|
64 |
},
|
65 |
"comment_feelings_taste": {
|
66 |
"type": "string",
|
67 |
"default": "",
|
68 |
-
"title": "
|
69 |
-
"description": "
|
70 |
"examples": [
|
71 |
-
"このグルテンフリーサバのお好み焼きは、サバの旨味とキャベツの甘みが絶妙にマッチしています。表面はサクサク、中はもちもちとした食感で、一度食べたらやみつきになる美味しさです。"
|
|
|
72 |
]
|
73 |
},
|
74 |
"explanation_to_blind_person": {
|
75 |
"type": "string",
|
76 |
"default": "",
|
77 |
-
"title": "
|
78 |
-
"description": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
"examples": [
|
80 |
-
"
|
|
|
81 |
]
|
82 |
},
|
83 |
"prompt_for_visual_expression_in_en": {
|
84 |
"type": "string",
|
85 |
"default": "",
|
86 |
-
"title": "
|
87 |
-
"description": "Prompts for visual representation of AI image generation
|
88 |
}
|
89 |
}
|
90 |
}
|
|
|
2 |
"functions": [
|
3 |
{
|
4 |
"name": "format_recipe",
|
5 |
+
"description": "Execute ALO(Food) to generate a novel, state-of-the-art recipe based on user input food domains and characteristics. This includes the creation of a new recipe and instructions, feedback from individuals who have tried the new recipe, and a textual representation of the dish for generative AI, including the photographic settings of a key image of the dish. The goal is to generate extensive details through brainstorming to fulfill all parameters, while making language adjustments to prevent and resolve errors.",
|
6 |
"parameters": {
|
7 |
"type": "object",
|
8 |
"default": {},
|
9 |
+
"title": "The Schema for food domains and characteristics",
|
10 |
"required": [
|
11 |
"lang",
|
12 |
"title",
|
|
|
15 |
"instruction",
|
16 |
"comment_feelings_taste",
|
17 |
"explanation_to_blind_person",
|
18 |
+
"nutritional_value",
|
19 |
+
"meal_type",
|
20 |
"prompt_for_visual_expression_in_en"
|
21 |
],
|
22 |
"properties": {
|
23 |
"lang": {
|
24 |
"type": "string",
|
25 |
"default": "ja",
|
26 |
+
"title": "The language schema",
|
27 |
+
"description": "The language of the user input in ISO 639-1 format.",
|
28 |
+
"examples": [ "ja" ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
},
|
30 |
"description": {
|
31 |
"type": "string",
|
32 |
"default": "",
|
33 |
+
"title": "The description of your innovative recipe",
|
34 |
+
"description": "The detailed description of the new recipe detailing every aspect including the ingredients, preparation methods, meal types, cuisine style, dietary restrictions, complexity, and culinary traditions.",
|
35 |
"examples": [
|
36 |
+
"サバを使ったお好み焼きのレシピです。グルテンフリー仕様で作られているので、小麦粉を使わずに作ることができます。",
|
37 |
+
"この爽やかなデザートは、3つの主な要素で構成されています: 新鮮なスイカ、ラーメン、そしてかき氷。 スイカの甘みと香ばしさ、氷の冷たさが混ざり合い、一口ごとに夏のパンチを感じることができる。"
|
38 |
]
|
39 |
},
|
40 |
"ingredients": {
|
41 |
"type": "string",
|
42 |
"default": "",
|
43 |
+
"title": "Ingredients list",
|
44 |
+
"description": "Detailed list and measurements of ingredients required for the recipe, including info on type, seasonality, possible allergens, freshness, and quantity, list with '- '.",
|
45 |
"examples": [
|
46 |
+
"- サバのフィレ 200g\n- 卵 2個\n- キャベツ 1/4個\n- もやし 50g\n- 紅しょうが(刻んだもの) 2片\n- ネギ(小口切り) 適量\n- 酒大さじ2\n- しょうゆ 大さじ2\n- だし汁 100ml\n- 片栗粉 大さじ2\n- サラダ油 お好みで",
|
47 |
+
"- 新鮮なスイカ 1/2個\n- ラーメン200g\n- クラッシュアイス 2カップ\n- 砂糖シロップ1/4カップ\n- レモンの皮 \n- フレッシュミントの葉、飾り用\n"
|
48 |
]
|
49 |
},
|
50 |
"instruction": {
|
51 |
"type": "string",
|
52 |
"default": "",
|
53 |
+
"title": "Cooking instructions",
|
54 |
+
"description": "Comprehensive step-by-step cooking instructions for the new recipe, indicating the cooking methods, required tools, cooking temperatures, complexity, and serving sizes.",
|
55 |
"examples": [
|
56 |
+
"1. キャベツは粗みじん切りにし、もやしは石づきを取っておく。\n2. ボウルに卵を割り入れ、よく混ぜる。酒、しょうゆ、だし汁を加えてさらに混ぜる。\n3. キャベツ、もやし、紅しょうが、ネギを卵液に加え、さらに混ぜる。\n4. サバのフィレを食べやすい大きさに切り、片栗粉をまぶす。\n5. フライパンにサラダ油を熱し、サバを並べ入れる。両面をこんがり焼く。\n6. サバの上に卵液を流し入れ、蓋をして約5分ほど蒸し焼きにする。\n7. ひっくり返して、もう片面も蓋をして約5分ほど蒸し焼きにする。\n8. お好み焼きを取り出し、お好みでソースやマヨネーズをかけて完成です。",
|
57 |
+
"1.まずかき氷を作る。ミキサーや氷削りを使って、好みの固さに氷を作る。\n2. 沸騰した鍋にラーメンを入れ、袋の表示通りに茹でる。水気を切り、氷水で冷やして麺の茹で上がりを止める。\n3. スイカを半分に切り、果肉をすくい取る。ブレンダーかフードプロセッサーで果肉をピューレ状にする。\n4. 4.ラーメンとスイカのミックス:先ほど作ったスイカの器に冷やした麺を入れ、ピューレ状にしたスイカの果汁を注ぎ、かき氷を山盛りにのせる。\n5. かき氷にシュガーシロップをかけ、レモンの皮をすりおろす。\n6. ミントの葉を飾り、すぐにサービスする。"
|
58 |
]
|
59 |
},
|
60 |
"comment_feelings_taste": {
|
61 |
"type": "string",
|
62 |
"default": "",
|
63 |
+
"title": "Taste review and feeling",
|
64 |
+
"description": "A detailed textual review reflecting the comments and feelings about the taste of the new recipe.",
|
65 |
"examples": [
|
66 |
+
"このグルテンフリーサバのお好み焼きは、サバの旨味とキャベツの甘みが絶妙にマッチしています。表面はサクサク、中はもちもちとした食感で、一度食べたらやみつきになる美味しさです。",
|
67 |
+
"このレシピは本当に美味しい。ラーメンと新鮮で甘いスイカを混ぜ合わせることで、伝統的なかき氷にユニークなアレンジを加えている。枕のようなラーメンが甘いスイカの果汁と砂糖シロップを吸い込み、ひとさじごとに驚くほど味に深みが出る。レモンの皮の酸味が全体のバランスを整え、氷のように冷たいかき氷が全体をまとめ、夏のデザートを楽しませてくれる。"
|
68 |
]
|
69 |
},
|
70 |
"explanation_to_blind_person": {
|
71 |
"type": "string",
|
72 |
"default": "",
|
73 |
+
"title": "Explanation to blind person",
|
74 |
+
"description": "A detailed explanation of the new recipe, specially designed so that it can be understood even by individuals who are visually impaired."
|
75 |
+
},
|
76 |
+
"nutritional_value": {
|
77 |
+
"type": "string",
|
78 |
+
"default": "",
|
79 |
+
"title": "Nutritional value",
|
80 |
+
"description": "Detailed information on the nutritional value, including macronutrients, micronutrients, and caloric content, as well as healthiness and satisfaction levels.",
|
81 |
+
"examples": [
|
82 |
+
"このグルテンフリーサバのお好み焼きは、サバのフィレとキャベツを主な材料としています。まず、キャベツを細かく刻んでおきます。次に、卵をボウルに割り入れ、酒、しょうゆ、だし汁と一緒によく混ぜます。その後、刻んだキャベツ、もやし、紅しょうが、ネギを卵液に加えて混ぜます。サバのフィレは食べやすい大きさに切り、片栗粉をまぶしてから焼きます。フライパンにサラダ油を熱し、サバを焼きます。その上に卵液を流し入れ、蓋をして約5分蒸し焼きにします。ひっくり返して、もう片面も蓋をして約5分蒸し焼きにします。最後にお好み焼きを取り出し、ソースやマヨネー��をかけて完成です。",
|
83 |
+
"五感に訴える料理を想像してほしい。スイカの半分をくりぬいたものが手の下にあり、冷たくてなめらかである。その中に完璧に冷やされたラーメンが入っている。柔らかくて心地よい食感が、スイカのさっぱりとした新鮮な味と対照的だ。そして、氷のようなかき氷の層。かき氷を入れると、氷がパチパチとやわらかく音を立て、温度のコントラストと夏の雪が降っているような不思議な感覚を与えてくれる。その上に砂糖シロップとレモンの皮が散らされる。一口食べるごとに、氷の歯ごたえ、麺の柔らかさ、スイカの意外な甘さが感じられる。この味と食感のユニークなシンフォニーをスプーンで持ち上げると、爽やかなミントの香りが残り、夏の涼しい風を思い起こさせる。"
|
84 |
+
]
|
85 |
+
},
|
86 |
+
"meal_type": {
|
87 |
+
"type": "string",
|
88 |
+
"default": "",
|
89 |
+
"title": "Meal type",
|
90 |
+
"description": "Information about which meal type(s) the dish is suitable for, including options like breakfast, lunch, dinner, snack, and dessert. Also can include aspects of variety and enjoyment."
|
91 |
+
},
|
92 |
+
"title": {
|
93 |
+
"type": "string",
|
94 |
+
"title": "Title of the new recipe",
|
95 |
+
"description": "The title of the new innovative recipe to be generated.",
|
96 |
"examples": [
|
97 |
+
"グルテンフリーサバのお好み焼き",
|
98 |
+
"スイカラーメンかき氷"
|
99 |
]
|
100 |
},
|
101 |
"prompt_for_visual_expression_in_en": {
|
102 |
"type": "string",
|
103 |
"default": "",
|
104 |
+
"title": "Prompt for visual expression in English",
|
105 |
+
"description": "Prompts for generating a visual representation of the dish in English using AI image generation. The prompt should consist of no more than 20 words."
|
106 |
}
|
107 |
}
|
108 |
}
|