<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sonam</title>
    <description>The latest articles on DEV Community by Sonam (@sonam_50a41a4ced7e6b4f3fa).</description>
    <link>https://dev.to/sonam_50a41a4ced7e6b4f3fa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4004574%2Ff1f1b787-1d13-4716-b3f7-c8d2d134849c.png</url>
      <title>DEV Community: Sonam</title>
      <link>https://dev.to/sonam_50a41a4ced7e6b4f3fa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sonam_50a41a4ced7e6b4f3fa"/>
    <language>en</language>
    <item>
      <title>Build an AI Audio Translator in Python on Telnyx Inference</title>
      <dc:creator>Sonam</dc:creator>
      <pubDate>Fri, 26 Jun 2026 22:14:42 +0000</pubDate>
      <link>https://dev.to/sonam_50a41a4ced7e6b4f3fa/build-an-ai-audio-translator-in-python-on-telnyx-inference-5e0g</link>
      <guid>https://dev.to/sonam_50a41a4ced7e6b4f3fa/build-an-ai-audio-translator-in-python-on-telnyx-inference-5e0g</guid>
      <description>&lt;p&gt;A lot of AI apps are starting to mix voice, language models, and generated audio.&lt;/p&gt;

&lt;p&gt;I built a small Python example that shows that full loop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;take an audio file&lt;/li&gt;
&lt;li&gt;transcribe it&lt;/li&gt;
&lt;li&gt;translate the transcript with an LLM&lt;/li&gt;
&lt;li&gt;generate translated speech&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python" rel="noopener noreferrer"&gt;https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;The app exposes a Flask API for translating spoken content.&lt;/p&gt;

&lt;p&gt;You send it an audio file and a target language. It returns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the original transcript&lt;/li&gt;
&lt;li&gt;the translated text&lt;/li&gt;
&lt;li&gt;generated translated audio&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So instead of only translating text, the example shows a practical speech-to-speech style workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this pattern is useful
&lt;/h2&gt;

&lt;p&gt;This kind of flow can be useful for apps that need multilingual voice experiences, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;customer support tools&lt;/li&gt;
&lt;li&gt;education apps&lt;/li&gt;
&lt;li&gt;internal enablement content&lt;/li&gt;
&lt;li&gt;voice agents&lt;/li&gt;
&lt;li&gt;media localization&lt;/li&gt;
&lt;li&gt;accessibility workflows&lt;/li&gt;
&lt;li&gt;product tutorials in multiple languages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important part is that each step stays understandable. Speech-to-text, translation, and text-to-speech are separate pieces, so you can debug or replace one part without rewriting the whole app.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the example works
&lt;/h2&gt;

&lt;p&gt;The app uses Telnyx APIs for the voice and AI parts of the workflow.&lt;/p&gt;

&lt;p&gt;At a high level:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload source audio&lt;/li&gt;
&lt;li&gt;Transcribe the audio&lt;/li&gt;
&lt;li&gt;Send the transcript to an LLM for translation&lt;/li&gt;
&lt;li&gt;Generate speech from the translated text&lt;/li&gt;
&lt;li&gt;Return text plus audio output&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That gives you a clean starting point for building your own multilingual AI workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Clone the repo:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git clone https://github.com/team-telnyx/telnyx-code-examples.git&lt;br&gt;
cd telnyx-code-examples/ai-content-translator-python&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Install dependencies and set up your environment:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install -r requirements.txt&lt;br&gt;
cp .env.example .env&lt;br&gt;
python app.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then call the translation endpoint with an audio file and target language. Check the README for the exact request shape:&lt;br&gt;
&lt;a href="https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python" rel="noopener noreferrer"&gt;https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I like this example
&lt;/h2&gt;

&lt;p&gt;It is a useful pattern for anyone building AI apps where the interface is not just text. Text-only LLM demos are helpful, but a lot of real user experiences involve audio: people speaking, systems responding, and content moving across languages.&lt;/p&gt;

&lt;p&gt;This example keeps the workflow small enough to understand, while still showing how speech-to-text, LLM translation, and text-to-speech can fit together in one app.&lt;br&gt;
The Telnyx code examples repo is also structured to be agent-readable, so coding agents can inspect the examples, understand the API patterns, and help you extend them into fuller applications.&lt;/p&gt;

&lt;p&gt;Resources:&lt;br&gt;
&lt;a href="https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python" rel="noopener noreferrer"&gt;Code example&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developers.telnyx.com" rel="noopener noreferrer"&gt;Telnyx Developer Docs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>stt</category>
      <category>tts</category>
      <category>telnyx</category>
    </item>
    <item>
      <title>Build a Simple RAG App with Telnyx AI Inference</title>
      <dc:creator>Sonam</dc:creator>
      <pubDate>Fri, 26 Jun 2026 22:11:23 +0000</pubDate>
      <link>https://dev.to/sonam_50a41a4ced7e6b4f3fa/build-a-simple-rag-app-with-telnyx-ai-inference-mfl</link>
      <guid>https://dev.to/sonam_50a41a4ced7e6b4f3fa/build-a-simple-rag-app-with-telnyx-ai-inference-mfl</guid>
      <description>&lt;p&gt;RAG is one of those patterns that sounds more complicated than it has to be.&lt;/p&gt;

&lt;p&gt;At its core, retrieval-augmented generation is just:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Store some documents&lt;/li&gt;
&lt;li&gt;Embed the user’s question&lt;/li&gt;
&lt;li&gt;Find the most relevant docs&lt;/li&gt;
&lt;li&gt;Send those docs to the model as context&lt;/li&gt;
&lt;li&gt;Return an answer with sources&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I built a small Python example that shows that flow end to end with Telnyx AI Inference.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/team-telnyx/telnyx-code-examples/tree/main/build-rag-with-telnyx-inference-python" rel="noopener noreferrer"&gt;https://github.com/team-telnyx/telnyx-code-examples/tree/main/build-rag-with-telnyx-inference-python&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;The app exposes a Flask API for asking questions against a tiny in-memory knowledge base.&lt;/p&gt;

&lt;p&gt;You send a question like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
  "question": "Production signup broke after rotating an API key. Logs show 401 errors. What should we check first?"&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The app
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;creates an embedding for the question&lt;/li&gt;
&lt;li&gt;compares it against embeddings for the sample documents&lt;/li&gt;
&lt;li&gt;retrieves the most relevant sources&lt;/li&gt;
&lt;li&gt;sends those sources to a chat model&lt;/li&gt;
&lt;li&gt;returns a grounded answer plus source titles&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why this pattern is useful
&lt;/h2&gt;

&lt;p&gt;A normal LLM call only knows what is in the prompt and the model’s training data. RAG lets your app answer with your own docs, policies, product information, support notes, or internal knowledge base. That makes it useful for things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;support assistants&lt;/li&gt;
&lt;li&gt;internal docs search&lt;/li&gt;
&lt;li&gt;onboarding copilots&lt;/li&gt;
&lt;li&gt;product Q&amp;amp;A&lt;/li&gt;
&lt;li&gt;troubleshooting workflows&lt;/li&gt;
&lt;li&gt;agent tools that need source-grounded answers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How the example works
&lt;/h2&gt;

&lt;p&gt;The example keeps the moving parts intentionally small.&lt;br&gt;
There is an in-memory DOCUMENTS list. On the first request, the app creates embeddings for those documents and caches them. When a user asks a question, the app embeds the question, compares it to the document embeddings, and sends the best matches to the model.&lt;br&gt;
The answer response includes source titles, so you can see what context the app used instead of treating the model like a black box.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Clone the repo:&lt;br&gt;
&lt;code&gt;git clone https://github.com/team-telnyx/telnyx-code-examples.git&lt;br&gt;
cd telnyx-code-examples/build-rag-with-telnyx-inference-python&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Install dependencies and run the app:&lt;br&gt;
&lt;code&gt;pip install -r requirements.txt&lt;br&gt;
cp .env.example .env&lt;br&gt;
python app.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Ask a question:&lt;br&gt;
&lt;code&gt;curl -X POST http://localhost:5000/rag/ask \&lt;br&gt;
  -H "Content-Type: application/json" \&lt;br&gt;
  -d '{&lt;br&gt;
    "question": "Production signup broke after rotating an API key. Logs show 401 errors. What should we check first?"&lt;br&gt;
  }'&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I like this example
&lt;/h2&gt;

&lt;p&gt;It is deliberately small, but it gives you the core pieces of a real RAG workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;embeddings&lt;/li&gt;
&lt;li&gt;retrieval&lt;/li&gt;
&lt;li&gt;source grounding&lt;/li&gt;
&lt;li&gt;chat completion&lt;/li&gt;
&lt;li&gt;a clean API surface&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From there, you could swap the in-memory docs for a vector database, pull content from product docs, or turn it into a support assistant.&lt;br&gt;
The Telnyx code examples repo is also structured to be agent-readable, so coding agents can inspect these examples and help you extend them into fuller applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/team-telnyx/telnyx-code-examples/tree/main/build-rag-with-telnyx-inference-python" rel="noopener noreferrer"&gt;Code example &lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/team-telnyx/ai" rel="noopener noreferrer"&gt;Telnyx AI repo with skills/toolkits&lt;/a&gt; &lt;br&gt;
&lt;a href="https://developers.telnyx.com/docs/inference" rel="noopener noreferrer"&gt;Telnyx AI Inference docs&lt;/a&gt; &lt;/p&gt;

</description>
      <category>rag</category>
      <category>ai</category>
      <category>telnyx</category>
      <category>flask</category>
    </item>
    <item>
      <title>Extract Structured JSON from Messy Text with Telnyx AI Inference</title>
      <dc:creator>Sonam</dc:creator>
      <pubDate>Fri, 26 Jun 2026 22:03:29 +0000</pubDate>
      <link>https://dev.to/sonam_50a41a4ced7e6b4f3fa/extract-structured-json-from-messy-text-with-telnyx-ai-inference-57ib</link>
      <guid>https://dev.to/sonam_50a41a4ced7e6b4f3fa/extract-structured-json-from-messy-text-with-telnyx-ai-inference-57ib</guid>
      <description>&lt;p&gt;Messy text is everywhere: support tickets, lead forms, emails, contracts, incident reports, call notes, Slack messages. The annoying part is that the useful data is usually in there somewhere, but not in a shape your app can trust.&lt;/p&gt;

&lt;p&gt;I built a small Python example that uses Telnyx AI Inference to turn unstructured text into structured JSON.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/team-telnyx/telnyx-code-examples/tree/main/extract-structured-json-with-ai-python" rel="noopener noreferrer"&gt;https://github.com/team-telnyx/telnyx-code-examples/tree/main/extract-structured-json-with-ai-python&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;The app exposes a simple Flask endpoint where you send messy text plus the fields you want back.&lt;/p&gt;

&lt;p&gt;For example, you can send something like a customer support note and ask for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;customer name&lt;/li&gt;
&lt;li&gt;issue type&lt;/li&gt;
&lt;li&gt;urgency&lt;/li&gt;
&lt;li&gt;product&lt;/li&gt;
&lt;li&gt;next action&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The model returns a structured JSON object that your app can validate, store, route, or pass into another workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this pattern is useful
&lt;/h2&gt;

&lt;p&gt;A lot of AI demos stop at “summarize this text.” That is useful, but many real apps need something stricter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;route a ticket&lt;/li&gt;
&lt;li&gt;classify an incident&lt;/li&gt;
&lt;li&gt;extract lead details&lt;/li&gt;
&lt;li&gt;normalize intake forms&lt;/li&gt;
&lt;li&gt;prepare data for a CRM&lt;/li&gt;
&lt;li&gt;trigger automations based on extracted fields&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Structured JSON makes the LLM output easier to use in actual software.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;The example uses Telnyx AI Inference through an OpenAI-compatible client pattern.&lt;/p&gt;

&lt;p&gt;At a high level:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define the schema you want back&lt;/li&gt;
&lt;li&gt;Send messy text to the model&lt;/li&gt;
&lt;li&gt;Ask the model to return JSON&lt;/li&gt;
&lt;li&gt;Validate the result before using it&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That last part matters. Even when you ask an LLM for JSON, your app should still treat model output like external input and validate it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Clone the repo:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git clone https://github.com/team-telnyx/telnyx-code-examples.git&lt;br&gt;
cd telnyx-code-examples/extract-structured-json-with-ai-python&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Install dependencies and run the app:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;pip install -r requirements.txt&lt;br&gt;
cp .env.example .env&lt;br&gt;
python app.py&lt;/code&gt;&lt;br&gt;
Then call the endpoint with your own text.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I like this example
&lt;/h2&gt;

&lt;p&gt;It is small enough to understand quickly, but it maps to a very real app pattern: taking messy human language and turning it into data your system can actually act on.&lt;br&gt;
Also worth noting: the Telnyx code examples repo is structured to be agent-readable, so coding agents can inspect the examples, understand the API patterns, and help you extend them into fuller apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/team-telnyx/telnyx-code-examples/tree/main/extract-structured-json-with-ai-python" rel="noopener noreferrer"&gt;Code example&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/team-telnyx/ai" rel="noopener noreferrer"&gt;Telnyx AI repo with skills/toolkits&lt;/a&gt;&lt;br&gt;
&lt;a&gt;Telnyx AI Inference&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Feedback welcome, especially from folks building AI apps that need reliable structured output from messy user input.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>inference</category>
      <category>telnyx</category>
      <category>json</category>
    </item>
  </channel>
</rss>
