Skip to content

Commit 5d442f8

Browse files
authored
fix: synthetic gen (#25)
* fix: synthetic conversation messages types * more info in synthetic conv file
1 parent 68077a6 commit 5d442f8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/agents/llm_factory.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from langchain_openai import ChatOpenAI
88
from langchain_openai import OpenAIEmbeddings
99
from langchain_google_genai import ChatGoogleGenerativeAI
10+
from dotenv import load_dotenv
11+
load_dotenv()
1012

1113
class AzureLLMs:
1214
def __init__(self, temperature: int = 0):

src/agents/utils/synthetic_conversation_generation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ def generate_synthetic_conversations(raw_text: str, num_turns: int, student_agen
7979
# Student starts
8080
student_response = invoke_student_agent(message, conversation_history[:-1], summary, student_agent_type, question_response_details_prompt, conversation_id)
8181
conversation_history.append({
82-
"role": "assistant",
82+
"role": "user",
8383
"content": student_response["output"]
8484
})
8585
else:
86-
tutor_response = invoke_tutor_agent(message, conversation_history[:-1], summary, conversational_style, question_response_details_prompt, conversation_id)
86+
tutor_response = invoke_tutor_agent(message, conversation_history, summary, conversational_style, question_response_details_prompt, conversation_id)
8787
conversation_history.append({
8888
"role": "assistant",
8989
"content": tutor_response["output"]
@@ -97,6 +97,8 @@ def generate_synthetic_conversations(raw_text: str, num_turns: int, student_agen
9797
# Save Conversation
9898
conversation_output = {
9999
"conversation_id": conversation_id+"_"+student_agent_type+"_"+tutor_agent_type+"_synthetic",
100+
"student_agent_type": student_agent_type,
101+
"tutor_agent_type": tutor_agent_type,
100102
"conversation": conversation_history
101103
}
102104
return conversation_output

0 commit comments

Comments
 (0)