<?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: fadingNA</title>
    <description>The latest articles on DEV Community by fadingNA (@fadingna).</description>
    <link>https://dev.to/fadingna</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%2F1196982%2Fd263f31f-2fff-4ed2-9878-a21f73044ac7.png</url>
      <title>DEV Community: fadingNA</title>
      <link>https://dev.to/fadingna</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fadingna"/>
    <language>en</language>
    <item>
      <title>Final Result</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Sun, 08 Dec 2024 21:26:54 +0000</pubDate>
      <link>https://dev.to/fadingna/final-result-4m68</link>
      <guid>https://dev.to/fadingna/final-result-4m68</guid>
      <description>&lt;h4&gt;
  
  
  Previous blog posts of this series
&lt;/h4&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/fadingna" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F1196982%2Fd263f31f-2fff-4ed2-9878-a21f73044ac7.png" alt="fadingna"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/fadingna/dare-to-challenge-hard-thing-5blb" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Dare to challenge hard thing&lt;/h2&gt;
      &lt;h3&gt;fadingNA ・ Nov 24&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/fadingna" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F1196982%2Fd263f31f-2fff-4ed2-9878-a21f73044ac7.png" alt="fadingna"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/fadingna/progress-on-contributions-3nnh" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Progress on Contributions&lt;/h2&gt;
      &lt;h3&gt;fadingNA ・ Nov 30&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;





&lt;h4&gt;
  
  
  Reflection of these results
&lt;/h4&gt;

&lt;p&gt;In the first post, I shared my aspirations and the challenges I anticipated into opensource projects. By the second post, I had made significant progress, not only overcoming those challenges but also discovering new insights about collaboration in open source.&lt;/p&gt;

&lt;h4&gt;
  
  
  Challenges
&lt;/h4&gt;

&lt;p&gt;I faced many challenges in my final contributions. One of the biggest was understanding the complexities of the project codebases for &lt;code&gt;DocsGPT&lt;/code&gt; and &lt;code&gt;ChatCraft&lt;/code&gt;. Both are large projects, yet they are entirely different. &lt;code&gt;DocsGPT&lt;/code&gt; uses &lt;code&gt;Python&lt;/code&gt; on the backend and &lt;code&gt;TypeScript&lt;/code&gt; on the frontend, while &lt;code&gt;ChatCraft&lt;/code&gt; is purely &lt;code&gt;TypeScript&lt;/code&gt; with the &lt;code&gt;Chakra UI&lt;/code&gt; framework for its UI. Initially, I had no idea what I was doing—where to start, which components to focus on, or which functionalities to modify or leave untouched. Through committing back and forth and discussing with maintainers, I eventually learned which functions could be adapted and which did not need any changes.&lt;/p&gt;

&lt;p&gt;Additionally, balancing my time between multiple courses in my final semester was tough. Despite the challenges, I managed to complete all of my pull requests except one. This remaining PR involves separating image embeddings into a vector space using the CLIP model. &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/pull/1462" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        GenAI eatting image from DOCX
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1462&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/pull/1462" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 28, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;What kind of change does this PR introduce?&lt;/strong&gt; (Bug fix, feature, docs update, ...)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;#1451&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Chage from docx2txt.process to extract them manually
Eatting image as Base64 | Table as HTML tag | Text for paragraph&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why was this change needed?&lt;/strong&gt; (You can also link to an open issue here)&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;To using multiple vector store to retrieve correct image as paragraph order instead of zip them by docx2text.process()&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Other information&lt;/strong&gt;:&lt;/li&gt;
&lt;li&gt;Progress the issue is now when we retrieve need to find the way to convert base64 back for AI to understand image
&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/6c3e996e-ce80-4086-8858-0a50feb40d9f"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F6c3e996e-ce80-4086-8858-0a50feb40d9f" alt="Screenshot 2024-11-28 at 12 00 19 PM"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;@dartpain  let me know if this correct approach or wrong direction&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/pull/1462" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
 Although this PR is not yet complete, I am determined to continue working on it until it is finished.

&lt;p&gt;On the other hand, one of my other pull requests was closed due to the large number of changes, which made it difficult to review. However, I successfully contributed to another critical PR that enabled MongoDB to efficiently handle search, sorting, and pagination for documents uploaded to the app. &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/pull/1442" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Table Styling &amp;amp; Add search feature to backend
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1442&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/pull/1442" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 16, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;What kind of change does this PR introduce?&lt;/strong&gt; (Bug fix, feature, docs update, ...)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;#1440&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Why was this change needed?&lt;/strong&gt; (You can also link to an open issue here)
uniform table nicely&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Other information&lt;/strong&gt;:
update table styling uniformly&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/manishmadan2882"&gt;@manishmadan2882&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/370b78f0-af16-4cae-a5b5-21f77807438f"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F370b78f0-af16-4cae-a5b5-21f77807438f" alt="Screenshot 2024-11-15 at 11 17 28 PM"&gt;&lt;/a&gt;&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/pull/1442" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Moreover, I have to ingest the document by using celery worker that really interesting and challenging in the same because the process is ingest behind the backend and to be able to understand the workflow was giving me a hard time.&lt;/p&gt;




&lt;h4&gt;
  
  
  Conclusion
&lt;/h4&gt;

&lt;p&gt;Reflecting on this journey, contributing to large open-source projects like DocsGPT and ChatCraft has been a challenging yet rewarding experience. It tested my ability to adapt, learn quickly, and collaborate effectively with the open-source community. The process of navigating complex codebases, managing multiple responsibilities, and refining my contributions through feedback has significantly enhanced my technical and problem-solving skills.&lt;/p&gt;

&lt;p&gt;While not every pull request resulted in success, each one provided valuable lessons that have shaped me into a more confident developer. From understanding project workflows to implementing meaningful features like MongoDB search, sort, and pagination, I’ve gained insights into how impactful even small contributions can be. The unfinished CLIP model PR serves as a reminder that open-source is not just about completion but about consistent progress and persistence.&lt;/p&gt;

&lt;p&gt;As I move forward, I am motivated to tackle more complex issues, collaborate with diverse teams, and continue giving back to the community. This experience has been a stepping stone toward my future goals, and I’m excited to apply these lessons in my upcoming opensource project contributing.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Progress on Contributions</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Sat, 30 Nov 2024 07:14:09 +0000</pubDate>
      <link>https://dev.to/fadingna/progress-on-contributions-3nnh</link>
      <guid>https://dev.to/fadingna/progress-on-contributions-3nnh</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/fadingna" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F1196982%2Fd263f31f-2fff-4ed2-9878-a21f73044ac7.png" alt="fadingna"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/fadingna/dare-to-challenge-hard-thing-5blb" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Dare to challenge hard thing&lt;/h2&gt;
      &lt;h3&gt;fadingNA ・ Nov 24&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h4&gt;
  
  
  Progress overview
&lt;/h4&gt;

&lt;p&gt;Embarking on complex opensource application projects often presents presents challenges that test one's skill and resilience. Over the past two weeks, I have contributed in several such endeavour to open my world of contributing, each offering improvement of unique ares such as embedding mode, UI styling, API request. Which is providing me huges experiences and opportunities for growth and gain techniques that I can reuse on my future application.&lt;/p&gt;




&lt;h5&gt;
  
  
  Chatcraft
&lt;/h5&gt;

&lt;p&gt;Sometimes, the best way to grow as a software developer as I'm right now is to tackle challenges that seem overwhelming at first sight. Over past two weeks, I have been working on several pull requests as I mentioned on the first blogs above. One of (PR) for the  &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/tarasglek/chatcraft.org/pull/752" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Migrate to Chakra V3
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#752&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/tarasglek/chatcraft.org/pull/752" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 22, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Move from fork repo PR to upstream repo.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;#749&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;@humphd  &lt;a class="mentioned-user" href="https://dev.to/amnish04"&gt;@amnish04&lt;/a&gt;  @tarasglek&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tarasglek/chatcraft.org/pull/752" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
 

&lt;p&gt;First PR was short of a rollercoaster ride. This PR involves migrating the entire project to the latest version of Chakra UI, a task that has tested my skills and patience but also taught me invaluable lessons.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sample Code&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Chakra UI 3.0 using &lt;code&gt;lineClamp&lt;/code&gt; instead &lt;code&gt;noOfLines&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&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%2Fv8lwyik0q46jncy2va7n.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%2Fv8lwyik0q46jncy2va7n.png" alt="Image description" width="800" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chakra UI 3.0 using &lt;code&gt;Dialog&lt;/code&gt; instead of &lt;code&gt;Modal&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&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%2F7efrjpuw4g6er719mjco.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%2F7efrjpuw4g6er719mjco.png" alt="Image description" width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chakra UI 3.0 using &lt;code&gt;Card&lt;/code&gt; Objects instead of Seperate objects of Card such as CardBody , CardFooter&lt;/li&gt;
&lt;/ul&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%2Fgi4xub33fvxkb4rid3vo.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%2Fgi4xub33fvxkb4rid3vo.png" alt="Image description" width="800" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More you can find in each component change here &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://www.chakra-ui.com/docs/get-started/migration" rel="noopener noreferrer"&gt;
      chakra-ui.com
    &lt;/a&gt;
&lt;/div&gt;





&lt;h5&gt;
  
  
  DocsGPT
&lt;/h5&gt;

&lt;p&gt;Second PR was merged couple days ago. This PR was quite similar to the first PR that we have to fix User Interface that involves around 5 components Document Table | API Table | Settings Table | BackAPI Request | Pagination dropdow.&lt;/p&gt;


&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/pull/1442" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Table Styling &amp;amp; Add search feature to backend
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1442&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/pull/1442" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 16, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;What kind of change does this PR introduce?&lt;/strong&gt; (Bug fix, feature, docs update, ...)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;#1440&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Why was this change needed?&lt;/strong&gt; (You can also link to an open issue here)
uniform table nicely&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Other information&lt;/strong&gt;:
update table styling uniformly&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/manishmadan2882"&gt;@manishmadan2882&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/370b78f0-af16-4cae-a5b5-21f77807438f"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F370b78f0-af16-4cae-a5b5-21f77807438f" alt="Screenshot 2024-11-15 at 11 17 28 PM"&gt;&lt;/a&gt;&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/pull/1442" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;This PR focused on refining the user interface for several key components within the application, tackling issues that spanned across multiple tables and features. While the task was similar in complexity to my first PR, it presented its own set of unique challenges and learning opportunities.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sample Code&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Change from &lt;code&gt;select&lt;/code&gt; to &lt;code&gt;div&lt;/code&gt; to improve transition of user experience of dropdown select box position as well.&lt;/li&gt;
&lt;/ul&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%2Fcfyebmi6ul43qnksheo9.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%2Fcfyebmi6ul43qnksheo9.png" alt="Image description" width="800" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instead of using &lt;code&gt;table&lt;/code&gt; as a container I wrapped it up with div so I have more controlled of table&lt;/li&gt;
&lt;/ul&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%2F0ltev0n1h09oshpmsekc.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%2F0ltev0n1h09oshpmsekc.png" alt="Image description" width="800" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pagination behaviour fixed when sending sort and column to filter the document&lt;/li&gt;
&lt;/ul&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%2F5j6r6tra5tod3plpednj.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%2F5j6r6tra5tod3plpednj.png" alt="Image description" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Move Pagination Component out scrollable area &lt;/li&gt;
&lt;/ul&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%2Fu1g66qa3zb59j7i5hvcg.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%2Fu1g66qa3zb59j7i5hvcg.png" alt="Image description" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;I recently, submitted my third pull request (PR) which is another PR to DocsGPT project, addressing an issue where images from DOCX files were not being processed correctly. This PR involved adding support for image extraction and handling within the document processing pipeline, and also introduce new embeddings model from mpbasenet to openai/clip.&lt;/p&gt;


&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/pull/1462" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        GenAI eatting image from DOCX
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1462&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/pull/1462" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 28, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;What kind of change does this PR introduce?&lt;/strong&gt; (Bug fix, feature, docs update, ...)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;#1451&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Chage from docx2txt.process to extract them manually
Eatting image as Base64 | Table as HTML tag | Text for paragraph&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why was this change needed?&lt;/strong&gt; (You can also link to an open issue here)&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;To using multiple vector store to retrieve correct image as paragraph order instead of zip them by docx2text.process()&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Other information&lt;/strong&gt;:&lt;/li&gt;
&lt;li&gt;Progress the issue is now when we retrieve need to find the way to convert base64 back for AI to understand image
&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/6c3e996e-ce80-4086-8858-0a50feb40d9f"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F6c3e996e-ce80-4086-8858-0a50feb40d9f" alt="Screenshot 2024-11-28 at 12 00 19 PM"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;@dartpain  let me know if this correct approach or wrong direction&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/pull/1462" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;For now we are testing on extension .docx only that extract core information right table , text , image and embedding them correctly to vertorstore which right position in the database.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sample Code&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Instead of using &lt;code&gt;doc2text.process&lt;/code&gt; change to &lt;/li&gt;
&lt;/ul&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%2Fhdzwpu2if670d3q2qr3p.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%2Fhdzwpu2if670d3q2qr3p.png" alt="Image description" width="800" height="715"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change Single Embedding model to Multi Modal Model&lt;/li&gt;
&lt;/ul&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%2Fnwhe04jn3usmip4qygoh.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%2Fnwhe04jn3usmip4qygoh.png" alt="Image description" width="800" height="82"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Find out more about CLIP model : &lt;a href="https://huggingface.co/learn/cookbook/en/faiss_with_hf_datasets_and_clip" rel="noopener noreferrer"&gt;https://huggingface.co/learn/cookbook/en/faiss_with_hf_datasets_and_clip&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change Embeddeing Wrapper Class to align with CLIP model&lt;/li&gt;
&lt;/ul&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%2Fegtpndxkowmusf6xm1lz.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%2Fegtpndxkowmusf6xm1lz.png" alt="Image description" width="800" height="698"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  Summary
&lt;/h4&gt;

&lt;p&gt;These contributions have been instrumental in advancing my skills as a software developer. Each project presented distinct challenges, from large-scale UI migrations to intricate data processing tasks, all of which required strategic planning, problem-solving, and collaboration with the open-source community. The experiences have not only deepened my technical expertise but also underscored the value of perseverance and continuous learning in the ever-evolving field of software development.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>Dare to challenge hard thing</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Sun, 24 Nov 2024 22:19:34 +0000</pubDate>
      <link>https://dev.to/fadingna/dare-to-challenge-hard-thing-5blb</link>
      <guid>https://dev.to/fadingna/dare-to-challenge-hard-thing-5blb</guid>
      <description>&lt;h2&gt;
  
  
  Planning for big contribute
&lt;/h2&gt;

&lt;p&gt;In the upcoming 0.4 release, I aim to contribute to two notable open-source projects: ChatCraft.org and DocsGPT. My focus will be on addressing specific issues and implementing enhancements to improve user experience and functionality.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. First issue ChatCraft.org: Migrating to Chakra UI V3
&lt;/h4&gt;

&lt;p&gt;Issue: Migrate to Chakra V3&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pull Request: Migrate to Chakra V3 &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/tarasglek/chatcraft.org/pull/752" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Migrate to Chakra V3
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#752&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/tarasglek/chatcraft.org/pull/752" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 22, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Move from fork repo PR to upstream repo.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;#749&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;@humphd  &lt;a class="mentioned-user" href="https://dev.to/amnish04"&gt;@amnish04&lt;/a&gt;  @tarasglek&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tarasglek/chatcraft.org/pull/752" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/blockquote&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Issue: &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/tarasglek/chatcraft.org/issues/701" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Migrate to Chakra V3
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#701&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/Amnish04" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F78865303%3Fv%3D4" alt="Amnish04 avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/Amnish04" rel="noopener noreferrer"&gt;Amnish04&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/tarasglek/chatcraft.org/issues/701" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 28, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;Recently, &lt;a href="https://www.chakra-ui.com/" rel="nofollow noopener noreferrer"&gt;Chakra&lt;/a&gt; rolled out a &lt;strong&gt;new major version&lt;/strong&gt; with lots of new components and updates styles.
&lt;a href="https://www.chakra-ui.com/blog/00-announcing-v3" rel="nofollow noopener noreferrer"&gt;https://www.chakra-ui.com/blog/00-announcing-v3&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It would be awesome to upgrade and give &lt;strong&gt;ChatCraft&lt;/strong&gt; a much deserved modern look :D&lt;/p&gt;
&lt;p&gt;Would also be interesting to explore the new components and discover places where they could be used for a better UX.&lt;/p&gt;
&lt;p&gt;Maybe we should wait for a few patch releases before upgrading though.&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tarasglek/chatcraft.org/issues/701" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Objective: Upgrade the ChatCraft.org interface to Chakra UI V3 to leverage new components and updated styles, providing a modern and consistent user experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  &lt;strong&gt;Approach&lt;/strong&gt;
&lt;/h5&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt; : I have opened pull request but due to the big change and un review the code change so I have to plan ahead what to do and split into smaller pull request.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Update the project dependencies to Chakra UI version 3.0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Details:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Modify the &lt;code&gt;package.json&lt;/code&gt; file to include the latest Chakra UI version.&lt;/li&gt;
&lt;li&gt;Update any related configurations required for the new version.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Eliminate hooks and components deprecated in Chakra UI 3.0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Details:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Identify and remove deprecated items.&lt;/li&gt;
&lt;li&gt;Replace them with updated counterparts as per the &lt;a href="https://www.chakra-ui.com/docs/get-started/migration" rel="noopener noreferrer"&gt;Chakra UI migration guide&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Implement the &lt;code&gt;ChatBase&lt;/code&gt; component, comprising the Header and Sidebar.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Details:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Develop the foundational &lt;code&gt;ChatBase&lt;/code&gt; layout.&lt;/li&gt;
&lt;li&gt;Ensure the application remains functional with this new structure.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Integrate essential components like Messages, Prompt Form, and Send Button.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Details:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Develop and incorporate these core components.&lt;/li&gt;
&lt;li&gt;Ensure alignment with Chakra UI 3.0 standards.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Refine the styling of the newly added components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Details:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Adjust CSS and Chakra UI style props.&lt;/li&gt;
&lt;li&gt;Ensure the components achieve the desired appearance and responsiveness.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Update the Settings modal to be compatible with Chakra UI 3.0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Details:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Revise the modal's structure and styling.&lt;/li&gt;
&lt;li&gt;Test to ensure compatibility and proper functionality.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Ensure the application is responsive and mobile-friendly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Details:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Apply the above changes to the mobile component.&lt;/li&gt;
&lt;li&gt;Make adjustments to ensure mobile compatibility.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Result&lt;/strong&gt;
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Upgrading to Chakra UI V3 will enhance the visual appeal and usability of ChatCraft.org, making it more engaging for users.&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  2. Second issue DocsGPT: Frontend UI change on setting/Document &amp;amp; setting/APIKey
&lt;/h4&gt;

&lt;p&gt;Issue: Bug Report: &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/issues/1440" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        🐛 Bug Report: Imperfections in Settings/Document table
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1440&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/ManishMadan2882" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F96079232%3Fv%3D4" alt="ManishMadan2882 avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/ManishMadan2882" rel="noopener noreferrer"&gt;ManishMadan2882&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/issues/1440" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 14, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;📜 Description&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;The pagination tab at the bottom should not move depending on the number of rows&lt;/li&gt;
&lt;li&gt;The search currently, only searches among the docs rendered in a page&lt;/li&gt;
&lt;li&gt;Remove type row from the table&lt;/li&gt;
&lt;li&gt;If one of the docs is syncable, then there is inconsistency in the delete row.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;👟 Reproduction steps&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Go to settings &amp;gt; documents
Search a document, try inserting few documents
The pagination tab shifts if there variable number of docs per page
Search a document which is not there on a page but exists&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;👍 Expected behavior&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;The pagination tab should be placed somewhere below the maximum height of the table or at the bottom of the page&lt;/li&gt;
&lt;li&gt;/sources/paginated endpoint should also be filtered based on the document name, so that the documents can be searched completely&lt;/li&gt;
&lt;li&gt;Since all docs are private, the type row can be removed&lt;/li&gt;
&lt;li&gt;The delete buttons should align uniformly.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;👎 Actual Behavior with Screenshots&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/023ed381-0e93-4a93-89e2-8bff306c487a"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F023ed381-0e93-4a93-89e2-8bff306c487a" alt="image"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/15388cae-533d-4b8b-8d55-05cad2c6c25a"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F15388cae-533d-4b8b-8d55-05cad2c6c25a" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;💻 Operating system&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Linux&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;What browsers are you seeing the problem on?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Chrome&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🤖 What development environment are you experiencing this bug on?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Docker&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🔒 Did you set the correct environment variables in the right path? List the environment variable names (not values please!)&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Yes&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;📃 Provide any additional context for the Bug.&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;No response&lt;/em&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;📖 Relevant log output&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;No response&lt;/em&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;👀 Have you spent some time to check if this bug has been raised before?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;[X] I checked and didn't find similar issue&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🔗 Are you willing to submit PR?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🧑‍⚖️ Code of Conduct&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;[X] I agree to follow this project's Code of Conduct&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/issues/1440" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;





&lt;p&gt;Pull Request: Table Styling &amp;amp; Add search feature to backend: &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/pull/1442" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Table Styling &amp;amp; Add search feature to backend
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1442&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/pull/1442" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 16, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;What kind of change does this PR introduce?&lt;/strong&gt; (Bug fix, feature, docs update, ...)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;#1440&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Why was this change needed?&lt;/strong&gt; (You can also link to an open issue here)
uniform table nicely&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Other information&lt;/strong&gt;:
update table styling uniformly&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/manishmadan2882"&gt;@manishmadan2882&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/370b78f0-af16-4cae-a5b5-21f77807438f"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F370b78f0-af16-4cae-a5b5-21f77807438f" alt="Screenshot 2024-11-15 at 11 17 28 PM"&gt;&lt;/a&gt;&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/pull/1442" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h5&gt;
  
  
  &lt;strong&gt;Objective:&lt;/strong&gt;
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Improve the document table in DocsGPT by addressing UI imperfections and adding a search feature to enhance user experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  &lt;strong&gt;Approach&lt;/strong&gt;
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Examine the document table to pinpoint imperfections, such as pagination inconsistencies and search limitations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Details:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Investigate on Document components&lt;/li&gt;
&lt;li&gt;Investigate on APIKey components&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Modify the table’s design to ensure a consistent and user-friendly interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Details:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Change from css styling to tailwind css for more controllable and familiar of my knowledge&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Result&lt;/strong&gt;
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Enhancing the document table’s functionality will streamline user interactions, making it easier to manage and locate documents within DocsGPT.&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  3. DocsGPT: Enabling Image Processing Capabilities
&lt;/h4&gt;

&lt;p&gt;Issue: Bug Report: &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/issues/1451" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        🚀 Feature Allow our AI's to eat images.
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1451&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/issues/1451" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 23, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🔖 Feature description&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;@dartpain  Basically allow our AI's to eat images. good place to start is just open ai llms, even docsgpt free service should work&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🎤 Why is this feature needed ?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Accept image and encoded base64&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Maybe user wants to send a message with an image when chatting with AI&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;✌️ How do you aim to achieve this?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;When a source has an image, for example there is a link (publicly accessible) in markdown file that was ingested, we can pass it to llm inside classic rag retriever when its generating an answer.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🔄️ Additional Information&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;No response&lt;/em&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;👀 Have you spent some time to check if this feature request has been raised before?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;[X] I checked and didn't find similar issue&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Are you willing to submit PR?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Yes I am willing to submit a PR!&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/issues/1451" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h5&gt;
  
  
  &lt;strong&gt;Objective&lt;/strong&gt;
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Extend DocsGPT’s capabilities to process images, allowing users to include images in their interactions with the AI.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  &lt;strong&gt;Approach&lt;/strong&gt;
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Objective:&lt;/strong&gt; Add the ability for DocsGPT to handle and understand images, making it more useful for tasks that include pictures.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Details:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Look into how we can make DocsGPT work with images and ensure it fits well with the current AI models.&lt;/li&gt;
&lt;li&gt;Build a system to accept and process images, including ones encoded in base64.&lt;/li&gt;
&lt;li&gt;Test everything to make sure DocsGPT can understand images and respond correctly.&lt;/li&gt;
&lt;li&gt;Update the user guide to show how to use the new image feature easily.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h5&gt;
  
  
  &lt;strong&gt;Result&lt;/strong&gt;
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;LLM_Completion able to eat image from base64 or url provided and return back the response to user along with prompt. In addition, validation the limit token per llm requirement and cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;By focusing on these targeted contributions, I aim to enhance the functionality and user experience of ChatCraft.org and DocsGPT. This plan sets clear goals for my next contributions, for that approaches above quite teaching me a few things, if we have a good plan before develop we can reduce significant of time to achieve the requirement. &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>DocGPT - Pagination &amp; Multiple Files upload</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Mon, 18 Nov 2024 03:13:25 +0000</pubDate>
      <link>https://dev.to/fadingna/docgpt-pagination-13kf</link>
      <guid>https://dev.to/fadingna/docgpt-pagination-13kf</guid>
      <description>&lt;h2&gt;
  
  
  Hi everyone,
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In my recent contributions to the &lt;a href="https://github.com/arc53/DocsGPT" rel="noopener noreferrer"&gt;DocsGPT&lt;/a&gt; project, I addressed two key areas: implementing pagination in the Settings &amp;gt; Documents section and resolving an error related to uploading multiple files.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Implementing Pagination in Settings &amp;gt; Documents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The Settings &amp;gt; Documents section in DocsGPT lacked pagination, leading to a cluttered interface when numerous documents were present. To enhance user experience, I introduced pagination, allowing users to navigate through documents more efficiently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Process&lt;/strong&gt;&lt;br&gt;
    1. Understanding the Requirement: I reviewed the feature request in &lt;a href="https://github.com/arc53/DocsGPT/issues/1417" rel="noopener noreferrer"&gt;Issue-147&lt;/a&gt; , which highlighted the need for pagination and referenced a Figma design for guidance.&lt;br&gt;
    2. Backend Modifications: I updated the /api/combine endpoint to accept a pageNumber query parameter, enabling the retrieval of documents in paginated form.&lt;br&gt;
    3. Frontend Integration: I implemented pagination controls in the frontend, aligning with the provided Figma design to ensure a cohesive user interface.&lt;br&gt;
    4. Testing: I conducted thorough testing to verify that pagination functioned correctly across various scenarios, including different document counts and page navigations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Outcome&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The implementation was successful, resulting in a more organized and user-friendly document management interface. The changes were merged into the main branch via Pull Request &lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/pull/1419" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Pagination
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1419&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/pull/1419" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 07, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What kind of change does this PR introduce?&lt;/strong&gt; (Bug fix, feature, docs update, ...)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;New feature add pagination to Setting / Document for user that have uploaded multiple document have pagination to align the documents&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/57cb4575-005e-4cbe-a132-e1ba36995f59"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F57cb4575-005e-4cbe-a132-e1ba36995f59" alt="Screenshot 2024-11-06 at 10 35 29 PM"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why was this change needed?&lt;/strong&gt; (You can also link to an open issue here)&lt;/li&gt;
&lt;li&gt;#1417&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/manishmadan2882"&gt;@manishmadan2882&lt;/a&gt; thanks for this.&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/pull/1419" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Second Pull Request
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Resolving Multiple File Upload Error
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Users encountered errors when attempting to upload multiple files simultaneously in the Settings &amp;gt; Documents section. The system would become unresponsive, and errors were logged in the backend.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Process&lt;/strong&gt;&lt;br&gt;
    1. Issue Identification: I examined &lt;a href="https://github.com/arc53/DocsGPT/issues/1420" rel="noopener noreferrer"&gt;Issue-1420&lt;/a&gt;, which detailed the error encountered during multiple file uploads.&lt;br&gt;
    2. Root Cause Analysis: I discovered that the backend was not handling multiple file uploads correctly, leading to server errors and unresponsive behavior.&lt;br&gt;
    3. Implementing the Fix: I modified the upload route to process files individually rather than in bulk. This change ensured that each file was handled properly, preventing server overload.&lt;br&gt;
    4. Testing: I tested the updated upload functionality with various file types and sizes to confirm that multiple files could be uploaded without issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Outcome&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The fix resolved the multiple file upload error, enhancing the reliability of the document upload feature. The solution was merged into the main branch via Pull Request &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/pull/1422" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        upload routes fix for multiple upload
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1422&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/pull/1422" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 08, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;What kind of change does this PR introduce?&lt;/strong&gt; (Bug fix, feature, docs update, ...)
Fix error on the client-side when send file the formData the server-side throwing code 500 when upload multiple files&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Why was this change needed?&lt;/strong&gt; (You can also link to an open issue here)
to be able upload multiple file&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Other information&lt;/strong&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;#1420&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/pull/1422" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Importance of User Experience: Implementing pagination significantly improved the usability of the document management interface, highlighting the impact of thoughtful UI design.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Robust Error Handling: Ensuring that the system can gracefully handle multiple file uploads is crucial for maintaining stability and providing a seamless user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Collaborative Development: Engaging with the community through issue discussions and pull requests facilitated effective problem-solving and knowledge sharing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;These contributions have enhanced the functionality and user experience of DocsGPT, demonstrating the value of addressing both feature enhancements and bug fixes in open-source projects.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In conclusion, working on these featuyres and fixed for DocsGPT taught me a lot about the power of user experiences and careful system hadnling. Adding pagination to the Document section made the interface more user-friendly and manageable, which was good to see, and manage the document as well. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Solving the multiple files issue was quite challenging for me to dig deep into backend processing and come up with a robust fix that improved reliablity for everyone.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Overall, these contributions made me realize how even seemingly small enhancements can make a big impact for users. I learned that every step in this journey—whether through engaging with community feedback, tackling bugs, or building new features—helps me grow as a developer while making DocsGPT better for everyone.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>docgpt</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Simplifying Package Distribution with setuptools and pyproject.toml</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Mon, 18 Nov 2024 02:44:54 +0000</pubDate>
      <link>https://dev.to/fadingna/simplifying-package-distribution-with-setuptools-and-pyprojecttoml-38in</link>
      <guid>https://dev.to/fadingna/simplifying-package-distribution-with-setuptools-and-pyprojecttoml-38in</guid>
      <description>&lt;h2&gt;
  
  
  Hi Everyone,
&lt;/h2&gt;

&lt;p&gt;Have you ever built something cool with Python and wanted to share it with the world? Maybe you’ve made a game, a tool, or something to help with work. If you want others to use it easily, you need to package it up and put it in a place where everyone can get it—like PyPI! Let’s talk about two tools that help with this: setuptools and pyproject.toml.&lt;/p&gt;




&lt;h3&gt;
  
  
  What is setuptools?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Think of setuptools as your helpful friend who makes packing easy. When you want to share your project, setuptools helps bundle all the files together neatly. This way, anyone who wants to use your project can get everything they need, without missing a piece.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is pyproject.toml?
&lt;/h3&gt;

&lt;p&gt;pyproject.toml is like a checklist for setuptools. It tells setuptools (and other tools) what to do and what your project is all about. It’s just a file you write to explain things like&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What your project is called.&lt;/li&gt;
&lt;li&gt;Where to find more information (like a website).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://packaging.python.org/en/latest/tutorials/packaging-projects/" rel="noopener noreferrer"&gt;tutorial using pypi packing your project&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example for pyproject.toml
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You can create pyproject.toml on the root of your project, but please be careful about your project structure.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[build-system]&lt;/span&gt;
&lt;span class="py"&gt;requires&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="py"&gt;["setuptools&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;61.0&lt;/span&gt;&lt;span class="s"&gt;"]&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="py"&gt;build-backend&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"setuptools.build_meta"&lt;/span&gt;

&lt;span class="nn"&gt;[project]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"chat-minal"&lt;/span&gt;
&lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"1.0"&lt;/span&gt;
&lt;span class="py"&gt;authors&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="err"&gt;{&lt;/span&gt; &lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Nonthachai Plodthong"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;email&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fadingna@procode.ca"&lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Chat Completion running on CLI using Language, support OpenAI and Groq"&lt;/span&gt;
&lt;span class="py"&gt;readme&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"README.md"&lt;/span&gt;
&lt;span class="py"&gt;requires-python&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="py"&gt;"&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;3.11&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="py"&gt;classifiers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s"&gt;"Programming Language :: Python :: 3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"License :: OSI Approved :: MIT License"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"Operating System :: OS Independent"&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nn"&gt;[project.urls]&lt;/span&gt;
&lt;span class="py"&gt;Homepage&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://github.com/xxxx/chat-completion-api"&lt;/span&gt;
&lt;span class="py"&gt;Issues&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://github.com/xxxx/chat-completion-api/issues"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;However, my app is have sub-directory which is /app so we need to specify on &lt;code&gt;pyproject&lt;/code&gt; where to look for main entrance.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[tool.setuptools.packages.find]&lt;/span&gt;
&lt;span class="py"&gt;where&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'app'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That's it your pyproject.toml is ready for upload to pypi or test-pypi.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step to upload to PyPi
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Build Your Project:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;python3 -m build&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload to PyPi
&lt;code&gt;python3 -m twine upload dist/*&lt;/code&gt; this will upload to pypi.org&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;python3 -m twine upload --repository test-pypi dist/*&lt;/code&gt; this will upload to test-pypi.org&lt;/p&gt;


&lt;h3&gt;
  
  
  Wrapping Up
&lt;/h3&gt;

&lt;p&gt;With setuptools and pyproject.toml, packaging and sharing your Python project is easy and fun! You’ve got everything you need to let the world see and use what you’ve built.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://pypi.org/project/chat-minal/1.0/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpypi.org%2Fstatic%2Fimages%2Ftwitter.abaf4b19.webp" height="300" class="m-0" width="300"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://pypi.org/project/chat-minal/1.0/" rel="noopener noreferrer" class="c-link"&gt;
          chat-minal · PyPI
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Chat Completion running on CLI using Language, support OpenAI and Groq
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpypi.org%2Fstatic%2Fimages%2Ffavicon.35549fe8.ico" width="800" height="400"&gt;
        pypi.org
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Python &amp; Github Guards</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Mon, 11 Nov 2024 00:23:53 +0000</pubDate>
      <link>https://dev.to/fadingna/python-github-guards-31n7</link>
      <guid>https://dev.to/fadingna/python-github-guards-31n7</guid>
      <description>&lt;h2&gt;
  
  
  First
&lt;/h2&gt;

&lt;p&gt;In software development, ensuring the quality of code is crucial for delivering a reliable product. Automated testing and continuous integration (CI) processes help catch issues early in the development cycle. This blog outlines the steps taken to set up a CI pipeline for a Python project using GitHub Actions. It covers the configuration of automated testing, linting, and handling common challenges faced during implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up CI/CD for a Chatminal
&lt;/h2&gt;

&lt;p&gt;In this case, our project involves building a Python application with the following goals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run automated tests for every push and pull request to the main branch.&lt;/li&gt;
&lt;li&gt;Perform code linting and enforce formatting standards.&lt;/li&gt;
&lt;li&gt;Ensure all changes pass CI checks before merging.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  1. Creating the GitHub Actions Workflow
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  - name: Set up Python
    uses: actions/setup-python@v2
    with:
      python-version: 3.11

  - name: Install dependencies
    run: |
      python -m pip install --upgrade pip
      pip install -r requirements.txt

  - name: Run Linter
    run: |
      pip install flake8 black
      flake8 ./app/*.py
      black --check .

  - name: Run Tests
    run: |
      python -m unittest discover -s test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Handling Linting with flake8 and black
&lt;/h3&gt;

&lt;p&gt;Linting ensures consistent code style and catches potential bugs early. We used flake8 for code linting and black for enforcing code formatting. To ignore specific warnings (e.g., unused imports), .flake8 configuration was added:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[flake8]&lt;/code&gt;&lt;br&gt;
&lt;code&gt;ignore = F401&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Writing and Running Unit Tests
&lt;/h3&gt;

&lt;p&gt;Tests were written using the unittest module. Each test file followed a naming convention of *_test.py and was placed in the test directory. An example of a tests for the Chatminal Object wide, Utilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Enforcing CI Checks for Pull Requests
&lt;/h3&gt;

&lt;p&gt;To ensure code quality, a rule was set to block merging if CI checks fail. This prevents code that does not meet quality standards from entering the main branch.&lt;/p&gt;




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

&lt;p&gt;Setting up a robust CI/CD pipeline with automated testing and linting helps maintain high code quality. GitHub Actions simplifies this process, making it easy to automate testing, enforce code standards, and catch issues early. By adopting these practices, developers can focus on building features while reducing the likelihood of introducing regressions.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>UnitTesting - Chatminal</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Wed, 06 Nov 2024 00:04:35 +0000</pubDate>
      <link>https://dev.to/fadingna/unittesting-chatminal-57fc</link>
      <guid>https://dev.to/fadingna/unittesting-chatminal-57fc</guid>
      <description>&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;

&lt;p&gt;Testing is a crucial step in the software development lifecycle that ensures your code works as expected and adheres to the specified logic. Proper testing not only validates the functionality of individual components but also guards against potential regressions when changes are introduced. Among various testing approaches, unit testing stands out as one of the most effective strategies for validating individual functions and methods in isolation.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll explore the significance of unit testing in Python using the unittest framework, with a focus on leveraging mocking techniques to isolate code, simulate dependencies, and verify behavior. Our practical example involves testing a custom object and mocking API requests from Langchain.&lt;/p&gt;

&lt;h1&gt;
  
  
  Unit Testing
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Detect Bug&lt;/li&gt;
&lt;li&gt;Improved Code Quality&lt;/li&gt;
&lt;li&gt;Checked Code flow&lt;/li&gt;
&lt;li&gt;Ensure development Cycles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unit testing verifies that each functions of application working properly. The focus is on every part of an application that I have build call Chatminal, and I will implement 2 significant testing model, Chat minal object and mock api request from Langchain&lt;/p&gt;

&lt;h1&gt;
  
  
  Methodology
&lt;/h1&gt;

&lt;p&gt;In Python, unit testing often involves object-oriented instances, though this approach isn’t strictly necessary. However, adopting object-oriented testing practices offers cleaner and more organized tests. Consider the following test structure using unittest and unittest.mock for mocking dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@patch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sys.exit&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@patch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;app.completion_tool.logger&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TestMinal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unittest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TestCase&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the two decorators @patch("sys.exit") and @patch("app.completion_tool.logger") mock the sys.exit call used to terminate the application and a logger used to debug application behavior.&lt;/p&gt;

&lt;p&gt;First method on that TestMinal Object&lt;br&gt;
Consider a method that tests argument parsing for a file, because our application depend from file input to give context to LLM.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_only_file_argument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mock_logger&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mock_exit&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;patch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sys.argv&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;completion_tool.py&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;test_file.txt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
            &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;patch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;os.path.exists&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;return_value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse_arguments&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;input_text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Default input text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-4&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;mock_exit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assert_not_called&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This test verifies that when a valid file argument is provided, the default values for other parameters are correctly set, and sys.exit is not called.&lt;/p&gt;

&lt;p&gt;This test suite demonstrates key unit testing techniques, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Patching System Calls, mocking sys.exit and loggers for controlled test behaviour.&lt;/li&gt;
&lt;li&gt;Mocking Dependencies, simulating external responses to isolate functionality.&lt;/li&gt;
&lt;li&gt;Argument Parsing Validation, ensuring command-line arguments are processed correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Mock API Request
&lt;/h3&gt;

&lt;p&gt;First define private variable to mock response from LangChain Completion&lt;/p&gt;

&lt;p&gt;&lt;code&gt;self.mock_response.response_metadata = {&lt;br&gt;
            "token_usage": {&lt;br&gt;
                "completion_tokens": 86,&lt;br&gt;
                "prompt_tokens": 48,&lt;br&gt;
                "total_tokens": 134,&lt;br&gt;
            },&lt;br&gt;
            "model_name": "gpt-4-0613",&lt;br&gt;
            "finish_reason": "stop",&lt;br&gt;
        }&lt;br&gt;
        self.mock_response.id = "mocked-id-12345"&lt;br&gt;
        self.mock_response.usage_metadata = {&lt;br&gt;
            "input_tokens": 48,&lt;br&gt;
            "output_tokens": 86,&lt;br&gt;
            "total_tokens": 134,&lt;br&gt;
        }&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_generate_completion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mock_logger&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mock_exit&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;patch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;app.completion_tool.LangChainOpenAI&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;MockLangChainOpenAI&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;mock_llm_instance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MockLangChainOpenAI&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;return_value&lt;/span&gt;
            &lt;span class="n"&gt;mock_chain_llm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mock_response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__or__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;return_value&lt;/span&gt;
            &lt;span class="n"&gt;mock_chain_llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;return_value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mock_response&lt;/span&gt;

            &lt;span class="c1"&gt;# Patch get_prompt_template and get_response to return mocks
&lt;/span&gt;            &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;patch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;get_prompt_template&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;return_value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mock_response&lt;/span&gt;
            &lt;span class="p"&gt;):&lt;/span&gt;
                &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;patch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;get_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;return_value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;mock_llm_instance&lt;/span&gt;
                &lt;span class="p"&gt;):&lt;/span&gt;
                    &lt;span class="c1"&gt;# using patch to mock the standard output
&lt;/span&gt;                    &lt;span class="c1"&gt;# and capture the printed output
&lt;/span&gt;                    &lt;span class="c1"&gt;# because our project print _reponse.content + '\n'
&lt;/span&gt;                    &lt;span class="c1"&gt;# to the standard output and we have to capture and mock it
&lt;/span&gt;                    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;patch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sys.stdout&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_callable&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StringIO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;fake_out&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate_completion&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                        &lt;span class="n"&gt;printed_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fake_out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getvalue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

                    &lt;span class="n"&gt;expected_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mock_response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
                    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;printed_output&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expected_output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Key Takeaways&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Effective Mocking, this approach ensures that your tests do not depend on live API calls, making them faster, more predictable, and less error-prone.&lt;/li&gt;
&lt;li&gt;Output Verification, by capturing sys.stdout, you can verify the behavior of functions that print output, which is particularly useful for command-line tools.&lt;/li&gt;
&lt;li&gt;Isolated Testing, by controlling all external dependencies with mocks, you can test the logic and behavior of your code in isolation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This method ensures that your code behaves correctly when interacting with external services and allows for comprehensive testing without actual network calls.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Unit testing is an indispensable practice for ensuring the reliability and maintainability of your Python applications. By mastering the use of unittest.mock, you can effectively isolate your code, simulate external dependencies, and verify both functional behavior and logging output. Remember to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1. Mock Correctly: Always patch the object where it’s used, not where it’s defined.&lt;/li&gt;
&lt;li&gt;2. Maintain Correct Argument Order: Especially when using multiple @patch decorators.&lt;/li&gt;
&lt;li&gt;3. Prefer Mocking Over Capturing stdout: Mocking functions like print leads to cleaner and more reliable tests.&lt;/li&gt;
&lt;li&gt;4. Leverage assertLogs: For testing logging output without complex mocking.&lt;/li&gt;
&lt;li&gt;5. Refactor for Testability: Design your code in a way that facilitates easy and effective testing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following these guidelines and learning from common pitfalls, you’ll enhance your testing strategy and build more resilient Python applications.&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Streamlining Python Development: Integrating Black and Flake8 with VSCode and Pre-Commit Hooks</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Tue, 29 Oct 2024 04:57:29 +0000</pubDate>
      <link>https://dev.to/fadingna/streamlining-python-development-integrating-black-and-flake8-with-vscode-and-pre-commit-hooks-57jj</link>
      <guid>https://dev.to/fadingna/streamlining-python-development-integrating-black-and-flake8-with-vscode-and-pre-commit-hooks-57jj</guid>
      <description>&lt;p&gt;As a developer, maintaining code quality and consistency is crucial for collaborative projects. In this blog post, I’ll walk you through how I integrated the Black code formatter and Flake8 linter into my Python project using Visual Studio Code (VSCode) and set up pre-commit hooks to automate code quality checks. This setup ensures that all contributors adhere to the same coding standards, enhancing the overall quality of the project.&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;In the open-source projects, it is very important to maintain a consistent code style and catch a small error early before commit. By integrating with tool like &lt;code&gt;black&lt;/code&gt; and &lt;code&gt;flake8&lt;/code&gt; into project in this case my project call Chatminal&lt;/p&gt;

&lt;h2&gt;
  
  
  Formatting with Black
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Black is a reliable tool formatter, that help developer careless about consistency of code pattern, and also using PEP 8 style guide.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Why Selecting Black?&lt;br&gt;
First of all, the speed of the process of Black CLI is very good by fast and efficient, minimizing disruption to the development workflow and also ready for pre-commit as well. Secondly, ease to use simple configuration with minimal options, making it easy to adopt to desire development styling.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/psf" rel="noopener noreferrer"&gt;
        psf
      &lt;/a&gt; / &lt;a href="https://github.com/psf/black" rel="noopener noreferrer"&gt;
        black
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      The uncompromising Python code formatter
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://black.readthedocs.io/en/stable/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fpsf%2Fblack%2Fmain%2Fdocs%2F_static%2Flogo2-readme.png" alt="Black Logo"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;The Uncompromising Code Formatter&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;a href="https://github.com/psf/black/actions" rel="noopener noreferrer"&gt;&lt;img alt="Actions Status" src="https://github.com/psf/black/workflows/Test/badge.svg"&gt;&lt;/a&gt;
&lt;a href="https://black.readthedocs.io/en/stable/?badge=stable" rel="nofollow noopener noreferrer"&gt;&lt;img alt="Documentation Status" src="https://camo.githubusercontent.com/430ae37f49bf0d95823717ca4aae3d4a9ea9833076fa6443188cf881930129e6/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f626c61636b2f62616467652f3f76657273696f6e3d737461626c65"&gt;&lt;/a&gt;
&lt;a href="https://coveralls.io/github/psf/black?branch=main" rel="nofollow noopener noreferrer"&gt;&lt;img alt="Coverage Status" src="https://camo.githubusercontent.com/7be9930614951d0c5e0d35e9c224c5afbdddccff22a856a6415b29acd2915909/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7073662f626c61636b2f62616467652e7376673f6272616e63683d6d61696e"&gt;&lt;/a&gt;
&lt;a href="https://github.com/psf/black/blob/main/LICENSE" rel="noopener noreferrer"&gt;&lt;img alt="License: MIT" src="https://camo.githubusercontent.com/fe44042bfcb831c710ac6052a7c862e9076cffe2e3b437188c6e8b2217b6fc7d/68747470733a2f2f626c61636b2e72656164746865646f63732e696f2f656e2f737461626c652f5f7374617469632f6c6963656e73652e737667"&gt;&lt;/a&gt;
&lt;a href="https://pypi.org/project/black/" rel="nofollow noopener noreferrer"&gt;&lt;img alt="PyPI" src="https://camo.githubusercontent.com/1e3b76d2bbc84d22ac9d95dcbc0be3a098d3a1f2a6899f32bdb714b9e7836808/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f626c61636b"&gt;&lt;/a&gt;
&lt;a href="https://pepy.tech/project/black" rel="nofollow noopener noreferrer"&gt;&lt;img alt="Downloads" src="https://camo.githubusercontent.com/42054966a313f88b434a7d0d0a4531359749986b58f07a2f1e15f55a8ca8ad3b/68747470733a2f2f7374617469632e706570792e746563682f62616467652f626c61636b"&gt;&lt;/a&gt;
&lt;a href="https://anaconda.org/conda-forge/black/" rel="nofollow noopener noreferrer"&gt;&lt;img alt="conda-forge" src="https://camo.githubusercontent.com/b0f2349e6f68240a841e7579d18b7e7ed688904612ee32ec542c69974ff6c893/68747470733a2f2f696d672e736869656c64732e696f2f636f6e64612f646e2f636f6e64612d666f7267652f626c61636b2e7376673f6c6162656c3d636f6e64612d666f726765"&gt;&lt;/a&gt;
&lt;a href="https://github.com/psf/black" rel="noopener noreferrer"&gt;&lt;img alt="Code style: black" src="https://camo.githubusercontent.com/5bf9e9fa18966df7cb5fac7715bef6b72df15e01a6efa9d616c83f9fcb527fe2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d626c61636b2d3030303030302e737667"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Any color you like.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Black&lt;/em&gt; is the uncompromising Python code formatter. By using it, you agree to cede
control over minutiae of hand-formatting. In return, &lt;em&gt;Black&lt;/em&gt; gives you speed
determinism, and freedom from &lt;code&gt;pycodestyle&lt;/code&gt; nagging about formatting. You will save time
and mental energy for more important matters.&lt;/p&gt;
&lt;p&gt;Blackened code looks the same regardless of the project you're reading. Formatting
becomes transparent after a while and you can focus on the content instead.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Black&lt;/em&gt; makes code review faster by producing the smallest diffs possible.&lt;/p&gt;
&lt;p&gt;Try it out now using the &lt;a href="https://black.vercel.app" rel="nofollow noopener noreferrer"&gt;Black Playground&lt;/a&gt;. Watch the
&lt;a href="https://youtu.be/esZLCuWs_2Y" rel="nofollow noopener noreferrer"&gt;PyCon 2019 talk&lt;/a&gt; to learn more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://black.readthedocs.io/en/stable" rel="nofollow noopener noreferrer"&gt;Read the documentation on ReadTheDocs!&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation and usage&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Installation&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Black&lt;/em&gt; can be installed by running &lt;code&gt;pip install black&lt;/code&gt;. It requires Python 3.9+ to run.
If you want to format Jupyter Notebooks, install with &lt;code&gt;pip install "black[jupyter]"&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you can't wait for the latest…&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/psf/black" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  Linting with Flake8
&lt;/h2&gt;

&lt;p&gt;Flake8 is a versatile Python linter that checks your code for style guide enforcement, programming errors, and code complexity.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why Selecting Flake8 ?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Comprehensive checking, with combines the functionality of PyFlakes, pycodestyle, and Ned Batchelder’s McCabe script.&lt;br&gt;
And also supports plugins to add more checks or customize existing ones. Moreover Flake8 is a open source project that widely used with extensive documentation and community backing.&lt;br&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://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/PyCQA" rel="noopener noreferrer"&gt;
        PyCQA
      &lt;/a&gt; / &lt;a href="https://github.com/PyCQA/flake8" rel="noopener noreferrer"&gt;
        flake8
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="rst"&gt;
&lt;a href="https://github.com/PyCQA/flake8/actions?query=workflow%3Amain" rel="noopener noreferrer"&gt;&lt;img alt="build status" src="https://github.com/PyCQA/flake8/workflows/main/badge.svg"&gt;
&lt;/a&gt;
&lt;a href="https://results.pre-commit.ci/latest/github/PyCQA/flake8/main" rel="nofollow noopener noreferrer"&gt;&lt;img alt="pre-commit.ci status" src="https://camo.githubusercontent.com/4e64aaa838bd6701ff402ea18a3dd1b4e2182a9ce35f9ea5f21e38182be5aa95/68747470733a2f2f726573756c74732e7072652d636f6d6d69742e63692f62616467652f6769746875622f50794351412f666c616b65382f6d61696e2e737667"&gt;
&lt;/a&gt;
&lt;a href="https://discord.gg/qYxpadCgkx" rel="nofollow noopener noreferrer"&gt;&lt;img alt="Discord" src="https://camo.githubusercontent.com/a8d7d829de1cfd621953b1f32b2f3d2b9a7cb2b7b7da745c3e518ffe5512c980/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3832353436333431333633343839313737362e737667"&gt;
&lt;/a&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Flake8&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Flake8 is a wrapper around these tools:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PyFlakes&lt;/li&gt;
&lt;li&gt;pycodestyle&lt;/li&gt;
&lt;li&gt;Ned Batchelder's McCabe script&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Flake8 runs all the tools by launching the single &lt;code&gt;flake8&lt;/code&gt; command
It displays the warnings in a per-file, merged output.&lt;/p&gt;
&lt;p&gt;It also adds a few features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;files that contain this line are skipped:&lt;/p&gt;
&lt;pre&gt;# flake8: noqa
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;lines that contain a &lt;code&gt;# noqa&lt;/code&gt; comment at the end will not issue warnings.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;you can ignore specific errors on a line with &lt;code&gt;# noqa: &amp;lt;error&amp;gt;&lt;/code&gt;, e.g.,
&lt;code&gt;# noqa: E234&lt;/code&gt;. Multiple codes can be given, separated by comma. The &lt;code&gt;noqa&lt;/code&gt; token is case insensitive, the colon before the list of codes is required otherwise the part after &lt;code&gt;noqa&lt;/code&gt; is ignored&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Git and Mercurial hooks&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;extendable through &lt;code&gt;flake8.extension&lt;/code&gt; and &lt;code&gt;flake8.formatting&lt;/code&gt; entry
points&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Quickstart&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;See our &lt;a href="https://flake8.pycqa.org/en/latest/index.html#quickstart" rel="nofollow noopener noreferrer"&gt;quickstart documentation&lt;/a&gt; for how to install
and get started with Flake8.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Frequently Asked Questions&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Flake8 maintains an &lt;a href="https://flake8.pycqa.org/en/latest/faq.html" rel="nofollow noopener noreferrer"&gt;FAQ&lt;/a&gt; in its
documentation.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Questions or Feedback&lt;/h3&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/PyCQA/flake8" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;





&lt;h1&gt;
  
  
  What I Learned
&lt;/h1&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%2Fhq9f7u68dngtctq51qow.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%2Fhq9f7u68dngtctq51qow.png" alt="Image description" width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Integrating Black, Flake8, and Pre-Commit hooks into Chatminal was a transformative experience. And see how black reformatted my code remove extra space. Here are some key takeaways&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Consistency is Key: Automated tools enforce a consistent code style, making the codebase more readable and maintainable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automation Saves Time: Pre-Commit hooks and editor integrations reduce the manual effort required for formatting and linting, speeding up the development workflow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Early Issue Detection: Tools like Flake8 catch potential bugs and code smells early, preventing them from propagating into the codebase.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Collaboration Made Easier: With standardized coding practices, collaborating with other developers becomes seamless, minimizing merge conflicts and misunderstandings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Backup Plans are Essential: Understanding Git’s reflog and having strategies to recover lost commits is invaluable, especially when performing operations like interactive rebase.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Automating code formatting and linting is a game-changer for any Python project. By integrating Black and Flake8 with Pre-Commit hooks and Visual Studio Code, I was able to enforce consistent coding standards, catch issues early, and streamline the development workflow in Chatminal. These tools not only enhance code quality but also foster a more collaborative and efficient development environment.&lt;/p&gt;

&lt;p&gt;Whether you’re working on a solo project or collaborating with a team, investing time in setting up these tools will pay dividends in the long run. I highly recommend adopting a similar setup to maintain high standards and ensure that your codebase remains clean and efficient.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Recap Hacktober Fest</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Sun, 27 Oct 2024 18:48:08 +0000</pubDate>
      <link>https://dev.to/fadingna/recap-hacktober-fest-4ln3</link>
      <guid>https://dev.to/fadingna/recap-hacktober-fest-4ln3</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&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%2Fbu36md1s1quu19ady8mh.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%2Fbu36md1s1quu19ady8mh.png" alt="Image description" width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the month of October, I had a very good chance to contribute to Hacktoberfest, and this was my first time contributing to open source projects. As part of the event, I needed to make a total of four pull requests. Below is the list of projects and contributions I made:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Transformers
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Issue:&lt;/strong&gt; &lt;a href="https://github.com/huggingface/transformers/issues/33193" rel="noopener noreferrer"&gt;KeyError Update in Transformers&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;This issue involved improving error handling for a &lt;code&gt;KeyError&lt;/code&gt; in the Hugging Face Transformers library. Specifically, I worked on improving the error messages for better debugging, as users were facing difficulties in understanding why the error occurred during the &lt;code&gt;_evaluate&lt;/code&gt; and &lt;code&gt;_save_checkpoint&lt;/code&gt; functions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Pull Request:&lt;/strong&gt; &lt;a href="https://github.com/huggingface/transformers/pull/33832" rel="noopener noreferrer"&gt;PR Update KeyError, _evaluate function, _save_checkpoint function&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;My pull request addressed the KeyError by providing a more descriptive error message, helping users to quickly identify and understand the underlying cause of the error. I also made improvements to the &lt;code&gt;_evaluate&lt;/code&gt; and &lt;code&gt;_save_checkpoint&lt;/code&gt; functions to prevent similar issues in the future.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. Scrape-it
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Issue:&lt;/strong&gt; &lt;a href="https://github.com/IonicaBizau/scrape-it/issues/193" rel="noopener noreferrer"&gt;Type Update for scrape-it&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;The issue was related to outdated type definitions for the &lt;code&gt;scrape-it&lt;/code&gt; library, which caused problems for developers using modern TypeScript features. The goal was to update the type definitions to be more compatible with the latest TypeScript standards.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Pull Request:&lt;/strong&gt; &lt;a href="https://github.com/IonicaBizau/scrape-it/pull/194" rel="noopener noreferrer"&gt;PR Update Type for Scrape-it&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;In my pull request, I updated the type definitions to ensure that they align with modern TypeScript practices, making it easier for developers to use the library without encountering type errors or incompatibility issues.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. DocsGPT
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Issue:&lt;/strong&gt; &lt;a href="https://github.com/arc53/DocsGPT/issues/1295" rel="noopener noreferrer"&gt;New Feature: Caching System for DocsGPT&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;This issue proposed adding a new feature to introduce a caching mechanism for DocsGPT, a project aimed at improving the efficiency of LLM responses. The caching system would store responses to avoid redundant API calls and speed up response times.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Pull Request:&lt;/strong&gt; &lt;a href="https://github.com/arc53/DocsGPT/pull/1308" rel="noopener noreferrer"&gt;PR Add New Feature for caching LLM response using Redis&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;My pull request implemented a Redis-based caching solution to store LLM responses. This feature significantly improved the efficiency of DocsGPT by reducing response times and decreasing the load on the backend by avoiding repeated computations for identical queries.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. Gradio
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Issue:&lt;/strong&gt; &lt;a href="https://github.com/gradio-app/gradio/issues/9787" rel="noopener noreferrer"&gt;Update Docstring for Button Variant in Gradio&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;The issue was about outdated or unclear documentation regarding the behavior of the &lt;code&gt;Button&lt;/code&gt; component in Gradio, specifically when different variants were used. The goal was to make the documentation more user-friendly and informative.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Pull Request:&lt;/strong&gt; &lt;a href="https://github.com/gradio-app/gradio/pull/9806" rel="noopener noreferrer"&gt;PR Update Docstring for Button behavior with variant&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;In my pull request, I updated the docstring for the &lt;code&gt;Button&lt;/code&gt; component to clarify its behavior based on the selected variant. This helps developers understand how different variants affect the appearance and behavior of buttons in Gradio, making the library easier to use.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Blog Posts
&lt;/h3&gt;

&lt;p&gt;To document my Hacktoberfest journey, I wrote blog posts about each of my contributions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://dev.to/fadingna/happy-hacking-my-first-hacktoberfest-pull-request-1lba"&gt;First PR: Transformer&lt;/a&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In this post, I detailed my first experience contributing to the Hugging Face Transformers library, the challenges I faced, and how I overcame them.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://dev.to/fadingna/scrape-it-contributor-1ko6-temp-slug-2118272?preview=477eea5cdff5d1da70300e0ad73b78a185f7015747c7792d8d80c09f5c59905c3627fbedccc5b20ce5a85e39aeafa9f9d54b38f3845da106e4b477fc"&gt;Second PR: Scrape IT&lt;/a&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In this post, I covered my work on updating type definitions for the &lt;code&gt;scrape-it&lt;/code&gt; library, why the change was necessary, and its impact on users of the library.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://dev.to/fadingna/new-feature-for-caching-llm-response-with-redis-instance-49l"&gt;Third PR: DocsGPT Caching&lt;/a&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In this post, I explained the importance of caching for LLMs, how I implemented the feature in DocsGPT, and the benefits it brought to the project.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://dev.to/fadingna/document-api-update-on-graddio-3fcj"&gt;Fourth PR: Gradio Document API Update&lt;/a&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In this post, I discussed my contribution to updating the Gradio documentation, the importance of clear documentation for open-source tools, and how these changes improved user experience.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Lastly
&lt;/h3&gt;

&lt;p&gt;Contributing to open source for the first time as part of Hacktoberfest and my course OSD600 has been an incredibly experience. I learned a lot about working with different codebases, collaborating with other developers, and the value of clear documentation. Each contribution helped me think and do problem solving as a developer should do, and I'm very enjoy for the opportunity to be able to give it back to community, and free library that everyone have been using.&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>Document API Update on Graddio</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Fri, 25 Oct 2024 18:15:46 +0000</pubDate>
      <link>https://dev.to/fadingna/document-api-update-on-graddio-3fcj</link>
      <guid>https://dev.to/fadingna/document-api-update-on-graddio-3fcj</guid>
      <description>&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Hey everyone! This last week, I had the chance to dive into the world of &lt;a href="https://github.com/gradio-app/gradio" rel="noopener noreferrer"&gt;gradio&lt;/a&gt; and contribute to improving its documentation. It was a fun experience, so I thought I'd share what I learned and how it all went down.
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/gradio-app" rel="noopener noreferrer"&gt;
        gradio-app
      &lt;/a&gt; / &lt;a href="https://github.com/gradio-app/gradio" rel="noopener noreferrer"&gt;
        gradio
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div&gt;
&lt;a href="https://gradio.app" rel="nofollow noopener noreferrer"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fgradio-app%2Fgradioreadme_files%2Fgradio.svg" alt="gradio" width="350"&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span&gt;
&lt;a href="https://www.producthunt.com/posts/gradio-5-0?embed=true&amp;amp;utm_source=badge-featured&amp;amp;utm_medium=badge&amp;amp;utm_souce=badge-gradio-5-0" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/c0669c9a964fcb21d59bd1f230991fd4628c5027c23a0af0a1a9ea697e3e5dee/68747470733a2f2f6170692e70726f6475637468756e742e636f6d2f776964676574732f656d6265642d696d6167652f76312f66656174757265642e7376673f706f73745f69643d353031393036267468656d653d6c69676874" alt="Gradio 5.0 - the easiest way to build AI web apps | Product Hunt" width="150" height="54"&gt;&lt;/a&gt;
&lt;a href="https://trendshift.io/repositories/2145" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/de25db4d4e50915cde63d3efd69a3668d216a60ca632a243a3ded993f51996a2/68747470733a2f2f7472656e6473686966742e696f2f6170692f62616467652f7265706f7369746f726965732f32313435" alt="gradio-app%2Fgradio | Trendshift" width="150" height="55"&gt;&lt;/a&gt;
&lt;/span&gt;
&lt;p&gt;&lt;a href="https://github.com/gradio-app/gradio/actions/workflows/test-python.yml" rel="noopener noreferrer"&gt;&lt;img src="https://github.com/gradio-app/gradio/actions/workflows/test-python.yml/badge.svg" alt="gradio-backend"&gt;&lt;/a&gt;
&lt;a href="https://github.com/gradio-app/gradio/actions/workflows/tests-js.yml" rel="noopener noreferrer"&gt;&lt;img src="https://github.com/gradio-app/gradio/actions/workflows/tests-js.yml/badge.svg" alt="gradio-ui"&gt;&lt;/a&gt;
&lt;a href="https://pypi.org/project/gradio/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/4d6475b24edfd48317507fc60962205f79a8d11bedf3400e7ce0a5cdcd34e7d0/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f67726164696f" alt="PyPI"&gt;&lt;/a&gt;
&lt;a href="https://pypi.org/project/gradio/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/1388869fe37d96e14ca32e471f07e6ed80a65eb2020edf193f00c8db70b33463/68747470733a2f2f696d672e736869656c64732e696f2f707970692f646d2f67726164696f" alt="PyPI downloads"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/ac6c977480634b1b7c3aa51e54383b66dd67ba626933fdfc2d5bea1cb4b5bb09/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d332e31302b2d696d706f7274616e74"&gt;&lt;img src="https://camo.githubusercontent.com/ac6c977480634b1b7c3aa51e54383b66dd67ba626933fdfc2d5bea1cb4b5bb09/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d332e31302b2d696d706f7274616e74" alt="Python version"&gt;&lt;/a&gt;
&lt;a href="https://twitter.com/gradio" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/8cd00fce81e1f033144e48b285911feeb551ff6a0e1e71d860511d298f677920/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f67726164696f3f7374796c653d736f6369616c266c6162656c3d666f6c6c6f77" alt="Twitter follow"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://gradio.app" rel="nofollow noopener noreferrer"&gt;Website&lt;/a&gt;
| &lt;a href="https://gradio.app/docs/" rel="nofollow noopener noreferrer"&gt;Documentation&lt;/a&gt;
| &lt;a href="https://gradio.app/guides/" rel="nofollow noopener noreferrer"&gt;Guides&lt;/a&gt;
| &lt;a href="https://gradio.app/getting_started/" rel="nofollow noopener noreferrer"&gt;Getting Started&lt;/a&gt;
| &lt;a href="https://github.com/gradio-app/gradiodemo/" rel="noopener noreferrer"&gt;Examples&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;English | &lt;a href="https://github.com/gradio-app/gradioreadme_files/zh-cn#readme" rel="noopener noreferrer"&gt;中文&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Gradio: Build Machine Learning Web Apps — in Python&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Gradio is an open-source Python package that allows you to quickly &lt;strong&gt;build&lt;/strong&gt; a demo or web application for your machine learning model, API, or any arbitrary Python function. You can then &lt;strong&gt;share&lt;/strong&gt; a link to your demo or web application in just a few seconds using Gradio's built-in sharing features. &lt;em&gt;No JavaScript, CSS, or web hosting experience needed!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/12c773e6a6bf9728c62c498e01fccf1e8dc7aa2e271e12c0f2f76fd2d774e2cc/68747470733a2f2f68756767696e67666163652e636f2f64617461736574732f68756767696e67666163652f646f63756d656e746174696f6e2d696d616765732f7265736f6c76652f6d61696e2f67726164696f2d6775696465732f6769662d76657273696f6e2e676966"&gt;&lt;img src="https://camo.githubusercontent.com/12c773e6a6bf9728c62c498e01fccf1e8dc7aa2e271e12c0f2f76fd2d774e2cc/68747470733a2f2f68756767696e67666163652e636f2f64617461736574732f68756767696e67666163652f646f63756d656e746174696f6e2d696d616765732f7265736f6c76652f6d61696e2f67726164696f2d6775696465732f6769662d76657273696f6e2e676966"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It just takes a few lines of Python to create your own demo, so let's get started 💫&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Installation&lt;/h3&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Prerequisite&lt;/strong&gt;: Gradio 5 requires &lt;a href="https://www.python.org/downloads/" rel="nofollow noopener noreferrer"&gt;Python 3.10 or higher&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We recommend installing Gradio using &lt;code&gt;pip&lt;/code&gt;, which is included by default in Python. Run this in your terminal or command prompt:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;pip install --upgrade gradio&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-alert markdown-alert-tip"&gt;
&lt;p class="markdown-alert-title"&gt;Tip&lt;/p&gt;
&lt;p&gt;It is best to install Gradio in a virtual environment. Detailed installation instructions for all…&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/gradio-app/gradio" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Issue
&lt;/h3&gt;


&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/gradio-app/gradio/issues/9787" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Buttons of type 'huggingface' appear Black
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#9787&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/Steveolas" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F76042684%3Fv%3D4" alt="Steveolas avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/Steveolas" rel="noopener noreferrer"&gt;Steveolas&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/gradio-app/gradio/issues/9787" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 22, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Describe the bug&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;When not in darkmode, 'huggingface buttons appear black with white text. When in darkmode they appear white. This is in contrary to the documentation. And in contrary to how they worked in gradio 5.1.0.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Have you searched existing issues?  🔎&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;[X] I have searched and found no existing issues&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Reproduction&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight highlight-source-python js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;numpy&lt;/span&gt; &lt;span class="pl-k"&gt;as&lt;/span&gt; &lt;span class="pl-s1"&gt;np&lt;/span&gt;
&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;gradio&lt;/span&gt; &lt;span class="pl-k"&gt;as&lt;/span&gt; &lt;span class="pl-s1"&gt;gr&lt;/span&gt;

&lt;span class="pl-k"&gt;with&lt;/span&gt; &lt;span class="pl-s1"&gt;gr&lt;/span&gt;.&lt;span class="pl-v"&gt;Blocks&lt;/span&gt;() &lt;span class="pl-k"&gt;as&lt;/span&gt; &lt;span class="pl-s1"&gt;demo&lt;/span&gt;:
    &lt;span class="pl-s1"&gt;text_button&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;gr&lt;/span&gt;.&lt;span class="pl-v"&gt;Button&lt;/span&gt;(&lt;span class="pl-s"&gt;"I Am a Button"&lt;/span&gt;, &lt;span class="pl-s1"&gt;variant&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;'huggingface'&lt;/span&gt;)


&lt;span class="pl-k"&gt;if&lt;/span&gt; &lt;span class="pl-s1"&gt;__name__&lt;/span&gt; &lt;span class="pl-c1"&gt;==&lt;/span&gt; &lt;span class="pl-s"&gt;"__main__"&lt;/span&gt;:
    &lt;span class="pl-s1"&gt;demo&lt;/span&gt;.&lt;span class="pl-en"&gt;launch&lt;/span&gt;()&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Screenshot&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/f714fe62-ce7d-4a5c-a608-bc7ebf918dc3"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2Ff714fe62-ce7d-4a5c-a608-bc7ebf918dc3" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Logs&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;No response&lt;/em&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;System Info&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight highlight-source-shell js-code-highlight"&gt;
&lt;pre&gt;gradio 5.3.0&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Severity&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;I can work around it&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/gradio-app/gradio/issues/9787" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;It all started when a new issue popped up in the Gradio repository someone noticed that the 'huggingface' variant of the button component was showing up with a black background and white text when not in dark mode. This was different from how the documentation described it and even how it looked in Gradio 5.1.0. You can see the original issue&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Pull Request
&lt;/h3&gt;


&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/gradio-app/gradio/pull/9806" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        update docstring for the the "variant" parameter in `gr.Button`
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#9806&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/gradio-app/gradio/pull/9806" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 22, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Description&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Align parameter document of button api reference&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🎯 PRs Should Target Issues&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Closes: #9787&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Tests&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;All tests pass.&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/gradio-app/gradio/pull/9806" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I submitted a pull request (PR) that aimed to update the API documentation to reflect the correct behavior of the 'huggingface' variant in the button component. Unlike some of my previous contributions, this PR was focused solely on documentation adjustments, helping align user expectations with the UI's actual behavior. This experience gave me a deeper understanding of how even seemingly minor documentation updates can be valuable in open source, as they clarify functionality for all users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An interesting takeaway from this PR was observing how the maintainers efficiently utilized it to improve the API documentation without opening a new PR for each small update. This approach helped avoid clutter in the repository and minimized PR overlap, especially for minor but essential updates.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Communication is Key - The conversation between the contributor and the maintainers was open and clear, which made it easy to understand what needed to be fixed. It’s a reminder of how valuable it is to reach out and ask questions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;From this last pull request I have done, taught me something about the best practice to do CI pipeline approval, even document api change we have to use maintainer approved it, so the repository become more secure. Overall, this contribution has deepened my understanding of documentation's role in open-source projects and reinforced the importance of clear communication and robust CI processes.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>New Feature for caching LLM response with redis instance</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Fri, 25 Oct 2024 18:05:33 +0000</pubDate>
      <link>https://dev.to/fadingna/new-feature-for-caching-llm-response-with-redis-instance-49l</link>
      <guid>https://dev.to/fadingna/new-feature-for-caching-llm-response-with-redis-instance-49l</guid>
      <description>&lt;p&gt;First of all, this is my third pull request of Hacktoberfest contribution during October 2024, I have a chance to contribute in big project called DocsGPT, and the project overview is in this link below. &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/arc53" rel="noopener noreferrer"&gt;
        arc53
      &lt;/a&gt; / &lt;a href="https://github.com/arc53/DocsGPT" rel="noopener noreferrer"&gt;
        DocsGPT
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Chatbot for documentation, that allows you to chat with your data. Privately deployable, provides AI knowledge sharing and integrates knowledge into your AI workflow
    &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;
  DocsGPT  🦖
&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;
  &lt;strong&gt;Open-Source Documentation Assistant&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
  &lt;strong&gt;&lt;a href="https://www.docsgpt.cloud/" rel="nofollow noopener noreferrer"&gt;DocsGPT&lt;/a&gt;&lt;/strong&gt; is a cutting-edge open-source solution that streamlines the process of finding information in the project documentation. With its integration of the powerful &lt;strong&gt;GPT&lt;/strong&gt; models, developers can easily ask questions about a project and receive accurate answers
&lt;/p&gt;

&lt;p&gt;Say goodbye to time-consuming manual searches, and let &lt;strong&gt;&lt;a href="https://www.docsgpt.cloud/" rel="nofollow noopener noreferrer"&gt;DocsGPT&lt;/a&gt;&lt;/strong&gt; help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance.&lt;/p&gt;

&lt;div&gt;
&lt;p&gt;&lt;a href="https://github.com/arc53/DocsGPT" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/d2f392695bd68c10140e8d173bc9d71c92774c1d889b8530556ea2d2a5648a3c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f61726335332f646f63736770743f7374796c653d736f6369616c" alt="link to main GitHub showing Stars number"&gt;&lt;/a&gt;
&lt;a href="https://github.com/arc53/DocsGPT" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/e1b98526c87c0363e43c69a0a426bff73677a3c0f5b9141f674b67c348dd6756/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f61726335332f646f63736770743f7374796c653d736f6369616c" alt="link to main GitHub showing Forks number"&gt;&lt;/a&gt;
&lt;a href="https://github.com/arc53/DocsGPT/blob/main/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/46638aa4db289054e9199852b7428b34539276d205ba499350398671fc222b1a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f61726335332f646f6373677074" alt="link to license file"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/n5BX8dh8rU" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/ee6b0196ebd3f7e624150404eb43b6a4ae270d0b90265f3ddfa39a42f455cb0f/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f31303730303436353033333032383737323136" alt="link to discord"&gt;&lt;/a&gt;
&lt;a href="https://twitter.com/docsgptai" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/60305c69a1109f90b6206d6f694659c98ba5d9aacfab752da776448651cbb916/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f646f63736770746169" alt="X (formerly Twitter) URL"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🎃 &lt;a href="https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md" rel="noopener noreferrer"&gt;Hacktoberfest Prizes, Rules &amp;amp; Q&amp;amp;A&lt;/a&gt; 🎃&lt;/h3&gt;

&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Production Support / Help for Companies:&lt;/h3&gt;

&lt;/div&gt;

&lt;p&gt;We're eager to provide personalized assistance when deploying your DocsGPT to a live environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cal.com/arc53/docsgpt-demo-b2b" rel="nofollow noopener noreferrer"&gt;&lt;br&gt;
    &lt;img alt="Let's chat" src="https://camo.githubusercontent.com/298517cca77af25bc85b9663f5f3981400cbfff904619bffae30dae85f45d5a5/68747470733a2f2f63616c2e636f6d2f626f6f6b2d776974682d63616c2d6461726b2e737667"&gt;&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/arc53/DocsGPTmailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions" rel="noopener noreferrer"&gt;Send Email 📧&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://private-user-images.githubusercontent.com/82649533/376220259-9a1f21de-7a15-4e42-9424-70d22ba5a913.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzAxNjg4NDAsIm5iZiI6MTczMDE2ODU0MCwicGF0aCI6Ii84MjY0OTUzMy8zNzYyMjAyNTktOWExZjIxZGUtN2ExNS00ZTQyLTk0MjQtNzBkMjJiYTVhOTEzLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDI5VDAyMjIyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmODAzOTlmMmY4MTQwNzVhOWVmYzk0MDRkZDZkNmIxNDM2OTQ1YWYzOTU5OWNlM2JmOGRiMTQ1ODEwNWUwZDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Z1P32DOVRjajMpB_wSj3hVtiD9z27S3ZzXCe_Oq8KxI"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fprivate-user-images.githubusercontent.com%2F82649533%2F376220259-9a1f21de-7a15-4e42-9424-70d22ba5a913.gif%3Fjwt%3DeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzAxNjg4NDAsIm5iZiI6MTczMDE2ODU0MCwicGF0aCI6Ii84MjY0OTUzMy8zNzYyMjAyNTktOWExZjIxZGUtN2ExNS00ZTQyLTk0MjQtNzBkMjJiYTVhOTEzLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDI5VDAyMjIyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmODAzOTlmMmY4MTQwNzVhOWVmYzk0MDRkZDZkNmIxNDM2OTQ1YWYzOTU5OWNlM2JmOGRiMTQ1ODEwNWUwZDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Z1P32DOVRjajMpB_wSj3hVtiD9z27S3ZzXCe_Oq8KxI" alt="video-example-of-docs-gpt" width="1000" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Roadmap&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;You can find our roadmap &lt;a href="https://github.com/orgs/arc53/projects/2" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Please don't hesitate to contribute or create issues, it helps us improve DocsGPT!&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Our Open-Source Models Optimized for DocsGPT:&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;br&gt;
&lt;thead&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;br&gt;
&lt;th&gt;Base Model&lt;/th&gt;
&lt;br&gt;
&lt;th&gt;Requirements (or similar)&lt;/th&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;/thead&gt;
&lt;br&gt;
&lt;tbody&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;td&gt;&lt;a href="https://huggingface.co/Arc53/docsgpt-7b-mistral" rel="nofollow noopener noreferrer"&gt;Docsgpt-7b-mistral&lt;/a&gt;&lt;/td&gt;
&lt;br&gt;
&lt;td&gt;Mistral-7b&lt;/td&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;/tbody&gt;
&lt;br&gt;
&lt;/table&gt;&lt;/div&gt;…&lt;/p&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
 

&lt;h3&gt;
  
  
  Beginning
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I began by checking out the issues listed in the repository. I found a feature request that the maintainer needed help with, and I thought, "Why not give it a shot?" So, I joined their Discord channel and started chatting with the maintainers about the new feature they wanted, as well as the coding style they preferred. Here's the issue I tackled &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/issues/1295" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        🚀 Feature: Caching for DocsGPT
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1295&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/pabik" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F32868631%3Fv%3D4" alt="pabik avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/pabik" rel="noopener noreferrer"&gt;pabik&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/issues/1295" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 10, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🔖 Feature description&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;We need to implement caching for DocsGPT to improve performance and efficiency. If the same question is asked, using the same source and the same LLM, the result should be retrieved from the cache rather than triggering a new API call.&lt;/p&gt;
&lt;p&gt;Redis is already configured and used for Celery tasks, so the cache system should leverage Redis for storing and retrieving these cached responses.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🎤 Why is this feature needed ?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;This feature will improve the performance of DocsGPT by avoiding redundant API calls for identical requests. It will reduce response time for repeated queries, lower API costs, and improve user experience, especially for frequently asked questions.&lt;/p&gt;
&lt;p&gt;When users ask similar questions repeatedly using the same data source, there's no need to re-run the same logic each time (at least for some time period). By introducing caching, we can streamline this process.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;✌️ How do you aim to achieve this?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;The implementation will involve:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Using Redis as the caching layer to store LLM responses, indexed by the combination of question, source, and LLM used.&lt;/li&gt;
&lt;li&gt;Checking the cache before executing new LLM queries to see if a cached result is available.&lt;/li&gt;
&lt;li&gt;Triggering from cache if an identical question is found in the cache, otherwise proceeding with the usual query process and then storing the result for future use.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is a challenging task, and we'd love to collaborate on it. You can contribute directly in this issue or join the discussion in our &lt;a href="https://discord.gg/ueQcwgxeDY" rel="nofollow noopener noreferrer"&gt;Discord (collaborative-issues)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We also encourage splitting this issue into smaller, manageable tasks, but please link them back to this original issue for tracking purposes.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🔄️ Additional Information&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;No response&lt;/em&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;👀 Have you spent some time to check if this feature request has been raised before?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;[X] I checked and didn't find similar issue&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Are you willing to submit PR?&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;

&lt;p&gt;None&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;/div&amp;gt;
&amp;lt;div class="gh-btn-container"&amp;gt;&amp;lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/issues/1295"&amp;gt;View on GitHub&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
&lt;li&gt;
&lt;p&gt;After some back-and-forth dicussions, I got a better understanding of what was needed. I also learned a lot about the project's structure. Its turn out the repository includes both UI and Server, plus a bunch of services like PostGreSQL, Redis, and SQL running in Docker containers. It was a bit overwhelming at first, but I got the hang of it.&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/arc53/DocsGPT/pull/1308" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Caching docsgpt
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#1308&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F94852295%3Fv%3D4" alt="fadingNA avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/fadingNA" rel="noopener noreferrer"&gt;fadingNA&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/arc53/DocsGPT/pull/1308" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 12, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;&lt;strong&gt;What kind of change does this PR introduce?&lt;/strong&gt; (New Feature Caching)&lt;/p&gt;
&lt;p&gt;The changes are applied in the BaseLLM class to ensure that all LLM queries (both standard and streaming) benefit from&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Caching of responses to improve performance.&lt;/li&gt;
&lt;li&gt;Token usage tracking for monitoring API costs.&lt;/li&gt;
&lt;li&gt;The concrete LLMs implementations now automatically apply caching and token tracking without modifying their core logic.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Why was this change needed?&lt;/strong&gt; (You can also link to an open issue here)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;#1295&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Other information&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The addition of caching and token usage tracking was necessary to improve performance and reduce redundant API calls for LLM queries. This change also allows monitoring of token usage for better cost management. By caching the results of similar requests, repeated queries can retrieve cached responses, thus saving time and reducing API costs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, the use of decorators makes the code more modular, allowing the caching and token tracking logic to be applied across different LLM implementations without modifying each one.&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/arc53/DocsGPT/pull/1308" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;/li&gt;
&lt;br&gt;


&lt;h3&gt;
  
  
  Diving into the code
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Not that long that I made myself comfortable with server architecture using Python3, and running server with Flask. It was a fun task, and I really enjoyed seeing how everything connected. from Abstract Object to Concrete and running by decorator function to apply all LLM instances.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;p&gt;This experience taught me a lot about handling server-side caching and working within a larger, collaborative project. Here are some key takeaways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Communication is key: Talking directly with the maintainers helped me understand exactly what was needed, saving time and avoiding confusion.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Project structure matters: Understanding how different parts of the project interact, like how the server communicates with PostgreSQL and Redis, made a huge difference.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Patience is a virtue: Large projects can be complex, and it takes time to navigate them. But the satisfaction of making a contribution is totally worth it!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If I could go back, I will spend a bit more time exploring the codebase before diving into my changes. It would have made the process easier. But, and I would definitely keep the open more communication with maintainers it made everything so much easier, but also research more how to caching work in pararell timeline.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;The overall of this pull request is quite big that I have to organize the redis script to make LLM response with cache if the pattern of conversation is happened before. It was not just about writing code. I had to think about how to structure the cache efficiently, so that it could store and retrieve responses quickly. This meant considering different conversation scenarios and making sure that the cache would be hit only when it made sense, preventing unnecessary API calls.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>llm</category>
      <category>docstr</category>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>scrape-it - contributor</title>
      <dc:creator>fadingNA</dc:creator>
      <pubDate>Tue, 15 Oct 2024 02:30:38 +0000</pubDate>
      <link>https://dev.to/fadingna/scrape-it-contributor-1pn7</link>
      <guid>https://dev.to/fadingna/scrape-it-contributor-1pn7</guid>
      <description>&lt;p&gt;In this blog post, I’ll walk you through my recent contribution to the scrape-it repository, where I resolved a type error in the ScrapeOptionElement interface. This was part of issue &lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/IonicaBizau/scrape-it/issues/193" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Type error with the how field of type ScrapeOptionElement
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#193&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/RepolloDev" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F96484170%3Fv%3D4" alt="RepolloDev avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/RepolloDev" rel="noopener noreferrer"&gt;RepolloDev&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/IonicaBizau/scrape-it/issues/193" rel="noopener noreferrer"&gt;&lt;time&gt;Aug 03, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;A little context&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;I recently started using scrape-it to extract data from html pages, but there were cases where I needed to intervene in the extraction using the Cheerio API.&lt;/p&gt;
&lt;div class="highlight highlight-source-ts js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;// test example&lt;/span&gt;
&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;anyHTML&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s"&gt;'&amp;lt;html&amp;gt;...&amp;lt;/html&amp;gt;'&lt;/span&gt;
&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt; data &lt;span class="pl-kos"&gt;}&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;scrapeIt&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;scrapeHTML&lt;/span&gt;&lt;span class="pl-kos"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pl-kos"&gt;{&lt;/span&gt; &lt;span class="pl-c1"&gt;data&lt;/span&gt;: &lt;span class="pl-smi"&gt;unknown&lt;/span&gt; &lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;&amp;gt;&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;anyHTML&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
  &lt;span class="pl-c1"&gt;data&lt;/span&gt;: &lt;span class="pl-kos"&gt;{&lt;/span&gt;
    &lt;span class="pl-c1"&gt;listItem&lt;/span&gt;: &lt;span class="pl-s"&gt;'main'&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
    &lt;span class="pl-c1"&gt;data&lt;/span&gt;: &lt;span class="pl-kos"&gt;{&lt;/span&gt;
      &lt;span class="pl-c1"&gt;items&lt;/span&gt;: &lt;span class="pl-kos"&gt;{&lt;/span&gt;
        &lt;span class="pl-c1"&gt;selector&lt;/span&gt;: &lt;span class="pl-s"&gt;'article'&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
        &lt;span class="pl-en"&gt;how&lt;/span&gt;: &lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;element&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-c1"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
           &lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;$items&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;element&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;find&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;'p:nth-child(n+2)'&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
           &lt;span class="pl-c"&gt;// more cheerio methods&lt;/span&gt;
           &lt;span class="pl-k"&gt;return&lt;/span&gt; &lt;span class="pl-s1"&gt;$items&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;text&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
        &lt;span class="pl-kos"&gt;}&lt;/span&gt;
      &lt;span class="pl-kos"&gt;}&lt;/span&gt;
    &lt;span class="pl-kos"&gt;}&lt;/span&gt;
  &lt;span class="pl-kos"&gt;}&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;The problem&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;TypeScript throws a typing warning, &lt;strong&gt;if you run the code nothing happens&lt;/strong&gt;, but it becomes a nuisance to have that warning and not have autocompletion with the Cheerio object passed to the function parameter.
&lt;a rel="noopener noreferrer" href="https://github.com/user-attachments/assets/d190b3b2-fe62-4081-812d-995adad319e1"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2Fd190b3b2-fe62-4081-812d-995adad319e1" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Solución&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Looking into the types of scrape-it, the &lt;code&gt;how&lt;/code&gt; field has as its type a function whose parameter is a &lt;code&gt;cheerio.Selector&lt;/code&gt;, which may cause the problem.&lt;/p&gt;
&lt;div class="highlight highlight-source-ts js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;export&lt;/span&gt; &lt;span class="pl-k"&gt;interface&lt;/span&gt; &lt;span class="pl-smi"&gt;ScrapeOptionElement&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
        &lt;span class="pl-c1"&gt;selector&lt;/span&gt;?: &lt;span class="pl-smi"&gt;string&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
        &lt;span class="pl-c1"&gt;convert&lt;/span&gt;?: &lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;value&lt;/span&gt;: &lt;span class="pl-smi"&gt;any&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-c1"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="pl-smi"&gt;any&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
        &lt;span class="pl-c"&gt;// Change cheerio.Selector to cheerio.Cheerio&lt;/span&gt;
        &lt;span class="pl-c1"&gt;how&lt;/span&gt;?: &lt;span class="pl-smi"&gt;string&lt;/span&gt; &lt;span class="pl-c1"&gt;|&lt;/span&gt; &lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;element&lt;/span&gt;: &lt;span class="pl-s1"&gt;cheerio&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-smi"&gt;Selector&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-c1"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="pl-smi"&gt;any&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
        &lt;span class="pl-c1"&gt;attr&lt;/span&gt;?: &lt;span class="pl-smi"&gt;string&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
        &lt;span class="pl-c1"&gt;trim&lt;/span&gt;?: &lt;span class="pl-smi"&gt;boolean&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
        &lt;span class="pl-c1"&gt;closest&lt;/span&gt;?: &lt;span class="pl-smi"&gt;string&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
        &lt;span class="pl-c1"&gt;eq&lt;/span&gt;?: &lt;span class="pl-smi"&gt;number&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
        &lt;span class="pl-c1"&gt;texteq&lt;/span&gt;?: &lt;span class="pl-smi"&gt;number&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
    &lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/IonicaBizau/scrape-it/issues/193" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Which highlighted outdated type definitions when using the how function in TypeScript. Here’s the journey from identifying the problem to submitting a successful pull request.&lt;/p&gt;

&lt;h3&gt;
  
  
  The issue: Outdated Type
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The issue was centered around the ScrapeOptionElement interface, specifically the how field. The problem was that the element parameter of the how function was not correctly typed in TypeScript. As a result, developers were not getting proper type hints or autocompletion when using Cheerio methods.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/IonicaBizau/scrape-it/issues/193" rel="noopener noreferrer"&gt;Issue URL: Type error with the how field of type ScrapeOptionElement #193&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The how field in ScrapeOptionElement was typed as string | ((element: any) =&amp;gt; any). This typing was too generic for users working with Cheerio. What we needed was to type the element parameter more specifically as Cheerio, ensuring that TypeScript could recognize Cheerio methods and provide better tooling support.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Did I Do to Fix It?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To address the issue, I updated the type definition for the ScrapeOptionElement interface in the index.d.ts file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&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;ScrapeOptionElement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;how&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;cheerio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Selector&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// original&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How I updated it ?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I updated the how field to explicitly use the Cheerio type for the element parameter. This ensured that TypeScript would provide correct typings and autocompletion for all Cheerio methods. So we are using reference to declaration so we don't have to import.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;
&lt;span class="c1"&gt;/// reference Cheerio&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ScrapeOptionElement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;how&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Cheerio&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Updated type&lt;/span&gt;
&lt;span class="p"&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;const&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="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;scrapeIt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scrapeHTML&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;{&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;unknown&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://ionicabizau.net&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="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;listItem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;main&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;
                    &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;article&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
                &lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="na"&gt;how&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&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;const&lt;/span&gt; &lt;span class="nx"&gt;$items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p:nth-child(n+2)&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="nx"&gt;$items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                    &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&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="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Testing the Fix
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;After making the necessary changes, I created an example TypeScript file (example/index-type.ts) to demonstrate how the updated ScrapeOptionElement interface works. This example included both Promise-based and async/await usage to showcase how the how function could be used with proper typings in TypeScript.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Research and Challenges
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;While updating the type definition itself was straightforward, I had to ensure that the fix didn’t break existing functionality or introduce new errors. My primary challenge was ensuring backward compatibility and understanding how Cheerio’s type definitions worked.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Pull Request and Interaction with Maintainers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Once I completed the fix, I submitted a pull request &lt;a href="https://github.com/IonicaBizau/scrape-it/pull/194" rel="noopener noreferrer"&gt;PR #194&lt;/a&gt; to the scrape-it repository. The project maintainer, IonicaBizau, reviewed my code and provided feedback. After ensuring that all tests passed and the changes were satisfactory, the PR was merged successfully.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This contribution helped improve the TypeScript experience for developers using the scrape-it library by providing proper typings for the how function when working with Cheerio elements. By fixing this type error, developers can now enjoy better autocompletion and error-checking in their scraping projects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you’re working with web scraping and TypeScript, this fix makes it easier to write robust, type-safe code. You can check out the updated type definitions in version 6.1.3 of scrape-it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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