Skip to content

Commit

Permalink
fix agent graph when supportai not available
Browse files Browse the repository at this point in the history
  • Loading branch information
parkererickson-tg committed Jun 4, 2024
1 parent 82f6f7a commit 133878a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/agent/agent_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ def route_question(self, state):
return "apologize"
state["question_retry_count"] += 1
logger.debug_pii(f"request_id={req_id_cv.get()} Routing question: {state['question']}")
source = step.route_question(state['question'])
logger.debug_pii(f"request_id={req_id_cv.get()} Routing question to: {source}")
if source.datasource == "vectorstore" and self.supportai_enabled:
return "supportai_lookup"
elif source.datasource == "functions":
if self.supportai_enabled:
source = step.route_question(state['question'])
logger.debug_pii(f"request_id={req_id_cv.get()} Routing question to: {source}")
if source.datasource == "vectorstore":
return "supportai_lookup"
elif source.datasource == "functions":
return "inquiryai_lookup"
else:
return "inquiryai_lookup"

def apologize(self, state):
Expand Down

0 comments on commit 133878a

Please sign in to comment.