<?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: Paweł Ciosek</title>
    <description>The latest articles on DEV Community by Paweł Ciosek (@pavelee).</description>
    <link>https://dev.to/pavelee</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%2F427274%2F4ac6c989-1e5e-44ab-b87b-584ec5e54804.jpeg</url>
      <title>DEV Community: Paweł Ciosek</title>
      <link>https://dev.to/pavelee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pavelee"/>
    <language>en</language>
    <item>
      <title>Minify your images and save the planet 🌍🙏</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Sun, 12 May 2024 21:28:29 +0000</pubDate>
      <link>https://dev.to/pavelee/minify-your-images-and-save-the-planet-4bnc</link>
      <guid>https://dev.to/pavelee/minify-your-images-and-save-the-planet-4bnc</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the Netlify Dynamic Site Challenge: Visual Feast, Build with Blobs&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I have created a tool to optimize your images, which also analyzes how much CO2 we will save by transferring reduced images!&lt;/p&gt;

&lt;p&gt;The idea is simple, you can upload your images and download them after optimization, thanks to which your content will be more optimal and ecological! I made sure that it is possible to upload many files at once and download them all with one click 😎&lt;/p&gt;

&lt;p&gt;Additionally, we count how much we potentially managed to reduce CO2 emissions 🌲 by reducing the energy needed to send content! Cool! After optimization, you have a chance to become contributors in the fight against co2 emissions 🏅&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://main--optimizer-netlify-challange.netlify.app"&gt;Link to demo&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/pavelee"&gt;
        pavelee
      &lt;/a&gt; / &lt;a href="https://github.com/pavelee/optimizer-netlify-challenge"&gt;
        optimizer-netlify-challenge
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Image Optimizer&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/4d7df01b73951abe66550fbc30b4ef98e5fbd2ca620f76eaa01280bd99d3893c/68747470733a2f2f6d656469612e6465762e746f2f63646e2d6367692f696d6167652f77696474683d3830302532436865696768743d2532436669743d7363616c652d646f776e253243677261766974793d6175746f253243666f726d61743d6175746f2f68747470732533412532462532466465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d25324675706c6f61647325324661727469636c65732532466830756c7177313766333565707a7676776a76642e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/4d7df01b73951abe66550fbc30b4ef98e5fbd2ca620f76eaa01280bd99d3893c/68747470733a2f2f6d656469612e6465762e746f2f63646e2d6367692f696d6167652f77696474683d3830302532436865696768743d2532436669743d7363616c652d646f776e253243677261766974793d6175746f253243666f726d61743d6175746f2f68747470732533412532462532466465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d25324675706c6f61647325324661727469636c65732532466830756c7177313766333565707a7676776a76642e706e67" alt="app"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What is this?&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;This is submission to &lt;a href="https://dev.to/devteam/join-us-for-the-netlify-dynamic-site-challenge-3000-in-prizes-3mfn" rel="nofollow"&gt;https://dev.to/devteam/join-us-for-the-netlify-dynamic-site-challenge-3000-in-prizes-3mfn&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It uses Netlify's CDN and blob store to optimize images on the fly.&lt;/p&gt;
&lt;p&gt;More info here: &lt;a href="https://dev.to/pavelee/minify-your-images-and-save-the-planet-4bnc" rel="nofollow"&gt;https://dev.to/pavelee/minify-your-images-and-save-the-planet-4bnc&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Developing Locally&lt;/h2&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clone this repository, then run &lt;code&gt;npm install&lt;/code&gt; in its root directory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For the starter to have full functionality locally (e.g. edge functions, blob store), please ensure you have an up-to-date version of Netlify CLI. Run:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;npm install netlify-cli@latest -g
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ol start="3"&gt;
&lt;li&gt;Link your local repository to the deployed Netlify site. This will ensure you're using the same runtime version for both local development and your deployed site.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;netlify link
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ol start="4"&gt;
&lt;li&gt;Then, run the Next.js development server via Netlify CLI:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;netlify dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If your browser doesn't navigate to the site automatically, visit &lt;a href="http://localhost:8888" rel="nofollow"&gt;localhost:8888&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Running locally on MacOs&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;You need to install curl on your local machine to run the netlify dev command. You can install curl using the following command:&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;brew install curl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/pavelee/optimizer-netlify-challenge"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0ulqw17f35epzvvwjvd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0ulqw17f35epzvvwjvd.png" alt="app screen" width="800" height="986"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Platform Primitives
&lt;/h2&gt;

&lt;p&gt;This challenge was not easy to start, initially I had no idea how to creatively use the indicated tools. The obvious idea is an image gallery, but as I'm not a great designer, I wanted to make something that would have a little more logic in it 😎&lt;/p&gt;

&lt;p&gt;After some time, I came up with an idea &lt;strong&gt;how to combine storage blob and CDN&lt;/strong&gt; to enable the user to optimize images? Such tools exist on the market, so there must be a problem! 👏&lt;/p&gt;

&lt;p&gt;Additionally, to diversify the topic a bit, I thought that an incentive for optimization could be the belief that the smaller the images, the less energy is needed to transfer them. Therefore, less energy, less CO2!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As for co2 counting, I use the library &lt;a href="https://www.npmjs.com/package/bytes-to-co2"&gt;https://www.npmjs.com/package/bytes-to-co2&lt;/a&gt; 👏&lt;br&gt;
As you can see, the problem is simplified for challenge purposes, in practice we have different co2 emissions depending on the country, it's not that simple! 🫣&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To perform the optimization underneath I query Netlify's CDN to perform the optimization and then I store it in a Blob. The user can set a lower quality to perform even greater image optimization 🥳&lt;/p&gt;

&lt;p&gt;Additionally, I use Blob as a Database 😅, I keep three objects there:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Image (basic information about file, size etc.)&lt;/li&gt;
&lt;li&gt;Asset (consists of images and information about them) &lt;/li&gt;
&lt;li&gt;AssetGroup (aggregates assets)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was curious how it would work and it's good! 👏 Suitable for a simplified database. This allowed me to model a system for calculating reduced weight and CO2 after optimization.&lt;/p&gt;

&lt;p&gt;Interestingly, when you upload, your AssetGroup will be created and its ID will appear in the link. This will allow you to return to your photos after refreshing the page! You can even share the link with someone else! 👏&lt;/p&gt;

&lt;p&gt;See you in the next challenge! 🚂♥️&lt;/p&gt;

</description>
      <category>netlifychallenge</category>
      <category>devchallenge</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Dev.to chatbot! 🤖</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Sun, 28 Apr 2024 20:50:58 +0000</pubDate>
      <link>https://dev.to/pavelee/devto-chat-bot-1di3</link>
      <guid>https://dev.to/pavelee/devto-chat-bot-1di3</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/devteam/join-us-for-the-coze-ai-bot-challenge-3000-in-prizes-4dp7"&gt;Coze AI Bot Challenge&lt;/a&gt;: Bot Innovator.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built dev.to chatbot! 🤓&lt;/p&gt;

&lt;p&gt;The bot is able to search the content of our beloved website and answer our questions.&lt;/p&gt;

&lt;p&gt;For example, you can ask him to send you an article on a specific topic, and he can also analyze the found content in terms of the information I am looking for! 🤓&lt;/p&gt;

&lt;p&gt;I see that it has potential as an advanced search engine for website content!&lt;/p&gt;

&lt;p&gt;To create the robot, I wrote a plugin for integration with the search engine and the dev.to API 🤗, more information in the journey section 🚂&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Link to bot: &lt;a href="https://www.coze.com/store/bot/7358908091464794117"&gt;https://www.coze.com/store/bot/7358908091464794117&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Your Configuration
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmt001rme7r38vem1ms95.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmt001rme7r38vem1ms95.png" alt="Image description" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Journey
&lt;/h2&gt;

&lt;p&gt;It was an interesting task, initially it seemed much simpler, but in practice I got a little tired 😅&lt;/p&gt;

&lt;p&gt;First of all, I want to mention that the coze.com platform is great! I had a lot of fun creating a bot or plugin is easy. I really like the built-in IDE for building the plugin, bravo! 👏&lt;/p&gt;

&lt;p&gt;I was wondering about the use case for using the robot. Why would it be of value to anyone. I had a problem with this, but I decided to build a prototype to see how the AI ​​would use what I prepared. 🧑‍💻&lt;/p&gt;

&lt;p&gt;At first I started using the "Browser" and "Google web search" plugins. However, the bot is unable to use the search engine on the dev.to website 😭 (it probably has problems with dynamically loaded content)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fappx4qunuahc06k5wkbl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fappx4qunuahc06k5wkbl.png" alt="Image description" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I thought there must be some other way 🫰, I started searching for the API and found it 🥳&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.forem.com/api/v1"&gt;https://developers.forem.com/api/v1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The great joy was quickly extinguished by the fact that the API does not have a search engine 😭, there is an end for downloading published articles, but the results are completely different, and that's what I wanted. 🙋&lt;/p&gt;

&lt;p&gt;Still looking for a solution, I started analyzing how the search engine works, guess what? I found that the search engine queries the endpoint underneath! 🥳 (not in the documentation 🫣)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://dev.to/search/feed_content
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Best of all, you can search not only articles but also users, podcasts, organizations, tags and comments! 🚀&lt;/p&gt;

&lt;p&gt;At this point I already had the integration tool, but how do I integrate it with the chatbot? 🤖&lt;/p&gt;

&lt;p&gt;The answer is a plugin! At the very beginning, I knew that I would need to prepare a simpler interface for the chatbot, so I immediately started working on a plugin built in the IDE. 🧑‍💻&lt;/p&gt;

&lt;p&gt;Ultimately, it turned out that I would need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;content search tools&lt;/li&gt;
&lt;li&gt;a tool to download article details (content), so that the chat bot can analyze the content in terms of the content I am looking for&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, along the way I created more tools, but these two remained as the most sensible ones.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iqkjwvq5w9br2iwle05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iqkjwvq5w9br2iwle05.png" alt="Image description" width="266" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I needed to add some of my own code, for example to build an appropriate query to the search engine endpoint:&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;buildSearchQuery&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Args&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Input&lt;/span&gt;&lt;span class="o"&gt;&amp;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;input&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;class_name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;objectTypeVales&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;per_page&lt;/span&gt;&lt;span class="dl"&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;60&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// it's default value on dev.to. We want chatbot to use search like a user.&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;page&lt;/span&gt;&lt;span class="dl"&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;0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// default value&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;search_fields&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phrase&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sort_by&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;newest&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="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&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="s2"&gt;sort_by&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;published_at&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sort_direction&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;desc&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="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sort_by&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;oldest&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="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&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="s2"&gt;sort_by&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;published_at&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sort_direction&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;asc&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="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URLSearchParams&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="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;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&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;query&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;p&gt;After writing the code, a plugin for dev.to was created 🤓 -&amp;gt; &lt;a href="https://www.coze.com/store/plugin/7362263649500741638"&gt;https://www.coze.com/store/plugin/7362263649500741638&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6c899u6z2z3mehqwoeb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6c899u6z2z3mehqwoeb.png" alt="Image description" width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With connecting the plugin to my bot, I got an answer to a question that the previous bot was unable to answer. 🥳&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2n7vkjhp5ohm9hyl1y0f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2n7vkjhp5ohm9hyl1y0f.png" alt="Image description" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last thing left to decide was which model to connect to the test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ChatGPT 3.5 -&amp;gt; quick replies, but unfortunately not very accurate&lt;/li&gt;
&lt;li&gt;ChatGPT 4 -&amp;gt; slower, responses much better. Unfortunately, there is too little context to analyze more content&lt;/li&gt;
&lt;li&gt;ChatGPT 4 turbo -&amp;gt; even slower, but gives the best results.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, I set ChatGPT 4 Turbo, after testing it is the most practical for a chatbot.&lt;/p&gt;

&lt;p&gt;I'm curious about your chatbot use! Is it practical for you? How can it be developed?&lt;/p&gt;

&lt;p&gt;See you in the next challenge!&lt;/p&gt;

</description>
      <category>cozechallenge</category>
      <category>devchallenge</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Empowering Creative Writing with AI: An Introduction to the Cloudflare AI Challenge Markdown Editor</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Sun, 14 Apr 2024 19:59:51 +0000</pubDate>
      <link>https://dev.to/pavelee/empowering-creative-writing-with-ai-an-introduction-to-the-cloudflare-ai-challenge-markdown-editor-5agf</link>
      <guid>https://dev.to/pavelee/empowering-creative-writing-with-ai-an-introduction-to-the-cloudflare-ai-challenge-markdown-editor-5agf</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99"&gt;Cloudflare AI Challenge&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built tool to allow write your posts with AI assistance. Genuinely it's basic markdown editor, but with handful AI tools around it!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI assistant - chat with AI, ask about anything, you can select preferred model&lt;/li&gt;
&lt;li&gt;AI title generator - generating propose of title based on your text summary&lt;/li&gt;
&lt;li&gt;AI cover generator - generating propose of cover based on your text summary &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I tried it myself, and creating titles or covers from my post is handy! 🤓&lt;/p&gt;

&lt;p&gt;What's crucial is that I wanted to avoid creating an app for generating posts, instead, I aim to encourage people to write on their own. &lt;strong&gt;Let's be pilots, and keep AI as co-pilot.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="//pokemon-guess.pages.dev"&gt;Link to app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26pf3mel47ieij0srcqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26pf3mel47ieij0srcqt.png" alt="Image description" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/pavelee"&gt;
        pavelee
      &lt;/a&gt; / &lt;a href="https://github.com/pavelee/cloudflare-challange-post-ai"&gt;
        cloudflare-challange-post-ai
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      write post with AI assistance, dev.to challenge
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;This is a &lt;a href="https://nextjs.org/" rel="nofollow"&gt;Next.js&lt;/a&gt; project bootstrapped with &lt;a href="https://github.com/vercel/next.js/tree/canary/packages/create-next-app"&gt;&lt;code&gt;create-next-app&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;First, run the development server:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm run dev
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
yarn dev
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
pnpm dev
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
bun dev&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Open &lt;a href="http://localhost:3000" rel="nofollow"&gt;http://localhost:3000&lt;/a&gt; with your browser to see the result.&lt;/p&gt;
&lt;p&gt;You can start editing the page by modifying &lt;code&gt;app/page.tsx&lt;/code&gt;. The page auto-updates as you edit the file.&lt;/p&gt;
&lt;p&gt;This project uses &lt;a href="https://nextjs.org/docs/basic-features/font-optimization" rel="nofollow"&gt;&lt;code&gt;next/font&lt;/code&gt;&lt;/a&gt; to automatically optimize and load Inter, a custom Google Font.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Learn More&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;To learn more about Next.js, take a look at the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nextjs.org/docs" rel="nofollow"&gt;Next.js Documentation&lt;/a&gt; - learn about Next.js features and API.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nextjs.org/learn" rel="nofollow"&gt;Learn Next.js&lt;/a&gt; - an interactive Next.js tutorial.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can check out &lt;a href="https://github.com/vercel/next.js/"&gt;the Next.js GitHub repository&lt;/a&gt; - your feedback and contributions are welcome!&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Deploy on Vercel&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;The easiest way to deploy your Next.js app is to use the &lt;a href="https://vercel.com/new?utm_medium=default-template&amp;amp;filter=next.js&amp;amp;utm_source=create-next-app&amp;amp;utm_campaign=create-next-app-readme" rel="nofollow"&gt;Vercel Platform&lt;/a&gt; from the creators of Next.js.&lt;/p&gt;
&lt;p&gt;Check out our &lt;a href="https://nextjs.org/docs/deployment" rel="nofollow"&gt;Next.js deployment documentation&lt;/a&gt; for more details.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;&lt;code&gt;@cloudflare/next-on-pages&lt;/code&gt;&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;&lt;code&gt;@cloudflare/next-on-pages&lt;/code&gt;…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/pavelee/cloudflare-challange-post-ai"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Journey
&lt;/h2&gt;

&lt;p&gt;It was really full of fun project! 🥳&lt;/p&gt;

&lt;p&gt;AI apps still have some magic within! 🤓&lt;/p&gt;

&lt;p&gt;I am quite impressed with Cloudflare for releasing such an excellent feature, using models is pretty easy. The documentation is clear 👏&lt;/p&gt;

&lt;p&gt;I deployed app on Cloudflare Pages. Typically I use Vercel could 😅, but I wanted to give it a try. Deploying was pretty ok, with some troubles. After reading docs I was able to deploy Next.js to Pages 👏 Cool! 😎&lt;/p&gt;

&lt;p&gt;My first problem was storage 💾, my goal was to allow user keep their work and chat history. Firstly I thought to use supabase but I noticed that Cloudflare has a KV! KV is a simple key-value storage. Great for this kind of an app! 🤓 &lt;/p&gt;

&lt;p&gt;My second problem was data structure. I needed nested object, called "project" 🫣 and KV is flat 🌏 storage. Solution was to storage it as a JSON! 😅 Not an optimal way but it is a pretty enough to develop the app!&lt;/p&gt;

&lt;p&gt;My third problem was generating title for the post. I couldn't pass the whole text to "text generation" model because it was too huge 🫣. Solution was to use "summary model" as a proxy! 🤓&lt;/p&gt;

&lt;p&gt;What I proud of &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I was able to host the whole project on Cloudflare infrastructure! 👏&lt;/li&gt;
&lt;li&gt;storage configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I created interface:&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="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Storage&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&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;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&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;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&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;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;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;p&gt;then I implemented "KVStorage" and configured it inside the config file&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;KVStorage&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../util/storage/KVStorage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Storage&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../util/storage/Storage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cloudfrareKey&lt;/span&gt; &lt;span class="o"&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;CLOUDDLARE_KV_API_KEY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cfAccountId&lt;/span&gt; &lt;span class="o"&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;CLOUDFLARE_ACCOUNT_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cloudflareKvNamespaceId&lt;/span&gt; &lt;span class="o"&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;CLOUDFLARE_KV_NAMESPACE_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;cloudfrareKey&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;cfAccountId&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;cloudflareKvNamespaceId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Cloudflare key or account ID is missing&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="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Storage&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;KVStorage&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;cfAccountId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;cloudflareKvNamespaceId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;cloudfrareKey&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the app I am using storage object that implement interface so you can easily change to other storage! 🥳&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiple Models and/or Triple Task Types&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AI Assistant
&lt;/h3&gt;

&lt;p&gt;Based on text generation models, user can choose from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;meta/llama-2-7b-chat-fp16&lt;/li&gt;
&lt;li&gt;thebloke/openhermes-2.5-mistral-7b-awq&lt;/li&gt;
&lt;li&gt;mistral/mistral-7b-instruct-v0.1&lt;/li&gt;
&lt;li&gt;tiiuae/falcon-7b-instruct&lt;/li&gt;
&lt;li&gt;google/gemma-2b-it-lora&lt;/li&gt;
&lt;li&gt;nousresearch/hermes-2-pro-mistral-7b&lt;/li&gt;
&lt;li&gt;thebloke/llama-2-13b-chat-awq&lt;/li&gt;
&lt;li&gt;qwen/qwen1.5-14b-chat-awq&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  AI Title Generator
&lt;/h3&gt;

&lt;p&gt;First I use "bart-large-cnn" to summary text:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;facebook/bart-large-cnn&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then I use "nousresearch/hermes-2-pro-mistral-7b" to generate title&lt;/p&gt;

&lt;h3&gt;
  
  
  AI Cover Generator
&lt;/h3&gt;

&lt;p&gt;First I use "bart-large-cnn" to summary text:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;facebook/bart-large-cnn&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;then user can use one of models:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;lykon/dreamshaper-8-lcm&lt;/li&gt;
&lt;li&gt;runwayml/stable-diffusion-v1-5-img2img&lt;/li&gt;
&lt;li&gt;runwayml/stable-diffusion-v1-5-inpainting&lt;/li&gt;
&lt;li&gt;stabilityai/stable-diffusion-xl-base-1.0&lt;/li&gt;
&lt;li&gt;bytedance/stable-diffusion-xl-lightning&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cloudflarechallenge</category>
      <category>devchallenge</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>we_coded iMac CSS Art</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Sat, 30 Mar 2024 22:25:01 +0000</pubDate>
      <link>https://dev.to/pavelee/wecoded-imac-css-art-1ofd</link>
      <guid>https://dev.to/pavelee/wecoded-imac-css-art-1ofd</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for DEV Challenge v24.03.20, CSS Art: Favorite Snack.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspiration
&lt;/h2&gt;

&lt;p&gt;My inspiration was apple iMac (Mac in css 😅), although we still celebrating we_coded 2024, so I wonder how could I join both ideas! Create the art and support the great event! 🤓&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ty1swuafis2d7tt8anx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ty1swuafis2d7tt8anx.png" alt="Image description" width="800" height="693"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;source code: &lt;a href="https://github.com/pavelee/css_art"&gt;https://github.com/pavelee/css_art&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/css-art-n6pp56"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Journey
&lt;/h2&gt;

&lt;p&gt;It's my first time creating css art! 🥳&lt;/p&gt;

&lt;p&gt;Firstly I thought it's gonna be harder, but step by step I was moving forward. What important I had really fun time! 🤗&lt;/p&gt;

&lt;p&gt;Getting good CSS structure is still challenging for me, I used pure CSS without any preprocessors and I could say it's pretty hard to make it clear! 🥲&lt;/p&gt;

&lt;p&gt;I thought how could I refractor the code. I tried to create mac's window template, so it's reusable and shared across two windows on my Mac&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="c"&gt;&amp;lt;!-- window tempalte --&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- &amp;lt;div class="window"&amp;gt;
    &amp;lt;div class="bar"&amp;gt;
      &amp;lt;div class="controls"&amp;gt;
        &amp;lt;div class="close"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;div class="minimize"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;div class="maximize"&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div class="title"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class="body"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt; --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For sure it's a good direction to keep it more clear! 🚂&lt;/p&gt;

&lt;p&gt;That was a good time 🧑‍💻, thanks for the challange! ♥️&lt;/p&gt;

</description>
      <category>frontendchallenge</category>
      <category>devchallenge</category>
      <category>css</category>
      <category>wecoded</category>
    </item>
    <item>
      <title>CoLlama 🦙 - code autocompletion (local machine and free)</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Sat, 24 Feb 2024 19:50:42 +0000</pubDate>
      <link>https://dev.to/pavelee/collama-code-autocompletion-local-machine-and-free-49l1</link>
      <guid>https://dev.to/pavelee/collama-code-autocompletion-local-machine-and-free-49l1</guid>
      <description>&lt;p&gt;In the recent post, I write about using codellama as our local version of code assistant.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/pavelee" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F427274%2F4ac6c989-1e5e-44ab-b87b-584ec5e54804.jpeg" alt="pavelee"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/pavelee/colamma-ollama-as-your-ai-coding-assistant-local-machine-and-free-5694" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;CoLlama 🦙 - ollama as your AI coding assistant (local machine and free)&lt;/h2&gt;
      &lt;h3&gt;Paweł Ciosek ・ Jan 1&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#ai&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ollama&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#githubcopilot&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#codenewbie&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;There was a sentence:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The extension do not support code completion, if you know extension that support code completion, please let me know in the comments. 🙏&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You know what? I found a way to use llama to support code autocompletion! 🥳&lt;/p&gt;

&lt;p&gt;As you guess 🤓 you need ollama installed locally, if you don't have, take a look to the previous post 🙏&lt;/p&gt;

&lt;p&gt;So what we need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ollama model &lt;strong&gt;codellama:7b-code&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;extension CodyAI -&amp;gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai" rel="noopener noreferrer"&gt;https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's configure it together, step by step! 🧑‍💻&lt;/p&gt;

&lt;h4&gt;
  
  
  Download codellama:7b-code
&lt;/h4&gt;

&lt;p&gt;Extension require this model, you cannot choose any other 🫣, but it is pretty good optimised to the job ⚙️  &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

ollama pull codellama:7b-code


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

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.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%2F6nh0vlwhquzwq5cjz2b1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F6nh0vlwhquzwq5cjz2b1.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Install CodyAI extension
&lt;/h4&gt;

&lt;p&gt;You gonna find it in an extension browser bar by searching "cody ai"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1ah72kwjcgjjf7hfuvd9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1ah72kwjcgjjf7hfuvd9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Configure CodyAI to use ollama as your companion
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;go to vs code settings&lt;/li&gt;
&lt;li&gt;put inside search bar: cody.autocomplete.advanced.provider&lt;/li&gt;
&lt;li&gt;you should see the option&lt;/li&gt;
&lt;li&gt;set it to "experimental-ollama"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fyb1dxipwlw3yrumkkuzw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fyb1dxipwlw3yrumkkuzw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Make sure CodyAI autocompletion is enabled
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Click on CodyAI icon at the bottom right bar
&lt;img src="https://media.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%2Fmhcctzwut57gkl4d7zci.png" alt="Image description"&gt;
&lt;/li&gt;
&lt;li&gt;make sure option "Code autocomplete" is enabled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Feo26yk4uk7z3nutyhvlx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Feo26yk4uk7z3nutyhvlx.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Make sure you are running ollama
&lt;/h4&gt;

&lt;p&gt;That seems obvious, but it's worth reminding! 😅&lt;/p&gt;

&lt;h4&gt;
  
  
  Test it!
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.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%2F2qyknggbgi5ti045z6ar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F2qyknggbgi5ti045z6ar.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;So right now you can have ollama supporting you as chat assistant and with code autocompletion as well! 🤩&lt;/p&gt;

&lt;p&gt;Locally, secure and free! 🆓&lt;/p&gt;

&lt;p&gt;Did you try ollama as code companion? What do you think about it?&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>ai</category>
      <category>learning</category>
      <category>programming</category>
    </item>
    <item>
      <title>2024 Resolution</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Thu, 11 Jan 2024 19:10:46 +0000</pubDate>
      <link>https://dev.to/pavelee/2024-resolution-kna</link>
      <guid>https://dev.to/pavelee/2024-resolution-kna</guid>
      <description>&lt;p&gt;My 2024 Resolution is pretty stright forward: I want to write at least one article per month on Dev.to 📝&lt;/p&gt;

&lt;p&gt;That's it. 🥳&lt;/p&gt;

&lt;p&gt;I know it's not a fancy one, but i want to make it achievable. I'm not a native english speaker, so writing articles is a challenge for me. I hope that by the end of 2024 i will be able to write articles without any problems. 🤞&lt;/p&gt;

&lt;p&gt;Keep it up! 🚀&lt;/p&gt;

</description>
      <category>devresolutions2024</category>
    </item>
    <item>
      <title>CoLlama 🦙 - ollama as your AI coding assistant (local machine and free)</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Mon, 01 Jan 2024 19:29:16 +0000</pubDate>
      <link>https://dev.to/pavelee/colamma-ollama-as-your-ai-coding-assistant-local-machine-and-free-5694</link>
      <guid>https://dev.to/pavelee/colamma-ollama-as-your-ai-coding-assistant-local-machine-and-free-5694</guid>
      <description>&lt;p&gt;Hello 🙋 first of all, Happy New Year! 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;If you in hurry, below a mindmap to quickly consume the content. 🕒🥗&lt;/p&gt;

&lt;p&gt;&lt;a href="https://xmind.ai/embed/czUQGAGV?sheet-id=d88ac48303b8e52a11a35a33be" rel="noopener noreferrer"&gt;Click here to see the mind map in xmind&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fkj829g7fjyktg5z3hbnw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fkj829g7fjyktg5z3hbnw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Coding Assistant
&lt;/h2&gt;

&lt;p&gt;AI Code Assistants are rapidly gaining popularity in the tech industry. They are becoming an essential tool for programmers, providing assistance in writing code, debugging, and even generating code snippets. Mastering the use of an AI Code Assistant is becoming a necessary skill for modern developers.&lt;/p&gt;

&lt;p&gt;There are several AI Code Assistants available in the market. GitHub Copilot, AWS Codewhisperer, Tabnine. There are many more tools available, each with its unique features and capabilities.&lt;/p&gt;

&lt;p&gt;However, most of these tools come with their own set of limitations. Many of them are not free, although they often offer trial versions for users to test out their capabilities. Additionally, these tools typically work by sending your code to an external server, which might raise privacy concerns for some users. Lastly, these tools are generally limited to answering programming-related questions and may not be able to assist with other types of inquiries.&lt;/p&gt;

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

&lt;p&gt;Ollama is a user-friendly tool designed to run large language models (LLMs) locally on a computer. This means it offers a level of security that many other tools can't match, as it operates solely on your local machine, eliminating the need to send your code to an external server. Plus, being free and open-source, it doesn't require any fees or credit card information, making it accessible to everyone. 🥳&lt;/p&gt;

&lt;p&gt;You can find more about ollama on their official website: &lt;a href="https://ollama.ai/" rel="noopener noreferrer"&gt;https://ollama.ai/&lt;/a&gt;. It's designed to work in a completely independent way, with a command-line interface (CLI) that allows it to be used for a wide range of tasks. It's not just for coding - ollama can assist with a variety of general tasks as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fjl8o4q565339lbork9nj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fjl8o4q565339lbork9nj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the standout features of ollama is its library of models trained on different data, which can be found at &lt;a href="https://ollama.ai/library" rel="noopener noreferrer"&gt;https://ollama.ai/library&lt;/a&gt;. These models are designed to cater to a variety of needs, with some specialized in coding tasks. One such model is codellama, which is specifically trained to assist with programming tasks.&lt;/p&gt;

&lt;p&gt;Even, you can train your own model 🤓&lt;/p&gt;

&lt;h2&gt;
  
  
  Run ollama locally
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;You need at least 8GB of RAM to run ollama locally.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Running ollama locally is a straightforward process. The first step is to install it following the instructions provided on the official website: &lt;a href="https://ollama.ai/download" rel="noopener noreferrer"&gt;https://ollama.ai/download&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fd51a820x7zwas0npka0o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fd51a820x7zwas0npka0o.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  If you are Windows user
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;If you are a Windows user, you might need to use the Windows Subsystem for Linux (WSL) to run ollama locally, as it's not natively supported on Windows. You can find instructions on how to install WSL on the Microsoft website: &lt;a href="https://learn.microsoft.com/en-us/windows/wsl/install" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/windows/wsl/install&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once ollama is installed, the next step is to download the model that best fits your needs. For programming-related tasks, it's recommended to use the codellama model.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

ollama pull codellama


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

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.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%2F96ets9jsyaageaouyelx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F96ets9jsyaageaouyelx.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the model is downloaded, you can start using ollama.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

ollama run codellama


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

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.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%2Frm0ex5lpc453bj02rb9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Frm0ex5lpc453bj02rb9u.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to integrate ollama with my editor?
&lt;/h2&gt;

&lt;p&gt;Integrating ollama with your code editor can enhance your coding experience by providing AI assistance directly in your workspace. This can be achieved using the Continue extension, which is available for both Visual Studio Code and JetBrains editors. You can find the extension at &lt;a href="https://continue.dev/" rel="noopener noreferrer"&gt;https://continue.dev/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fd7n95xzcm9cdstc2xfk7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fd7n95xzcm9cdstc2xfk7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the extension is installed, you'll need to configure it to work with ollama. This involves adding ollama to the extension's configuration file. In your &lt;strong&gt;home directory, look for the .continue folder&lt;/strong&gt; (e.g., /Users/pciosek/.continue) and edit &lt;strong&gt;the config.json file&lt;/strong&gt;. Add the ollama model to the "models" section as follows:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&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;"models"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"CodeLlama"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"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;"codellama"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"provider"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ollama"&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="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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;More information about this configuration can be found at &lt;a href="https://continue.dev/docs/reference/Model%20Providers/ollama" rel="noopener noreferrer"&gt;https://continue.dev/docs/reference/Model%20Providers/ollama&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After updating the configuration, restart your editor for the changes to take effect. You should now see ollama listed as a model in the extension's sidebar. 🥳&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fh6lhcydti2dtn4uqn8gc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fh6lhcydti2dtn4uqn8gc.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you're ready to use ollama in your editor!&lt;/p&gt;

&lt;h3&gt;
  
  
  Two ways to use ollama in your editor
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open the extension's sidebar and start the conversation.&lt;/li&gt;
&lt;li&gt;Inside code editor, select the code and press (cmd/ctrl) + M to start the conversation. Selected code will be use as a context for the conversation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More about the extension can be found at &lt;a href="https://continue.dev/docs/intro" rel="noopener noreferrer"&gt;https://continue.dev/docs/intro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below an example of generating tests for a component&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Ftuk6ifbvfmdgssxe3sd0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ftuk6ifbvfmdgssxe3sd0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The extension do not support code completion, if you know extension that support code completion, please let me know in the comments. 🙏&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;AI Code Assistants are the future of programming. It's imporant the technology is accessible to everyone, and ollama is a great example of this. It's free, open-source, and runs locally on your machine, making it a great choice for developers looking for an AI Code Assistant that is both secure, free and easy to use. 🥳&lt;/p&gt;

&lt;h2&gt;
  
  
  Share your thoughts
&lt;/h2&gt;

&lt;p&gt;What do you think about ollama? Do you use any other AI Code Assistants? Maybe did you use other models? Let me know in the comments below! 🙏&lt;/p&gt;

</description>
      <category>ai</category>
      <category>ollama</category>
      <category>githubcopilot</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Test your skills with AI assistance</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Wed, 19 Jul 2023 22:55:55 +0000</pubDate>
      <link>https://dev.to/pavelee/test-your-skills-with-ai-assistance-n06</link>
      <guid>https://dev.to/pavelee/test-your-skills-with-ai-assistance-n06</guid>
      <description>&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;👨‍💻 Dev-Gym is a basic testing platform with a hacker-inspired design, created to help programmers hone their skills with AI-Powered hints. &lt;/p&gt;

&lt;h3&gt;
  
  
  Category Submission:
&lt;/h3&gt;

&lt;p&gt;Best Project built using Supabase as the main data provider for the refine app.&lt;/p&gt;

&lt;h3&gt;
  
  
  App Link
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://dev-gym.vercel.app"&gt;https://dev-gym.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshots
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DQsQ3Yng--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zwaq6sg2ohy5gws8oc1o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DQsQ3Yng--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zwaq6sg2ohy5gws8oc1o.png" alt="Image description" width="800" height="589"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I3nBgcR5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxgl56ggnzcxffyh2xhh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I3nBgcR5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxgl56ggnzcxffyh2xhh.png" alt="Image description" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TQbpWHBE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1648lkd1u9rgjn5z5gbu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TQbpWHBE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1648lkd1u9rgjn5z5gbu.png" alt="Image description" width="800" height="636"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HE9fRGTq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1v4o7nups44k7j7y0yu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HE9fRGTq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1v4o7nups44k7j7y0yu.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Description
&lt;/h3&gt;

&lt;p&gt;🕵️‍♂️ Hacker-Inspired Design: Dev-Gym sports a cool, hacker-inspired design to engage tech enthusiasts.&lt;/p&gt;

&lt;p&gt;🤖 GPT-4 Assisted Tests: The coding tests in this prototype are pre-generated manually with the help of the advanced GPT-4 model.&lt;/p&gt;

&lt;p&gt;💡 AI-Powered Hints: Dev-Gym integrates AI-driven hints during tests, offering real-time assistance&lt;/p&gt;

&lt;p&gt;🔗 Supabase Integration: Dev-Gym is integrated with Supabase, where the data is stored.&lt;/p&gt;

&lt;p&gt;📝 Admin Panel: The platform includes a panel where users can add new tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Source Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/pavelee/dev-gym"&gt;https://github.com/pavelee/dev-gym&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Permissive License
&lt;/h3&gt;

&lt;p&gt;MIT&lt;/p&gt;

&lt;h2&gt;
  
  
  Background (What made you decide to build this particular app? What inspired you?)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Fascinated by AI's transformative power in programmer education. &lt;/li&gt;
&lt;li&gt;Looking for a positive site of AI&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How I built it (How did you utilize refine? Did you learn something new along the way? Pick up a new skill?)
&lt;/h3&gt;

&lt;p&gt;The most important, I gained knowledge how to use refine in practice.&lt;/p&gt;

&lt;p&gt;Additionally I tried supabase and I like it!&lt;/p&gt;

&lt;p&gt;Tech stack: Next.js, Antd UI, Supabase&lt;/p&gt;

&lt;p&gt;What else:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using Refine built-in integration with Supabase. Really cool!

&lt;ul&gt;
&lt;li&gt;instant integration! wow!&lt;/li&gt;
&lt;li&gt;Utilizing Refine's hooks for data fetching. In my opinion it's the best part of the framework.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Admin panel built with generated code

&lt;ul&gt;
&lt;li&gt;Firstly I was a little bit confused, but after tutorial it become clear.&lt;/li&gt;
&lt;li&gt;it really speed up CRUD job&lt;/li&gt;
&lt;li&gt;I love idea to copy and adjust code, a lot of flexibility &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;OpenAI integration for AI hints&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Additional Resources/Info
&lt;/h3&gt;

&lt;p&gt;Admin panel is located at path /admin&lt;/p&gt;

</description>
      <category>refinehackathon</category>
    </item>
    <item>
      <title>Stoa - forum app that use redis as a primary database</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Sun, 28 Aug 2022 22:29:40 +0000</pubDate>
      <link>https://dev.to/pavelee/stoa-forum-app-that-use-redis-as-a-primary-database-43eh</link>
      <guid>https://dev.to/pavelee/stoa-forum-app-that-use-redis-as-a-primary-database-43eh</guid>
      <description>&lt;h3&gt;
  
  
  Overview of My Submission
&lt;/h3&gt;

&lt;p&gt;Stoa is a small forum app. The inspiration is a need of minimalistic internal forum for organizations. Designed to look like a typical social media app.&lt;/p&gt;

&lt;p&gt;The main purpose of the project is to test redis as main database. I am using redisJSON to store documents and RediSearch to perform searches.&lt;/p&gt;

&lt;p&gt;Stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Typescript&lt;/li&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;tailwindcss&lt;/li&gt;
&lt;li&gt;Redis stack&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some thoughts from mine experience:&lt;/p&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to understand&lt;/li&gt;
&lt;li&gt;Fast integration thanks to &lt;a href="https://github.com/redis/redis-om-node"&gt;redis-om-node&lt;/a&gt; library. In dozen minutes, we are ready to start manipulating with documents.&lt;/li&gt;
&lt;li&gt; We can storage several types of data, not only json.&lt;/li&gt;
&lt;li&gt;RedisInsight app is really helpful during development process. Cool!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disadvantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's tricky when we want to build related data structure. We need to handle it by extending an entity class.&lt;/li&gt;
&lt;li&gt;We have to create index on a collection, before starting to search anything. It's tricky for the first time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;MEAN/MERN Mavericks&lt;/p&gt;

&lt;h3&gt;
  
  
  Language Used
&lt;/h3&gt;

&lt;p&gt;JS/TS/Node.js&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Code
&lt;/h3&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/pavelee"&gt;
        pavelee
      &lt;/a&gt; / &lt;a href="https://github.com/pavelee/stoa-redis-stack"&gt;
        stoa-redis-stack
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Share your ideas among community
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1 id="user-content-stoa"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/stoa-redis-stack#stoa"&gt;Stoa&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/pavelee/stoa-redis-stack/main/public/dashboard.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K3UgecpW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pavelee/stoa-redis-stack/main/public/dashboard.png"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Stoa is a small forum app. The inspiration is a need of minimalistic internal forum for organizations. Designed to look like a typical social media app.&lt;/p&gt;

&lt;p&gt;The main purpose of the project is to test redis as main database. I am using redisJSON to store documents and RediSearch to perform searches.&lt;/p&gt;

&lt;p&gt;Stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Typescript&lt;/li&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;tailwindcss&lt;/li&gt;
&lt;li&gt;Redis stack&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="user-content-how-it-works"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/stoa-redis-stack#how-it-works"&gt;How it works&lt;/a&gt;&lt;/h2&gt;

&lt;h3 id="user-content-how-the-data-is-stored"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/stoa-redis-stack#how-the-data-is-stored"&gt;How the data is stored:&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Data is stored as documents using redisJSON&lt;/p&gt;

&lt;h3 id="user-content-how-the-data-is-accessed"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/stoa-redis-stack#how-the-data-is-accessed"&gt;How the data is accessed:&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Data is accesed through &lt;a href="https://github.com/redis/redis-om-node"&gt;redis-om-node&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="user-content-how-to-run-it-locally"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/stoa-redis-stack#how-to-run-it-locally"&gt;How to run it locally?&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;You can run it loccaly using docker.&lt;/p&gt;

&lt;h3 id="user-content-prerequisites"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/stoa-redis-stack#prerequisites"&gt;Prerequisites&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id="user-content-local-installation"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/stoa-redis-stack#local-installation"&gt;Local installation&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Run containers&lt;/p&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Acess app in the borwser&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;http://localhost:3000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="user-content-more-information-about-redis-stack"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/stoa-redis-stack#more-information-about-redis-stack"&gt;More Information about Redis Stack&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here some resources to help you quickly get started using Redis Stack. If you still have questions, feel free to ask them in the &lt;a href="https://discord.gg/redis" rel="nofollow"&gt;Redis Discord&lt;/a&gt; or on &lt;a href="https://twitter.com/redisinc" rel="nofollow"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="user-content-getting-started"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/stoa-redis-stack#getting-started"&gt;Getting Started&lt;/a&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Sign up for…&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/pavelee/stoa-redis-stack"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K3UgecpW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pavelee/stoa-redis-stack/main/public/dashboard.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K3UgecpW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pavelee/stoa-redis-stack/main/public/dashboard.png" alt="test" width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Check out &lt;a href="https://redis.io/docs/stack/get-started/clients/#high-level-client-libraries"&gt;Redis OM&lt;/a&gt;, client libraries for working with Redis as a multi-model database.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Use &lt;a href="https://redis.info/redisinsight"&gt;RedisInsight&lt;/a&gt; to visualize your data in Redis.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Sign up for a &lt;a href="https://redis.info/try-free-dev-to"&gt;free Redis database&lt;/a&gt;.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>redishackathon</category>
      <category>react</category>
      <category>tailwindcss</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Boost your app accessibility with AI Speech Recognition (Deepgram)!</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Sun, 10 Apr 2022 15:05:05 +0000</pubDate>
      <link>https://dev.to/pavelee/boost-your-app-accessibility-with-ai-speech-recognition-deepgram-5fl9</link>
      <guid>https://dev.to/pavelee/boost-your-app-accessibility-with-ai-speech-recognition-deepgram-5fl9</guid>
      <description>&lt;h3&gt;
  
  
  Overview of My Submission
&lt;/h3&gt;

&lt;p&gt;The goal is to provide extra way to input value. It could be really helpful for people with disabilities, anyone that have problems with typing on a keyboard. You can fill any input using pointer and voice! Cool!&lt;/p&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;Accessibility&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Code on GitHub
&lt;/h3&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/pavelee"&gt;
        pavelee
      &lt;/a&gt; / &lt;a href="https://github.com/pavelee/react-deepgram-example"&gt;
        react-deepgram-example
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      DEV hackathon project, usage of Deepgram AI Speech Recognition, boost your app accessibility
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1 id="user-content-boost-your-react-app-accessibility-with-ai-speech-recognition-deepgram"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/react-deepgram-example#boost-your-react-app-accessibility-with-ai-speech-recognition-deepgram"&gt;Boost your react app accessibility with AI Speech Recognition (Deepgram)!&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/pavelee/react-deepgram-example#whats-that"&gt;What's that?&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/pavelee/react-deepgram-example#deepgram"&gt;Deepgram?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/pavelee/react-deepgram-example#purpose"&gt;Purpose&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/pavelee/react-deepgram-example#why"&gt;Why?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/pavelee/react-deepgram-example#How-its-working"&gt;How it's working?&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/pavelee/react-deepgram-example#deepgram-proxy"&gt;deepgram-proxy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/pavelee/react-deepgram-example#deepgram-react"&gt;deepgram-react&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/pavelee/react-deepgram-example#run-a-project"&gt;Run a project&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/pavelee/react-deepgram-example#get-your-API-key"&gt;Get your API key&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/pavelee/react-deepgram-example#set-your-API-key"&gt;Set your API key&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/pavelee/react-deepgram-example#run"&gt;Run&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/pavelee/react-deepgram-example#using-docker"&gt;Using docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/pavelee/react-deepgram-example#using-local-env"&gt;Using local env&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="user-content-whats-that"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/react-deepgram-example#whats-that"&gt;What's that?&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It's example of integration with Deepgram using react.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/de28711d7167a4d0abd9001ba968d1ca95f7b4db04e97d8cdc009d021cdeea65/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f78366e35736b676c35327465746d6e32767461342e676966"&gt;&lt;img src="https://camo.githubusercontent.com/de28711d7167a4d0abd9001ba968d1ca95f7b4db04e97d8cdc009d021cdeea65/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f78366e35736b676c35327465746d6e32767461342e676966" alt="gif"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="user-content-deepgram"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/react-deepgram-example#deepgram"&gt;Deepgram?&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Deepgram is external service to transcript speech from audio! (using AI, crazy stuff!)&lt;/p&gt;
&lt;p&gt;Read more here: &lt;a href="https://deepgram.com" rel="nofollow"&gt;https://deepgram.com&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="user-content-purpose"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/react-deepgram-example#purpose"&gt;Purpose&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Purpose is to use speech transcription to improve an react app accessibility. We provide extra way to input value!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Help to provide input for people with disabilities&lt;/li&gt;
&lt;li&gt;Speed up a form filling&lt;/li&gt;
&lt;li&gt;Share expierience accross any device
&lt;ul&gt;
&lt;li&gt;any device supporting modern browser&lt;/li&gt;
&lt;li&gt;react-native (mobile, TV, dekstop) as well!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="user-content-why"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/react-deepgram-example#why"&gt;Why?&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Project was made as submission to DEV hackathlon, read more &lt;a href="https://dev.to/devteam/join-us-for-a-new-kind-of-hackathon-on-dev-brought-to-you-by-deepgram-2bjd" rel="nofollow"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Post here: &lt;a href="https://dev.to/pavelee/boost-your-app-accessibility-with-ai-speech-recognition-deepgram-5fl9" rel="nofollow"&gt;post&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="user-content-how-its-working"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/react-deepgram-example#how-its-working"&gt;How it's working?&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Project is built from two parts deepgram-proxy and deepgram-react&lt;/p&gt;
&lt;h3 id="user-content-deepgram-proxy"&gt;&lt;a class="heading-link" href="https://github.com/pavelee/react-deepgram-example#deepgram-proxy"&gt;deepgram-proxy&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We need some backend to upload audio file…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/pavelee/react-deepgram-example"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;I am using react as a frontend app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's important to remember that react frontend app is not necessary. You can integrate proxy with any other type of app. It's just REST API!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The process is pretty simple.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Display Deepgram component&lt;/li&gt;
&lt;li&gt;Ask permission to microphone (browser)&lt;/li&gt;
&lt;li&gt;Record your voice&lt;/li&gt;
&lt;li&gt;Sending audio to proxy&lt;/li&gt;
&lt;li&gt;Proxy ask Deepgram for transcription&lt;/li&gt;
&lt;li&gt;Proxy responses with transcription, error or warring about no transcription (eg. user need to repeat louder)&lt;/li&gt;
&lt;li&gt;User receives transcription and apply to input&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qy9b5csw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x6n5skgl52tetmn2vta4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qy9b5csw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x6n5skgl52tetmn2vta4.gif" alt="process gif" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Proxy from technical aspect.
&lt;/h4&gt;

&lt;p&gt;It's node.js + express.js to handle API requests and communicate with Deepgram (using Deepgram SDK)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// endpoint to upload and transcript
app.post("/audiotranscript", upload.single("file"), async (req, res) =&amp;gt; {
    let filepath = req.file.path
    let language = req.body.language;
    let transcript = await deepgramTranscript(deepgramApiKey, filepath, language);
    res.send({ transcript: transcript });
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Fronted from technical aspect.
&lt;/h4&gt;

&lt;p&gt;It's simple handler you pass proxy url and setter for your value.&lt;/p&gt;

&lt;p&gt;I prepared two visualizations of usage. I am using antd design as component library.&lt;/p&gt;

&lt;p&gt;Using wrapper that creates popover to any React component.&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;DeepgramHandlerPopover
    setValue={setNotepadValue}
    proxyUploadUrl={proxyUploadUrl}
&amp;gt;
    &amp;lt;Input.TextArea
        rows={20}
        value={value}
        onChange={(ev) =&amp;gt; {
            setValue(ev.target.value);
        }}
    /&amp;gt;
&amp;lt;/DeepgramHandlerPopover&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9tnRAlxh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ae9usvmo9p9w04xeukwr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9tnRAlxh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ae9usvmo9p9w04xeukwr.png" alt="popover" width="760" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using modal (small devices friendly)&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;DeepgramHandlerModalButton
    setValue={setNotepadValue}
    proxyUploadUrl={proxyUploadUrl}
    buttonProps={{
        type: "primary",
    }}
/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dvwgJj5L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/637ric30p4xn1a7s4udl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dvwgJj5L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/637ric30p4xn1a7s4udl.png" alt="modal" width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have other idea you can easy just wrap handler:&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;MyCoolComponent&amp;gt;
    &amp;lt;DeepgramHandler
        setValue={setValue}
        proxyUploadUrl={proxyUploadUrl}
    /&amp;gt;
&amp;lt;/MyCoolComponent&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Final thoughts
&lt;/h4&gt;

&lt;p&gt;I really appreciate what Deepgram has created. It is really well working, even with my unclear English. Amazing how tech industry improving our lives! &amp;lt;3&lt;/p&gt;

</description>
      <category>hackwithdg</category>
      <category>react</category>
      <category>showdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>first post, don't open</title>
      <dc:creator>Paweł Ciosek</dc:creator>
      <pubDate>Sun, 12 Jul 2020 21:07:13 +0000</pubDate>
      <link>https://dev.to/pavelee/first-post-don-t-open-22pi</link>
      <guid>https://dev.to/pavelee/first-post-don-t-open-22pi</guid>
      <description>&lt;p&gt;first post, nothing interesting here.&lt;/p&gt;

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