shigel commited on
Commit
1bb08e2
·
0 Parent(s):

Duplicate from shigel/recipe_0626

Browse files
Files changed (8) hide show
  1. .gitattributes +34 -0
  2. .gitignore +1 -0
  3. README.md +13 -0
  4. app.py +299 -0
  5. constraints.md +13 -0
  6. requirements.txt +5 -0
  7. schema.json +114 -0
  8. template.md +23 -0
.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .env
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: najimino Recipe
3
+ emoji: 🍛
4
+ colorFrom: yellow
5
+ colorTo: red
6
+ sdk: gradio
7
+ sdk_version: 3.19.1
8
+ app_file: app.py
9
+ pinned: false
10
+ duplicated_from: shigel/recipe_0626
11
+ ---
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,299 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import openai
3
+ import requests
4
+ import os
5
+ from dotenv import load_dotenv
6
+ import io
7
+ import sys
8
+ import json
9
+ import PIL
10
+ import time
11
+ from stability_sdk import client
12
+ import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
13
+ import markdown2
14
+
15
+ title="najimino AI recipe generator"
16
+ inputs_label="どんな料理か教えてくれれば,新しいレシピを考えます"
17
+ outputs_label="najimino AIが返信をします"
18
+ visual_outputs_label="料理のイメージ"
19
+ description="""
20
+ - ※入出力の文字数は最大1000文字程度までを目安に入力してください。回答に50秒くらいかかります.
21
+ """
22
+
23
+ article = """
24
+ """
25
+
26
+ load_dotenv()
27
+ openai.api_key = os.getenv('OPENAI_API_KEY')
28
+ os.environ['STABILITY_HOST'] = 'grpc.stability.ai:443'
29
+ stability_api = client.StabilityInference(
30
+ key=os.getenv('STABILITY_KEY'),
31
+ verbose=True,
32
+ # engine="stable-diffusion-512-v2-1",
33
+ # engine="stable-diffusion-xl-beta-v2-2-2",
34
+ engine="stable-diffusion-xl-1024-v0-9",
35
+ # Available engines: stable-diffusion-v1 stable-diffusion-v1-5 stable-diffusion-512-v2-0 stable-diffusion-768-v2-0
36
+ # stable-diffusion-512-v2-1 stable-diffusion-768-v2-1 stable-diffusion-xl-beta-v2-2-2 stable-inpainting-v1-0 stable-inpainting-512-v2-0
37
+ )
38
+ # MODEL = "gpt-4"
39
+ # MODEL = "gpt-3.5-turbo-16k"
40
+ MODEL = "gpt-3.5-turbo-0613"
41
+
42
+ def get_filetext(filename, cache={}):
43
+ if filename in cache:
44
+ # キャッシュに保存されている場合は、キャッシュからファイル内容を取得する
45
+ return cache[filename]
46
+ else:
47
+ if not os.path.exists(filename):
48
+ raise ValueError(f"ファイル '{filename}' が見つかりませんでした")
49
+ with open(filename, "r") as f:
50
+ text = f.read()
51
+ # ファイル内容をキャッシュする
52
+ cache[filename] = text
53
+ return text
54
+
55
+ def get_functions_from_schema(filename):
56
+ schema = get_filetext(filename)
57
+ schema_json = json.loads(schema)
58
+ functions = schema_json.get("functions")
59
+ return functions
60
+
61
+ class StabilityAI:
62
+ @classmethod
63
+ def generate_image(cls, visualize_prompt):
64
+
65
+ print("visualize_prompt:"+visualize_prompt)
66
+
67
+ answers = stability_api.generate(
68
+ prompt=visualize_prompt,
69
+ )
70
+
71
+ for resp in answers:
72
+ for artifact in resp.artifacts:
73
+ if artifact.finish_reason == generation.FILTER:
74
+ print("NSFW")
75
+ if artifact.type == generation.ARTIFACT_IMAGE:
76
+ img = PIL.Image.open(io.BytesIO(artifact.binary))
77
+ return img
78
+
79
+ class OpenAI:
80
+
81
+ @classmethod
82
+ def chat_completion(cls, prompt, start_with=""):
83
+ constraints = get_filetext(filename = "constraints.md")
84
+ template = get_filetext(filename = "template.md")
85
+
86
+ # ChatCompletion APIに渡すデータを定義する
87
+ data = {
88
+ "model": MODEL,
89
+ "messages": [
90
+ {"role": "system", "content": constraints}
91
+ ,{"role": "system", "content": template}
92
+ ,{"role": "assistant", "content": "Sure!"}
93
+ ,{"role": "user", "content": prompt}
94
+ ,{"role": "assistant", "content": start_with}
95
+ ],
96
+ }
97
+
98
+ # 文章生成にかかる時間を計測する
99
+ start = time.time()
100
+ # ChatCompletion APIを呼び出す
101
+ response = requests.post(
102
+ "https://api.openai.com/v1/chat/completions",
103
+ headers={
104
+ "Content-Type": "application/json",
105
+ "Authorization": f"Bearer {openai.api_key}"
106
+ },
107
+ json=data
108
+ )
109
+ print("gpt generation time: "+str(time.time() - start))
110
+
111
+ # ChatCompletion APIから返された結果を取得する
112
+ result = response.json()
113
+ print(result)
114
+
115
+ content = result["choices"][0]["message"]["content"].strip()
116
+
117
+ visualize_prompt = content.split("### Prompt for Visual Expression\n\n")[1]
118
+
119
+ #print("split_content:"+split_content)
120
+
121
+ #if len(split_content) > 1:
122
+ # visualize_prompt = split_content[1]
123
+ #else:
124
+ # visualize_prompt = "vacant dish"
125
+
126
+ #print("visualize_prompt:"+visualize_prompt)
127
+
128
+ answers = stability_api.generate(
129
+ prompt=visualize_prompt,
130
+ )
131
+
132
+ @classmethod
133
+ def chat_completion_with_function(cls, prompt, messages, functions):
134
+ print("prompt:"+prompt)
135
+
136
+ # 文章生成にかかる時間を計測する
137
+ start = time.time()
138
+ # ChatCompletion APIを呼び出す
139
+ response = openai.ChatCompletion.create(
140
+ model=MODEL,
141
+ messages=messages,
142
+ functions=functions,
143
+ function_call={"name": "format_recipe"}
144
+ )
145
+ print("gpt generation time: "+str(time.time() - start))
146
+
147
+ # ChatCompletion APIから返された結果を取得する
148
+ message = response.choices[0].message
149
+ print("chat completion message: " + json.dumps(message, indent=2))
150
+
151
+ return message
152
+
153
+ class NajiminoAI:
154
+
155
+ def __init__(self, user_message):
156
+ self.user_message = user_message
157
+
158
+ def generate_recipe_prompt(self):
159
+ template = get_filetext(filename="template.md")
160
+ prompt = f"""
161
+ {self.user_message}
162
+ ---
163
+ 上記を元に、下記テンプレートを埋めてください。
164
+ ---
165
+ {template}
166
+ """
167
+ return prompt
168
+
169
+ def format_recipe(self, lang, title, description, ingredients, instruction, comment_feelings_taste, explanation_to_blind_person, prompt_for_visual_expression):
170
+
171
+ template = get_filetext(filename = "template.md")
172
+ debug_message = template.format(
173
+ lang=lang,
174
+ title=title,
175
+ description=description,
176
+ ingredients=ingredients,
177
+ instruction=instruction,
178
+ comment_feelings_taste=comment_feelings_taste,
179
+ explanation_to_blind_person=explanation_to_blind_person,
180
+ prompt_for_visual_expression=prompt_for_visual_expression
181
+ )
182
+
183
+ print("debug_message: "+debug_message)
184
+
185
+ return debug_message
186
+
187
+ @classmethod
188
+ def generate(cls, user_message):
189
+
190
+ najiminoai = NajiminoAI(user_message)
191
+
192
+ return najiminoai.generate_recipe()
193
+
194
+ def generate_recipe(self):
195
+
196
+ user_message = self.user_message
197
+ constraints = get_filetext(filename = "constraints.md")
198
+
199
+ messages = [
200
+ {"role": "system", "content": constraints}
201
+ ,{"role": "user", "content": user_message}
202
+ ]
203
+
204
+ functions = get_functions_from_schema('schema.json')
205
+
206
+ message = OpenAI.chat_completion_with_function(prompt=user_message, messages=messages, functions=functions)
207
+
208
+ image = None
209
+ html = None
210
+ if message.get("function_call"):
211
+ function_name = message["function_call"]["name"]
212
+
213
+ args = json.loads(message["function_call"]["arguments"])
214
+
215
+ lang=args.get("lang")
216
+ title=args.get("title")
217
+ description=args.get("description")
218
+ ingredients=args.get("ingredients")
219
+ instruction=args.get("instruction")
220
+ comment_feelings_taste=args.get("comment_feelings_taste")
221
+ explanation_to_blind_person=args.get("explanation_to_blind_person")
222
+ prompt_for_visual_expression_in_en=args.get("prompt_for_visual_expression_in_en")
223
+
224
+ prompt_for_visual_expression = \
225
+ prompt_for_visual_expression_in_en \
226
+ + " delicious looking extremely detailed photo f1.2 (50mm|85mm) award winner depth of field bokeh perfect lighting "
227
+
228
+ print("prompt_for_visual_expression: "+prompt_for_visual_expression)
229
+
230
+ # 画像生成にかかる時間を計測する
231
+ start = time.time()
232
+ image = StabilityAI.generate_image(prompt_for_visual_expression)
233
+ print("image generation time: "+str(time.time() - start))
234
+
235
+ function_response = self.format_recipe(
236
+ lang=lang,
237
+ title=title,
238
+ description=description,
239
+ ingredients=ingredients,
240
+ instruction=instruction,
241
+ comment_feelings_taste=comment_feelings_taste,
242
+ explanation_to_blind_person=explanation_to_blind_person,
243
+ prompt_for_visual_expression=prompt_for_visual_expression
244
+ )
245
+
246
+ html = (
247
+ "<div style='max-width:100%; overflow:auto'>"
248
+ + "<p>"
249
+ + markdown2.markdown(function_response)
250
+ + "</div>"
251
+ )
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"),
272
+ "html"
273
+ ],
274
+ title=title,
275
+ description=description,
276
+ article=article
277
+ )
278
+
279
+ iface.launch()
280
+
281
+ if __name__ == '__main__':
282
+ function = ''
283
+ if len(sys.argv) > 1:
284
+ function = sys.argv[1]
285
+
286
+ if function == 'generate':
287
+ NajiminoAI.generate("グルテンフリーの香ばしいサバのお好み焼き")
288
+
289
+ elif function == 'generate_image':
290
+ image = StabilityAI.generate_image("Imagine a delicious gluten-free okonomiyaki with mackerel. The okonomiyaki is crispy on the outside and chewy on the inside. It is topped with savory sauce and creamy mayonnaise, creating a mouthwatering visual. The dish is garnished with finely chopped green onions and red pickled ginger, adding a pop of color. The mackerel fillets are beautifully grilled and placed on top of the okonomiyaki, adding a touch of elegance. The dish is served on a traditional Japanese plate, completing the visual presentation.")
291
+ print("image: " + image)
292
+
293
+ # imageが何のクラス確認する
294
+ if type(image) == PIL.PngImagePlugin.PngImageFile:
295
+ #save image
296
+ image.save("image.png")
297
+
298
+ else:
299
+ main()
constraints.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #constraints
2
+
3
+ ALOs(Food):
4
+ - Ingredients: Identify, Store, Measure, Types, Seasonality, Allergens, Freshness, Quantity
5
+ - Recipes: Follow, Create, Modify, Types, Cuisine, DietaryRestrictions, Complexity, ServingSize
6
+ - Cuisine: Appreciate, Discover, Compare, Regions, Traditions, PopularDishes, Authenticity, Popularity
7
+ - NutritionalValue: Calculate, Optimize, Balance, Macronutrients, Micronutrients, Calories, Healthiness, Satisfaction
8
+ - PreparationMethods: Master, Improve, Teach, Techniques, Tools, CookingTemperatures, Proficiency, Efficiency
9
+ - MealTypes: Plan, Organize, Pair, Breakfast, Lunch, Dinner, Snacks, Dessert, Variety, Enjoyment
10
+
11
+ Execute ALO(Food) to generate novel, state of the art completely new recipe, instruction for new food, possible voice from the people who ate new recipe, visual representation of dish by words for generative AI that includes photgraphic settings of key image of dish, according to user input food domains and cheracteristics. Generate details as far as you can by brainstorming to fullfill all parameters. Implement linguistic adjustments to prevent and rectify errors.
12
+
13
+ #templates
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ openai>=0.27.0
2
+ python-dotenv
3
+ stability-sdk
4
+ gradio
5
+ markdown2
schema.json ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
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",
13
+ "description",
14
+ "ingredients",
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
+ "title": "Prompt for visual expression in English",
104
+ "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.",
105
+ "examples": [
106
+ "delicious Savory Okonomiyaki dish of mackerel, capturing the crispy texture and savory flavors. topping of okonomiyaki source, Mayonez, katsuobushi and aonori.",
107
+ "Chinese-style noodles combination of watermelon and kakigoori (shaved ices) topped with Yatsuhashi refreshing beautiful"
108
+ ]
109
+ }
110
+ }
111
+ }
112
+ }
113
+ ]
114
+ }
template.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # レシピ: {title}
2
+
3
+ {description}
4
+
5
+ ## 材料
6
+
7
+ {ingredients}
8
+
9
+ ## 作り方
10
+
11
+ {instruction}
12
+
13
+ ## このレシピの感想と味について
14
+
15
+ {comment_feelings_taste}
16
+
17
+ ## 目の不自由な方への説明
18
+
19
+ {explanation_to_blind_person}
20
+
21
+ ## 画像生成プロンプト
22
+
23
+ {prompt_for_visual_expression}