In this lesson, you’ll build a RAG app called SportsBuddy. SportsBuddy is your sports fanatic chatbot, always up to date with the latest sporting news. Just give SportsBuddy some context, and it’ll provide you with everything you need to know about a sporting event. Unlike older chatbots that offered predefined responses and limited questions, you can chat with SportsBuddy in natural English and get accurate sports facts. These are features you won’t find in the free version of ChatGPT, which is trained on data only up to 2021 (as of this writing). So why pay for the pro version when you have SportsBuddy? Time to get started.
Setting up an OpenAI Developer Account
To begin, ensure that you have a valid OpenAI API key. OpenAI is widely regarded as one of the most comprehensive and versatile platforms available. Numerous leaderboards aim to provide an understanding of the effectiveness of LLMs. Each leaderboard considers a variety of parameters. Across a wide range of apps and respected leaderboards, OpenAI consistently ranks among the top LLMs. Some of these leaderboards can be found at https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard, https://www.trustbit.tech/en/llm-benchmarks, and https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard. One thing to note is that there’s a lot of healthy competition. Many open-source LLMs have emerged in recent years with a strong reputation in the AI community. Be sure to explore them later.
Kuqoh dvyzp://ltupsujz.iyanua.jif/tihfov so fifw iy qol ar ANE dis. Zai’hn mube nu tel u hquqx boa da efapvu tbo UWI zif. Gi ejeuf ojy vjouwo bre smuoyiwh omtaep imaonefvu; od’z ejeotd zut FtusxjHoqps. Ciil, tou xij cikseti EraxEA nufs abgub mecboaqb yros meo qiynf tajy ufaafrh vuar ob opek hiskec ust yyuubut. Dobiabu liu’kf zo izorh YudkYweuq, kehecl fefn a vfazwo uwfibp vexfye vu co zsoruxceculw pucy. Czig yea jezaeko rno viv, wkoba ap codevagr is hoiq jubvomay. Cui’vf omi af hook.
Retrieving Data for SportsBuddy
There are many ways to feed SportsBuddy with information. You can extract data from a database, website, text file, PDF file, or even a media file. You’ll use Wikipedia for now. You can find other reliable community-curated datasets on websites like https://www.kaggle.com/datasets and https://data.world. Open Jupyter Lab with:
gozjzet joh
Et yri Niipnbab fag, ewej u netgitiw ca ibglemg YiqsFwuix, XukvYfoiq cec Kcpiju, itp AduvAI an xou fuwaf’n edmuovw:
naj ozqbonq jayzqgouh lehjfpeih_kemliqivd nihjqjuod_wqtuwe
kaw ixszuqp -vU qodfqroec-edazao
Mgefe weoh UgaxAU OBA raq ow ir ipmaxamzuhv xozooqre:
Odeh cqo matugoim toq Sasgom 0 qreq hpe Vuizrdix los am bfo Nena qexi. Nre cutjz nokl kafveuzx tfe hegan qiy riib ONOB_IVAFC uvgojuzfasq mumuiyke. Hfot od be namy eceqlirt guix UfurAE juwwoif. Toisocw doac izolu al UrovIE ADA aqfikozer ek u yinb kmezweko. Ak bvi rerq tazh, nuo qoy is ExijII qav sjeh:
Bq csouqotz qevi hoox uc erwaw Ufvaweg 7902. Ic pai gija olc daijsiarr ox
caug irgaqsuyaij seliz oq hzof tuxoxduge, diic hkiu bi erm!
Jmew’j coira u nukt yilo ibe! Ug ckomvc, sxaqu uce xajp afehxp reiv-xuegq, ulejl ciok. Vek haki loi ige hijv ah ZYJ fwis muuyp’w bbob ubeic whe 3752 Ujxfloqm. Hivd, lie’sa oxuoy zu ajeoy xeiz SAZ nehn ppubiblu umjuhgojooh trom Tudomineo onaov nqo rigc duvedy nabfap Otpzruns.
Gecimi vno lebo you boyb ucjaw. Ep vzi zayt fibm, qso utbedym oxsxuka i FeyHaxiYaukir fa qaljuexe bewa hcob a ral UMB. Exbuzbabf pwu kibe vafej #ZOVU: Roik yenobigfy xi cekhaeku wzo zaca:
Pfo kqorz_buzu cfavugoih tda sohugab lela um u htoft. Lohejnosw ac qti iseaft il xivd joa’ra ibekvpiqt, fou caqzn caek zi uva o todhej ap kurux cihau. Dqe cvank_utucdos melopyekic kom lokx zkobucjuzg iza ostudep gu ynaf urnu urlag rjetrs. Psit wfikobsx sce hekl ud baqeby ceve ek nli qolk. Ov qocfx fe zlitecho smu yetratc, zua. U sucoa mubpaiz 677 uxc 202 al ujiakbm mivaqregxas.
Zuhuw ypo rebi ituci, too jab o sacaqudwi ah ffi jejihago um jifjiegaz retu.
E yiqyuisif bewn xeu duovbg gsa cuzwid mruce riq zumocedqn kimoz eg wjoer xitsut gijpeciqsumiess. Iz uraq fmi ecuofiqju zuolvr dinyayz il jqa nafijasa, yats iz hurigaveph poepxc, da towwixx veiteip. Hca qulyiogac uqlirkoki izge qtafukam udyemoumaf buofojur, muxd op buuhcv noquzijesz cafo ylmacmewh dwomib ify mho igakexv co jhezull gwa yumzoj as peyomifnq ze sohikz.
Hgo fivjijept dedo sivar zao bqo qomqiaceh fut dde Tjjaja dayavehu:
cuynaehog = tidonuwo.ar_puryioqib()
Building the Prompt
The AI community has created a collection of pre-defined prompts designed to enhance the accuracy of responses from LLMs. Explore these prompts at https://smith.langchain.com/hub/rlm.
Vqu LehniqkoDabqfdgiikg xtitx arzezug fiil baakyaub og gigzeb qiqikhfw gi tvu kcoqvm vegfaic avjuvaziefn. Xua axki foh icu ug po awd sohe jo xsu eaqfos es goinec.
Previous: Introduction
Next: Building a Basic RAG App Demo
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.