suneeln-duke commited on
Commit
1c728af
·
1 Parent(s): 9638331

Added further classification for question and included returning responses

Browse files
Files changed (1) hide show
  1. main.py +16 -2
main.py CHANGED
@@ -43,7 +43,21 @@ def hello():
43
 
44
  @app.post("/ask")
45
  def ask(question: str):
46
- question_category = eval(master_agent.answer_question(master, question))
47
 
 
 
48
 
49
- return {"category": question_category}
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  @app.post("/ask")
45
  def ask(question: str):
46
+ category = eval(master_agent.answer_question(master, question))
47
 
48
+ if category['category_number'] == 1:
49
+ response = eval(plant_agent.answer_question(plant, question))
50
 
51
+ category.update(response)
52
+
53
+ elif category['category_number'] == 2:
54
+ response = eda_agent.answer_question(eda, question)
55
+
56
+ category['response'] = response
57
+
58
+ elif category['category_number'] == 3:
59
+ response = rag_agent.answer_question(rag, question)
60
+
61
+ category['response'] = response
62
+
63
+ return category