GoogleCalc commited on
Commit
553362d
·
verified ·
1 Parent(s): 2645f6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -8
app.py CHANGED
@@ -897,19 +897,33 @@ def calculate_feed(birds, weeks, days, bag_size, price_per_bag, email, country_c
897
 
898
 
899
  # ============================================================
900
- # QUESTION / ANSWER
901
  # ============================================================
902
 
903
- def answer_farmer_question(question, email, breed):
904
- if not question or not question.strip():
905
- return "Please type or speak your question first."
 
 
 
 
 
 
906
 
907
- save_question(email or "", question, breed)
 
 
 
 
908
 
909
- q = question.lower().strip()
 
 
 
910
 
911
- if "bag" in q and ("feed" in q or "birds" in q):
912
- answer = """
 
913
  ### Feed-bag questions
914
 
915
  For an exact feed estimate, use the calculator above.
 
897
 
898
 
899
  # ============================================================
900
+ # ASK A QUESTION
901
  # ============================================================
902
 
903
+ with gr.Group(elem_classes=["question-card"]):
904
+
905
+ gr.HTML(
906
+ """
907
+ <div class="question-title">
908
+ ❓ Ask a Question
909
+ </div>
910
+ """
911
+ )
912
 
913
+ question_input = gr.Textbox(
914
+ placeholder="How many bags for 100 broilers for 6 weeks?",
915
+ label=None,
916
+ lines=2,
917
+ )
918
 
919
+ question_button = gr.Button(
920
+ "💬 Get Answer",
921
+ variant="primary",
922
+ )
923
 
924
+ question_answer = gr.Markdown(
925
+ visible=False
926
+ )
927
  ### Feed-bag questions
928
 
929
  For an exact feed estimate, use the calculator above.