<?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: Johnson Samuel</title>
    <description>The latest articles on DEV Community by Johnson Samuel (@johnsamuel).</description>
    <link>https://dev.to/johnsamuel</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3886496%2F6fff500f-e343-4ffd-80c2-9d8613f71a73.jpg</url>
      <title>DEV Community: Johnson Samuel</title>
      <link>https://dev.to/johnsamuel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/johnsamuel"/>
    <language>en</language>
    <item>
      <title>AI for good</title>
      <dc:creator>Johnson Samuel</dc:creator>
      <pubDate>Thu, 07 May 2026 02:05:31 +0000</pubDate>
      <link>https://dev.to/johnsamuel/ai-for-good-1jpp</link>
      <guid>https://dev.to/johnsamuel/ai-for-good-1jpp</guid>
      <description>&lt;h2&gt;
  
  
  Building an AI Chatbot Isn’t Hard — Making It Useful Is (Lessons from a Real Project)
&lt;/h2&gt;

&lt;p&gt;A month ago, while building a resume coach AI chatbot using Lambda functions and deploying them on Vercel(a leading cloud platform for frontend developers), I repeatedly encountered timeout errors in the Vercel logs during testing. As I debugged the issue for sometime, I discovered that I was using response.json() instead of streaming the response, which was causing the timeout ⌛️errors on Vercel. Once I updated the Lambda functions to use streams, it started to work without issues.&lt;/p&gt;

&lt;p&gt;💡 I had built the chatbot’s UI using React (buildcv.makeadifference.app).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5rddw5bebbcsspkudqe.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5rddw5bebbcsspkudqe.jpeg" alt="ai for good" width="750" height="988"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do we need to use streams in Lambda?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Streams are ideal for AI chatbots or any conversation based applications because they give good user experience. With streaming, users don’t have to wait for the entire response but they can receive the output incrementally, a better interactive experience for the user 🙂.&lt;/p&gt;

&lt;p&gt;Based on my personal experience building APIs, I would suggest streaming for texts and json for any CRUD operations or business logic implementation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lambda / serverless function:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Request streamed response from AI model
const stream = AI.generateStream(userPrompt)

res.setHeader("Content-Type", "text/plain; charset=utf-8");
res.setHeader("Cache-Control", "no-cache");

// Return chunks immediately to frontend
for await (const chunk of stream) {
    const text = chunk.text;
    if (text) {
        res.write(text);
    }
}

res.end();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
javascript&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frontend(React)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const response = await fetch("api/chat");

const reader = response.body.getReader();
const decoder = new TextDecoder();

let fullText = "";

while (true) {
    const { value, done } = await reader.read();
    if (done) break;

    const chunk = decoder.decode(value);
    fullText += chunk;
}

if (!response.ok) {
    throw new Error(`Failed to get response: ${response.status}`);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 Vercel allows us to send data to the client(frontend) in chunks rather than waiting for the entire response to be generated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are you building using AI?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have you faced any issue building using AI and how did you solve it?&lt;/p&gt;

&lt;p&gt;Happy learning 🎉&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Mentor — making a difference</title>
      <dc:creator>Johnson Samuel</dc:creator>
      <pubDate>Sat, 18 Apr 2026 19:22:27 +0000</pubDate>
      <link>https://dev.to/johnsamuel/mentor-making-a-difference-35cb</link>
      <guid>https://dev.to/johnsamuel/mentor-making-a-difference-35cb</guid>
      <description>&lt;p&gt;🚀 I started my career in a small company(now people call it a startup 😄).&lt;/p&gt;

&lt;p&gt;I feel blessed 😇 because of my mentors and the opportunities they gave me.&lt;/p&gt;

&lt;p&gt;It is the place where I had learnt most of the tech stack, JavaScript, Database, HTML, CSS, and the list goes on.&lt;/p&gt;

&lt;p&gt;Mentors/coaches play an important role in the mentee’s life.&lt;/p&gt;

&lt;p&gt;Few years back, as I was watching Sindhu’s badminton 🏸 match, I closely observed her coach’s reaction.&lt;/p&gt;

&lt;p&gt;He became emotional when she won the bronze medal 🥉. It was as if he was playing the game and he won the bronze medal.&lt;/p&gt;

&lt;p&gt;Do you have mentors who,&lt;/p&gt;

&lt;p&gt;💪🏼 Helped you.&lt;br&gt;
⭐️ Trained you.&lt;br&gt;
🤩 Celebrated your wins.&lt;br&gt;
🙂 Encouraged you during your failures?&lt;br&gt;
😀 Transformed you to mentor others?&lt;br&gt;
😀 Gave you opportunity, which helped you build your career?&lt;/p&gt;

&lt;p&gt;Would love to hear your thoughts :)&lt;/p&gt;

</description>
      <category>ai</category>
      <category>makeadifference</category>
      <category>mentorship</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
