Conversational Ai • Last Updated 9/29/2023

Customer spotlight: Using Telnyx Voice API with OpenAI

A developer in Turkey leveraged Telnyx and OpenAI to call thousands of pharmacies to find medication during a shortage.

Marlo_Vernon

By Marlo Vernon

Using Telnyx Voice API with OpenAI

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.

The issue at hand

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.

A novel solution with Telnyx and OpenAI

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.

Intelligent identification with GPT-3.5

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.

Customer Spotlight: Telnyx and OpenAI Twitter Code Video

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!

The impact and feedback

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!

Inspired to help others facing the same challenge, Yiğit shared the project code on Github for others to use and modify.

Future Plans and Opportunities

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.

Share on Social

Related articles

Sign up and start building.