Spaces:
Paused
Paused
Update app.py
Browse files
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):
|