venkat charan commited on
Commit
b088b6f
1 Parent(s): 7ffed93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -10,17 +10,22 @@ llm = ChatOpenAI(temperature=0, model="gpt-3.5-turbo",openai_api_key=openai_api_
10
 
11
 
12
  prompt = ChatPromptTemplate.from_messages([
13
- ("system", "You are a good chef.You are a helpful assistant that suggests me how to cook a dish")
14
- ("human", "Give a proper way with mentioning ingredients\n{input}")
15
- ])
16
 
17
  st.title("Dish Maker")
18
  st.write("Enter the dish you want to make:")
19
 
20
-
21
  dish = st.text_area("Dish")
22
 
23
  if st.button("Generate process"):
24
- chain = prompt | llm
25
- response = chain.invoke({"input": dish})
26
- st.write(response.content)
 
 
 
 
 
 
10
 
11
 
12
  prompt = ChatPromptTemplate.from_messages([
13
+ ("system", "You are a good chef. You are a helpful assistant that suggests how to cook a dish."),
14
+ ("human", "Give a proper way with mentioning ingredients\n{input}")
15
+ ])
16
 
17
  st.title("Dish Maker")
18
  st.write("Enter the dish you want to make:")
19
 
20
+ # User input
21
  dish = st.text_area("Dish")
22
 
23
  if st.button("Generate process"):
24
+ chain = prompt | llm
25
+ response = chain.invoke({"input": dish})
26
+
27
+ if response:
28
+ st.write("Generated Cooking Process:")
29
+ st.write(response.content)
30
+ else:
31
+ st.write("No response from the model. Please try again.")