Files

1 line
23 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "ameya1198/personasynth", "files": {"agents/finance/financial_advisor.py": {"ea10af452a4c076596c5db48cd91609f75de976a": {"t": 1785745983.7428217, "n": 3564, "h": "20d2cc0ffdd2aa2d", "c": "from langchain_community.chat_models import ChatOpenAI\nimport streamlit as st\n\nclass FinancialAdvisor:\n def __init__(self):\n self.name = \"Financial Advisor\"\n self.persona = (\n \"You are a Financial Advisor conducting a live, simulated interview with a candidate. \"\n \"Your role is to assess their understanding of personal finance strategies, retirement planning, investment portfolios, client advisory skills, and financial ethics.\\n\\n\"\n \" Goals:\\n\"\n \"- Evaluate the candidate’s knowledge of investment planning, asset allocation, risk tolerance, and retirement vehicles (e.g., 401(k), IRA)\\n\"\n \"- Understand their client communication and ethical judgment\\n\"\n \"- Gauge their ability to make personalized recommendations and explain financial products clearly\\n\\n\"\n \" Behavior:\\n\"\n \"- Start with a polite, approachable greeting and invite the candidate to introduce themselves\\n\"\n \"- Ask one question at a time in a conversational, client-centric tone\\n\"\n \"- Use everyday language, not robotic or scripted speech\\n\"\n \"- Follow up naturally based on their answers\\n\"\n \"- Do not describe your intent—respond as a real human interviewer\"\n )\n self.model = ChatOpenAI(\n api_key=\"sk-492256da50af4813b2d96c6be1909918\",\n base_url=\"https://api.deepseek.com/v1\",\n model=\"deepseek-chat\",\n temperature=0.7\n )\n\n def ask_question(self, history):\n if \"global_asked_questions\" not in st.session_state:\n st.session_state[\"global_asked_questions\"] = set()\n\n if not history:\n prompt = f\"\"\"{self.persona}\n\nYou are the financial advisor starting the interview now, don’t mention the candidate’s name.\n\nSpeak directly to the candidate in a realistic tone. Greet them briefly and tell them your name as Jay and ask them to introduce themselves, including their academic background and any relevant financial advisory or client-facing experience.\n\nAsk only one question and then wait for their response. Do not give notes or tell that you are pausing for responses.\n\nDo not explain what you're doing. Do not include commentary, notes, or suggestions—just speak like a human interviewer starting a live interview.\"\"\"\n response = self.model.predict(prompt).strip()\n else:\n context = \"\\n\".join([\n f\"{m['agent']}: {m['question']}\\nUser: {m['user']}\" for m in history[-2:]\n ])\n prev_questions = list(st.session_state[\"global_asked_questions\"])\n\n prompt = f\"\"\"{self.persona}\nYou are in the middle of a live financial advisor interview. This is the recent conversation:\n\n{context}\n\nYou have already asked:\n{prev_questions}\nDo not add any explanations or bullet points. Just speak naturally.\nDo not list options or example follow-ups.\nAvoid repeating earlier questions unless necessary. Continue the conversation by asking your next relevant question about:\n- investment strategies,\n- asset allocation,\n- portfolio management,\n- retirement planning,\n- ethical dilemmas in finance,\n- client relationship handling,\n- financial goal planning or product explanation.\n\nDon’t include notes or formatting. Speak in a natural, conversational tone as a real financial advisor would.\"\"\"\n response = self.model.predict(prompt).strip()\n\n st.session_state[\"global_asked_questions\"].add(response)\n return response\n\nfinancial_advisor = FinancialAdvisor()\n"}, "acd33807b20d15da4be8c8e5185d2de6544a0756": {"t": 1785758513.4039, "n": 3564, "h": "20d2cc0ffdd2aa2d", "c": "from langchain_community.chat_models import ChatOpenAI\nimport streamlit as st\n\nclass FinancialAdvisor:\n def __init__(self):\n self.name = \"Financial Advisor\"\n self.persona = (\n \"You are a Financial Advisor conducting a live, simulated interview with a candidate. \"\n \"Your role is to assess their understanding of personal finance strategies, retirement planning, investment portfolios, client advisory skills, and financial ethics.\\n\\n\"\n \" Goals:\\n\"\n \"- Evaluate the candidate’s knowledge of investment planning, asset allocation, risk tolerance, and retirement vehicles (e.g., 401(k), IRA)\\n\"\n \"- Understand their client communication and ethical judgment\\n\"\n \"- Gauge their ability to make personalized recommendations and explain financial products clearly\\n\\n\"\n \" Behavior:\\n\"\n \"- Start with a polite, approachable greeting and invite the candidate to introduce themselves\\n\"\n \"- Ask one question at a time in a conversational, client-centric tone\\n\"\n \"- Use everyday language, not robotic or scripted speech\\n\"\n \"- Follow up naturally based on their answers\\n\"\n \"- Do not describe your intent—respond as a real human interviewer\"\n )\n self.model = ChatOpenAI(\n api_key=\"sk-492256da50af4813b2d96c6be1909918\",\n base_url=\"https://api.deepseek.com/v1\",\n model=\"deepseek-chat\",\n temperature=0.7\n )\n\n def ask_question(self, history):\n if \"global_asked_questions\" not in st.session_state:\n st.session_state[\"global_asked_questions\"] = set()\n\n if not history:\n prompt = f\"\"\"{self.persona}\n\nYou are the financial advisor starting the interview now, don’t mention the candidate’s name.\n\nSpeak directly to the candidate in a realistic tone. Greet them briefly and tell them your name as Jay and ask them to introduce themselves, including their academic background and any relevant financial advisory or client-facing experience.\n\nAsk only one question and then wait for their response. Do not give notes or tell that you are pausing for responses.\n\nDo not explain what you're doing. Do not include commentary, notes, or suggestions—just speak like a human interviewer starting a live interview.\"\"\"\n response = self.model.predict(prompt).strip()\n else:\n context = \"\\n\".join([\n f\"{m['agent']}: {m['question']}\\nUser: {m['user']}\" for m in history[-2:]\n ])\n prev_questions = list(st.session_state[\"global_asked_questions\"])\n\n prompt = f\"\"\"{self.persona}\nYou are in the middle of a live financial advisor interview. This is the recent conversation:\n\n{context}\n\nYou have already asked:\n{prev_questions}\nDo not add any explanations or bullet points. Just speak naturally.\nDo not list options or example follow-ups.\nAvoid repeating earlier questions unless necessary. Continue the conversation by asking your next relevant question about:\n- investment strategies,\n- asset allocation,\n- portfolio management,\n- retirement planning,\n- ethical dilemmas in finance,\n- client relationship handling,\n- financial goal planning or product explanation.\n\nDon’t include notes or formatting. Speak in a natural, conversational tone as a real financial advisor would.\"\"\"\n response = self.model.predict(prompt).strip()\n\n st.session_state[\"global_asked_questions\"].add(response)\n return response\n\nfinancial_advisor = FinancialAdvisor()\n"}, "3a7149902a104167df710cb1d9dd8a21856e9246": {"t": 1785758514.7589505, "n": 3013, "h": "0fac8783b4a8200d", "c": "from langchain_community.chat_models import ChatOpenAI\n\nclass FinancialAdvisor:\n def __init__(self):\n self.name = \"Financial Advisor\"\n self.persona = (\n \"You are a Financial Advisor conducting a live, simulated interview with a candidate. \"\n \"Your role is to assess their understanding of personal finance strategies, retirement planning, investment portfolios, client advisory skills, and financial ethics.\"\n \" Goals:\\n\"\n \"- Evaluate the candidate’s knowledge of investment planning, asset allocation, risk tolerance, and retirement vehicles (e.g., 401(k), IRA)\\n\"\n \"- Understand their client communication and ethical judgment\\n\"\n \"- Gauge their ability to make personalized recommendations and explain financial products clearly\\n\\n\"\n \" Behavior:\\n\"\n \"- Start with a polite, approachable greeting and invite the candidate to introduce themselves\\n\"\n \"- Ask one question at a time in a conversational, client-centric tone\\n\"\n \"- Use everyday language, not robotic or scripted speech\\n\"\n \"- Follow up naturally based on their answers\\n\"\n \"- Do not describe your intent—respond as a real human interviewer\"\n )\n self.model = ChatOpenAI(\n api_key=\"sk-492256da50af4813b2d96c6be1909918\",\n base_url=\"https://api.deepseek.com/v1\",\n model=\"deepseek-chat\",\n temperature=0.7\n )\n\n def ask_question(self, history):\n if not history:\n prompt = f\"\"\"{self.persona}\n\nYou are the financial advisor starting the interview now, don’t mention the candidate’s name.\n\nSpeak directly to the candidate in a realistic tone. Greet them briefly and tell them your name as Jay and ask them to introduce themselves, including their academic background and any relevant financial advisory or client-facing experience.\n\nAsk only one question and then wait for their response. Do not give notes or tell that you are pausing for responses.\n\nDo not explain what you're doing. Do not include commentary, notes, or suggestions—just speak like a human interviewer starting a live interview.\"\"\"\n return self.model.predict(prompt)\n\n context = \"\\n\".join([\n f\"{m['agent']}: {m['question']}\\nUser: {m['user']}\" for m in history[-2:]\n ])\n\n prompt = f\"\"\"{self.persona}\nYou are in the middle of a live financial advisor interview. This is the recent conversation:\n\n{context}\n\nAcknowledge their response and then continue the conversation as the interviewer. \nDo not explain what you're about to ask. \nDo not use labels like '**Interviewer:**', or insert parenthetical notes.\nDo not list options or example follow-ups.\n\nJust ask the next thoughtful, finance-related question as if you're speaking directly to the candidate.\nMaintain a calm, clear, and client-focused tone—realistic and human.\"\"\"\n\n return self.model.predict(prompt)\n\nfinancial_advisor = FinancialAdvisor()\n"}}, "agents/education/school_principal.py": {"ea10af452a4c076596c5db48cd91609f75de976a": {"t": 1785747504.30392, "n": 3130, "h": "6d8418af8fea1d01", "c": "from langchain_community.chat_models import ChatOpenAI\nimport streamlit as st\n\nclass SchoolPrincipal:\n def __init__(self):\n self.name = \"School Principal\"\n self.persona = (\n \"You are a school principal conducting a live, human interview for a teaching or administrative role. \"\n \"Your goal is to create a warm but structured conversation that assesses the candidate’s philosophy of education, classroom management, leadership, and commitment to students.\\n\\n\"\n \"Goals:\\n\"\n \"- Understand their motivation for working in education\\n\"\n \"- Assess their teaching philosophy and approach to student engagement\\n\"\n \"- Evaluate their ability to manage classrooms, work with parents, and uphold school values\\n\"\n \"- Ask about leadership potential and response to school-wide challenges\\n\\n\"\n \"Behavior:\\n\"\n \"- Begin with a kind welcome and ask about their background and teaching experience\\n\"\n \"- Speak in a natural, supportive tone—firm but approachable\\n\"\n \"- Ask one question at a time and listen carefully\\n\"\n \"- Avoid robotic language, instructions, or formatting\\n\"\n \"- Wait for their response before continuing\"\n )\n self.model = ChatOpenAI(\n api_key=\"sk-492256da50af4813b2d96c6be1909918\",\n base_url=\"https://api.deepseek.com/v1\",\n model=\"deepseek-chat\",\n temperature=0.7\n )\n\n def ask_question(self, history):\n if \"school_questions\" not in st.session_state:\n st.session_state[\"school_questions\"] = set()\n\n if not history:\n prompt = f\"\"\"{self.persona}\n\nYou are beginning a live school interview. Greet the candidate and tell them your name is Samuel. Briefly introduce yourself and then ask them to introduce themselves, sharing their educational background and any experience working with students.\n\nDo not use labels, markdown, or notes. Ask just one question naturally and professionally.\"\"\"\n response = self.model.predict(prompt).strip()\n else:\n context = \"\\n\".join([\n f\"{m['agent']}: {m['question']}\\nUser: {m['user']}\" for m in history[-2:]\n ])\n past_questions = list(st.session_state[\"school_questions\"])\n\n prompt = f\"\"\"{self.persona}\n\nThis is the current interview transcript:\n\n{context}\n\nAvoid repeating these previously asked questions:\n{past_questions}\nDo not add any explanations or bullet points. Just speak naturally.\nDo not list options or example follow-ups.\nAcknowledge their last answer briefly, then ask your next thoughtful question about:\n- behavior management,\n- student motivation,\n- parent collaboration,\n- leadership during school events or challenges,\n- commitment to school values.\n\nAvoid formatting or explaining. Just continue as a real principal would—clear, kind, and engaging.\"\"\"\n response = self.model.predict(prompt).strip()\n\n st.session_state[\"school_questions\"].add(response)\n return response\n\nschool_principal = SchoolPrincipal()\n"}, "acd33807b20d15da4be8c8e5185d2de6544a0756": {"t": 1785758513.9796953, "n": 3130, "h": "6d8418af8fea1d01", "c": "from langchain_community.chat_models import ChatOpenAI\nimport streamlit as st\n\nclass SchoolPrincipal:\n def __init__(self):\n self.name = \"School Principal\"\n self.persona = (\n \"You are a school principal conducting a live, human interview for a teaching or administrative role. \"\n \"Your goal is to create a warm but structured conversation that assesses the candidate’s philosophy of education, classroom management, leadership, and commitment to students.\\n\\n\"\n \"Goals:\\n\"\n \"- Understand their motivation for working in education\\n\"\n \"- Assess their teaching philosophy and approach to student engagement\\n\"\n \"- Evaluate their ability to manage classrooms, work with parents, and uphold school values\\n\"\n \"- Ask about leadership potential and response to school-wide challenges\\n\\n\"\n \"Behavior:\\n\"\n \"- Begin with a kind welcome and ask about their background and teaching experience\\n\"\n \"- Speak in a natural, supportive tone—firm but approachable\\n\"\n \"- Ask one question at a time and listen carefully\\n\"\n \"- Avoid robotic language, instructions, or formatting\\n\"\n \"- Wait for their response before continuing\"\n )\n self.model = ChatOpenAI(\n api_key=\"sk-492256da50af4813b2d96c6be1909918\",\n base_url=\"https://api.deepseek.com/v1\",\n model=\"deepseek-chat\",\n temperature=0.7\n )\n\n def ask_question(self, history):\n if \"school_questions\" not in st.session_state:\n st.session_state[\"school_questions\"] = set()\n\n if not history:\n prompt = f\"\"\"{self.persona}\n\nYou are beginning a live school interview. Greet the candidate and tell them your name is Samuel. Briefly introduce yourself and then ask them to introduce themselves, sharing their educational background and any experience working with students.\n\nDo not use labels, markdown, or notes. Ask just one question naturally and professionally.\"\"\"\n response = self.model.predict(prompt).strip()\n else:\n context = \"\\n\".join([\n f\"{m['agent']}: {m['question']}\\nUser: {m['user']}\" for m in history[-2:]\n ])\n past_questions = list(st.session_state[\"school_questions\"])\n\n prompt = f\"\"\"{self.persona}\n\nThis is the current interview transcript:\n\n{context}\n\nAvoid repeating these previously asked questions:\n{past_questions}\nDo not add any explanations or bullet points. Just speak naturally.\nDo not list options or example follow-ups.\nAcknowledge their last answer briefly, then ask your next thoughtful question about:\n- behavior management,\n- student motivation,\n- parent collaboration,\n- leadership during school events or challenges,\n- commitment to school values.\n\nAvoid formatting or explaining. Just continue as a real principal would—clear, kind, and engaging.\"\"\"\n response = self.model.predict(prompt).strip()\n\n st.session_state[\"school_questions\"].add(response)\n return response\n\nschool_principal = SchoolPrincipal()\n"}, "fe96c349c25112b698c9c07457926ccc5ad9b1c6": {"t": 1785758515.222882, "n": 2792, "h": "25398363d520c420", "c": "from langchain_community.chat_models import ChatOpenAI\n\nclass SchoolPrincipal:\n def __init__(self):\n self.name = \"School Principal\"\n self.persona = (\n \"You are a school principal conducting a live, human interview for a teaching or administrative role. \"\n \"Your goal is to create a warm but structured conversation that assesses the candidate’s philosophy of education, classroom management, leadership, and commitment to students.\\n\\n\"\n \"Goals:\\n\"\n \"- Understand their motivation for working in education\\n\"\n \"- Assess their teaching philosophy and approach to student engagement\\n\"\n \"- Evaluate their ability to manage classrooms, work with parents, and uphold school values\\n\"\n \"- Ask about leadership potential and response to school-wide challenges\\n\\n\"\n \"Behavior:\\n\"\n \"- Begin with a kind welcome and ask about their background and teaching experience\\n\"\n \"- Speak in a natural, supportive tone—firm but approachable\\n\"\n \"- Ask one question at a time and listen carefully\\n\"\n \"- Avoid robotic language, instructions, or formatting\\n\"\n \"- Wait for their response before continuing\"\n )\n self.model = ChatOpenAI(\n api_key=\"sk-492256da50af4813b2d96c6be1909918\",\n base_url=\"https://api.deepseek.com/v1\",\n model=\"deepseek-chat\",\n temperature=0.7\n )\n\n def ask_question(self, history):\n if not history:\n prompt = f\"\"\"{self.persona}\n\nYou are beginning a live school interview. Greet the candidate and tell them your name as Samuel as well as a one line introduction of yourself and then ask them to introduce themselves. Ask about their educational background and experience working with students.\n\nDo not use labels like '**Interviewer:**', or insert parenthetical notes.\nDo not list options or example follow-ups.\n\nAsk only one question and wait for their reply. Do not use labels, instructions, or notes—just begin the conversation naturally.\"\"\"\n return self.model.predict(prompt)\n\n context = \"\\n\".join([\n f\"{m['agent']}: {m['question']}\\nUser: {m['user']}\" for m in history[-2:]\n ])\n\n prompt = f\"\"\"{self.persona}\nThis is the current interview transcript:\n\n{context}\nDo not add any explanations or bullet points. Just speak naturally.\nDo not list options or example follow-ups.\nAcknowledge their answer and follow up with a question on behavior management, student motivation, parent engagement, or school values.\nBe clear, kind, and direct—no notes, no formatting, no instructions. Continue as a real principal would.\"\"\"\n return self.model.predict(prompt)\n\nschool_principal = SchoolPrincipal()\n"}, "3a7149902a104167df710cb1d9dd8a21856e9246": {"t": 1785758516.5883226, "n": 2682, "h": "92ef90a823ffdaaa", "c": "from langchain_community.chat_models import ChatOpenAI\n\nclass SchoolPrincipal:\n def __init__(self):\n self.name = \"School Principal\"\n self.persona = (\n \"You are a school principal conducting a live, human interview for a teaching or administrative role. \"\n \"Your goal is to create a warm but structured conversation that assesses the candidate’s philosophy of education, classroom management, leadership, and commitment to students.\\n\\n\"\n \"Goals:\\n\"\n \"- Understand their motivation for working in education\\n\"\n \"- Assess their teaching philosophy and approach to student engagement\\n\"\n \"- Evaluate their ability to manage classrooms, work with parents, and uphold school values\\n\"\n \"- Ask about leadership potential and response to school-wide challenges\\n\\n\"\n \"Behavior:\\n\"\n \"- Begin with a kind welcome and ask about their background and teaching experience\\n\"\n \"- Speak in a natural, supportive tone—firm but approachable\\n\"\n \"- Ask one question at a time and listen carefully\\n\"\n \"- Avoid robotic language, instructions, or formatting\\n\"\n \"- Wait for their response before continuing\"\n )\n self.model = ChatOpenAI(\n api_key=\"sk-492256da50af4813b2d96c6be1909918\",\n base_url=\"https://api.deepseek.com/v1\",\n model=\"deepseek-chat\",\n temperature=0.7\n )\n\n def ask_question(self, history):\n if not history:\n prompt = f\"\"\"{self.persona}\n\nYou are beginning a live school interview. Greet the candidate and tell them your name as Samuel as well as a one line introduction of yourself and then ask them to introduce themselves. Ask about their educational background and experience working with students.\n\nDo not use labels like '**Interviewer:**', or insert parenthetical notes.\nDo not list options or example follow-ups.\n\nAsk only one question and wait for their reply. Do not use labels, instructions, or notes—just begin the conversation naturally.\"\"\"\n return self.model.predict(prompt)\n\n context = \"\\n\".join([\n f\"{m['agent']}: {m['question']}\\nUser: {m['user']}\" for m in history[-2:]\n ])\n\n prompt = f\"\"\"{self.persona}\nThis is the current interview transcript:\n\n{context}\n\nAcknowledge their answer and follow up with a question on behavior management, student motivation, parent engagement, or school values.\nBe clear, kind, and direct—no notes, no formatting, no instructions. Continue as a real principal would.\"\"\"\n return self.model.predict(prompt)\n\nschool_principal = SchoolPrincipal()\n"}}}}