diff --git a/src/agents/llm_factory.py b/src/agents/llm_factory.py index db12d27..5f11580 100644 --- a/src/agents/llm_factory.py +++ b/src/agents/llm_factory.py @@ -7,6 +7,8 @@ from langchain_openai import ChatOpenAI from langchain_openai import OpenAIEmbeddings from langchain_google_genai import ChatGoogleGenerativeAI +from dotenv import load_dotenv +load_dotenv() class AzureLLMs: def __init__(self, temperature: int = 0): diff --git a/src/agents/utils/synthetic_conversation_generation.py b/src/agents/utils/synthetic_conversation_generation.py index e359406..35de15e 100644 --- a/src/agents/utils/synthetic_conversation_generation.py +++ b/src/agents/utils/synthetic_conversation_generation.py @@ -79,11 +79,11 @@ def generate_synthetic_conversations(raw_text: str, num_turns: int, student_agen # Student starts student_response = invoke_student_agent(message, conversation_history[:-1], summary, student_agent_type, question_response_details_prompt, conversation_id) conversation_history.append({ - "role": "assistant", + "role": "user", "content": student_response["output"] }) else: - tutor_response = invoke_tutor_agent(message, conversation_history[:-1], summary, conversational_style, question_response_details_prompt, conversation_id) + tutor_response = invoke_tutor_agent(message, conversation_history, summary, conversational_style, question_response_details_prompt, conversation_id) conversation_history.append({ "role": "assistant", "content": tutor_response["output"] @@ -97,6 +97,8 @@ def generate_synthetic_conversations(raw_text: str, num_turns: int, student_agen # Save Conversation conversation_output = { "conversation_id": conversation_id+"_"+student_agent_type+"_"+tutor_agent_type+"_synthetic", + "student_agent_type": student_agent_type, + "tutor_agent_type": tutor_agent_type, "conversation": conversation_history } return conversation_output