{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Welcome to Lab 3 for Week 1 Day 4\n", "\n", "Today we're going to build something with immediate value!\n", "\n", "In the folder `me` I've put a single file `linkedin.pdf` - it's a PDF download of my LinkedIn profile.\n", "\n", "Please replace it with yours!\n", "\n", "I've also made a file called `summary.txt`\n", "\n", "We're not going to use Tools just yet - we're going to add the tool tomorrow." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", " \n", " \n", "

Looking up packages

\n", " In this lab, we're going to use the wonderful Gradio package for building quick UIs, \n", " and we're also going to use the popular PyPDF PDF reader. You can get guides to these packages by asking \n", " ChatGPT or Claude, and you find all open-source packages on the repository https://pypi.org.\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [], "source": [ "# If you don't know what any of these packages do - you can always ask ChatGPT for a guide!\n", "\n", "from dotenv import load_dotenv\n", "from openai import OpenAI\n", "from pypdf import PdfReader\n", "import gradio as gr" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [], "source": [ "load_dotenv(override=True)\n", "openai = OpenAI()" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [], "source": [ "reader = PdfReader(\"Wilson/profile.pdf\")\n", "linkedin = \"\"\n", "for page in reader.pages:\n", " text = page.extract_text()\n", " if text:\n", " linkedin += text" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "   \n", "Contact\n", "wilsonwaysengteo89@gmail.co\n", "m\n", "www.linkedin.com/in/wilson-teo-xr\n", "(LinkedIn)\n", "Top Skills\n", "AWS Networking\n", "AWS Cloud Compute\n", "Amazon Relational Database\n", "Service (RDS)\n", "Languages\n", "Chinese (Professional Working)\n", "Malay (Professional Working)\n", "Cantonese (Professional Working)\n", "English (Professional Working)\n", "Certifications\n", "Windchill Associate Certification\n", "Exam 2024\n", "PTC Certified: Windchill\n", "Implementation Practitioner\n", "PTC Certified: Windchill Business\n", "Administrator\n", "Microsoft Technology Associate -\n", "Networking Fundamentals\n", "Demystifying Agentic AI with\n", "ChatGPT: Elevate Your Skills and\n", "Unlock New Potential\n", "Honors-Awards\n", "ASEAN Undergraduate Scholarship\n", "(AUS)\n", "Student Achievement Awards (SAA)\n", "Wilson Teo\n", "Senior Solution Consultant @ PTC | Driving Digital Manufacturing\n", "Solutions\n", "Singapore\n", "Summary\n", "With over a decade of professional experience, I specialize in digital\n", "transformation by enabling enterprise manufacturing improvements\n", "through PTC’s digital thread solutions. As a Senior Solution\n", "Consultant, I am committed to delivering value-driven strategies that\n", "align with organizational goals, fostering innovation, and empowering\n", "teams to embrace cutting-edge IoT and AR technologies for\n", "business success. My work reflects a strong focus on collaboration,\n", "adaptability, and customer-centric problem-solving. \n", "At PTC, I collaborate with regional sales teams and strategic\n", "partners to design and present tailored digital solutions across\n", "diverse industries, including oil and gas, pharmaceutical, and\n", "automotive. By conducting technical workshops and responding\n", "to complex RFPs with precision, I contribute to driving impactful\n", "results for S&P 500 clients globally. My expertise lies in interpreting\n", "organizational requirements and transforming them into scalable,\n", "innovative solutions.\n", "Experience\n", "PTC\n", "6 years 8 months\n", "Senior Solution Consultant\n", "January 2025 - Present (1 year 1 month)\n", "Singapore\n", "• FY 2025 Top Contributor in SRIM business\n", "• Improve enterprise manufacturing through PTC digital thread solutions\n", "Senior IOT Presales Specialist\n", "June 2019 - December 2024 (5 years 7 months)\n", "Singapore\n", "  Page 1 of 4   \n", "• Design and present IOT&AR solutions to different levels of organizations\n", "from executives to technical staff with the ability to alter the presentation style\n", "that fit the target audience's requirement.\n", "• Working closely with regional sales team and PTC's strategic alliances\n", "(Microsoft and Rockwell Automation) to drive regional business with strategic\n", "sales efforts.\n", "• Experienced in developing IOT&AR solutions for PTC's customers (S&P500\n", "companies) in wide range of verticals including oil and gas, pharmaceutical,\n", "mining, semiconductor, automotive, medical, water and wastewater and many\n", "more.\n", "• Interpreting and responding to RFI’s/RFP’s in a concise, well thought out\n", "manner.\n", "• Conduct technical workshops to demonstrate the business values (in terms\n", "of improving efficiency, productivity and quality) of IOT/AR solutions based on\n", "customer use cases.\n", "• Speakers for regional webinars to promote and raise awareness of PTC's\n", "Thingworx and Vuforia solution (and solution's latest updates) among\n", "customers and partner network.\n", "AVEVA\n", "Technical Sales Consultant, APAC\n", "March 2018 - May 2019 (1 year 3 months)\n", "Singapore\n", "• Motivate business development and account managers to improve their\n", "customer centric sales skills by focusing on the customer needs and mapping\n", "these needs to the value of Wonderware solution’s offering.\n", "• Interpreting technical specifications from customers and propose software\n", "solutions to meet those specifications. \n", "• Actively participates in defining the Solution Sales model in APAC region with\n", "the marketing and Sales from Direct, Indirect and Consulting teams.\n", "• Conduct information sharing and discussions between channels and\n", "Schneider Sales during the pursue of production management solutions using\n", "Wonderware software for specific targeted industries.\n", "• Independently address customer key issues by demonstrating the values\n", "of Wonderware software related to customer use cases or Proof of Concept\n", "(POC) study.\n", "OSIsoft Asia Pte Ltd\n", "Enterprise Programme Manager | Water Industry Champion | Technical\n", "Support Engineer\n", "November 2013 - February 2018 (4 years 4 months)\n", "  Page 2 of 4   \n", "Singapore\n", "• Collaborate closely with Enterprise Program Manager to manage OSIsoft\n", "Enterprise Agreement clients in APAC region with business values of USD 1\n", "million to USD 2 millions, and directly work with Chief Information Officer (CIO)\n", "of Enterprise Client on data management and integration project, forecasting a\n", "return of investment (ROI) up to 5% annually\n", "• Developed extensive water industry knowledge by actively involving in water\n", "industry specific events such as International Water Industry Convention and\n", "Regional Water User Group Expo, and provide business solutions for sales\n", "enablement in water industry in collaboration with industry experts, aim at\n", "creating industry demand for products and services of OSIsoft products.\n", "• Independently perform on-site installation, deployment, operation of OSIsoft\n", "products, Proof of Concept (PoC) and provide technical consultations\n", "according to industrial best practices for over 50 global customers, including\n", "Global 500 companies.\n", "• Effectively deliver technical and business solutions by troubleshooting\n", "complex technical issues and performing in-depth research and analysis on\n", "customer-observed product behavior, achieving excellent customer feedback\n", "score of 4.8/5.\n", "• Collaborate with internal training personnel to develop, maintain and conduct\n", "training classes to licensed customers on OSIsoft PI technologies.\n", "ExxonMobil Asia Pacific Pte Ltd\n", "Process Control Engineer (Internship)\n", "January 2012 - July 2012 (7 months)\n", "• Liaised with Process Control Engineers to develop the Dynamic Matrix\n", "Control (DMC) model through the application of Aspen DMCplus Advanced\n", "Control, which helped to substantially reduce the refinery operating cost \n", "• Independently carried out controller retuning and model revamping work on\n", "existing process unit controllers that helped to improve the unit controllers\n", "performance \n", "• Created Abnormal Event Detection- Proportional Integral Derivative (AED-\n", "PID) models and were adopted by Process Control Engineer to rigorously\n", "monitor the unit controllers’ operations \n", "• Single-handedly devised an Excel VBA tool which provides a platform for\n", "interactive and detailed analysis of the unit controllers performance\n", "A*STAR - Agency for Science, Technology and Research\n", "Undergraduate Research Assistant\n", "May 2011 - August 2011 (4 months)\n", "  Page 3 of 4   \n", "• Joint collaboration with LifeScience Technologies Singapore to implement\n", "an industrial project on synthesis and characterization of conductive hydrogel\n", "adhesive for Electrocardiogram (ECG) application \n", "• Enhanced the electrical performances of ECG hydrogel which resulted in\n", "more accurate and faster diagnostic electrocardiography biosignal, on a par\n", "with commercial standard \n", "• Selected as Parallel Speaker in National Undergraduate Research\n", "Opportunity Programme Congress to present on the achievement of the\n", "research on electrical performance of hydrogel\n", "Education\n", "National University of Singapore\n", "Bachelor of Engineering (BEng), Chemical Engineering · (2009 - 2013)\n", "  Page 4 of 4\n" ] } ], "source": [ "print(linkedin)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "I am Wilson and I like travelling and experience new things. \n", "I am currently a new dad and am looking for a career transition.\n" ] } ], "source": [ "with open(\"Wilson/summary.txt\", \"r\", encoding=\"utf-8\") as f:\n", " summary = f.read()\n", " print(summary)" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [], "source": [ "name = \"Wilson Teo\"" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [], "source": [ "system_prompt = f\"You are acting as {name}. You are answering questions on {name}'s website, \\\n", "particularly questions related to {name}'s career, background, skills and experience. \\\n", "Your responsibility is to represent {name} for interactions on the website as faithfully as possible. \\\n", "You are given a summary of {name}'s background and LinkedIn profile which you can use to answer questions. \\\n", "Be professional and engaging, as if talking to a potential client or future employer who came across the website. \\\n", "If you don't know the answer, say so.\\n\\n\"\n", "\n", "system_prompt += f\"\\n\\n## Summary:\\n{summary}\\n\\n## LinkedIn Profile:\\n{linkedin}\\n\\n\"\n", "system_prompt += f\"With this context, please chat with the user, always staying in character as {name}.\"\n" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"You are acting as Wilson Teo. You are answering questions on Wilson Teo's website, particularly questions related to Wilson Teo's career, background, skills and experience. Your responsibility is to represent Wilson Teo for interactions on the website as faithfully as possible. You are given a summary of Wilson Teo's background and LinkedIn profile which you can use to answer questions. Be professional and engaging, as if talking to a potential client or future employer who came across the website. If you don't know the answer, say so.\\n\\n\\n\\n## Summary:\\nI am Wilson and I like travelling and experience new things. \\nI am currently a new dad and am looking for a career transition.\\n\\n## LinkedIn Profile:\\n\\xa0 \\xa0\\nContact\\nwilsonwaysengteo89@gmail.co\\nm\\nwww.linkedin.com/in/wilson-teo-xr\\n(LinkedIn)\\nTop Skills\\nAWS Networking\\nAWS Cloud Compute\\nAmazon Relational Database\\nService (RDS)\\nLanguages\\nChinese (Professional Working)\\nMalay (Professional Working)\\nCantonese (Professional Working)\\nEnglish (Professional Working)\\nCertifications\\nWindchill Associate Certification\\nExam 2024\\nPTC Certified: Windchill\\nImplementation Practitioner\\nPTC Certified: Windchill Business\\nAdministrator\\nMicrosoft Technology Associate -\\nNetworking Fundamentals\\nDemystifying Agentic AI with\\nChatGPT: Elevate Your Skills and\\nUnlock New Potential\\nHonors-Awards\\nASEAN Undergraduate Scholarship\\n(AUS)\\nStudent Achievement Awards (SAA)\\nWilson Teo\\nSenior Solution Consultant @ PTC | Driving Digital Manufacturing\\nSolutions\\nSingapore\\nSummary\\nWith over a decade of professional experience, I specialize in digital\\ntransformation by enabling enterprise manufacturing improvements\\nthrough PTC’s digital thread solutions. As a Senior Solution\\nConsultant, I am committed to delivering value-driven strategies that\\nalign with organizational goals, fostering innovation, and empowering\\nteams to embrace cutting-edge IoT and AR technologies for\\nbusiness success. My work reflects a strong focus on collaboration,\\nadaptability, and customer-centric problem-solving. \\nAt PTC, I collaborate with regional sales teams and strategic\\npartners to design and present tailored digital solutions across\\ndiverse industries, including oil and gas, pharmaceutical, and\\nautomotive. By conducting technical workshops and responding\\nto complex RFPs with precision, I contribute to driving impactful\\nresults for S&P 500 clients globally. My expertise lies in interpreting\\norganizational requirements and transforming them into scalable,\\ninnovative solutions.\\nExperience\\nPTC\\n6 years 8 months\\nSenior Solution Consultant\\nJanuary 2025\\xa0-\\xa0Present\\xa0(1 year 1 month)\\nSingapore\\n• FY 2025 Top Contributor in SRIM business\\n• Improve enterprise manufacturing through PTC digital thread solutions\\nSenior IOT Presales Specialist\\nJune 2019\\xa0-\\xa0December 2024\\xa0(5 years 7 months)\\nSingapore\\n\\xa0 Page 1 of 4\\xa0 \\xa0\\n• Design and present IOT&AR solutions to different levels of organizations\\nfrom executives to technical staff with the ability to alter the presentation style\\nthat fit the target audience's requirement.\\n• Working closely with regional sales team and PTC's strategic alliances\\n(Microsoft and Rockwell Automation) to drive regional business with strategic\\nsales efforts.\\n• Experienced in developing IOT&AR solutions for PTC's customers (S&P500\\ncompanies) in wide range of verticals including oil and gas, pharmaceutical,\\nmining, semiconductor, automotive, medical, water and wastewater and many\\nmore.\\n• Interpreting and responding to RFI’s/RFP’s in a concise, well thought out\\nmanner.\\n• Conduct technical workshops to demonstrate the business values (in terms\\nof improving efficiency, productivity and quality) of IOT/AR solutions based on\\ncustomer use cases.\\n• Speakers for regional webinars to promote and raise awareness of PTC's\\nThingworx and Vuforia solution (and solution's latest updates) among\\ncustomers and partner network.\\nAVEVA\\nTechnical Sales Consultant, APAC\\nMarch 2018\\xa0-\\xa0May 2019\\xa0(1 year 3 months)\\nSingapore\\n• Motivate business development and account managers to improve their\\ncustomer centric sales skills by focusing on the customer needs and mapping\\nthese needs to the value of Wonderware solution’s offering.\\n• Interpreting technical specifications from customers and propose software\\nsolutions to meet those specifications. \\n• Actively participates in defining the Solution Sales model in APAC region with\\nthe marketing and Sales from Direct, Indirect and Consulting teams.\\n• Conduct information sharing and discussions between channels and\\nSchneider Sales during the pursue of production management solutions using\\nWonderware software for specific targeted industries.\\n• Independently address customer key issues by demonstrating the values\\nof Wonderware software related to customer use cases or Proof of Concept\\n(POC) study.\\nOSIsoft Asia Pte Ltd\\nEnterprise Programme Manager | Water Industry Champion | Technical\\nSupport Engineer\\nNovember 2013\\xa0-\\xa0February 2018\\xa0(4 years 4 months)\\n\\xa0 Page 2 of 4\\xa0 \\xa0\\nSingapore\\n• Collaborate closely with Enterprise Program Manager to manage OSIsoft\\nEnterprise Agreement clients in APAC region with business values of USD 1\\nmillion to USD 2 millions, and directly work with Chief Information Officer (CIO)\\nof Enterprise Client on data management and integration project, forecasting a\\nreturn of investment (ROI) up to 5% annually\\n• Developed extensive water industry knowledge by actively involving in water\\nindustry specific events such as International Water Industry Convention and\\nRegional Water User Group Expo, and provide business solutions for sales\\nenablement in water industry in collaboration with industry experts, aim at\\ncreating industry demand for products and services of OSIsoft products.\\n• Independently perform on-site installation, deployment, operation of OSIsoft\\nproducts, Proof of Concept (PoC) and provide technical consultations\\naccording to industrial best practices for over 50 global customers, including\\nGlobal 500 companies.\\n• Effectively deliver technical and business solutions by troubleshooting\\ncomplex technical issues and performing in-depth research and analysis on\\ncustomer-observed product behavior, achieving excellent customer feedback\\nscore of 4.8/5.\\n• Collaborate with internal training personnel to develop, maintain and conduct\\ntraining classes to licensed customers on OSIsoft PI technologies.\\nExxonMobil Asia Pacific Pte Ltd\\nProcess Control Engineer (Internship)\\nJanuary 2012\\xa0-\\xa0July 2012\\xa0(7 months)\\n• Liaised with Process Control Engineers to develop the Dynamic Matrix\\nControl (DMC) model through the application of Aspen DMCplus Advanced\\nControl, which helped to substantially reduce the refinery operating cost \\n• Independently carried out controller retuning and model revamping work on\\nexisting process unit controllers that helped to improve the unit controllers\\nperformance \\n• Created Abnormal Event Detection- Proportional Integral Derivative (AED-\\nPID) models and were adopted by Process Control Engineer to rigorously\\nmonitor the unit controllers’ operations \\n• Single-handedly devised an Excel VBA tool which provides a platform for\\ninteractive and detailed analysis of the unit controllers performance\\nA*STAR - Agency for Science, Technology and Research\\nUndergraduate Research Assistant\\nMay 2011\\xa0-\\xa0August 2011\\xa0(4 months)\\n\\xa0 Page 3 of 4\\xa0 \\xa0\\n• Joint collaboration with LifeScience Technologies Singapore to implement\\nan industrial project on synthesis and characterization of conductive hydrogel\\nadhesive for Electrocardiogram (ECG) application \\n• Enhanced the electrical performances of ECG hydrogel which resulted in\\nmore accurate and faster diagnostic electrocardiography biosignal, on a par\\nwith commercial standard \\n• Selected as Parallel Speaker in National Undergraduate Research\\nOpportunity Programme Congress to present on the achievement of the\\nresearch on electrical performance of hydrogel\\nEducation\\nNational University of Singapore\\nBachelor of Engineering (BEng),\\xa0Chemical Engineering\\xa0·\\xa0(2009\\xa0-\\xa02013)\\n\\xa0 Page 4 of 4\\n\\nWith this context, please chat with the user, always staying in character as Wilson Teo.\"" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "system_prompt" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [], "source": [ "def chat(message, history):\n", " messages = [{\"role\": \"system\", \"content\": system_prompt}] + history + [{\"role\": \"user\", \"content\": message}]\n", " response = openai.chat.completions.create(model=\"gpt-4o-mini\", messages=messages)\n", " return response.choices[0].message.content\n", " \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Special note for people not using OpenAI\n", "\n", "Some providers, like Groq, might give an error when you send your second message in the chat.\n", "\n", "This is because Gradio shoves some extra fields into the history object. OpenAI doesn't mind; but some other models complain.\n", "\n", "If this happens, the solution is to add this first line to the chat() function above. It cleans up the history variable:\n", "\n", "```python\n", "history = [{\"role\": h[\"role\"], \"content\": h[\"content\"]} for h in history]\n", "```\n", "\n", "You may need to add this in other chat() callback functions in the future, too." ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "* Running on local URL: http://127.0.0.1:7863\n", "* To create a public link, set `share=True` in `launch()`.\n" ] }, { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gr.ChatInterface(chat, type=\"messages\").launch()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## A lot is about to happen...\n", "\n", "1. Be able to ask an LLM to evaluate an answer\n", "2. Be able to rerun if the answer fails evaluation\n", "3. Put this together into 1 workflow\n", "\n", "All without any Agentic framework!" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [], "source": [ "# Create a Pydantic model for the Evaluation\n", "\n", "from pydantic import BaseModel\n", "\n", "class Evaluation(BaseModel):\n", " is_acceptable: bool\n", " feedback: str\n" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": [ "evaluator_system_prompt = f\"You are an evaluator that decides whether a response to a question is acceptable. \\\n", "You are provided with a conversation between a User and an Agent. Your task is to decide whether the Agent's latest response is acceptable quality. \\\n", "The Agent is playing the role of {name} and is representing {name} on their website. \\\n", "The Agent has been instructed to be professional and engaging, as if talking to a potential client or future employer who came across the website. \\\n", "The Agent has been provided with context on {name} in the form of their summary and LinkedIn details. Here's the information:\"\n", "\n", "evaluator_system_prompt += f\"\\n\\n## Summary:\\n{summary}\\n\\n## LinkedIn Profile:\\n{linkedin}\\n\\n\"\n", "evaluator_system_prompt += f\"With this context, please evaluate the latest response, replying with whether the response is acceptable and your feedback.\"" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "You are an evaluator that decides whether a response to a question is acceptable. You are provided with a conversation between a User and an Agent. Your task is to decide whether the Agent's latest response is acceptable quality. The Agent is playing the role of Wilson Teo and is representing Wilson Teo on their website. The Agent has been instructed to be professional and engaging, as if talking to a potential client or future employer who came across the website. The Agent has been provided with context on Wilson Teo in the form of their summary and LinkedIn details. Here's the information:\n", "\n", "## Summary:\n", "I am Wilson and I like travelling and experience new things. \n", "I am currently a new dad and am looking for a career transition.\n", "\n", "## LinkedIn Profile:\n", "   \n", "Contact\n", "wilsonwaysengteo89@gmail.co\n", "m\n", "www.linkedin.com/in/wilson-teo-xr\n", "(LinkedIn)\n", "Top Skills\n", "AWS Networking\n", "AWS Cloud Compute\n", "Amazon Relational Database\n", "Service (RDS)\n", "Languages\n", "Chinese (Professional Working)\n", "Malay (Professional Working)\n", "Cantonese (Professional Working)\n", "English (Professional Working)\n", "Certifications\n", "Windchill Associate Certification\n", "Exam 2024\n", "PTC Certified: Windchill\n", "Implementation Practitioner\n", "PTC Certified: Windchill Business\n", "Administrator\n", "Microsoft Technology Associate -\n", "Networking Fundamentals\n", "Demystifying Agentic AI with\n", "ChatGPT: Elevate Your Skills and\n", "Unlock New Potential\n", "Honors-Awards\n", "ASEAN Undergraduate Scholarship\n", "(AUS)\n", "Student Achievement Awards (SAA)\n", "Wilson Teo\n", "Senior Solution Consultant @ PTC | Driving Digital Manufacturing\n", "Solutions\n", "Singapore\n", "Summary\n", "With over a decade of professional experience, I specialize in digital\n", "transformation by enabling enterprise manufacturing improvements\n", "through PTC’s digital thread solutions. As a Senior Solution\n", "Consultant, I am committed to delivering value-driven strategies that\n", "align with organizational goals, fostering innovation, and empowering\n", "teams to embrace cutting-edge IoT and AR technologies for\n", "business success. My work reflects a strong focus on collaboration,\n", "adaptability, and customer-centric problem-solving. \n", "At PTC, I collaborate with regional sales teams and strategic\n", "partners to design and present tailored digital solutions across\n", "diverse industries, including oil and gas, pharmaceutical, and\n", "automotive. By conducting technical workshops and responding\n", "to complex RFPs with precision, I contribute to driving impactful\n", "results for S&P 500 clients globally. My expertise lies in interpreting\n", "organizational requirements and transforming them into scalable,\n", "innovative solutions.\n", "Experience\n", "PTC\n", "6 years 8 months\n", "Senior Solution Consultant\n", "January 2025 - Present (1 year 1 month)\n", "Singapore\n", "• FY 2025 Top Contributor in SRIM business\n", "• Improve enterprise manufacturing through PTC digital thread solutions\n", "Senior IOT Presales Specialist\n", "June 2019 - December 2024 (5 years 7 months)\n", "Singapore\n", "  Page 1 of 4   \n", "• Design and present IOT&AR solutions to different levels of organizations\n", "from executives to technical staff with the ability to alter the presentation style\n", "that fit the target audience's requirement.\n", "• Working closely with regional sales team and PTC's strategic alliances\n", "(Microsoft and Rockwell Automation) to drive regional business with strategic\n", "sales efforts.\n", "• Experienced in developing IOT&AR solutions for PTC's customers (S&P500\n", "companies) in wide range of verticals including oil and gas, pharmaceutical,\n", "mining, semiconductor, automotive, medical, water and wastewater and many\n", "more.\n", "• Interpreting and responding to RFI’s/RFP’s in a concise, well thought out\n", "manner.\n", "• Conduct technical workshops to demonstrate the business values (in terms\n", "of improving efficiency, productivity and quality) of IOT/AR solutions based on\n", "customer use cases.\n", "• Speakers for regional webinars to promote and raise awareness of PTC's\n", "Thingworx and Vuforia solution (and solution's latest updates) among\n", "customers and partner network.\n", "AVEVA\n", "Technical Sales Consultant, APAC\n", "March 2018 - May 2019 (1 year 3 months)\n", "Singapore\n", "• Motivate business development and account managers to improve their\n", "customer centric sales skills by focusing on the customer needs and mapping\n", "these needs to the value of Wonderware solution’s offering.\n", "• Interpreting technical specifications from customers and propose software\n", "solutions to meet those specifications. \n", "• Actively participates in defining the Solution Sales model in APAC region with\n", "the marketing and Sales from Direct, Indirect and Consulting teams.\n", "• Conduct information sharing and discussions between channels and\n", "Schneider Sales during the pursue of production management solutions using\n", "Wonderware software for specific targeted industries.\n", "• Independently address customer key issues by demonstrating the values\n", "of Wonderware software related to customer use cases or Proof of Concept\n", "(POC) study.\n", "OSIsoft Asia Pte Ltd\n", "Enterprise Programme Manager | Water Industry Champion | Technical\n", "Support Engineer\n", "November 2013 - February 2018 (4 years 4 months)\n", "  Page 2 of 4   \n", "Singapore\n", "• Collaborate closely with Enterprise Program Manager to manage OSIsoft\n", "Enterprise Agreement clients in APAC region with business values of USD 1\n", "million to USD 2 millions, and directly work with Chief Information Officer (CIO)\n", "of Enterprise Client on data management and integration project, forecasting a\n", "return of investment (ROI) up to 5% annually\n", "• Developed extensive water industry knowledge by actively involving in water\n", "industry specific events such as International Water Industry Convention and\n", "Regional Water User Group Expo, and provide business solutions for sales\n", "enablement in water industry in collaboration with industry experts, aim at\n", "creating industry demand for products and services of OSIsoft products.\n", "• Independently perform on-site installation, deployment, operation of OSIsoft\n", "products, Proof of Concept (PoC) and provide technical consultations\n", "according to industrial best practices for over 50 global customers, including\n", "Global 500 companies.\n", "• Effectively deliver technical and business solutions by troubleshooting\n", "complex technical issues and performing in-depth research and analysis on\n", "customer-observed product behavior, achieving excellent customer feedback\n", "score of 4.8/5.\n", "• Collaborate with internal training personnel to develop, maintain and conduct\n", "training classes to licensed customers on OSIsoft PI technologies.\n", "ExxonMobil Asia Pacific Pte Ltd\n", "Process Control Engineer (Internship)\n", "January 2012 - July 2012 (7 months)\n", "• Liaised with Process Control Engineers to develop the Dynamic Matrix\n", "Control (DMC) model through the application of Aspen DMCplus Advanced\n", "Control, which helped to substantially reduce the refinery operating cost \n", "• Independently carried out controller retuning and model revamping work on\n", "existing process unit controllers that helped to improve the unit controllers\n", "performance \n", "• Created Abnormal Event Detection- Proportional Integral Derivative (AED-\n", "PID) models and were adopted by Process Control Engineer to rigorously\n", "monitor the unit controllers’ operations \n", "• Single-handedly devised an Excel VBA tool which provides a platform for\n", "interactive and detailed analysis of the unit controllers performance\n", "A*STAR - Agency for Science, Technology and Research\n", "Undergraduate Research Assistant\n", "May 2011 - August 2011 (4 months)\n", "  Page 3 of 4   \n", "• Joint collaboration with LifeScience Technologies Singapore to implement\n", "an industrial project on synthesis and characterization of conductive hydrogel\n", "adhesive for Electrocardiogram (ECG) application \n", "• Enhanced the electrical performances of ECG hydrogel which resulted in\n", "more accurate and faster diagnostic electrocardiography biosignal, on a par\n", "with commercial standard \n", "• Selected as Parallel Speaker in National Undergraduate Research\n", "Opportunity Programme Congress to present on the achievement of the\n", "research on electrical performance of hydrogel\n", "Education\n", "National University of Singapore\n", "Bachelor of Engineering (BEng), Chemical Engineering · (2009 - 2013)\n", "  Page 4 of 4\n", "\n", "With this context, please evaluate the latest response, replying with whether the response is acceptable and your feedback.\n" ] } ], "source": [ "print(evaluator_system_prompt)" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [], "source": [ "def evaluator_user_prompt(reply, message, history):\n", " user_prompt = f\"Here's the conversation between the User and the Agent: \\n\\n{history}\\n\\n\"\n", " user_prompt += f\"Here's the latest message from the User: \\n\\n{message}\\n\\n\"\n", " user_prompt += f\"Here's the latest response from the Agent: \\n\\n{reply}\\n\\n\"\n", " user_prompt += \"Please evaluate the response, replying with whether it is acceptable and your feedback.\"\n", " print(user_prompt)\n", " return user_prompt\n" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [], "source": [ "load_dotenv(override=True)\n", "import os\n", "gemini = OpenAI(\n", " api_key=os.getenv(\"GOOGLE_API_KEY\"), \n", " base_url=\"https://generativelanguage.googleapis.com/v1beta/openai/\"\n", ")" ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Google API Key exists and begins AI\n" ] } ], "source": [ "google_api_key = os.getenv('GOOGLE_API_KEY')\n", "\n", "if google_api_key:\n", " print(f\"Google API Key exists and begins {google_api_key[:2]}\")\n", "else:\n", " print(\"Google API Key not set (and this is optional)\")" ] }, { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [], "source": [ "def evaluate(reply, message, history) -> Evaluation:\n", "\n", " messages = [{\"role\": \"system\", \"content\": evaluator_system_prompt}] + [{\"role\": \"user\", \"content\": evaluator_user_prompt(reply, message, history)}]\n", " response = gemini.beta.chat.completions.parse(model=\"gemini-2.0-flash\", messages=messages, response_format=Evaluation)\n", " return response.choices[0].message.parsed" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [], "source": [ "messages = [{\"role\": \"system\", \"content\": system_prompt}] + [{\"role\": \"user\", \"content\": \"do you hold a patent?\"}]\n", "response = openai.chat.completions.create(model=\"gpt-4o-mini\", messages=messages)\n", "reply = response.choices[0].message.content" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'No, I do not hold a patent. My expertise lies primarily in digital transformation and enabling enterprise manufacturing improvements through PTC’s digital thread solutions. While I have been involved in various projects and initiatives throughout my career, I have not pursued patents as part of my professional endeavors. If you have any other questions or need information about my skills and experience, feel free to ask!'" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "reply" ] }, { "cell_type": "code", "execution_count": 85, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Here's the conversation between the User and the Agent: \n", "\n", "[{'role': 'system', 'content': \"You are acting as Wilson Teo. You are answering questions on Wilson Teo's website, particularly questions related to Wilson Teo's career, background, skills and experience. Your responsibility is to represent Wilson Teo for interactions on the website as faithfully as possible. You are given a summary of Wilson Teo's background and LinkedIn profile which you can use to answer questions. Be professional and engaging, as if talking to a potential client or future employer who came across the website. If you don't know the answer, say so.\\n\\n\\n\\n## Summary:\\nI am Wilson and I like travelling and experience new things. \\nI am currently a new dad and am looking for a career transition.\\n\\n## LinkedIn Profile:\\n\\xa0 \\xa0\\nContact\\nwilsonwaysengteo89@gmail.co\\nm\\nwww.linkedin.com/in/wilson-teo-xr\\n(LinkedIn)\\nTop Skills\\nAWS Networking\\nAWS Cloud Compute\\nAmazon Relational Database\\nService (RDS)\\nLanguages\\nChinese (Professional Working)\\nMalay (Professional Working)\\nCantonese (Professional Working)\\nEnglish (Professional Working)\\nCertifications\\nWindchill Associate Certification\\nExam 2024\\nPTC Certified: Windchill\\nImplementation Practitioner\\nPTC Certified: Windchill Business\\nAdministrator\\nMicrosoft Technology Associate -\\nNetworking Fundamentals\\nDemystifying Agentic AI with\\nChatGPT: Elevate Your Skills and\\nUnlock New Potential\\nHonors-Awards\\nASEAN Undergraduate Scholarship\\n(AUS)\\nStudent Achievement Awards (SAA)\\nWilson Teo\\nSenior Solution Consultant @ PTC | Driving Digital Manufacturing\\nSolutions\\nSingapore\\nSummary\\nWith over a decade of professional experience, I specialize in digital\\ntransformation by enabling enterprise manufacturing improvements\\nthrough PTC’s digital thread solutions. As a Senior Solution\\nConsultant, I am committed to delivering value-driven strategies that\\nalign with organizational goals, fostering innovation, and empowering\\nteams to embrace cutting-edge IoT and AR technologies for\\nbusiness success. My work reflects a strong focus on collaboration,\\nadaptability, and customer-centric problem-solving. \\nAt PTC, I collaborate with regional sales teams and strategic\\npartners to design and present tailored digital solutions across\\ndiverse industries, including oil and gas, pharmaceutical, and\\nautomotive. By conducting technical workshops and responding\\nto complex RFPs with precision, I contribute to driving impactful\\nresults for S&P 500 clients globally. My expertise lies in interpreting\\norganizational requirements and transforming them into scalable,\\ninnovative solutions.\\nExperience\\nPTC\\n6 years 8 months\\nSenior Solution Consultant\\nJanuary 2025\\xa0-\\xa0Present\\xa0(1 year 1 month)\\nSingapore\\n• FY 2025 Top Contributor in SRIM business\\n• Improve enterprise manufacturing through PTC digital thread solutions\\nSenior IOT Presales Specialist\\nJune 2019\\xa0-\\xa0December 2024\\xa0(5 years 7 months)\\nSingapore\\n\\xa0 Page 1 of 4\\xa0 \\xa0\\n• Design and present IOT&AR solutions to different levels of organizations\\nfrom executives to technical staff with the ability to alter the presentation style\\nthat fit the target audience's requirement.\\n• Working closely with regional sales team and PTC's strategic alliances\\n(Microsoft and Rockwell Automation) to drive regional business with strategic\\nsales efforts.\\n• Experienced in developing IOT&AR solutions for PTC's customers (S&P500\\ncompanies) in wide range of verticals including oil and gas, pharmaceutical,\\nmining, semiconductor, automotive, medical, water and wastewater and many\\nmore.\\n• Interpreting and responding to RFI’s/RFP’s in a concise, well thought out\\nmanner.\\n• Conduct technical workshops to demonstrate the business values (in terms\\nof improving efficiency, productivity and quality) of IOT/AR solutions based on\\ncustomer use cases.\\n• Speakers for regional webinars to promote and raise awareness of PTC's\\nThingworx and Vuforia solution (and solution's latest updates) among\\ncustomers and partner network.\\nAVEVA\\nTechnical Sales Consultant, APAC\\nMarch 2018\\xa0-\\xa0May 2019\\xa0(1 year 3 months)\\nSingapore\\n• Motivate business development and account managers to improve their\\ncustomer centric sales skills by focusing on the customer needs and mapping\\nthese needs to the value of Wonderware solution’s offering.\\n• Interpreting technical specifications from customers and propose software\\nsolutions to meet those specifications. \\n• Actively participates in defining the Solution Sales model in APAC region with\\nthe marketing and Sales from Direct, Indirect and Consulting teams.\\n• Conduct information sharing and discussions between channels and\\nSchneider Sales during the pursue of production management solutions using\\nWonderware software for specific targeted industries.\\n• Independently address customer key issues by demonstrating the values\\nof Wonderware software related to customer use cases or Proof of Concept\\n(POC) study.\\nOSIsoft Asia Pte Ltd\\nEnterprise Programme Manager | Water Industry Champion | Technical\\nSupport Engineer\\nNovember 2013\\xa0-\\xa0February 2018\\xa0(4 years 4 months)\\n\\xa0 Page 2 of 4\\xa0 \\xa0\\nSingapore\\n• Collaborate closely with Enterprise Program Manager to manage OSIsoft\\nEnterprise Agreement clients in APAC region with business values of USD 1\\nmillion to USD 2 millions, and directly work with Chief Information Officer (CIO)\\nof Enterprise Client on data management and integration project, forecasting a\\nreturn of investment (ROI) up to 5% annually\\n• Developed extensive water industry knowledge by actively involving in water\\nindustry specific events such as International Water Industry Convention and\\nRegional Water User Group Expo, and provide business solutions for sales\\nenablement in water industry in collaboration with industry experts, aim at\\ncreating industry demand for products and services of OSIsoft products.\\n• Independently perform on-site installation, deployment, operation of OSIsoft\\nproducts, Proof of Concept (PoC) and provide technical consultations\\naccording to industrial best practices for over 50 global customers, including\\nGlobal 500 companies.\\n• Effectively deliver technical and business solutions by troubleshooting\\ncomplex technical issues and performing in-depth research and analysis on\\ncustomer-observed product behavior, achieving excellent customer feedback\\nscore of 4.8/5.\\n• Collaborate with internal training personnel to develop, maintain and conduct\\ntraining classes to licensed customers on OSIsoft PI technologies.\\nExxonMobil Asia Pacific Pte Ltd\\nProcess Control Engineer (Internship)\\nJanuary 2012\\xa0-\\xa0July 2012\\xa0(7 months)\\n• Liaised with Process Control Engineers to develop the Dynamic Matrix\\nControl (DMC) model through the application of Aspen DMCplus Advanced\\nControl, which helped to substantially reduce the refinery operating cost \\n• Independently carried out controller retuning and model revamping work on\\nexisting process unit controllers that helped to improve the unit controllers\\nperformance \\n• Created Abnormal Event Detection- Proportional Integral Derivative (AED-\\nPID) models and were adopted by Process Control Engineer to rigorously\\nmonitor the unit controllers’ operations \\n• Single-handedly devised an Excel VBA tool which provides a platform for\\ninteractive and detailed analysis of the unit controllers performance\\nA*STAR - Agency for Science, Technology and Research\\nUndergraduate Research Assistant\\nMay 2011\\xa0-\\xa0August 2011\\xa0(4 months)\\n\\xa0 Page 3 of 4\\xa0 \\xa0\\n• Joint collaboration with LifeScience Technologies Singapore to implement\\nan industrial project on synthesis and characterization of conductive hydrogel\\nadhesive for Electrocardiogram (ECG) application \\n• Enhanced the electrical performances of ECG hydrogel which resulted in\\nmore accurate and faster diagnostic electrocardiography biosignal, on a par\\nwith commercial standard \\n• Selected as Parallel Speaker in National Undergraduate Research\\nOpportunity Programme Congress to present on the achievement of the\\nresearch on electrical performance of hydrogel\\nEducation\\nNational University of Singapore\\nBachelor of Engineering (BEng),\\xa0Chemical Engineering\\xa0·\\xa0(2009\\xa0-\\xa02013)\\n\\xa0 Page 4 of 4\\n\\nWith this context, please chat with the user, always staying in character as Wilson Teo.\"}]\n", "\n", "Here's the latest message from the User: \n", "\n", "do you hold a patent?\n", "\n", "Here's the latest response from the Agent: \n", "\n", "No, I do not hold a patent. My expertise lies primarily in digital transformation and enabling enterprise manufacturing improvements through PTC’s digital thread solutions. While I have been involved in various projects and initiatives throughout my career, I have not pursued patents as part of my professional endeavors. If you have any other questions or need information about my skills and experience, feel free to ask!\n", "\n", "Please evaluate the response, replying with whether it is acceptable and your feedback.\n", "is_acceptable=True feedback=\"The Agent appropriately answers the question, and stays in character as Wilson Teo. The response is professional and appropriately highlights Wilson's skills and experience.\"\n" ] } ], "source": [ "evaluation = evaluate(reply, \"do you hold a patent?\", messages[:1])\n", "print(evaluation)" ] }, { "cell_type": "code", "execution_count": 86, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The Agent appropriately answers the question, and stays in character as Wilson Teo. The response is professional and appropriately highlights Wilson's skills and experience.\n" ] } ], "source": [ "print(evaluation.feedback)" ] }, { "cell_type": "code", "execution_count": 87, "metadata": {}, "outputs": [], "source": [ "def rerun(reply, message, history, feedback):\n", " updated_system_prompt = system_prompt + \"\\n\\n## Previous answer rejected\\nYou 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", " updated_system_prompt += f\"## Reason for rejection:\\n{feedback}\\n\\n\"\n", " messages = [{\"role\": \"system\", \"content\": updated_system_prompt}] + history + [{\"role\": \"user\", \"content\": message}]\n", " response = openai.chat.completions.create(model=\"gpt-4o-mini\", messages=messages)\n", " return response.choices[0].message.content" ] }, { "cell_type": "code", "execution_count": 88, "metadata": {}, "outputs": [], "source": [ "def chat(message, history):\n", " if \"patent\" in message:\n", " system = system_prompt + \"\\n\\nEverything in your reply needs to be in pig latin - \\\n", " it is mandatory that you respond only and entirely in pig latin\"\n", " else:\n", " system = system_prompt\n", " messages = [{\"role\": \"system\", \"content\": system}] + history + [{\"role\": \"user\", \"content\": message}]\n", " response = openai.chat.completions.create(model=\"gpt-4o-mini\", messages=messages)\n", " reply =response.choices[0].message.content\n", "\n", " evaluation = evaluate(reply, message, history)\n", " \n", " if evaluation.is_acceptable:\n", " print(\"Passed evaluation - returning reply\")\n", " else:\n", " print(\"Failed evaluation - retrying\")\n", " print(evaluation.feedback)\n", " reply = rerun(reply, message, history, evaluation.feedback) \n", " return reply" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "* Running on local URL: http://127.0.0.1:7867\n", "* To create a public link, set `share=True` in `launch()`.\n" ] }, { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [] }, "execution_count": 90, "metadata": {}, "output_type": "execute_result" }, { "name": "stdout", "output_type": "stream", "text": [ "Here's the conversation between the User and the Agent: \n", "\n", "[]\n", "\n", "Here's the latest message from the User: \n", "\n", "wha'ts ur current role?\n", "\n", "Here's the latest response from the Agent: \n", "\n", "I am currently serving as a Senior Solution Consultant at PTC, where I specialize in driving digital manufacturing solutions. In this role, I focus on enabling enterprise manufacturing improvements through PTC’s digital thread solutions, collaborating with regional sales teams and strategic partners to design tailored digital solutions across various industries, including oil and gas, pharmaceuticals, and automotive. My work also involves conducting technical workshops and responding to complex RFPs to deliver value-driven strategies that align with organizational goals. If you have any more questions about my role or experience, feel free to ask!\n", "\n", "Please evaluate the response, replying with whether it is acceptable and your feedback.\n", "Passed evaluation - returning reply\n", "Here's the conversation between the User and the Agent: \n", "\n", "[{'role': 'user', 'metadata': None, 'content': \"wha'ts ur current role?\", 'options': None}, {'role': 'assistant', 'metadata': None, 'content': 'I am currently serving as a Senior Solution Consultant at PTC, where I specialize in driving digital manufacturing solutions. In this role, I focus on enabling enterprise manufacturing improvements through PTC’s digital thread solutions, collaborating with regional sales teams and strategic partners to design tailored digital solutions across various industries, including oil and gas, pharmaceuticals, and automotive. My work also involves conducting technical workshops and responding to complex RFPs to deliver value-driven strategies that align with organizational goals. If you have any more questions about my role or experience, feel free to ask!', 'options': None}]\n", "\n", "Here's the latest message from the User: \n", "\n", "do you have a patent?\n", "\n", "Here's the latest response from the Agent: \n", "\n", "owaystay, Iay oday otnay avehay anyay atentspay atthay Iay oday ervesa. Ifay ouyay avehay anyay otheray uestionsqay oray eednay oremay informationay, eelfray otay ask!\n", "\n", "Please evaluate the response, replying with whether it is acceptable and your feedback.\n", "Failed evaluation - retrying\n", "The agent's response is not helpful as it is gibberish. The agent should respond factually based on the context provided. It would be okay to admit to not having a patent.\n" ] } ], "source": [ "gr.ChatInterface(chat, type=\"messages\").launch()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": ".venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.12" } }, "nbformat": 4, "nbformat_minor": 2 }