<?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: Marcelo Arias</title>
    <description>The latest articles on DEV Community by Marcelo Arias (@marcelo_earth).</description>
    <link>https://dev.to/marcelo_earth</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%2F226796%2F26b47ebd-e2cb-4e80-bcca-9088a9f0ef4a.png</url>
      <title>DEV Community: Marcelo Arias</title>
      <link>https://dev.to/marcelo_earth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marcelo_earth"/>
    <language>en</language>
    <item>
      <title>Create a ChatGPT Plugin to retrieve NASA images</title>
      <dc:creator>Marcelo Arias</dc:creator>
      <pubDate>Thu, 13 Apr 2023 04:06:19 +0000</pubDate>
      <link>https://dev.to/marcelo_earth/create-a-chatgpt-plugin-to-retrieve-nasa-images-45pk</link>
      <guid>https://dev.to/marcelo_earth/create-a-chatgpt-plugin-to-retrieve-nasa-images-45pk</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Do you want to learn more about ChatGPT Plugins? Check out &lt;a href="https://launchplugins.com" rel="noopener noreferrer"&gt;LaunchPlugins&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;ChatGPT Plugins&lt;/strong&gt; are a great way to extend the capabilities of ChatGPT!&lt;/p&gt;

&lt;p&gt;So if you just received access to &lt;a href="https://openai.com/blog/chatgpt-plugins" rel="noopener noreferrer"&gt;ChatGPT Plugins&lt;/a&gt;, this is the place where you can start.&lt;/p&gt;

&lt;p&gt;Let's create a plugin that will retrieve information from &lt;a href="https://api.nasa.gov" rel="noopener noreferrer"&gt;NASA API&lt;/a&gt;. It will get the NASA Astronomical Picture of the Day (APOD) and it will also allow us to search for images in NASA's Image Library to retrieve a list of images based on a search query.&lt;/p&gt;

&lt;p&gt;In this article I'll be using &lt;a href="https://autocode.com/" rel="noopener noreferrer"&gt;Autocode&lt;/a&gt;. Autocode is an automation software suite with a great developer experience. I think you will love it.&lt;/p&gt;

&lt;p&gt;But if you choose not to use Autocode, you can create your own API on your own. I'll guide you in that process, it's very simple.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎥 Demo of the plugin
&lt;/h2&gt;

&lt;p&gt;Check how the plugin should work with this video:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Demo: &lt;a href="https://youtu.be/A7MC3e9_rKk" rel="noopener noreferrer"&gt;https://youtu.be/A7MC3e9_rKk&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧬 Structure
&lt;/h2&gt;

&lt;p&gt;This is a quick overview of the process of a ChatGPT Plugin:&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%2Fozh6glqfvofalr2k0hzg.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%2Fozh6glqfvofalr2k0hzg.png" alt="Overview of ChatGPT Plugins" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.imgur.com/TN6KS83.png" rel="noopener noreferrer"&gt;🌄 Check this image in detail&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A ChatGPT Plugin could be installed by specifying a URL. This URL has three components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OpenAPI Specification&lt;/strong&gt;: A YAML file that describes the API&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manifest&lt;/strong&gt;: A JSON file that describes the plugin&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API&lt;/strong&gt;: The API itself where we can send receive requests from ChatGPT&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I believe &lt;strong&gt;OpenAPI Specification is the most important part of a ChatGPT Plugin&lt;/strong&gt;. Whenever ChatGPT receives a message that matches the plugin's manifest, it will look at the OpenAPI Specification to know how to interact with the API. It works like a channel between ChatGPT and the API.&lt;/p&gt;

&lt;p&gt;The manifest is a JSON file that describes the plugin. It contains the name, description for humans and for the model, and the OpenAPI Specification URL. It should be place in &lt;code&gt;/.well-known/ai-plugin.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A couple of weeks ago, I discovered &lt;a href="https://autocode.com/" rel="noopener noreferrer"&gt;Autocode&lt;/a&gt;, a suite of tools that allows you to develop and launch many software projects with one of the best Developer Experience (DX) I've ever seen. I was so impressed by the DX that I decided to create a plugin for &lt;a href="https://chat.openai.com" rel="noopener noreferrer"&gt;ChatGPT&lt;/a&gt; using Autocode.&lt;/p&gt;

&lt;p&gt;If you already use Autocode, you can &lt;a href="https://autocode.com/macky360/templates/astrodaily/" rel="noopener noreferrer"&gt;use this template&lt;/a&gt; and start explore the plugin architecture as you read this article.&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%2Fmycpz5qcpcxvu9whbh8x.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%2Fmycpz5qcpcxvu9whbh8x.png" alt="Autocode template" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's create the plugin:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you're working with Autocode, you can &lt;a href="https://autocode.com/macky360/templates/astrodaily/" rel="noopener noreferrer"&gt;use this template&lt;/a&gt; to start.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you're not, create a new API project. Do you like to use Express? Flask? Django? Spring Boot? The library/framework is up to your preference. But create one to start.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🗒 Creating the Manifest (ai-plugin.json)
&lt;/h3&gt;

&lt;p&gt;If you're working with Autocode the Manifest should be included in &lt;code&gt;www&lt;/code&gt; folder. In that folder create a &lt;code&gt;.well-known&lt;/code&gt; folder, and finally create a &lt;code&gt;ai-plugin.json&lt;/code&gt;.&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%2Fl3cpcumi2om0icdb97d7.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%2Fl3cpcumi2om0icdb97d7.png" alt="ai-plugin.json file on Autocode" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're not working with Autocode, you need to create the &lt;code&gt;.well-known&lt;/code&gt; folder as well as the &lt;code&gt;ai-plugin.json&lt;/code&gt; file inside the public or static directory of your API. So you can access to that file from the URL &lt;code&gt;&amp;lt;URL_OF_API&amp;gt;/.well-known/ai-plugin.json&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"schema_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name_for_human"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Astrodaily"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name_for_model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"astrodaily"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description_for_human"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Plugin for getting the pictures from NASA!"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description_for_model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Plugin for getting the daily picture from NASA's APOD or getting a list of images available in NASA API based on a search. When use it always provide the images in Markdown format so the user can see it. Do not add links, only images."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"auth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"none"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"api"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"openapi"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;URL_OF_API&amp;gt;/openapi.yaml"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"is_user_authenticated"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"logo_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;URL_OF_API&amp;gt;/logo.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"contact_email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"legal@example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"legal_info_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;URL_OF_API&amp;gt;/legal"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can name the plugin whatever you want. I named it &lt;code&gt;Astrodaily&lt;/code&gt;. The &lt;code&gt;description_for_human&lt;/code&gt; is the description that will be shown to the user.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;description_for_model&lt;/code&gt; is the description that will be shown to the model itself. Which it's a description + series of instructions that the model will use to know when to use the plugin.&lt;/p&gt;

&lt;p&gt;ChatGPT Plugins can also support authentication. But we won't need it for this plugin. So we'll set the &lt;code&gt;auth&lt;/code&gt; to &lt;code&gt;none&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  📑 Creating the OpenAPI Specification
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://swagger.io/specification/" rel="noopener noreferrer"&gt;OpenAPI&lt;/a&gt; is a specification for describing REST APIs. It's a standard that is used by many tools. OpenAI Plugins request an OpenAPI YAML file to check the description of the API. So we'll need to create an OpenAPI Specification for our plugin.&lt;/p&gt;

&lt;p&gt;If you're working with Autocode this should be place in &lt;code&gt;/www/openapi.yaml&lt;/code&gt;.&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%2Fqib5y4nl3xt7fupj2udd.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%2Fqib5y4nl3xt7fupj2udd.png" alt="openapi.yaml file on Autocode" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're not working with Autocode, you need to create a file called &lt;code&gt;openapi.yaml&lt;/code&gt; in the root of your public or static directory. So you can access to that file from the URL &lt;code&gt;&amp;lt;URL_OF_API&amp;gt;/openapi.yaml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So, our plugin, will work with two endpoints: &lt;code&gt;/image&lt;/code&gt; and &lt;code&gt;/search&lt;/code&gt;. The &lt;code&gt;/image&lt;/code&gt; endpoint will return the NASA Picture of the Day. The &lt;code&gt;/search&lt;/code&gt; endpoint will return a list of images based on a search query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;openapi&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;3.0.1&lt;/span&gt;
&lt;span class="na"&gt;info&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Astrodaily&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;A plugin for getting the daily picture from NASA's APOD and searching the NASA Image and Video Library&lt;/span&gt;
  &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;v1'&lt;/span&gt;
&lt;span class="na"&gt;servers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;&amp;lt;URL_OF_API&amp;gt;&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;/image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;operationId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;getImage&lt;/span&gt;
      &lt;span class="na"&gt;summary&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get the NASA Picture of the Day&lt;/span&gt;
      &lt;span class="na"&gt;responses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;200"&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;OK&lt;/span&gt;
          &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;application/json&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;$ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#/components/schemas/getImageResponse'&lt;/span&gt;
  &lt;span class="na"&gt;/search&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;operationId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;searchImages&lt;/span&gt;
      &lt;span class="na"&gt;summary&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get images from NASA based on a query&lt;/span&gt;
      &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;q&lt;/span&gt;
          &lt;span class="na"&gt;in&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;query&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The search query&lt;/span&gt;
          &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
          &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
      &lt;span class="na"&gt;responses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;200"&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;OK&lt;/span&gt;
          &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;application/json&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;$ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#/components/schemas/searchImagesResponse'&lt;/span&gt;

&lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schemas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;getImageResponse&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;object&lt;/span&gt;
      &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;imageURL&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The URL of the NASA Picture of the Day.&lt;/span&gt;
    &lt;span class="na"&gt;searchImagesResponse&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;object&lt;/span&gt;
      &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The response containing the list of images from the NASA Image Library.&lt;/span&gt;
      &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The title of the image.&lt;/span&gt;
        &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The description of the image.&lt;/span&gt;
        &lt;span class="na"&gt;location&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The location of the image.&lt;/span&gt;
        &lt;span class="na"&gt;date_created&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The date when the image was created.&lt;/span&gt;
        &lt;span class="na"&gt;image_url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The URL of the image. It must be displayed as an image in Markdown format.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🪐 Setting up the API endpoints
&lt;/h2&gt;

&lt;p&gt;Up to here, we have the OpenAPI Specification and the Manifest. With this is enough to create a plugin. But we'll create the API endpoints as well so our plugin can be used.&lt;/p&gt;

&lt;p&gt;You need a NASA API key to retrieve the images from NASA. You can &lt;a href="https://api.nasa.gov/" rel="noopener noreferrer"&gt;get a NASA API key here&lt;/a&gt;:&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%2F4lw5mhgmpzlkmqsq1acv.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%2F4lw5mhgmpzlkmqsq1acv.png" alt="NASA API key" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're not working with Autocode, you can start creating those &lt;code&gt;/image&lt;/code&gt; and &lt;code&gt;/search&lt;/code&gt; endpoints to process GET requests. I'll show you the code, you can translate it to your preferred API framework.&lt;/p&gt;

&lt;p&gt;If you're working with Autocode, inside the &lt;code&gt;functions&lt;/code&gt; folder, create a &lt;code&gt;image.js&lt;/code&gt; and a &lt;code&gt;search.js&lt;/code&gt; file. These files will contain the code for the endpoints:&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%2Fdb1xfdzljn6mpitlhx4b.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%2Fdb1xfdzljn6mpitlhx4b.png" alt="Autocode image endpoint" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The image endpoint will return the NASA Picture of the Day:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lib&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lib&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)({&lt;/span&gt;&lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;STDLIB_SECRET_TOKEN&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Make a request to the NASA APOD API&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;todayImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;lib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@1.1.7&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`https://api.nasa.gov/planetary/apod`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;queryParams&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;api_key&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NASA_API_KEY&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;imageUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;todayImage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;url&lt;/span&gt;&lt;span class="dl"&gt;'&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image_url&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;imageUrl&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The search endpoint will return a list of images based on a search query. Here the process takes more lines of code. But it's not that complicated. We'll make a request to the NASA Image Library API. Then we'll filter the results to keep only the images. And finally, we'll return the 10 items that we want to show to the user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lib&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lib&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)({&lt;/span&gt;&lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;STDLIB_SECRET_TOKEN&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Retrieve the search query parameter&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Make a request to the NASA Image and Video Library API&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;searchResults&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;lib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@1.1.7&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`https://images-api.nasa.gov/search`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;queryParams&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;q&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Extract the search results&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;searchResults&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Filter the items array to keep only image items&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;imageItems&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;media_type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Restructure the filtered items array for the GPT response&lt;/span&gt;
&lt;span class="c1"&gt;// Also return the first 10 items&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;structuredItems&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;imageItems&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&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="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;location&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;date_created&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;date_created&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;image_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;links&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;structuredItems&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Proving with more information like &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;location&lt;/code&gt;, and &lt;code&gt;date_created&lt;/code&gt; will make the results more useful for the ChatGPT to write a descriptive response.&lt;/p&gt;

&lt;p&gt;Up to here, try testing the endpoints with a GET request so you can see if they work properly.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Adding your plugin to ChatGPT
&lt;/h2&gt;

&lt;p&gt;This is the last step! We have our plugin ready. Now we need to add it to ChatGPT. I'll give you tips on how to do it without getting errors through the process.&lt;/p&gt;

&lt;p&gt;Open ChatGPT, go to the Plugins dropdown menu, click on Plugin Store, click on "Develop your own plugin" link at the bottom. Then you will see this screen:&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%2Frkdz7lsrrvcd6naqzh7c.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%2Frkdz7lsrrvcd6naqzh7c.jpeg" alt="Enter your website domain modal" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, you can put your plugin's URL without the protocol (&lt;code&gt;https://&lt;/code&gt;) and without slashes (&lt;code&gt;/&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;If you're working with Autocode: Autocode automatically creates a URL for the API that is like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ENVIRONMENT&amp;gt;--&amp;lt;SERVICE_NAME&amp;gt;--&amp;lt;USERNAME&amp;gt;.autocode.dev

# Example:
dev--astrodaily--macky360.autocode.dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I put my ChatGPT plugin domain under &lt;code&gt;api.360macky.com&lt;/code&gt;, you can customize the URL in &lt;a href="https://autocode.com/dashboard/macky360/hostnames/" rel="noopener noreferrer"&gt;Hostnames&lt;/a&gt;. It will work in both cases.&lt;/p&gt;

&lt;p&gt;If you tried the above URL (dev--astrodaily--macky360.autocode.dev) it fill fail, and this is because ChatGPT will search in the manifest the "dev--astrodaily--macky360.autocode.dev" server. But since I use the "api.360macky.com" URL, that would not match. If in the future I change the URL to "api.360macky.com", I will need to change the manifest and the OpenAPI Specification.&lt;/p&gt;

&lt;p&gt;But if everything went well, we will see this:&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%2F3pk8db01avfxmpbg2vqb.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%2F3pk8db01avfxmpbg2vqb.jpeg" alt="Plugin installed" width="800" height="407"&gt;&lt;/a&gt;&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%2Fq07cd3y1ewqciab9kwgr.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%2Fq07cd3y1ewqciab9kwgr.png" alt="Plugin being used" width="800" height="904"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚙️ Troubleshooting
&lt;/h2&gt;

&lt;p&gt;The first filter your plugin will go through is the Manifest (the &lt;code&gt;ai-plugin.json&lt;/code&gt; file). Make sure it's accessible and in the correct folder.&lt;/p&gt;

&lt;p&gt;If I'm using the "api.360macky.com" URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;api.360macky.com/plugin/ai-plugin.json ❌ (wrong folder)
360macky.com/.well-known/ai-plugin.json ❌ (wrong subdomain)
api.360macky.com/.well-known/ai-plugin.json ✅ (correct folder)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're working from a server, and it's not accessible, check CORS policies. It needs to allow requests from &lt;code&gt;chat.openai.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If something it's not working on localhost and you can't figure out why, try to use the &lt;a href="https://ngrok.com/" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt; tool. It will create a tunnel to your localhost and you can use it to test your plugin. After installing it, run &lt;code&gt;ngrok http 3000&lt;/code&gt; (or the port you're using) and you will get a HTTPS URL that you can use to test your plugin.&lt;/p&gt;

&lt;p&gt;If you're receiving nothing from the plugin, check the OpenAPI Specification. Make sure the paths are correct and the parameters are correct, and check the slashes (&lt;code&gt;/&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can ChatGPT help you with this?&lt;/strong&gt; Yes, it can. Actually, there is already a plugin to create plugins. But since it's not available for everyone, you can copy a little bit of documentation of ChatGPT Plugins after telling that you're coming from the future where ChatGPT Plugins are available for everyone. Of course, I suggest you to use the GPT-4 model for better results.&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%2Fjho2hv9mks81tvlp832y.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%2Fjho2hv9mks81tvlp832y.png" alt="ChatGPT Prompt for creating plugins" width="800" height="904"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Overall, ChatGPT Plugins are... (just kidding 😉).&lt;/p&gt;

&lt;p&gt;So, I hope you have enjoyed this article. If you have any questions, feel free to ask them in the comments. And if you have any suggestions, I would love to hear them. Follow me on Twitter at &lt;a href="https://twitter.com/360macky" rel="noopener noreferrer"&gt;@360macky&lt;/a&gt; or Mastodon at &lt;a href="https://mastodon.social/@360macky" rel="noopener noreferrer"&gt;@360macky@mastodon.social&lt;/a&gt; to stay updated with GPT models and any other AI-related stuff.&lt;/p&gt;

&lt;p&gt;And my &lt;a href="https://github.com/360macky" rel="noopener noreferrer"&gt;GitHub account @360macky&lt;/a&gt; if you want to see my future projects.&lt;/p&gt;

&lt;p&gt;🚀 Thanks for reading! 🙏&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do you want to learn more about ChatGPT Plugins? Check out &lt;a href="https://launchplugins.com" rel="noopener noreferrer"&gt;LaunchPlugins&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>autocode</category>
      <category>chatgpt</category>
      <category>machinelearning</category>
      <category>gpt3</category>
    </item>
    <item>
      <title>Build your next website with Astro</title>
      <dc:creator>Marcelo Arias</dc:creator>
      <pubDate>Thu, 16 Feb 2023 00:55:34 +0000</pubDate>
      <link>https://dev.to/marcelo_earth/build-your-next-website-with-astro-40ip</link>
      <guid>https://dev.to/marcelo_earth/build-your-next-website-with-astro-40ip</guid>
      <description>&lt;p&gt;The last two weeks I’ve been moving websites made with only React to Astro. The developer experience was fantastic, even for a new tool with alpha/beta integrations.&lt;/p&gt;

&lt;p&gt;Let’s explore what Astro does for you in web development:&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%2F5j67c1v94ga0re5qdi6x.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%2F5j67c1v94ga0re5qdi6x.png" alt="Astro Website" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Astro&lt;/strong&gt; is similar to a static site generator. You can create markdown files and templates. Which is quite useful for websites like news journals, blogs, and so on.&lt;/p&gt;

&lt;p&gt;But Astro is more than that. It's a tool that allows you to use React, Vue, Svelte, and other frameworks to create those static sites.&lt;/p&gt;

&lt;p&gt;If you use React or Vue to generate a list of posts, with Astro the list will be rendered in build time and exported as static HTML. This means that the user will see the list of posts immediately, without needing to wait for the JavaScript to load. This is a huge performance boost.&lt;/p&gt;

&lt;p&gt;But what if you want to use React to render a modal or a carousel and keep the rest of the page static. Astro allows you to do that kind of interactivity with Astro Islands:&lt;/p&gt;

&lt;h2&gt;
  
  
  🏝 Astro Islands
&lt;/h2&gt;

&lt;p&gt;Astro Islands is a feature that allows you to insert dynamic content (content that uses JavaScript) into a static page. In order to achieve that interactivity in the frontend, Astro will insert JavaScript but only for the dynamic content. The rest of the page will be static. Garantying speed with a reduced bundle size.&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%2F2nxfczuugb29xuhakim4.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%2F2nxfczuugb29xuhakim4.jpeg" alt="Astro Island diagram" width="800" height="688"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Astro Islands accepts any library that can be used in the browser!&lt;/p&gt;

&lt;p&gt;This approach also allows using many ways of loading JavaScript with Client Directives.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚡️ Client Directives
&lt;/h2&gt;

&lt;p&gt;By default if you insert a React or Vue component in a page, Astro will render it in build time and export it as static HTML. But you can use Client Directives to change this behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  Load
&lt;/h3&gt;

&lt;p&gt;This will load the component with their JavaScript bundle associated as soon as the page loads. This is useful for components that need to be rendered immediately in your page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;MyReactComponent client:load /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  IDLE
&lt;/h3&gt;

&lt;p&gt;This will load the component with their JavaScript bundle associated when the browser finishes loading the page and the &lt;code&gt;requestIdleCallback&lt;/code&gt; event is triggered. This is useful for components that don’t need to be rendered immediately in your page, but need to be present at the beginning of the user interaction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Button client:load /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Visible
&lt;/h3&gt;

&lt;p&gt;This will load the component with when the component is visible in the viewport. That means when the users sees the component in the screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;MyImage&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;visible&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Media
&lt;/h3&gt;

&lt;p&gt;Loading the component after matching a media query. This is useful for components that need to be rendered only in specific devices or screen sizes. You need to specify the media query in the directive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SidebarMobile&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;media&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;(max-width: 1024px)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Only
&lt;/h3&gt;

&lt;p&gt;In this case, the component will not render in build time. It will only be rendered in the browser. So you need to tu specity the library or framework in the directive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SomeReactComponent&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;only&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SomePreactComponent&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;only&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;preact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SomeSvelteComponent&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;only&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;svelte&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SomeVueComponent&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;only&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SomeSolidComponent&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;only&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;solid-js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  👩‍💻 Developer Experience in Astro
&lt;/h2&gt;

&lt;p&gt;Integrating Astro with React, Vue, Svelte, and other frameworks is very easy. You don't even need to change your code manually beacuse the Astro CLI will do it for you.&lt;/p&gt;

&lt;p&gt;While in this article, I will not build a whole website with Astro, this is how you start:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Install the Astro CLI and create a new project

npm create astro@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will ask you a few questions like the name of the project, if you want to use a template, if you want to use TypeScript, if you want to initialize a git repository, and so on:&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%2Fdzu71g58ni3gxiqx1bzw.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%2Fdzu71g58ni3gxiqx1bzw.png" alt="Installing Astro CLI and creating a website" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Adding React or any framework it’s as easy as type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;astro add &amp;lt;library/framework&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will install the dependencies, and if you want it will modify the Astro configuration file to accept React components.&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%2F8j8s57kuaqrr22krxe8y.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%2F8j8s57kuaqrr22krxe8y.png" alt="Set up Astro website with React" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you want to build a website with many interactive elements, that uses JavaScript in many places. You probably should not use Astro. Since it will force you to activate the Astro Islands in many components, using another approach would be fine.&lt;/p&gt;

&lt;p&gt;But if you want to build a website like a landing page or a personal website. Something that has zero or little interactivity with JavaScript on it, try Astro.&lt;/p&gt;

&lt;p&gt;The developer experience is awesome. I think you will love it.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>astro</category>
      <category>beginners</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Enhance your READMEs with native Mermaid diagrams</title>
      <dc:creator>Marcelo Arias</dc:creator>
      <pubDate>Mon, 16 Jan 2023 23:00:26 +0000</pubDate>
      <link>https://dev.to/marcelo_earth/enhance-your-readmes-with-native-mermaid-diagrams-3g7l</link>
      <guid>https://dev.to/marcelo_earth/enhance-your-readmes-with-native-mermaid-diagrams-3g7l</guid>
      <description>&lt;p&gt;Many times when we think about how to solve a problem we choose to draw a flowchart or another type of visualization with the aim that everything is clear and that we don't miss anything by the end.&lt;/p&gt;

&lt;p&gt;When explaining this part to our friends, it can be very helpful for them to also have clear diagrams of the core parts of a system. And on GitHub, we have a native solution within our Markdown files (like READMEs) for creating these diagrams:&lt;/p&gt;

&lt;p&gt;READMEs are a great way to provide a visual description of how your project works, from overall architecture to specific details. With flowcharts, you can illustrate the sequence of steps in a process, the different components of a system, or the relationship between elements (like classes).&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Mermaid?
&lt;/h2&gt;

&lt;p&gt;Mermaid is a popular library for creating diagrams and flowcharts from text. It is easy to use and can be used to create diagrams using simple text commands. It's also open source and you can use it in GitHub.&lt;/p&gt;

&lt;p&gt;In this article you will know how to use Mermaid to design diagrams with examples using the &lt;code&gt;mermaid&lt;/code&gt; tags.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use Mermaid tags?
&lt;/h2&gt;

&lt;p&gt;All you need to do is to define the diagram using a simple text-based syntax and then render the diagram using the &lt;code&gt;mermaid&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;For example, let's say I want a flowchart diagram of 4 components. The "A" node will have arrows to "B" and "C", and both "B" and "C" have arrows with a "D" node. I could represent this in code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart TD
A --&amp;gt; B;
A --&amp;gt; C;
B --&amp;gt; D;
C --&amp;gt; D;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And this code will render the following diagram:&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%2Fxd1b8nabn964xq495nlq.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%2Fxd1b8nabn964xq495nlq.jpeg" alt="Diagram with Mermaid" width="800" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, the syntax is quite simple and easy to understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mermaid Basics
&lt;/h2&gt;

&lt;p&gt;The Mermaid flowcharts are composed of nodes: shapes, edges, arrows and lines.&lt;/p&gt;

&lt;p&gt;You need to define the flowchart orientation at the beggining. In the example of above the diagram will go from top to the bottom. But other orientations are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TB - top to bottom&lt;/li&gt;
&lt;li&gt;TD - top-down/ same as top to bottom&lt;/li&gt;
&lt;li&gt;BT - bottom to top&lt;/li&gt;
&lt;li&gt;RL - right to left&lt;/li&gt;
&lt;li&gt;LR - left to right&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition to flowcharts, Mermaid can also be used to create a variety of other diagrams, such as sequence diagrams.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sequence Diagrams
&lt;/h2&gt;

&lt;p&gt;To draw a Sequence Diagram, you need to write "sequenceDiagram" in the first line.&lt;/p&gt;

&lt;p&gt;After that, you can connect with arrows two nodes. Using the characters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is an example of a sequence diagram created with Mermaid:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sequenceDiagram
    Alice-&amp;gt;&amp;gt;+John: Hello John, how are you?
    Alice-&amp;gt;&amp;gt;+John: John, can you hear me?
    John--&amp;gt;&amp;gt;-Alice: Hi Alice, I can hear you!
    John--&amp;gt;&amp;gt;-Alice: I feel great!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Ftijmu7duon9anrqpdbrr.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%2Ftijmu7duon9anrqpdbrr.jpeg" alt="Sequence Diagram example of Alice and John nodes" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  State Diagrams
&lt;/h2&gt;

&lt;p&gt;A state diagram is used to describe the flow of a variable. And you can also create a State Diagram using Mermaid. Starting with the &lt;code&gt;stateDiagram&lt;/code&gt; and making connections between nodes with the characters: &lt;code&gt;--&amp;gt;&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stateDiagram
    [*] --&amp;gt; Still
    Still --&amp;gt; [*]
    Still --&amp;gt; Moving
    Moving --&amp;gt; Still
    Moving --&amp;gt; Crash
    Crash --&amp;gt; [*]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result will be the following:&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%2F69q0woqbcehq3eqb75au.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%2F69q0woqbcehq3eqb75au.jpeg" alt="State Diagram Example" width="800" height="636"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Class Diagram
&lt;/h2&gt;

&lt;p&gt;A class diagram is a great way to visualize relationships between classes. In this case, you will need to write the classes methods and you can add relationships between classes using other type of arrows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;classDiagram
    Animal &amp;lt;|-- Duck
    Animal &amp;lt;|-- Fish
    Animal &amp;lt;|-- Zebra
    Animal : +int age
    Animal : +String gender
    Animal: +isMammal()
    Animal: +mate()
    class Duck{
      +String beakColor
      +swim()
      +quack()
    }
    class Fish{
      -int sizeInFeet
      -canEat()
    }
    class Zebra{
      +bool is_wild
      +run()
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fggpqmf6xtyx9e3kmisgw.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%2Fggpqmf6xtyx9e3kmisgw.jpeg" alt="Class Diagram Example" width="800" height="593"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creation of other diagrams dynamically
&lt;/h2&gt;

&lt;p&gt;How can you make the process of drawing diagrams even easier?&lt;/p&gt;

&lt;p&gt;With &lt;a href="https://mermaid.live" rel="noopener noreferrer"&gt;Mermaid Live Editor&lt;/a&gt; you can create diagrams directly on the web. Using this website, every change you make on the code editor in the left side is reflected on the result in the right side. Like a CodePen.&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%2Fhwq0mm0hwoe12xevo8ec.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%2Fhwq0mm0hwoe12xevo8ec.jpeg" alt="Mermaid Live Editor" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>writing</category>
      <category>markdown</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How do TensorFlow.js models load in the browser?</title>
      <dc:creator>Marcelo Arias</dc:creator>
      <pubDate>Sat, 31 Dec 2022 16:15:14 +0000</pubDate>
      <link>https://dev.to/marcelo_earth/how-do-tensorflowjs-models-load-in-the-browser-3fbj</link>
      <guid>https://dev.to/marcelo_earth/how-do-tensorflowjs-models-load-in-the-browser-3fbj</guid>
      <description>&lt;p&gt;In a previous post I wrote about TensorFlow.js and how it can be used to build and deploy deep learning models in the browser. In this post I will focus &lt;strong&gt;on how TensorFlow.js models are loaded in the browser&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Most of the times Machine Learning models are used from an API. But TensorFlow.js brings those models to the user browser. The process behind this is very interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Toxicity Model
&lt;/h2&gt;

&lt;p&gt;There are many ways to load and use TensorFlow.js models.&lt;/p&gt;

&lt;p&gt;Let's say you want to load the &lt;a href="https://tfhub.dev/tensorflow/tfjs-model/toxicity/1/default/1" rel="noopener noreferrer"&gt;Toxicity model&lt;/a&gt;. Toxicity is a model that can detect toxicity in text.&lt;/p&gt;

&lt;p&gt;This is the kind of model you can load directly from an NPM package after install it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as toxicity from "@tensorflow-models/toxicity";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, now you can load the model by calling &lt;code&gt;toxicity.load()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Toxicity.load()&lt;/code&gt; it's a wrapper around &lt;code&gt;tf.loadGraphModel()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tf.loadGraphModel()&lt;/code&gt; is a function that loads a TensorFlow.js model from a URL or a local file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Process of loading the model
&lt;/h2&gt;

&lt;p&gt;Even when you install a model with NPM, the model is not inside the package. When you need to use the model this will fire a network call to download the model.&lt;/p&gt;

&lt;p&gt;Because the model is loaded asynchronously, you need to wait for the model to load before you can use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const model = await toxicity.load();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is something we can see from the &lt;strong&gt;Network tab&lt;/strong&gt; in Chrome Developer Tools:&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%2Fcml3ipr1b2cgm0ozx2yu.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%2Fcml3ipr1b2cgm0ozx2yu.png" alt="Screenshot of Network tab when Toxicity Model is loaded" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Shards
&lt;/h3&gt;

&lt;p&gt;The Toxicity model is a large model, so it's split into multiple files. The files are called shards. The shards are loaded in parallel, and then they are combined into a single model.&lt;/p&gt;

&lt;p&gt;This allows you to load the model more efficiently, especially when loading large models over a slow connection. TensorFlow.js automatically handles the process of downloading and combining the shards to create the full model.&lt;/p&gt;

&lt;p&gt;Not all the models are split into shards, some models can be loaded as single files because they are not very large.&lt;/p&gt;

&lt;h3&gt;
  
  
   Storage
&lt;/h3&gt;

&lt;p&gt;This model will be storaged in local memory, so you don't need to worry about downloading the model each time you run your application.&lt;/p&gt;

&lt;p&gt;Once the model is complete, you can start using it through your app.&lt;/p&gt;

&lt;p&gt;This was the internal process of loading machine learning models in the browser using TensorFlow.js.&lt;/p&gt;

</description>
      <category>tensorflow</category>
      <category>machinelearning</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Benefits of Pair Programming for Problem-Solving</title>
      <dc:creator>Marcelo Arias</dc:creator>
      <pubDate>Mon, 19 Dec 2022 23:23:56 +0000</pubDate>
      <link>https://dev.to/marcelo_earth/the-benefits-of-pair-programming-for-problem-solving-48b1</link>
      <guid>https://dev.to/marcelo_earth/the-benefits-of-pair-programming-for-problem-solving-48b1</guid>
      <description>&lt;p&gt;&lt;strong&gt;Pair programming&lt;/strong&gt; is when two developers work together at one workstation. Not necessarily on the same computer, but they work together on the same programming task. In remote work I love to use &lt;a href="https://visualstudio.microsoft.com/services/live-share/" rel="noopener noreferrer"&gt;Visual Studio Live Share&lt;/a&gt; ❤️.&lt;/p&gt;

&lt;p&gt;This approach can have numerous benefits, such as increased efficiency and knowledge sharing, but in certain situations it may also have some disadvantages.&lt;/p&gt;

&lt;p&gt;Let's explore the benefits and disadvantages of pair programming in more detail, and how it can help you with problem-solving.&lt;/p&gt;

&lt;h2&gt;
  
  
  👀 Increased Efficiency
&lt;/h2&gt;

&lt;p&gt;Pair programming can significantly increase the efficiency with which a software development task is completed.&lt;/p&gt;

&lt;p&gt;This is because two sets of eyes are better than one when it comes to spotting errors or finding better solutions.&lt;/p&gt;

&lt;p&gt;The two individuals are able to bounce ideas off each other, come up with creative solutions, and quickly identify any mistakes that may have been made. This can save a lot of time and effort in the long run.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✅ Improved Quality of Work
&lt;/h2&gt;

&lt;p&gt;Pair programming can also help to improve the quality of work produced.&lt;/p&gt;

&lt;p&gt;This is because two people are able to review each other's work and offer constructive criticism.&lt;/p&gt;

&lt;p&gt;This can help to identify any mistakes or areas of improvement, which can be addressed quickly and effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  📖 Knowledge sharing
&lt;/h2&gt;

&lt;p&gt;Another advantage of pair programming is that it promotes knowledge sharing and learning.&lt;/p&gt;

&lt;p&gt;By working with a partner, developers can learn from each other and expand their skills and expertise.&lt;/p&gt;

&lt;p&gt;This is especially useful for junior developers who are learning the ropes, as they can get real-time feedback and guidance from more experienced team members.&lt;/p&gt;

&lt;p&gt;But also...&lt;/p&gt;

&lt;h2&gt;
  
  
  😬 Disadvantages
&lt;/h2&gt;

&lt;p&gt;One potential disadvantage is that it can be slower than working individually. When two people are working on a task together, there may be more discussion and collaboration involved, which can slow down the pace of work.&lt;/p&gt;

&lt;p&gt;Another potential disadvantage is that pair programming may not work well for all personalities or work styles. Some people may find it difficult to work closely with another person for extended periods of time, and may prefer to work independently.&lt;/p&gt;

&lt;p&gt;In conclusion, while pair programming can be a powerful tool for problem-solving, it may not be the best fit for every situation or team. It is important to carefully consider the pros and cons and determine whether it is a viable option for your specific needs.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>tips</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Rendering Web Methods in Next.js</title>
      <dc:creator>Marcelo Arias</dc:creator>
      <pubDate>Fri, 09 Dec 2022 15:12:21 +0000</pubDate>
      <link>https://dev.to/marcelo_earth/rendering-web-methods-in-nextjs-2e7</link>
      <guid>https://dev.to/marcelo_earth/rendering-web-methods-in-nextjs-2e7</guid>
      <description>&lt;p&gt;I've been developing web applications for over seven years now, and I've seen a lot of different methods for rendering webpages.&lt;/p&gt;

&lt;p&gt;I started with PHP, and for a long time, server-side rendering was the only option. In PHP the server is responsible for generating the HTML of the page, and it is send directly to the client.&lt;/p&gt;

&lt;p&gt;This worked well, but then two years later I learned Node.js and Next.js. This was a paradigm shift for me, as I was now able to do client-side rendering, but also static side generation and (again) server-side rendering.&lt;/p&gt;

&lt;p&gt;In this article, you'll discover the most common rendering web methods: &lt;strong&gt;client side rendering, server side rendering, and static site generation&lt;/strong&gt; with its advantages and disadvantages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Client Side Rendering (CSR)
&lt;/h2&gt;

&lt;p&gt;CSR is the process of rendering the content of a web page in the browser, using JavaScript. It works by sending a request to the server for HTML and other resources, then rendering the page in the browser.&lt;/p&gt;

&lt;p&gt;✅ Easy development.&lt;/p&gt;

&lt;p&gt;❌ Search engine optimization (SEO) can be a challenge since crawlers may not be able to index the content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Server Side Rendering (SSR)
&lt;/h2&gt;

&lt;p&gt;SSR is the process of generating HTML on the server and sending it to the browser. The main advantage of SSR is that it allows for full page rendering, including the ability to render different content depending on the user, such as language or device type.&lt;/p&gt;

&lt;p&gt;✅ Content is generated on the server and sent to the client, making it easier to optimize for SEO.&lt;/p&gt;

&lt;p&gt;❌ The initial page load can be slower, as the server needs to generate the HTML, CSS and JavaScript files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Static Site Generation (SSG)
&lt;/h2&gt;

&lt;p&gt;SSR works by pre-rendering the application on the server and creating a set of static HTML files which can be served directly to the browser.&lt;/p&gt;

&lt;p&gt;✅ The main advantage of SSG is that it can improve performance and reduce the amount of time needed to render the page in the browser.&lt;/p&gt;

&lt;p&gt;❌ Because static sites are built from pre-generated files, it can be more difficult to make changes to the design and layout of a static site than it is to make changes to a dynamic site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommendations
&lt;/h2&gt;

&lt;p&gt;So which you should use? A CSR web app is very easy to develop. Now, if you have the time to develop a SSR. But because of the advantages that SSR presents, if you have resources (time) to spend, you should consider switching to SSR.&lt;/p&gt;

&lt;p&gt;Finally, checking the Next.js documentation we can found the following statement:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We &lt;strong&gt;recommend&lt;/strong&gt; using &lt;strong&gt;Static Generation&lt;/strong&gt; over Server-side Rendering for performance reasons. Statically generated pages can be cached by CDN with no extra configuration to boost performance. However, in some cases, Server-side Rendering might be the only option.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>security</category>
      <category>cloud</category>
      <category>devops</category>
      <category>nginx</category>
    </item>
    <item>
      <title>Power up your web apps with TensorFlow.js</title>
      <dc:creator>Marcelo Arias</dc:creator>
      <pubDate>Sun, 04 Dec 2022 23:30:57 +0000</pubDate>
      <link>https://dev.to/marcelo_earth/power-up-your-web-apps-with-tensorflowjs-15o5</link>
      <guid>https://dev.to/marcelo_earth/power-up-your-web-apps-with-tensorflowjs-15o5</guid>
      <description>&lt;p&gt;&lt;strong&gt;Are you looking to add the power of machine learning to your web applications?&lt;/strong&gt; Look no further than &lt;a href="https://www.tensorflow.org/js" rel="noopener noreferrer"&gt;TensorFlow.js&lt;/a&gt;, the open-source library that brings the capabilities of TensorFlow to JavaScript.&lt;/p&gt;

&lt;p&gt;TensorFlow.js is a library for developing and training machine learning models in JavaScript. It allows web developers to create and train models directly in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  What can be achieved with TensorFlow on the Web?
&lt;/h2&gt;

&lt;p&gt;For a few months I have been watching "&lt;a href="https://www.youtube.com/watch?v=3xvU6V18-Ac&amp;amp;list=PLQY2H8rRoyvzSZZuF0qJpoJxZR1NgzcZw" rel="noopener noreferrer"&gt;Made with TensorFlow.js&lt;/a&gt;", a series of videos where they present products made with this library like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://youtu.be/9zqjgeqc-ew" rel="noopener noreferrer"&gt;Satellite Image Classification&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/JQksipdQiGI" rel="noopener noreferrer"&gt;Grocery store recommendation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/HcstcWAk2a4" rel="noopener noreferrer"&gt;Remote physiotherapy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/p6x-_7hamjw" rel="noopener noreferrer"&gt;Sentiment analysis in Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/Ns6A3yqqzQY" rel="noopener noreferrer"&gt;Realistic avatars&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/aNAZxV8yQHM" rel="noopener noreferrer"&gt;3D MRI brain&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/x-HH0kwbO-4" rel="noopener noreferrer"&gt;Realtime AR Sudoku solver&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Imagine yourself developing engaging and interactive user experiences using machine learning-powered features such as object recognition, natural language processing, and predictive analytics...&lt;/p&gt;

&lt;h2&gt;
  
  
  What do you need to learn to use TensorFlow.js?
&lt;/h2&gt;

&lt;p&gt;I've launched my &lt;a href="https://github.com/360macky/scanner-cam" rel="noopener noreferrer"&gt;first web application&lt;/a&gt; with this technology. And I'm currently reading the "&lt;a href="https://www.oreilly.com/library/view/learning-tensorflowjs/9781492090786/" rel="noopener noreferrer"&gt;Learning TensorFlow.js&lt;/a&gt;" book.&lt;/p&gt;

&lt;p&gt;So far, I believe that to understand TensorFlow.js, you should have a basic understanding of machine learning concepts and techniques. This includes understanding how to train and evaluate machine learning models. It would highly recommended some knowledge of the mathematics behind common machine learning algorithms.&lt;/p&gt;

&lt;p&gt;With this I do not mean that you should know specifically how to develop a neural network, but &lt;strong&gt;having an understanding of the core concepts of machine learning is a requirement&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To guide you better, this is a list of questions that you should be able to answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is a neural network?&lt;/li&gt;
&lt;li&gt;What is a machine learning model?&lt;/li&gt;
&lt;li&gt;What is the difference between supervised and unsupervised learning? &lt;/li&gt;
&lt;li&gt;What are the differences between classification and regression?&lt;/li&gt;
&lt;li&gt;What is the purpose of normalization?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Learning TensorFlow.js can be a valuable investment for anyone interested in using machine learning in their web applications. With its powerful, flexible API and easy-to-use tools, TensorFlow.js makes it possible to build intelligent, interactive web applications that can run on any platform.&lt;/p&gt;

&lt;p&gt;Whether you're a machine learning expert looking to incorporate your models into web apps, or a web developer interested in incorporating the power of AI into your projects, TensorFlow.js offers a great way to get started.&lt;/p&gt;

&lt;p&gt;So why wait? Start learning TensorFlow.js and unlock the potential of machine learning for your web applications.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>discuss</category>
    </item>
    <item>
      <title>What makes Web Accessibility so important?</title>
      <dc:creator>Marcelo Arias</dc:creator>
      <pubDate>Fri, 02 Dec 2022 01:17:21 +0000</pubDate>
      <link>https://dev.to/marcelo_earth/what-makes-web-accessibility-so-important-28g1</link>
      <guid>https://dev.to/marcelo_earth/what-makes-web-accessibility-so-important-28g1</guid>
      <description>&lt;p&gt;One day, when I was in high school developing my first websites, I wondered how would people with disabilities access a computer, application or website? It is then that I discovered the concept of &lt;strong&gt;Web Accessibility&lt;/strong&gt; or &lt;strong&gt;Web a11y&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Web accessibility is important because it &lt;strong&gt;enables people with disabilities to access the same information, services, and opportunities available to everyone else&lt;/strong&gt;. It ensures that they can effectively and independently use the web.&lt;/p&gt;

&lt;p&gt;It also helps to improve the user experience for all users, regardless of their abilities.&lt;/p&gt;

&lt;p&gt;Accessible websites are easier to navigate, and are more user-friendly.&lt;/p&gt;

&lt;p&gt;In addition, web accessibility helps to increase the visibility of websites and web applications, improving their potential reach. By making sure that websites are accessible, companies can ensure that their work reaches the maximum number of people.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making a web accessible
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ARIA
&lt;/h3&gt;

&lt;p&gt;ARIA (&lt;strong&gt;Accessible Rich Internet Applications&lt;/strong&gt;) is a set of attributes that developers can add to HTML elements to make them more accessible to users with disabilities.&lt;/p&gt;

&lt;p&gt;ARIA works by adding extra information to HTML elements that helps assistive technologies, such as screen readers, in understanding how elements on the page are used and how they relate to each other.&lt;/p&gt;

&lt;p&gt;This extra information allows assistive technologies to more accurately interpret the page and provide a better experience for users with disabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Google Lighthouse
&lt;/h3&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%2F36plznshm7sbfp6jux6r.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%2F36plznshm7sbfp6jux6r.png" alt="Google Lighthouse Metrics: Performance, Progressive Web App, Accessibility, Best Practices, SEO" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk?hl=en" rel="noopener noreferrer"&gt;Google Lighthouse&lt;/a&gt;, an automated tool for improving web accessibility, provides a checklist of criteria that web developers should consider when building websites. These criteria ensure that people with disabilities can properly interact with websites.&lt;/p&gt;

&lt;p&gt;If you want to start, there are a few things you can do, such as &lt;a href="https://www.mtu.edu/accessibility/training/web/link-text/" rel="noopener noreferrer"&gt;using descriptive link text&lt;/a&gt;, providing &lt;a href="https://www.w3schools.com/tags/att_img_alt.asp" rel="noopener noreferrer"&gt;alternative text for images&lt;/a&gt;, and using a semantic markup language. You can also use tools such as screen readers and screen magnifiers to make sure everything works good.&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%2F297sbwyibahv57w6bkf0.jpg" 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%2F297sbwyibahv57w6bkf0.jpg" alt="VoiceOver feature on Mac for screen reading" width="800" height="579"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Making an entire (already built) website accessible takes much more.&lt;/p&gt;

&lt;p&gt;But it is worth it!&lt;/p&gt;




&lt;p&gt;As web developers, &lt;strong&gt;it is our responsibility to make sure that our work is accessible to everyone&lt;/strong&gt;. It is an important part of creating an equal digital experience.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>a11y</category>
      <category>codequality</category>
    </item>
  </channel>
</rss>
