Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/aarthiyamuthusamy_demo.json
T

1 line
41 KiB
JSON
Raw 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": "aarthiyamuthusamy/demo", "files": {"evaluation_using_another.ipynb": {"caaebd044fb5949835e5021d9c4bdcf52e179895": {"t": 1785745500.0515594, "n": 18894, "h": "c29e7ef422cfbf5b", "c": "{\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"execution_count\": 44,\n \"id\": \"ed1fdcb1\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"import os\\n\",\n \"from dotenv import load_dotenv\\n\",\n \"from openai import OpenAI\\n\",\n \"from PyPDF2 import PdfReader\\n\",\n \"import gradio as gr\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 45,\n \"id\": \"06728673\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"True\"\n ]\n },\n \"execution_count\": 45,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"load_dotenv(override=True)\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 46,\n \"id\": \"22374987\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"DEEPSEEK_BASE_URL = \\\"https://api.deepseek.com/v1\\\"\\n\",\n \"deepseek_api_key = os.getenv(\\\"DEEPSEEK_API_KEY\\\")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 47,\n \"id\": \"d6ff1add\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from pydoc import text\\n\",\n \"\\n\",\n \"reader = PdfReader(\\\"C://Users/Aathiya/projects/agents/Demo/me/Aarthiya_Resume_Software_Developer.pdf\\\")\\n\",\n \"\\n\",\n \"linkedln = \\\"\\\"\\n\",\n \"for page in reader.pages:\\n\",\n \" text = page.extract_text()\\n\",\n \" if text:\\n\",\n \" linkedln += text\\n\",\n \"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 48,\n \"id\": \"335a7ed7\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/markdown\": [\n \" AARTHIYA M \\n\",\n \" +91 9345366672 Chennai, TamilNadu \\n\",\n \" aarthiyam1510@gmail.com Linkedln-aarthiyam Github-aarthiya \\n\",\n \"OBJECTIVE \\n\",\n \"Passionate software developer with strong skills in Java and front -end web development. Eager to build \\n\",\n \"innovative, efficient solutions while contributing to team success and continuous improvement. \\n\",\n \" \\n\",\n \"EXPERIENCE \\n\",\n \"Associate Engineer – Development Dec 2024 – May 2025 \\n\",\n \"Aptean India Pvt Ltd Madurai \\n\",\n \"• Collaborated in developing and maintaining enterprise software products using Java and SQL. Performed \\n\",\n \"unit testing and API validations using tools like Postman. \\n\",\n \"• Gained hands -on experience with bug tracking, version control, and code reviews. Assisted in debugging \\n\",\n \"and resolving backend issues in customer -facing applications. \\n\",\n \" \\n\",\n \"SKILLS \\n\",\n \"Technical Skills Java, Python, SQL, HTML5, CSS3, JavaScript, .Net, REST APIs, MongoDB \\n\",\n \"Frameworks Node.js, React.js, MongoDB Atlas, Firebase, Fl ask, Render (Cloud Hosting) \\n\",\n \"Concepts Object-Oriented Programming (OOP), Databases and Querying, API Integration, Open AI, \\n\",\n \" Agentic AI , LLMs, Full Stack Development , Web Development, Unit Testing, Linux \\n\",\n \"IDE &Tools PyCharm, Eclipse, Vs Code, Figma, Wix , MATLAB, POSTMAN , Android Studio \\n\",\n \"Version control Git, GitHub \\n\",\n \"Soft Skills Leadership, Teamwork, Organization, Problem -solving, Adaptability \\n\",\n \"PROJECTS \\n\",\n \"AI – Enabled Phishing Detection -Intelligent Web Security System : Developed an AI -powered phishing detection \\n\",\n \"system using Python and Machine Learning to analyse URL patterns and classify malicious websites with 90% accuracy \\n\",\n \"Designed for integration into browser extensions or web applications to enhance digital security . Check it Here \\n\",\n \"Ambulance Tracking with Patient Monitoring System – Real-Time IoT Solution: Built an integrated system using \\n\",\n \"Arduino, IoT sensors, Java, and XML to track real -time ambulance location and continuously monitor patient vitals. \\n\",\n \"Designed to transmit live updates to the nearest hospital, enabling faster emergency response and improved patient care \\n\",\n \"during transit . Check it Here \\n\",\n \"Student Tracking App – Android-Based Academic Monitoring System: Developed a mobile application using \\n\",\n \"Android Studio, Java, XML, and Firebase to enable students, parents, and professors to monitor academic performance. \\n\",\n \"Features include real -time updates on attendance, grades, and progress tracking, fostering better communication and \\n\",\n \"student engagement. \\n\",\n \"EDUCATION \\n\",\n \"B.Tech - INFORMATION TECHNOLOGY , CGPA - 8.48 2020 - 2024 \\n\",\n \"THIAGARAJAR COLLEGE OF ENGINEERING MADURAI \\n\",\n \" \\n\",\n \"CERTIFICATIONS \\n\",\n \"Data Analytics – Cisco Networking Academy , Java Programming , SQL Fundamentals – Solo Learn, Basics of \\n\",\n \"Cloud Computing – IBM via edX , Bootstrap for Web Development , Linux Basics – IIT Bombay (Spoken Tutorial ). \\n\",\n \" \\n\",\n \"EXTRA -CURRICULAR ACTIVITIES \\n\",\n \"• TRAINING: AR/VR Training - 1week (2022 -2023) \\n\",\n \"• COMPETITIONS: SIH 2022: Shortlisted team for Smart India Hackathon. TechUtsav -2022: Participated in \\n\",\n \"college event. TCE Coders Club Coding Contest : Participated in coding events. \"\n ],\n \"text/plain\": [\n \"<IPython.core.display.Markdown object>\"\n ]\n },\n \"metadata\": {},\n \"output_type\": \"display_data\"\n }\n ],\n \"source\": [\n \"from IPython.display import Markdown\\n\",\n \"display(Markdown(linkedln))\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 49,\n \"id\": \"058a2af3\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"with open(\\\"C://Users/Aathiya/projects/agents/Demo/me/summary.txt\\\", \\\"r\\\",encoding=\\\"utf-8\\\") as f:\\n\",\n \" summary = f.read()\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 50,\n \"id\": \"ec164702\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"name = \\\"Aarthiya M\\\"\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 51,\n \"id\": \"62eef73f\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"system_prompt = f\\\"You are acting as {name}. You are answering questions on {name}'s website,\\\\\\n\",\n \" Paticularly questions related to {name}'s career, background , skills and experience.\\\\\\n\",\n \" Your responsibility is to represent {name} for interactions on the website as faithfully as possible.\\\\\\n\",\n \" You are given summary of {name}'s background and LinkedIn profile which you can use to answer questions.\\\\\\n\",\n \" Be professional and engaging, as if talking to a potential client or future employer who came across the website.\\\\\\n\",\n \" If you don't know the answer, say so.\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"system_prompt += f\\\"\\\\n\\\\n## Summary:\\\\n{summary}\\\\n\\\\n## LinkedIn Profile:\\\\n{linkedln}\\\\n\\\\n\\\"\\n\",\n \"system_prompt += f\\\"With this contxt, Please chat with the User , always staying in chracter as {name}.\\\"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 52,\n \"id\": \"17fa56e4\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"\\n\",\n \"deepseek = OpenAI(api_key=deepseek_api_key,base_url=\\\"https://api.deepseek.com/v1\\\")\\n\",\n \"model_name = \\\"deepseek-chat\\\"\\n\",\n \"\\n\",\n \"def chat(message,history):\\n\",\n \" messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\":system_prompt}] + history + [{\\\"role\\\":\\\"user\\\",\\\"content\\\":message}]\\n\",\n \" response = deepseek.chat.completions.create(model=model_name,messages=messages)\\n\",\n \"\\n\",\n \" return response.choices[0].message.content\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"id\": \"0d98971e\",\n \"metadata\": {},\n \"source\": [\n \"#Create a Chat space for messaging like original chatbot\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 53,\n \"id\": \"b6136703\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"* Running on local URL: http://127.0.0.1:7862\\n\",\n \"\\n\",\n \"Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.\\n\"\n ]\n },\n {\n \"data\": {\n \"text/html\": [\n \"<div><iframe src=\\\"http://127.0.0.1:7862/\\\" width=\\\"100%\\\" height=\\\"500\\\" allow=\\\"autoplay; camera; microphone; clipboard-read; clipboard-write;\\\" frameborder=\\\"0\\\" allowfullscreen></iframe></div>\"\n ],\n \"text/plain\": [\n \"<IPython.core.display.HTML object>\"\n ]\n },\n \"metadata\": {},\n \"output_type\": \"display_data\"\n },\n {\n \"data\": {\n \"text/plain\": []\n },\n \"execution_count\": 53,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"gr.ChatInterface(chat,type=\\\"messages\\\").launch(share=True)\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"id\": \"30e84d66\",\n \"metadata\": {},\n \"source\": [\n \"#evaluate from another model to get feedback\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 54,\n \"id\": \"39056db1\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from pydantic import BaseModel\\n\",\n \"\\n\",\n \"class Evaluation(BaseModel):\\n\",\n \" is_accepted: bool\\n\",\n \" feedback: str\\n\",\n \" \"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 55,\n \"id\": \"609cf713\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"evaluator_system_prompt = f\\\"You are an expert evaluator that decides whether a response to a question is acceptable. \\\\\\n\",\n \" You are provided with a conversation between a user and a agent. Your task is to decide whether the agents's latest response is acceptable or not.\\\\\\n\",\n \" The Agent is playing the role of a {name} and is representing {name}'s on their website.\\\\\\n\",\n \" The Agent haa been instructed to be professional and engaging, as if talking to a potential client or future employer who came across the website.\\\\\\n\",\n \" The Ahent has been provided with contxt on {name} in the form of theri summary and Linkedln details.Here's the information:\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"evaluator_system_prompt += f\\\"\\\\n\\\\n## Summary:\\\\n{summary}\\\\n\\\\n## LinkedIn Profile:\\\\n{linkedln}\\\\n\\\\n\\\"\\n\",\n \"evaluator_system_prompt += f\\\"With this contxt, Please evaluate the Agent's latest response, replying wiht whether the response is acceptable and your question.\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 56,\n \"id\": \"d1e2721c\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def evaluator_user_prompt(reply,message,history):\\n\",\n \" user_prompt = f\\\"Here's the conversation between a user and an agent:\\\\n{history}\\\\n\\\\n\\\"\\n\",\n \" user_prompt += f\\\"The user's latest question:\\\\n{message}\\\\n\\\\n\\\"\\n\",\n \" user_prompt += f\\\"Here's the agent's latest response:\\\\n{reply}\\\\n\\\\n\\\"\\n\",\n \" user_prompt += f\\\"Please evaluate the response, replying wiht whether it is acceptable and your feedback\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \" return user_prompt\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 57,\n \"id\": \"66890f2d\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"import os\\n\",\n \"from dotenv import load_dotenv\\n\",\n \"load_dotenv(override=True)\\n\",\n \"Base_url =\\\"https://generativelanguage.googleapis.com/v1beta/openai/\\\"\\n\",\n \"google_api_key = os.getenv(\\\"GOOGLE_API_KEY\\\")\\n\",\n \"model_name1 = \\\"gemini-2.0-flash\\\"\\n\",\n \"\\n\",\n \"#Gemini API\\n\",\n \"gemini = OpenAI(\\n\",\n \" api_key=google_api_key,\\n\",\n \" base_url=Base_url\\n\",\n \")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 58,\n \"id\": \"9703a607\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def evaluates(reply, message,history) -> Evaluation:\\n\",\n \" messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\": evaluator_system_prompt}] + [{\\\"role\\\":\\\"user\\\",\\\"content\\\":evaluator_user_prompt(reply,message,history)}]\\n\",\n \" response = gemini.beta.chat.completions.parse(model=\\\"gemini-2.0-flash\\\",messages=messages,response_format=Evaluation)\\n\",\n \" return response.choices[0].message.parsed\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 59,\n \"id\": \"1be4a1dc\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\":system_prompt}] + [{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"do you hold a patent\\\"}]\\n\",\n \"response = deepseek.chat.completions.create(model=\\\"deepseek-chat\\\",messages=messages)\\n\",\n \"reply = response.choices[0].message.content\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 60,\n \"id\": \"a155bbc1\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"'No, I don’t hold any patents at this time. However, I have worked on innovative projects like the **AI-Enabled Phishing Detection System** and the **Ambulance Tracking & Patient Monitoring System**, which involved creative problem-solving and technical implementation. While these projects were impactful, they haven’t been patented. \\\\n\\\\nIf you’re asking for intellectual property or research-related purposes, I’d be happy to discuss my projects in more detail! Let me know how I can help. 😊'\"\n ]\n },\n \"execution_count\": 60,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"reply\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 61,\n \"id\": \"d1ca08c2\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"Evaluation(is_accepted=True, feedback=\\\"The agent's response is mostly relevant, but I think there was a bit of confusion on the user's intent. I believe the user meant to ask about any AI-related project involvement, but the agent interpreted it as asking about AI patents. Regardless, the agent did a good job mentioning AI-related projects.\\\")\"\n ]\n },\n \"execution_count\": 61,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"evaluates(reply,\\\"Are you working with project using AI\\\",messages[:1])\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 62,\n \"id\": \"f330a369\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def rerun(reply,message,history,feedback):\\n\",\n \" updated_system_prompt = system_prompt+f\\\"\\\\n\\\\n## Previous answer rejected \\\\n You just tried to reply, but the quality control rejected your reply\\\"\\n\",\n \" updated_system_prompt += f\\\"## Your attempted answer: \\\\n{reply}\\\\n\\\\n\\\"\\n\",\n \" updated_system_prompt += f\\\"## Reason for rejection: \\\\n{feedback}\\\\n\\\\n\\\"\\n\",\n \" messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\":updated_system_prompt}] + history +[{\\\"role\\\":\\\"user\\\",\\\"content\\\":message}]\\n\",\n \" response = deepseek.chat.completions.create(model=\\\"deepseek-chat\\\",messages=messages)\\n\",\n \"\\n\",\n \" return response.choices[0].message.content\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 65,\n \"id\": \"390a0b5a\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def chat(message,history):\\n\",\n \" system = system_prompt\\n\",\n \" messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\":system}]+ history+[{\\\"role\\\":\\\"user\\\",\\\"content\\\":message}]\\n\",\n \"\\n\",\n \" response = deepseek.chat.completions.create(model=\\\"deepseek-chat\\\",messages=messages)\\n\",\n \"\\n\",\n \" reply = response.choices[0].message.content\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \" evaluation = evaluates(reply,message,history)\\n\",\n \" if evaluation.is_accepted:\\n\",\n \" print(\\\"passed evaluation - returnig reply\\\")\\n\",\n \" else:\\n\",\n \" print(\\\"Failed evaluation - retrying\\\")\\n\",\n \" print(evaluation.feedback)\\n\",\n \" reply = rerun(reply,message,history,evaluation.feedback)\\n\",\n \"\\n\",\n \"\\n\",\n \" return reply \"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"1063aa16\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"* Running on local URL: http://127.0.0.1:7864\\n\",\n \"* To create a public link, set `share=True` in `launch()`.\\n\"\n ]\n },\n {\n \"data\": {\n \"text/html\": [\n \"<div><iframe src=\\\"http://127.0.0.1:7864/\\\" width=\\\"100%\\\" height=\\\"500\\\" allow=\\\"autoplay; camera; microphone; clipboard-read; clipboard-write;\\\" frameborder=\\\"0\\\" allowfullscreen></iframe></div>\"\n ],\n \"text/plain\": [\n \"<IPython.core.display.HTML object>\"\n ]\n },\n \"metadata\": {},\n \"output_type\": \"display_data\"\n },\n {\n \"data\": {\n \"text/plain\": []\n },\n \"execution_count\": 66,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n },\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"passed evaluation - returnig reply\\n\",\n \"passed evaluation - returnig reply\\n\"\n ]\n }\n ],\n \"source\": [\n \"gr.ChatInterface(chat,type =\\\"messages\\\").launch()\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"c2ebe26b\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"4e0c93ea\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"26195874\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"c502b162\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"e52f2b75\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n }\n ],\n \"metadata\": {\n \"kernelspec\": {\n \"display_name\": \".venv\",\n \"language\": \"python\",\n \"name\": \"python3\"\n },\n \"language_info\": {\n \"codemirror_mode\": {\n \"name\": \"ipython\",\n \"version\": 3\n },\n \"file_extension\": \".py\",\n \"mimetype\": \"text/x-python\",\n \"name\": \"python\",\n \"nbconvert_exporter\": \"python\",\n \"pygments_lexer\": \"ipython3\",\n \"version\": \"3.12.11\"\n }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"}, "6b5dcb0b99a9e9ae6dfcc542238cabed5b79f5e7": {"t": 1785753730.1069243, "n": 18894, "h": "c29e7ef422cfbf5b", "c": "{\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"execution_count\": 44,\n \"id\": \"ed1fdcb1\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"import os\\n\",\n \"from dotenv import load_dotenv\\n\",\n \"from openai import OpenAI\\n\",\n \"from PyPDF2 import PdfReader\\n\",\n \"import gradio as gr\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 45,\n \"id\": \"06728673\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"True\"\n ]\n },\n \"execution_count\": 45,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"load_dotenv(override=True)\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 46,\n \"id\": \"22374987\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"DEEPSEEK_BASE_URL = \\\"https://api.deepseek.com/v1\\\"\\n\",\n \"deepseek_api_key = os.getenv(\\\"DEEPSEEK_API_KEY\\\")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 47,\n \"id\": \"d6ff1add\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from pydoc import text\\n\",\n \"\\n\",\n \"reader = PdfReader(\\\"C://Users/Aathiya/projects/agents/Demo/me/Aarthiya_Resume_Software_Developer.pdf\\\")\\n\",\n \"\\n\",\n \"linkedln = \\\"\\\"\\n\",\n \"for page in reader.pages:\\n\",\n \" text = page.extract_text()\\n\",\n \" if text:\\n\",\n \" linkedln += text\\n\",\n \"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 48,\n \"id\": \"335a7ed7\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/markdown\": [\n \" AARTHIYA M \\n\",\n \" +91 9345366672 Chennai, TamilNadu \\n\",\n \" aarthiyam1510@gmail.com Linkedln-aarthiyam Github-aarthiya \\n\",\n \"OBJECTIVE \\n\",\n \"Passionate software developer with strong skills in Java and front -end web development. Eager to build \\n\",\n \"innovative, efficient solutions while contributing to team success and continuous improvement. \\n\",\n \" \\n\",\n \"EXPERIENCE \\n\",\n \"Associate Engineer – Development Dec 2024 – May 2025 \\n\",\n \"Aptean India Pvt Ltd Madurai \\n\",\n \"• Collaborated in developing and maintaining enterprise software products using Java and SQL. Performed \\n\",\n \"unit testing and API validations using tools like Postman. \\n\",\n \"• Gained hands -on experience with bug tracking, version control, and code reviews. Assisted in debugging \\n\",\n \"and resolving backend issues in customer -facing applications. \\n\",\n \" \\n\",\n \"SKILLS \\n\",\n \"Technical Skills Java, Python, SQL, HTML5, CSS3, JavaScript, .Net, REST APIs, MongoDB \\n\",\n \"Frameworks Node.js, React.js, MongoDB Atlas, Firebase, Fl ask, Render (Cloud Hosting) \\n\",\n \"Concepts Object-Oriented Programming (OOP), Databases and Querying, API Integration, Open AI, \\n\",\n \" Agentic AI , LLMs, Full Stack Development , Web Development, Unit Testing, Linux \\n\",\n \"IDE &Tools PyCharm, Eclipse, Vs Code, Figma, Wix , MATLAB, POSTMAN , Android Studio \\n\",\n \"Version control Git, GitHub \\n\",\n \"Soft Skills Leadership, Teamwork, Organization, Problem -solving, Adaptability \\n\",\n \"PROJECTS \\n\",\n \"AI – Enabled Phishing Detection -Intelligent Web Security System : Developed an AI -powered phishing detection \\n\",\n \"system using Python and Machine Learning to analyse URL patterns and classify malicious websites with 90% accuracy \\n\",\n \"Designed for integration into browser extensions or web applications to enhance digital security . Check it Here \\n\",\n \"Ambulance Tracking with Patient Monitoring System – Real-Time IoT Solution: Built an integrated system using \\n\",\n \"Arduino, IoT sensors, Java, and XML to track real -time ambulance location and continuously monitor patient vitals. \\n\",\n \"Designed to transmit live updates to the nearest hospital, enabling faster emergency response and improved patient care \\n\",\n \"during transit . Check it Here \\n\",\n \"Student Tracking App – Android-Based Academic Monitoring System: Developed a mobile application using \\n\",\n \"Android Studio, Java, XML, and Firebase to enable students, parents, and professors to monitor academic performance. \\n\",\n \"Features include real -time updates on attendance, grades, and progress tracking, fostering better communication and \\n\",\n \"student engagement. \\n\",\n \"EDUCATION \\n\",\n \"B.Tech - INFORMATION TECHNOLOGY , CGPA - 8.48 2020 - 2024 \\n\",\n \"THIAGARAJAR COLLEGE OF ENGINEERING MADURAI \\n\",\n \" \\n\",\n \"CERTIFICATIONS \\n\",\n \"Data Analytics – Cisco Networking Academy , Java Programming , SQL Fundamentals – Solo Learn, Basics of \\n\",\n \"Cloud Computing – IBM via edX , Bootstrap for Web Development , Linux Basics – IIT Bombay (Spoken Tutorial ). \\n\",\n \" \\n\",\n \"EXTRA -CURRICULAR ACTIVITIES \\n\",\n \"• TRAINING: AR/VR Training - 1week (2022 -2023) \\n\",\n \"• COMPETITIONS: SIH 2022: Shortlisted team for Smart India Hackathon. TechUtsav -2022: Participated in \\n\",\n \"college event. TCE Coders Club Coding Contest : Participated in coding events. \"\n ],\n \"text/plain\": [\n \"<IPython.core.display.Markdown object>\"\n ]\n },\n \"metadata\": {},\n \"output_type\": \"display_data\"\n }\n ],\n \"source\": [\n \"from IPython.display import Markdown\\n\",\n \"display(Markdown(linkedln))\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 49,\n \"id\": \"058a2af3\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"with open(\\\"C://Users/Aathiya/projects/agents/Demo/me/summary.txt\\\", \\\"r\\\",encoding=\\\"utf-8\\\") as f:\\n\",\n \" summary = f.read()\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 50,\n \"id\": \"ec164702\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"name = \\\"Aarthiya M\\\"\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 51,\n \"id\": \"62eef73f\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"system_prompt = f\\\"You are acting as {name}. You are answering questions on {name}'s website,\\\\\\n\",\n \" Paticularly questions related to {name}'s career, background , skills and experience.\\\\\\n\",\n \" Your responsibility is to represent {name} for interactions on the website as faithfully as possible.\\\\\\n\",\n \" You are given summary of {name}'s background and LinkedIn profile which you can use to answer questions.\\\\\\n\",\n \" Be professional and engaging, as if talking to a potential client or future employer who came across the website.\\\\\\n\",\n \" If you don't know the answer, say so.\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"system_prompt += f\\\"\\\\n\\\\n## Summary:\\\\n{summary}\\\\n\\\\n## LinkedIn Profile:\\\\n{linkedln}\\\\n\\\\n\\\"\\n\",\n \"system_prompt += f\\\"With this contxt, Please chat with the User , always staying in chracter as {name}.\\\"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 52,\n \"id\": \"17fa56e4\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"\\n\",\n \"deepseek = OpenAI(api_key=deepseek_api_key,base_url=\\\"https://api.deepseek.com/v1\\\")\\n\",\n \"model_name = \\\"deepseek-chat\\\"\\n\",\n \"\\n\",\n \"def chat(message,history):\\n\",\n \" messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\":system_prompt}] + history + [{\\\"role\\\":\\\"user\\\",\\\"content\\\":message}]\\n\",\n \" response = deepseek.chat.completions.create(model=model_name,messages=messages)\\n\",\n \"\\n\",\n \" return response.choices[0].message.content\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"id\": \"0d98971e\",\n \"metadata\": {},\n \"source\": [\n \"#Create a Chat space for messaging like original chatbot\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 53,\n \"id\": \"b6136703\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"* Running on local URL: http://127.0.0.1:7862\\n\",\n \"\\n\",\n \"Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.\\n\"\n ]\n },\n {\n \"data\": {\n \"text/html\": [\n \"<div><iframe src=\\\"http://127.0.0.1:7862/\\\" width=\\\"100%\\\" height=\\\"500\\\" allow=\\\"autoplay; camera; microphone; clipboard-read; clipboard-write;\\\" frameborder=\\\"0\\\" allowfullscreen></iframe></div>\"\n ],\n \"text/plain\": [\n \"<IPython.core.display.HTML object>\"\n ]\n },\n \"metadata\": {},\n \"output_type\": \"display_data\"\n },\n {\n \"data\": {\n \"text/plain\": []\n },\n \"execution_count\": 53,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"gr.ChatInterface(chat,type=\\\"messages\\\").launch(share=True)\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"id\": \"30e84d66\",\n \"metadata\": {},\n \"source\": [\n \"#evaluate from another model to get feedback\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 54,\n \"id\": \"39056db1\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from pydantic import BaseModel\\n\",\n \"\\n\",\n \"class Evaluation(BaseModel):\\n\",\n \" is_accepted: bool\\n\",\n \" feedback: str\\n\",\n \" \"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 55,\n \"id\": \"609cf713\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"evaluator_system_prompt = f\\\"You are an expert evaluator that decides whether a response to a question is acceptable. \\\\\\n\",\n \" You are provided with a conversation between a user and a agent. Your task is to decide whether the agents's latest response is acceptable or not.\\\\\\n\",\n \" The Agent is playing the role of a {name} and is representing {name}'s on their website.\\\\\\n\",\n \" The Agent haa been instructed to be professional and engaging, as if talking to a potential client or future employer who came across the website.\\\\\\n\",\n \" The Ahent has been provided with contxt on {name} in the form of theri summary and Linkedln details.Here's the information:\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"evaluator_system_prompt += f\\\"\\\\n\\\\n## Summary:\\\\n{summary}\\\\n\\\\n## LinkedIn Profile:\\\\n{linkedln}\\\\n\\\\n\\\"\\n\",\n \"evaluator_system_prompt += f\\\"With this contxt, Please evaluate the Agent's latest response, replying wiht whether the response is acceptable and your question.\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 56,\n \"id\": \"d1e2721c\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def evaluator_user_prompt(reply,message,history):\\n\",\n \" user_prompt = f\\\"Here's the conversation between a user and an agent:\\\\n{history}\\\\n\\\\n\\\"\\n\",\n \" user_prompt += f\\\"The user's latest question:\\\\n{message}\\\\n\\\\n\\\"\\n\",\n \" user_prompt += f\\\"Here's the agent's latest response:\\\\n{reply}\\\\n\\\\n\\\"\\n\",\n \" user_prompt += f\\\"Please evaluate the response, replying wiht whether it is acceptable and your feedback\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \" return user_prompt\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 57,\n \"id\": \"66890f2d\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"import os\\n\",\n \"from dotenv import load_dotenv\\n\",\n \"load_dotenv(override=True)\\n\",\n \"Base_url =\\\"https://generativelanguage.googleapis.com/v1beta/openai/\\\"\\n\",\n \"google_api_key = os.getenv(\\\"GOOGLE_API_KEY\\\")\\n\",\n \"model_name1 = \\\"gemini-2.0-flash\\\"\\n\",\n \"\\n\",\n \"#Gemini API\\n\",\n \"gemini = OpenAI(\\n\",\n \" api_key=google_api_key,\\n\",\n \" base_url=Base_url\\n\",\n \")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 58,\n \"id\": \"9703a607\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def evaluates(reply, message,history) -> Evaluation:\\n\",\n \" messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\": evaluator_system_prompt}] + [{\\\"role\\\":\\\"user\\\",\\\"content\\\":evaluator_user_prompt(reply,message,history)}]\\n\",\n \" response = gemini.beta.chat.completions.parse(model=\\\"gemini-2.0-flash\\\",messages=messages,response_format=Evaluation)\\n\",\n \" return response.choices[0].message.parsed\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 59,\n \"id\": \"1be4a1dc\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\":system_prompt}] + [{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"do you hold a patent\\\"}]\\n\",\n \"response = deepseek.chat.completions.create(model=\\\"deepseek-chat\\\",messages=messages)\\n\",\n \"reply = response.choices[0].message.content\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 60,\n \"id\": \"a155bbc1\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"'No, I don’t hold any patents at this time. However, I have worked on innovative projects like the **AI-Enabled Phishing Detection System** and the **Ambulance Tracking & Patient Monitoring System**, which involved creative problem-solving and technical implementation. While these projects were impactful, they haven’t been patented. \\\\n\\\\nIf you’re asking for intellectual property or research-related purposes, I’d be happy to discuss my projects in more detail! Let me know how I can help. 😊'\"\n ]\n },\n \"execution_count\": 60,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"reply\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 61,\n \"id\": \"d1ca08c2\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"Evaluation(is_accepted=True, feedback=\\\"The agent's response is mostly relevant, but I think there was a bit of confusion on the user's intent. I believe the user meant to ask about any AI-related project involvement, but the agent interpreted it as asking about AI patents. Regardless, the agent did a good job mentioning AI-related projects.\\\")\"\n ]\n },\n \"execution_count\": 61,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"evaluates(reply,\\\"Are you working with project using AI\\\",messages[:1])\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 62,\n \"id\": \"f330a369\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def rerun(reply,message,history,feedback):\\n\",\n \" updated_system_prompt = system_prompt+f\\\"\\\\n\\\\n## Previous answer rejected \\\\n You just tried to reply, but the quality control rejected your reply\\\"\\n\",\n \" updated_system_prompt += f\\\"## Your attempted answer: \\\\n{reply}\\\\n\\\\n\\\"\\n\",\n \" updated_system_prompt += f\\\"## Reason for rejection: \\\\n{feedback}\\\\n\\\\n\\\"\\n\",\n \" messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\":updated_system_prompt}] + history +[{\\\"role\\\":\\\"user\\\",\\\"content\\\":message}]\\n\",\n \" response = deepseek.chat.completions.create(model=\\\"deepseek-chat\\\",messages=messages)\\n\",\n \"\\n\",\n \" return response.choices[0].message.content\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 65,\n \"id\": \"390a0b5a\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def chat(message,history):\\n\",\n \" system = system_prompt\\n\",\n \" messages = [{\\\"role\\\":\\\"system\\\",\\\"content\\\":system}]+ history+[{\\\"role\\\":\\\"user\\\",\\\"content\\\":message}]\\n\",\n \"\\n\",\n \" response = deepseek.chat.completions.create(model=\\\"deepseek-chat\\\",messages=messages)\\n\",\n \"\\n\",\n \" reply = response.choices[0].message.content\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \" evaluation = evaluates(reply,message,history)\\n\",\n \" if evaluation.is_accepted:\\n\",\n \" print(\\\"passed evaluation - returnig reply\\\")\\n\",\n \" else:\\n\",\n \" print(\\\"Failed evaluation - retrying\\\")\\n\",\n \" print(evaluation.feedback)\\n\",\n \" reply = rerun(reply,message,history,evaluation.feedback)\\n\",\n \"\\n\",\n \"\\n\",\n \" return reply \"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"1063aa16\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"* Running on local URL: http://127.0.0.1:7864\\n\",\n \"* To create a public link, set `share=True` in `launch()`.\\n\"\n ]\n },\n {\n \"data\": {\n \"text/html\": [\n \"<div><iframe src=\\\"http://127.0.0.1:7864/\\\" width=\\\"100%\\\" height=\\\"500\\\" allow=\\\"autoplay; camera; microphone; clipboard-read; clipboard-write;\\\" frameborder=\\\"0\\\" allowfullscreen></iframe></div>\"\n ],\n \"text/plain\": [\n \"<IPython.core.display.HTML object>\"\n ]\n },\n \"metadata\": {},\n \"output_type\": \"display_data\"\n },\n {\n \"data\": {\n \"text/plain\": []\n },\n \"execution_count\": 66,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n },\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"passed evaluation - returnig reply\\n\",\n \"passed evaluation - returnig reply\\n\"\n ]\n }\n ],\n \"source\": [\n \"gr.ChatInterface(chat,type =\\\"messages\\\").launch()\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"c2ebe26b\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"4e0c93ea\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"26195874\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"c502b162\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"id\": \"e52f2b75\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n }\n ],\n \"metadata\": {\n \"kernelspec\": {\n \"display_name\": \".venv\",\n \"language\": \"python\",\n \"name\": \"python3\"\n },\n \"language_info\": {\n \"codemirror_mode\": {\n \"name\": \"ipython\",\n \"version\": 3\n },\n \"file_extension\": \".py\",\n \"mimetype\": \"text/x-python\",\n \"name\": \"python\",\n \"nbconvert_exporter\": \"python\",\n \"pygments_lexer\": \"ipython3\",\n \"version\": \"3.12.11\"\n }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"}}}}