Spaces:
Build error
Build error
Update app.py
Browse files528 unmodified lines5295305315325335345351 unmodified line537538539540541542543544545546547548549550551552553554528 unmodified lineswhile 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()1 unmodified lineuser_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."if os.getenv("IMAGE_PATH") in response_text:# Open the image file528 unmodified lines5295305315325335345351 unmodified line537538539540541542543544545546547548549550551552553554528 unmodified lineswhile 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()1 unmodified lineuser_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."if os.getenv("IMAGE_PATH") in response_text:# Open the image file
app.py+11-11