<?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>Forem: Shelomith Anyango</title>
    <description>The latest articles on Forem by Shelomith Anyango (@shelomith-anyango).</description>
    <link>https://forem.com/shelomith-anyango</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%2F3766934%2Fc8844150-60bc-4937-bc6f-b7c40e026708.jpeg</url>
      <title>Forem: Shelomith Anyango</title>
      <link>https://forem.com/shelomith-anyango</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/shelomith-anyango"/>
    <language>en</language>
    <item>
      <title>JAVA AWT AND HOW IT'S USED</title>
      <dc:creator>Shelomith Anyango</dc:creator>
      <pubDate>Mon, 16 Mar 2026 20:08:22 +0000</pubDate>
      <link>https://forem.com/shelomith-anyango/java-awt-and-how-its-used-2fa3</link>
      <guid>https://forem.com/shelomith-anyango/java-awt-and-how-its-used-2fa3</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;1.Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Java Absract Window Toolkit(AWT) is a Graphical User Interface(GUI) library.It is used to create windows,buttons,textfields,labels,menus and other components for desktop applications.AWT provides a set of classes that allow programmers to design applications that users can interact with through a graphical interface instead of typing commands.It was one of the earliest GUI toolkits in Java and is found in the java.awt package.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2.Features of Java AWT&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Java AWT has several important features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Platform Independance&lt;/strong&gt;-Java programs that use AWT can run on any OS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GUI components&lt;/strong&gt;-Provides textfields,labels,buttons,menus 
and may more components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event handling&lt;/strong&gt;-Allows programs to respond to use
actions ie when user clicks a button a response is given to
the action.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layout management&lt;/strong&gt;-Helps organise components inside 
a window(there are different types of layout managers).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3.AWT Components&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Components are the different visual elements that appear on the screen and they include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Button&lt;/strong&gt;-Perfoms an action when clicked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Label&lt;/strong&gt;-Displays text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TextField&lt;/strong&gt;-Allows user to enter text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checkbox&lt;/strong&gt;-Allows selection of options.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frame&lt;/strong&gt;-Main window container.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Example&lt;/span&gt; &lt;span class="nl"&gt;Code:&lt;/span&gt;
    &lt;span class="nc"&gt;JButton&lt;/span&gt; &lt;span class="n"&gt;btnLogin&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JButton&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//creates empty button&lt;/span&gt;
    &lt;span class="n"&gt;btnLogin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Login"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;span class="c1"&gt;//inside the button there should be a login text&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;4.Containers in AWT&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;These are components that hold other components.They help in structuring the interface and controling how components appear within a window&lt;br&gt;
Examples include:&lt;br&gt;
  &lt;strong&gt;1. Frame&lt;/strong&gt;&lt;br&gt;
A Frame is the main top-level window of an application. It contains the title bar, borders, and control buttons such as minimize, maximize and close. &lt;br&gt;
  &lt;strong&gt;2. Panel&lt;/strong&gt;&lt;br&gt;
A Panel is a simple container used to group related components together within another container. Panels are often placed inside a Frame to organize elements in sections, making the interface easier to design and manage.&lt;br&gt;
  &lt;strong&gt;3. Dialog&lt;/strong&gt;&lt;br&gt;
A Dialog is a pop-up window used to display messages or request input from the user. Dialog boxes are commonly used for alerts, confirmations or data entry.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;5.Layout Managers&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;They are used to organise components in a container.&lt;br&gt;
Common layout managers include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- BorderLayout&lt;/strong&gt;-Divides a screen into 5 regions.&lt;br&gt;
  &lt;strong&gt;- GridLayout-&lt;/strong&gt;Arranges components in a screen into rows &lt;br&gt;
  and columns.&lt;br&gt;
  &lt;strong&gt;- FlowLayout&lt;/strong&gt;-Places components in a row from left to right.&lt;br&gt;
  &lt;strong&gt;- CardLayout&lt;/strong&gt;-Allows switching between panel&lt;br&gt;
  s.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;6.Event Handling in AWT&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Event handling allows the program to respond to user actions.&lt;br&gt;
Examples of events:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clicking a button.&lt;/li&gt;
&lt;li&gt;Typing in a text field.&lt;/li&gt;
&lt;li&gt;Selecting a checkbox.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ActionListener&lt;/li&gt;
&lt;li&gt;MouseListener&lt;/li&gt;
&lt;li&gt;KeyListener&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;7.Simple AWT program&lt;/strong&gt;
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;   &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.awt.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

   &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SimpleAWT&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
       &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
           &lt;span class="nc"&gt;Frame&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Frame&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"My First AWT Program"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

           &lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="n"&gt;button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Click Me"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
           &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
           &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setBackground&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Color&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;CYAN&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

           &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setSize&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
           &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setLayout&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FlowLayout&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
           &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setVisible&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;NB:Ensure that SimpleAWT is also the filename incase you are using netbeans&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A picture of the expected output:&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%2Fhcvj28l85ahdhbbkhb71.png" 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%2Fhcvj28l85ahdhbbkhb71.png" alt=" " width="616" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This program creates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A window.&lt;/li&gt;
&lt;li&gt;A button inside the window.&lt;/li&gt;
&lt;li&gt;A background that is Cyan in color.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;8.Requirements and Setup&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To achieve all these you need to have JDK and netbeans Netbeans ie suitable across any platform be it linux or windows.&lt;br&gt;
You can also install JDK and JCreator learning edition which is suitable for learners especially those using windows OS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt;For any linux user who wants to install JCreator learning edition you'll have to first install wine using&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt install wine64 wine32&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I hope you'll enjoy working with java AWT.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>java</category>
      <category>programming</category>
      <category>ui</category>
    </item>
    <item>
      <title>HOW TO MAKE A CHATBOT USING FREE GEMINI API KEYS</title>
      <dc:creator>Shelomith Anyango</dc:creator>
      <pubDate>Fri, 27 Feb 2026 23:50:50 +0000</pubDate>
      <link>https://forem.com/shelomith-anyango/tipson-how-to-make-a-chatbot-using-free-gemini-api-keys-2f8f</link>
      <guid>https://forem.com/shelomith-anyango/tipson-how-to-make-a-chatbot-using-free-gemini-api-keys-2f8f</guid>
      <description>&lt;p&gt;Gemini API keys work efficiently when creating intelligent applications due to its cost saving nature and simplicity. Below is a technical guide on the architecture and implementation steps.&lt;/p&gt;




&lt;h2&gt;
  
  
  Technical Overview: Connecting Gemini API
&lt;/h2&gt;

&lt;p&gt;The Gemini API allows developers to access Google’s most capable AI models. To build a chatbot, you typically use a &lt;strong&gt;client-server architecture&lt;/strong&gt; to keep your API keys secure.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Architectural Workflow
&lt;/h3&gt;

&lt;p&gt;Before coding, it is important to understand how data flows between your user and the model.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Client:&lt;/strong&gt; The user types a prompt into your React/HTML interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server (Backend):&lt;/strong&gt; Your Django or Node.js environment receives the prompt and attaches your &lt;strong&gt;Secret API Key&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini API:&lt;/strong&gt; Google processes the natural language and returns a JSON response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Display:&lt;/strong&gt; The backend sends the text back to the frontend to be rendered in the chat bubble.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  2. Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;API Key:&lt;/strong&gt; Obtain one from the &lt;a href="https://aistudio.google.com/" rel="noopener noreferrer"&gt;Google AI Studio&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment:&lt;/strong&gt; A Python environment with the library installed:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-q&lt;/span&gt; &lt;span class="nt"&gt;-U&lt;/span&gt; google-generativeai

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. Implementation Steps (Python/Django Context)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Step A: Configuration
&lt;/h4&gt;

&lt;p&gt;In your &lt;code&gt;views.py&lt;/code&gt; or a dedicated service file eg &lt;code&gt;service.py&lt;/code&gt; initialize the model. Use environment variables to hide your key eg 'GEMINI_API_KEY' .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;google.generativeai&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;genai&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;

&lt;span class="c1"&gt;# Securely load your API key
&lt;/span&gt;&lt;span class="n"&gt;genai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GEMINI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="c1"&gt;# Initialize the model (Gemini 2.5 Flash is recommended for speed)
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;genai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GenerativeModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;gemini-2.5-flash&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step B: Handling Multi-turn Conversations (Chat)
&lt;/h4&gt;

&lt;p&gt;Standard "Prompt-Response" is stateless. To make it a &lt;strong&gt;Chatbot&lt;/strong&gt;, you must use the &lt;code&gt;.start_chat()&lt;/code&gt; method, which manages history for you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Start a chat session with an empty history
&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_chat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;history&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[])&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_chatbot_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Sending a message to the model
&lt;/span&gt;    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Extracting the text content
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  4. Response Text(output)
&lt;/h3&gt;

&lt;p&gt;Upon calling the repsonse.text the chatbots reply is genarated by googles generative model&lt;br&gt;
     Example&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   User input:

      “Hello”

   Possible response:

       Hello! How can I help you today
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;response.text is just the chatbot’s answer in plain string format, ready to be displayed in your frontend.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Critical Technical Considerations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Safety Settings:&lt;/strong&gt; Gemini has built-in filters for harassment or dangerous content. You can adjust these in your configuration if the model is being too restrictive for your specific use case.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;System Instructions:&lt;/strong&gt; You can define a "Persona." For your   Chatbot , you should initialize the model with a system instruction:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"You are a professional first-aid assistant. Provide clear, step-by-step emergency instructions."&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;API KEY storage:&lt;/em&gt;&lt;/strong&gt;Only put your api key in a .env file and gitignore it ie never exopse your api key&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error Handling:&lt;/strong&gt; Always wrap API calls in &lt;code&gt;try-except&lt;/code&gt; blocks to handle rate limits (Quota exceeded) or network timeouts.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. Security Best Practice
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Never&lt;/strong&gt; call the Gemini API directly from the frontend (JavaScript). If you do, your API key will be visible in the browser's "Network" tab, allowing anyone to steal it and use your quota. Always route requests through your backend in the .env file .&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
