<?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: Gabriel Vanderlei</title>
    <description>The latest articles on Forem by Gabriel Vanderlei (@gabrielvanderlei).</description>
    <link>https://forem.com/gabrielvanderlei</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%2F2470721%2F70fc2181-1d0f-42dd-a9c6-47edb565d676.png</url>
      <title>Forem: Gabriel Vanderlei</title>
      <link>https://forem.com/gabrielvanderlei</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gabrielvanderlei"/>
    <language>en</language>
    <item>
      <title>Exploring My OpenAI Agents Examples Repository</title>
      <dc:creator>Gabriel Vanderlei</dc:creator>
      <pubDate>Sat, 22 Mar 2025 17:34:08 +0000</pubDate>
      <link>https://forem.com/gabrielvanderlei/exploring-my-openai-agents-examples-repository-4hhb</link>
      <guid>https://forem.com/gabrielvanderlei/exploring-my-openai-agents-examples-repository-4hhb</guid>
      <description>&lt;p&gt;As the creator of the &lt;code&gt;openai-agent-examples&lt;/code&gt; repository, I wanted to share some practical implementations for using the OpenAI Agents library. In this post, I'll walk you through what's available in my repository and how you can use it to create your own AI agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Structured the Repository
&lt;/h2&gt;

&lt;p&gt;I divided the repository into two distinct sets of code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Introductory Examples (1-5)&lt;/strong&gt;: These are identical to the examples in the official documentation, allowing you to test basic functionalities in a controlled environment. I included these to provide a clear starting point and ensure you can see the foundational concepts working before diving into more complex implementations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Practical Projects (6-8)&lt;/strong&gt;: Three more sophisticated projects that explore additional possibilities in scenarios closer to real-world applications. These build on the basic concepts but demonstrate how to create fully functional systems.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is OpenAI Agents?
&lt;/h2&gt;

&lt;p&gt;When I started working with OpenAI Agents, I conceptualized it as a system that operates much like a web framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Triage&lt;/strong&gt;: Acts as a router that directs requests&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handoffs&lt;/strong&gt;: Represents the available routes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrails&lt;/strong&gt;: Defines the format and validation of requests&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agents&lt;/strong&gt;: Process specific requests based on their specializations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My Repository Structure
&lt;/h2&gt;

&lt;p&gt;I've organized the repository into several key sections:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openai-agent-examples/
├── 1-5_introduction_examples/  # Basic examples from documentation
├── 6_simple_chat/              # First practical implementation
├── 7_simple_chat_with_apis/    # Advanced implementation with API integration
├── 8_simple_chat_with_gradio/  # UI-focused implementation
├── .env.example
├── .gitignore
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Introductory Examples (1-5)
&lt;/h2&gt;

&lt;p&gt;These examples mirror what you'll find in the official documentation, providing a solid foundation:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Simple Agent (&lt;code&gt;simple_agent.py&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Creating a basic agent with defined instructions:&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;from&lt;/span&gt; &lt;span class="n"&gt;agents&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;

&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Math Tutor&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;instructions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You provide help with math problems. Explain your reasoning at each step and include examples&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Handoffs Between Specialized Agents
&lt;/h3&gt;

&lt;p&gt;A triage system that routes questions to specialized agents:&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="n"&gt;triage_agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Triage Agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;instructions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You determine which agent to use based on the user&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s homework question&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;handoffs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;history_tutor_agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;math_tutor_agent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Input Guardrails
&lt;/h3&gt;

&lt;p&gt;Safety checks using Pydantic models:&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;from&lt;/span&gt; &lt;span class="n"&gt;agents&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;InputGuardrail&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;GuardrailFunctionOutput&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Runner&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pydantic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseModel&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HomeworkOutput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;is_homework&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;
    &lt;span class="n"&gt;reasoning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Python Functions as Tools
&lt;/h3&gt;

&lt;p&gt;Transforming Python functions into tools for agents:&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="nd"&gt;@function_tool&lt;/span&gt;  
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fetch_weather&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Location&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Fetch the weather for a given location.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="c1"&gt;# In real implementations, this would call a weather API
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sunny&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Agents as Tools
&lt;/h3&gt;

&lt;p&gt;Using agents as tools for orchestration:&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="n"&gt;orchestrator_agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;orchestrator_agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;instructions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a translation agent. You use the tools given to you to translate.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;If asked for multiple translations, you call the relevant tools.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="n"&gt;spanish_agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;as_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;tool_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;translate_to_spanish&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;tool_description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Translate the user&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s message to Spanish&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;french_agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;as_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;tool_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;translate_to_french&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;tool_description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Translate the user&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s message to French&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Practical Implementations (6-8)
&lt;/h2&gt;

&lt;p&gt;After exploring the basic concepts, I created three more practical implementations that go beyond the documentation examples:&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Simple Chat
&lt;/h3&gt;

&lt;p&gt;My first practical implementation is a basic chat system with conversation history support. This bridges the gap between the introductory examples and more complex systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Chat with APIs
&lt;/h3&gt;

&lt;p&gt;This implementation expands to a complete asynchronous chat solution that incorporates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chat context management&lt;/li&gt;
&lt;li&gt;Multiple specialized agents:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bitcoin Agent&lt;/strong&gt;: Fetches real-time prices using CoinGecko's API&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jokes Agent&lt;/strong&gt;: Returns random or topic-related jokes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weather Agent&lt;/strong&gt;: Provides weather updates for specified cities&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time Agent&lt;/strong&gt;: Returns the current time&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;News Agent&lt;/strong&gt;: Simulates news headline searches&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;This example demonstrates how to build a system that can interact with external APIs while maintaining conversation context.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Chat with Gradio Interface
&lt;/h3&gt;

&lt;p&gt;My most advanced implementation includes a modern web interface using Gradio that adds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic API tool registration during runtime&lt;/li&gt;
&lt;li&gt;User-friendly UI for easier interaction&lt;/li&gt;
&lt;li&gt;Flexible context handling across sessions&lt;/li&gt;
&lt;li&gt;Integration with custom tools that can be added on-the-fly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This example shows how to create a deployment-ready system that end users can interact with through a web interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Built This Repository
&lt;/h2&gt;

&lt;p&gt;When I started working with OpenAI Agents, I realized there weren't many comprehensive examples showing how to build a complete system. I wanted to create a resource that would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Demonstrate the full potential of the library beyond basic usage&lt;/li&gt;
&lt;li&gt;Show how to integrate multiple agents in a cohesive system&lt;/li&gt;
&lt;li&gt;Provide practical examples that address real-world challenges&lt;/li&gt;
&lt;li&gt;Help developers understand how to maintain context in multi-turn conversations&lt;/li&gt;
&lt;li&gt;Showcase different deployment options from command line to web interfaces&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The introductory examples help you understand the basics, while the practical implementations show you how to create fully functional systems that could serve as starting points for your own projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking Forward
&lt;/h2&gt;

&lt;p&gt;I'm continuing to expand this repository with more examples and use cases. If you have suggestions or would like to contribute, please feel free to open an issue or submit a pull request on GitHub.&lt;/p&gt;

&lt;p&gt;By sharing these examples, I hope to help other developers explore the potential of the OpenAI Agents library and build their own innovative AI applications.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Bolt.new with any LLM, you need to use it</title>
      <dc:creator>Gabriel Vanderlei</dc:creator>
      <pubDate>Fri, 13 Dec 2024 14:05:40 +0000</pubDate>
      <link>https://forem.com/gabrielvanderlei/boltnew-with-any-llm-you-need-to-use-it-24eh</link>
      <guid>https://forem.com/gabrielvanderlei/boltnew-with-any-llm-you-need-to-use-it-24eh</guid>
      <description>&lt;h3&gt;
  
  
  The Situation
&lt;/h3&gt;

&lt;p&gt;Developing agile and efficient projects using cutting-edge Large Language Models (LLMs) is becoming increasingly essential. Tools like &lt;strong&gt;Bolt.new&lt;/strong&gt; have made this process easier by offering powerful features for rapid prototyping and brainstorming.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Problem
&lt;/h3&gt;

&lt;p&gt;While &lt;strong&gt;Bolt.new&lt;/strong&gt; is incredibly useful, its cost can be prohibitive, especially when managing multiple projects. This limits accessibility, making it challenging for independent developers and small teams to fully leverage its capabilities.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Solution
&lt;/h3&gt;

&lt;p&gt;I discovered that the core of &lt;strong&gt;Bolt.new&lt;/strong&gt; is &lt;strong&gt;open source&lt;/strong&gt;! Here's why this is a game-changer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can run the tool locally and use your own API keys for models like &lt;strong&gt;Anthropic&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;There’s an alternative repository, now called &lt;a href="https://github.com/stackblitz-labs/bolt.diy" rel="noopener noreferrer"&gt;&lt;strong&gt;Bolt.DIY&lt;/strong&gt;&lt;/a&gt;, hosted on the &lt;strong&gt;GitHub&lt;/strong&gt; by &lt;strong&gt;Stackblitz Labs&lt;/strong&gt;, previously known as "Bolt.new any LLM." This version enables:

&lt;ul&gt;
&lt;li&gt;Integration with any LLM, including &lt;strong&gt;OpenAI&lt;/strong&gt;, &lt;strong&gt;Grok&lt;/strong&gt;, and &lt;strong&gt;Anthropic&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Exporting chat data.&lt;/li&gt;
&lt;li&gt;Using Git repositories.&lt;/li&gt;
&lt;li&gt;Running local AI models with &lt;strong&gt;LMStudio&lt;/strong&gt; or &lt;strong&gt;Ollama&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This approach not only reduces costs but also provides more flexibility and control over your development environment.&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%2Frj7odn1ue5jdj4z5o35f.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%2Frj7odn1ue5jdj4z5o35f.png" alt="Image description" width="737" height="861"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Why Should You Try It?
&lt;/h3&gt;

&lt;p&gt;If you're looking for an efficient and cost-effective way to accelerate your developments and enhance your workflows with LLMs, the open-source &lt;strong&gt;Bolt.DIY&lt;/strong&gt; with multi-LLM support is a powerful choice. Explore its possibilities and adapt the tool to meet your unique needs!&lt;/p&gt;

&lt;h4&gt;
  
  
  Useful Links:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/stackblitz/bolt.new" rel="noopener noreferrer"&gt;Official Bolt.new Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/stackblitz-labs/bolt.diy" rel="noopener noreferrer"&gt;Bolt.DIY Repository on Stackblitz Labs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Transform your development process with greater freedom and unlimited potential. 🚀&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%2Fhzz5qj7i3a8f8kaypjk2.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%2Fhzz5qj7i3a8f8kaypjk2.png" alt="Image description" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>llm</category>
      <category>rag</category>
    </item>
    <item>
      <title>How I Created CriaLogoAI: Solving the Pain of Logo Creation with AI</title>
      <dc:creator>Gabriel Vanderlei</dc:creator>
      <pubDate>Thu, 05 Dec 2024 19:26:47 +0000</pubDate>
      <link>https://forem.com/gabrielvanderlei/como-criei-o-crialogoai-solucionando-a-dor-de-criar-logos-com-ai-3pd2</link>
      <guid>https://forem.com/gabrielvanderlei/como-criei-o-crialogoai-solucionando-a-dor-de-criar-logos-com-ai-3pd2</guid>
      <description>&lt;p&gt;Have you ever tried creating a logo using artificial intelligence but felt lost among tools in English or overly complex platforms? That’s exactly the situation that led me to create &lt;strong&gt;CriaLogoAI&lt;/strong&gt;, a straightforward and optimized solution to make logo creation effortless.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Problem: Inaccessible Tools
&lt;/h4&gt;

&lt;p&gt;Recently, I needed to create educational content about image generation models like Flux and Flux 1.1. However, I faced a major obstacle: the available tools weren’t accessible for those seeking speed and simplicity, let alone optimized for the Brazilian audience.&lt;/p&gt;

&lt;p&gt;These platforms required advanced technical knowledge, had confusing interfaces, and none of them focused on something as specific as logos. This wasn’t just my issue—many others shared the same frustrations.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Solution: A Straightforward and Efficient Tool
&lt;/h4&gt;

&lt;p&gt;That’s how &lt;strong&gt;CriaLogoAI&lt;/strong&gt; came to life. The idea was simple: allow anyone to create a logo in just a few minutes. No complications, no barriers.&lt;/p&gt;

&lt;p&gt;With CriaLogoAI, all you need is a prompt (a description of what you want), and in seconds, the logo is generated. Additionally, you can adjust details such as text (in quotes), styles, and colors. The model we use may have limitations with longer text, but it works incredibly well for short and direct phrases.&lt;/p&gt;

&lt;h4&gt;
  
  
  How CriaLogoAI Works
&lt;/h4&gt;

&lt;p&gt;The architecture was designed to be robust and scalable while maintaining simplicity for the end user:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Image generation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We use the &lt;strong&gt;Flux Schnell&lt;/strong&gt; model integrated via &lt;strong&gt;Replicate API&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Storage and security&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data is securely stored in &lt;strong&gt;MongoDB Atlas&lt;/strong&gt;, with authentication through &lt;strong&gt;JWT&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Payments&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For premium services, we’ve integrated &lt;strong&gt;Stripe&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Infrastructure and hosting&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The frontend is hosted on &lt;strong&gt;Netlify&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;The backend runs on &lt;strong&gt;Google Cloud Run&lt;/strong&gt;, ensuring high performance.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Additional tools&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The code was generated with the help of &lt;strong&gt;Bolt.new by Stackblitz&lt;/strong&gt;, speeding up development.&lt;/li&gt;
&lt;li&gt;We monitor the user experience with &lt;strong&gt;Google Analytics&lt;/strong&gt;, &lt;strong&gt;Hotjar&lt;/strong&gt;, and &lt;strong&gt;Posthog&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  The Result: Simplicity Delivered
&lt;/h4&gt;

&lt;p&gt;CriaLogoAI is more than just a tool; it’s a practical solution for those who need fast and professional results. Whether you’re a designer looking for inspiration or a small entrepreneur wanting to save time and money, CriaLogoAI is here to help.&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%2F0barf0sxvlvbjvem85ru.gif" 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%2F0barf0sxvlvbjvem85ru.gif" alt="Image description" width="600" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Try It Now
&lt;/h4&gt;

&lt;p&gt;Like the idea? Try it yourself by visiting &lt;a href="https://crialogoai.com" rel="noopener noreferrer"&gt;&lt;strong&gt;CriaLogoAI.com&lt;/strong&gt;&lt;/a&gt;. And of course, your feedback is always welcome! It helps us improve and evolve the tool.&lt;/p&gt;

&lt;p&gt;If you’ve faced similar difficulties, share your experience in the comments. Let’s keep creating solutions that simplify daily life! 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>DSPy: A New Approach to Language Model Programming</title>
      <dc:creator>Gabriel Vanderlei</dc:creator>
      <pubDate>Thu, 28 Nov 2024 11:59:23 +0000</pubDate>
      <link>https://forem.com/gabrielvanderlei/dspy-a-new-approach-to-language-model-programming-10lf</link>
      <guid>https://forem.com/gabrielvanderlei/dspy-a-new-approach-to-language-model-programming-10lf</guid>
      <description>&lt;h2&gt;
  
  
  The Challenge: Moving Beyond Traditional Prompting
&lt;/h2&gt;

&lt;p&gt;When working with Language Models (LLMs), developers face a common set of challenges. We spend countless hours crafting perfect prompts, only to find that our carefully engineered solutions break when we switch models or when the input slightly changes. The traditional approach of prompt engineering is manual, time-consuming, and often unpredictable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Stanford's DSPy Framework
&lt;/h2&gt;

&lt;p&gt;DSPy (Declarative Self-improving Python) emerges as Stanford NLP's answer to these challenges. As described on their website (dspy.ai), it's "the open-source framework for programming - rather than prompting - language models." It enables fast iteration on building modular AI systems and provides algorithms for optimizing prompts and weights, whether you're building simple classifiers, sophisticated RAG pipelines, or Agent loops.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works: The Core Components
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Getting Started
&lt;/h3&gt;

&lt;p&gt;First, install the framework:&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="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;U&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;
&lt;span class="n"&gt;lm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;LM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;openai/gpt-4-mini&lt;/span&gt;&lt;span class="sh"&gt;'&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="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;YOUR_OPENAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;dspy&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;lm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;lm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Understanding Signatures
&lt;/h3&gt;

&lt;p&gt;Signatures are the foundation of DSPy's declarative approach. They define the semantic roles for inputs and outputs in a simple format:&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;# Simple question answering
&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;question -&amp;gt; answer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Retrieval-based QA
&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;context: list[str], question: str -&amp;gt; answer: str&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Multiple-choice with reasoning
&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;question, choices: list[str] -&amp;gt; reasoning: str, selection: int&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Working with Modules
&lt;/h3&gt;

&lt;p&gt;DSPy provides several key modules for different use cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Predict&lt;/code&gt;: Direct LLM responses&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ChainOfThought&lt;/code&gt;: Step-by-step reasoning&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ProgramOfThought&lt;/code&gt;: Code-based solutions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ReAct&lt;/code&gt;: Agent-based interactions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MultiChainComparison&lt;/code&gt;: Compare multiple reasoning paths&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Real-World Applications
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Mathematical Problem Solving
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;math&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ChainOfThought&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;question -&amp;gt; answer: float&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;math&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Two dice are tossed. What is the probability that the sum equals two?&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;
  
  
  Retrieval-Augmented Generation (RAG)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;search_wikipedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ColBERTv2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;http://20.102.90.50:2017/wiki17_abstracts&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;rag&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ChainOfThought&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;context, question -&amp;gt; response&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;h2&gt;
  
  
  Beyond the Basics
&lt;/h2&gt;

&lt;p&gt;DSPy supports various advanced use cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classification tasks&lt;/li&gt;
&lt;li&gt;Information extraction&lt;/li&gt;
&lt;li&gt;Agent-based systems with tools&lt;/li&gt;
&lt;li&gt;Complex RAG pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The framework's self-improving nature means your applications can optimize their performance over time, learning from interactions and results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ready to Start?
&lt;/h2&gt;

&lt;p&gt;You can find complete examples and explore more use cases in the DSPy documentation and the community repository at &lt;a href="https://github.com/gabrielvanderlei/DSPy-examples" rel="noopener noreferrer"&gt;https://github.com/gabrielvanderlei/DSPy-examples&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;DSPy represents a paradigm shift from traditional prompt engineering to declarative programming with language models. It brings structure, reliability, and predictability to LLM development, making it easier to build and maintain AI-powered applications.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
