Skip to content

fix: synthetic gen #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/agents/llm_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 4 additions & 2 deletions src/agents/utils/synthetic_conversation_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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
Expand Down