A developer in Turkey leveraged Telnyx and OpenAI to call thousands of pharmacies to find medication during a shortage.
By Marlo Vernon
As a global communications platform empowering developers to build voice into applications, we love to hear how our customers are building and innovating with Telnyx. This use case might just be our favorite one yet! We were lucky enough to have Yiğit Konur share how he leveraged Telnyx and OpenAI to automate his solution to a medication shortage problem in Turkey. Watch the video or read on to find out how he managed to call thousands of pharmacies to find the medication he needed using Telnyx.
Turkey has faced a pressing issue: a drug supply problem. Demand outstrips supply, and some vital medications are frequently out of stock. Yiğit Konur, a non-professional developer with a knack for scripting and automation, found himself confronted with this issue when he was in desperate need of a medication. His solution? A fascinating integration of the Telnyx platform and OpenAI's Whisper API to call pharmacies throughout Istanbul.
Yiğit was faced with a time-consuming and inefficient task. In order to find the much-needed medication, he had to call each pharmacy one by one. With an estimated call time of 30 seconds per pharmacy, the task quickly became a tedious chore after contacting just a hundred pharmacies. It was apparent that a more efficient solution was necessary.
Having had previous positive experiences with Telnyx's platform for SMS automation, Yiğit decided to leverage it again, this time to automate the calling process to contact these pharmacies. He combined Telnyx's powerful telephony infrastructure with OpenAI's Whisper API, a lesser-known yet extremely potent speech-to-text technology.
The project involved writing a script that could make multiple parallel calls at a time. Yiğit worked with Telnyx to increase the usual call per second limit to accommodate his needs. He gathered all the phone numbers of pharmacies in Istanbul and set his script to work.
The automated system would call each pharmacy and inquire about the availability of "Ritali". To determine which pharmacies had the medication in stock, Yiğit employed GPT-3.5's few-shot prompting technology. This AI model sifted through the dialogues, effectively distinguishing between pharmacies that had the medication and those that did not.
While the bot could connect and play a specific audio file, Yiğit had to manually call the few pharmacies identified by the bot as having the medication in stock. A small price to pay for a much more streamlined process!
This innovative solution proved critical for Yiğit in his quest to find the needed medication,. The broader community took notice, with numerous people on Twitter reaching out to him to say they had successfully found medications using similar automation strategies. His Turkish Twitter thread explaining the project got over 500k views!
Finding medication in pharmacies is difficult due to the drug crisis in Turkey.
🤙🏽 To avoid the tiring task of calling pharmacies one by one, I created an automation with @openai and @telnyx API.
🤖 It calls pharmacies, asks for stock and converts it to text with Whisper 😬🥲 pic.twitter.com/81yIlTeQnXMay 6, 2023
Inspired to help others facing the same challenge, Yiğit shared the project code on Github for others to use and modify.
Yiğit Konur's innovative use of Telnyx and OpenAI serves as a testament to how technology can be harnessed to solve real-world issues. His SEO analytics & rank tracking company Wope, continues to explore similar opportunities, aiming to harness the power of AI and automation to better serve humanity.
Related articles