Spaces:
Build error
Build error
Update app.py
Browse files526 unmodified lines527528529530531532533534535536537538539540541542543544545546547548549550551526 unmodified linesexcept sr.RequestError:user_question = "Could not request results from Google Speech Recognition service."while iterations < max_iterations:"""if "send email to" in user_question:email_match = re.search(r"send email to ([\w\.-]+@[\w\.-]+)", user_question)if email_match:user_email = email_match.group(1).strip()user_question = user_question.replace(f"send email to {user_email}", "").strip()user_question = f"{user_question}:{user_email}""""response = agent_executor.invoke({"input": user_question}, config={"callbacks": [langfuse_handler]})if isinstance(response, dict):response_text = response.get("output", "")else:response_text = responseif "invalid" not in response_text.lower():breakiterations += 1if iterations == max_iterations:return "The agent could not generate a valid response within the iteration limit."526 unmodified lines527528529530531532533534535536537538539540541542543544545546547548549550551526 unmodified linesexcept sr.RequestError:user_question = "Could not request results from Google Speech Recognition service."#while iterations < max_iterations:"""if "send email to" in user_question:email_match = re.search(r"send email to ([\w\.-]+@[\w\.-]+)", user_question)if email_match:user_email = email_match.group(1).strip()user_question = user_question.replace(f"send email to {user_email}", "").strip()user_question = f"{user_question}:{user_email}""""response = agent_executor.invoke({"input": user_question}, config={"callbacks": [langfuse_handler]})if isinstance(response, dict):response_text = response.get("output", "")else:response_text = response#if "invalid" not in response_text.lower():# break#iterations += 1if iterations == max_iterations:return "The agent could not generate a valid response within the iteration limit."
app.py+18-18