in evaluations/genai_evaluation.py [0:0]
def send_question_to_python(question, conversation_id):
"""
Process the question using the Orchestrator locally.
Args:
question (str): The user's question.
conversation_id (str): The conversation ID.
Returns:
dict: The response from the Orchestrator.
"""
client_principal = {
'id': '00000000-0000-0000-0000-000000000000',
'name': 'anonymous'
}
if question:
try:
orchestrator = Orchestrator(conversation_id, client_principal)
result = asyncio.run(orchestrator.answer(question))
if not isinstance(result, dict):
logger.error("Expected result to be a dictionary.")
return {"error": "Invalid response format from orchestrator."}
return result
except Exception as e:
logger.exception(f"An error occurred while orchestrating the question: {e}")
return {"error": "An error occurred while processing your question."}
else:
logger.warning("No question provided to orchestrate.")
return {"error": "No question provided."}