Pijush2023 commited on
Commit
d2ff383
·
verified ·
1 Parent(s): 292623a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -341,13 +341,21 @@ def generate_answer(message, choice):
341
  return response['output'], addresses
342
 
343
 
 
 
 
 
 
344
  def extract_location_from_response(response):
345
- agent = initialize_agent_with_prompt(QA_CHAIN_PROMPT_1)
 
 
 
 
346
  address_response = agent(response)
347
  return address_response['output']
348
 
349
 
350
-
351
  def bot(history, choice):
352
  if not history:
353
  return history
 
341
  return response['output'], addresses
342
 
343
 
344
+ # def extract_location_from_response(response):
345
+ # agent = initialize_agent_with_prompt(QA_CHAIN_PROMPT_1)
346
+ # address_response = agent(response)
347
+ # return address_response['output']
348
+
349
  def extract_location_from_response(response):
350
+ address_prompt = PromptTemplate(
351
+ input_variables=["context", "question"],
352
+ template="Extract the address from the following response:\n{context}\nResponse: {question}"
353
+ )
354
+ agent = initialize_agent_with_prompt(address_prompt)
355
  address_response = agent(response)
356
  return address_response['output']
357
 
358
 
 
359
  def bot(history, choice):
360
  if not history:
361
  return history