# Generative AI ## ChatGPT based customer service * There are already some people offering similar products on the internet, but not free. * https://platform.chaticmedia.com/ * https://fastbots.ai/#pricing * I grab some information from FAQ on UE website (there are too many words in total, so I don't want to copy and paste them all, just grab some to test the chatbot), and feed it to my ChatGPT, and it can answer the questions. * [UE FAQ](https://www.ue-germany.com/study-with-us/faq) * [Deployment](https://gen-ai-red.vercel.app/), you can ask the bot any questions, not just related to UE, but don't ask too many, it seems it charges money. * [Repo, my source code](https://github.com/wolfzxcv/gen-ai) * You will not find any similar codes on the internet, most example codes only implement the first round of dialog, so can not remember the previous conversation, and use the information later on. * Even the exisiting product separate frontend and backend in different projects, whereas I build the full-stack under a full-stack framework under the same repo. * ![aaa](https://hackmd.io/_uploads/SJImrteeC.png) * Not sure if pre-train data has limited amount of words, because I saw this on ChatGPT page. * ![bbb](https://hackmd.io/_uploads/Byv18Kex0.jpg) * Don't understand why my phone number is already associated with a register API. * ![ccc](https://hackmd.io/_uploads/ByGl8YllC.jpg) * Looks like it really charges money. * ![ddd](https://hackmd.io/_uploads/BJ5lItlx0.png) * Gosh, it is really not free, we have to remain $5 for our account * ![image](https://hackmd.io/_uploads/rkIP8cLbC.png) * ![image](https://hackmd.io/_uploads/B1O_858-R.png) ### Facts * ==Hiring customer service as real humans costs more money, train new staff to onboard takes time.== * The DialogFlow I used in 2020, only knew about specific intents or entities, and the questions and answers are more limited and formulaic. * [I am in the developer team building this bot, we finished this project in 2020, sorry it's in Chinese.](https://chatweb.youbike.com.tw/?openExternalBrowser=1) * AI bot for the most popular bicycle-sharing system in Taiwan. Participated in frontend in Nuxt.js (only me) and backend (with another developer) in Node.js, also assigned to Product Education and Training, responsible for delivering a speech and teaching the client the concept of NLP with Dialogflow, teaching the client step-by-step built an easy project in Dialogflow. ### Future work * Current existing products * Seem only avaliable on the website, haven't integrated with FB messenger or Instagram or other social media. * I haven't tested their performance, but the way the API provided is not efficient, when the dialog becomes longer, the response speed will decrease a lot. * IDLE fucntion * Other ways to improve the speed? * Summarize the previous dialog * Use fine-tuning service from OpenAI * Pre-train data is fixed, maybe we can save the questions from the customers * Can feed the chatbot more information related to these questions. * Get to know some questions that are not in FAQ yet, and can add them later. * Understand the tendency of questions people are more likely to ask, so our university can provide more relevant info in the future. * Ethical consideration ## ChatGPT and Bard comaprison => I failed * Gemini (formerly Bard) doesn't offer any official JavaScript libraries for API integration. * I tried an unofficial library [bard-ai](https://www.npmjs.com/package/bard-ai), but it doesn't work, also the way it uses is kind of illegal. * Copy and paste from cookie in the browser to get the key, and only valid for 20 mins. * [Available languages and regions for Google AI Studio and Gemini API ](https://ai.google.dev/available_regions), no EU, no Germany for now. * [Claude is also not available in Germany.](https://www.anthropic.com/claude-ai-locations) * ![111](https://hackmd.io/_uploads/SkLfNKglC.jpg) # AWS * What I did these days, rebuild all the services we need on AWS and others (Cloudflare as CDN, Godaddy, Ubuntu, Nginx, SSL, etc). * For some reason, the previous structure was messy, so I decided to rebuild it. * They separated all services under 3 cloud accounts in the past. * They had previously 15 servers, I use 1 EC2, 1 RDS, and 1 S3 bucket to do the same work. Estimate to cost down more than 50% at cloud service bill afterwards. * I built only the service we needed from zero all under 1 AWS account. * I once worked as an AWS and frontend consultant for 2 weeks 3 years ago in Taiwan. (The contract is 8 hours in 2 weeks for about 287 EUR.) * S3 usage as cloud storage space, not hosting space, but connects to DNS. * The videos on YouTube, only people who use S3 as hosting space will connect to DNS, haven't seen people uses S3 as pure cloud storage and still connect to DNS. But I did it. * Most people rely on SSH terminal to connect to the Linux server and can only use the command line to manipulate the server, whereas I also use RDP, we can connect to the Linux server with the remote desktop connection app in the Windows system. Just modify the firewall setting to allow your IP.