Pijush2023 commited on
Commit
fa3a33c
·
verified ·
1 Parent(s): 5c35cb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -103,6 +103,11 @@ def generate_answer(message, choice):
103
  logging.error(f"Invalid prompt_choice: {choice}. Defaulting to 'Conversational'")
104
  agent = initialize_agent_with_prompt(QA_CHAIN_PROMPT_2)
105
  response = agent(message)
 
 
 
 
 
106
  return response['output']
107
 
108
  def bot(history, choice):
 
103
  logging.error(f"Invalid prompt_choice: {choice}. Defaulting to 'Conversational'")
104
  agent = initialize_agent_with_prompt(QA_CHAIN_PROMPT_2)
105
  response = agent(message)
106
+
107
+ # Extract addresses for mapping regardless of the choice
108
+ addresses = extract_addresses(response['output'])
109
+ if addresses:
110
+ generate_map(addresses)
111
  return response['output']
112
 
113
  def bot(history, choice):