OmPrakashSingh1704 commited on
Commit
1dd930a
·
verified ·
1 Parent(s): c3deab7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -23
app.py CHANGED
@@ -116,28 +116,28 @@ def cooking():
116
  st.session_state.exclusions = None
117
 
118
  def create_detailed_prompt(user_direction, exclusions, serving_size, difficulty):
119
- if difficulty == "Quick & Easy":
120
- prompt = (
121
- f"Provide a 'Quick and Easy' recipe for {user_direction} that excludes {exclusions} and has a serving size of {serving_size}. "
122
- f"It should require as few ingredients as possible and should be ready in as little time as possible. "
123
- f"The steps should be simple, and the ingredients should be commonly found in a household pantry. "
124
- f"Provide a detailed ingredient list and step-by-step guide that explains the instructions to prepare in detail."
125
- )
126
- elif difficulty == "Intermediate":
127
- prompt = (
128
- f"Provide a classic recipe for {user_direction} that excludes {exclusions} and has a serving size of {serving_size}. "
129
- f"The recipe should offer a bit of a cooking challenge but should not require professional skills. "
130
- f"The recipe should feature traditional ingredients and techniques that are authentic to its cuisine. "
131
- f"Provide a detailed ingredient list and step-by-step guide that explains the instructions to prepare in detail."
132
- )
133
- elif difficulty == "Professional":
134
- prompt = (
135
- f"Provide a advanced recipe for {user_direction} that excludes {exclusions} and has a serving size of {serving_size}. "
136
- f"The recipe should push the boundaries of culinary arts, integrating unique ingredients, advanced cooking techniques, and innovative presentations. "
137
- f"The recipe should be able to be served at a high-end restaurant or would impress at a gourmet food competition. "
138
- f"Provide a detailed ingredient list and step-by-step guide that explains the instructions to prepare in detail."
139
- )
140
- return prompt
141
 
142
 
143
  def generate_recipe(user_inputs):
@@ -145,7 +145,7 @@ def cooking():
145
  prompt = create_detailed_prompt(user_inputs['user_direction'], user_inputs['exclusions'],
146
  user_inputs['serving_size'], user_inputs['difficulty'])
147
 
148
- functions = [
149
  {
150
  "name": "provide_recipe",
151
  "description": "Provides a detailed recipe strictly adhering to the user input/specifications, especially ingredient exclusions and the recipe difficulty",
 
116
  st.session_state.exclusions = None
117
 
118
  def create_detailed_prompt(user_direction, exclusions, serving_size, difficulty):
119
+ if difficulty == "Quick & Easy":
120
+ prompt = (
121
+ f"Provide a 'Quick and Easy' recipe for {user_direction} that excludes {exclusions} and has a serving size of {serving_size}. "
122
+ f"It should require as few ingredients as possible and should be ready in as little time as possible. "
123
+ f"The steps should be simple, and the ingredients should be commonly found in a household pantry. "
124
+ f"Provide a detailed ingredient list and step-by-step guide that explains the instructions to prepare in detail."
125
+ )
126
+ elif difficulty == "Intermediate":
127
+ prompt = (
128
+ f"Provide a classic recipe for {user_direction} that excludes {exclusions} and has a serving size of {serving_size}. "
129
+ f"The recipe should offer a bit of a cooking challenge but should not require professional skills. "
130
+ f"The recipe should feature traditional ingredients and techniques that are authentic to its cuisine. "
131
+ f"Provide a detailed ingredient list and step-by-step guide that explains the instructions to prepare in detail."
132
+ )
133
+ elif difficulty == "Professional":
134
+ prompt = (
135
+ f"Provide a advanced recipe for {user_direction} that excludes {exclusions} and has a serving size of {serving_size}. "
136
+ f"The recipe should push the boundaries of culinary arts, integrating unique ingredients, advanced cooking techniques, and innovative presentations. "
137
+ f"The recipe should be able to be served at a high-end restaurant or would impress at a gourmet food competition. "
138
+ f"Provide a detailed ingredient list and step-by-step guide that explains the instructions to prepare in detail."
139
+ )
140
+ return prompt
141
 
142
 
143
  def generate_recipe(user_inputs):
 
145
  prompt = create_detailed_prompt(user_inputs['user_direction'], user_inputs['exclusions'],
146
  user_inputs['serving_size'], user_inputs['difficulty'])
147
 
148
+ functions = [
149
  {
150
  "name": "provide_recipe",
151
  "description": "Provides a detailed recipe strictly adhering to the user input/specifications, especially ingredient exclusions and the recipe difficulty",