<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Next Idea Tech</title>
    <description>The latest articles on Forem by Next Idea Tech (@nextideatech).</description>
    <link>https://forem.com/nextideatech</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%2Forganization%2Fprofile_image%2F6459%2F20df238b-6ad9-49af-b69b-a1405ece22c8.png</url>
      <title>Forem: Next Idea Tech</title>
      <link>https://forem.com/nextideatech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nextideatech"/>
    <language>en</language>
    <item>
      <title>How To Interview Next.js Developers</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Tue, 05 Dec 2023 21:37:15 +0000</pubDate>
      <link>https://forem.com/nextideatech/how-to-interview-nextjs-developers-1nn7</link>
      <guid>https://forem.com/nextideatech/how-to-interview-nextjs-developers-1nn7</guid>
      <description>&lt;p&gt;When it comes to building modern, efficient web applications, Next.js stands out as a powerful framework. This guide focuses on a critical aspect for any tech team: how to effectively interview Next.js developers. The process involves more than just evaluating technical skills; it’s about uncovering a candidate’s ability to harness Next.js’s features to innovate and […]&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.nextideatech.com/how-to-interview-next-js-developers/" rel="noopener noreferrer"&gt;How To Interview Next.js Developers&lt;/a&gt; appeared first on &lt;a href="https://blog.nextideatech.com" rel="noopener noreferrer"&gt;Next Idea Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>How Vital Are Cultural Dynamics in Nearshore Outsourcing Success?</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Fri, 01 Dec 2023 06:00:00 +0000</pubDate>
      <link>https://forem.com/nextideatech/how-vital-are-cultural-dynamics-in-nearshore-outsourcing-success-1l8h</link>
      <guid>https://forem.com/nextideatech/how-vital-are-cultural-dynamics-in-nearshore-outsourcing-success-1l8h</guid>
      <description>&lt;p&gt;Picture this: It’s 2023, the tech sector is alive with a buzz of Artificial Intelligence innovation and efficiency, driving global collaboration to new heights. Amidst this, nearshore outsourcing has evolved beyond mere cost-saving; it’s now a gateway to a world rich in talent and fresh perspectives. In this challenging economic climate, with inflation and potential […]&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.nextideatech.com/how-vital-are-cultural-dynamics-in-nearshore-outsourcing-success/" rel="noopener noreferrer"&gt;How Vital Are Cultural Dynamics in Nearshore Outsourcing Success?&lt;/a&gt; appeared first on &lt;a href="https://blog.nextideatech.com" rel="noopener noreferrer"&gt;Next Idea Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>Pre-Screening Questions For Nearshore Software Developers</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Tue, 28 Nov 2023 20:51:52 +0000</pubDate>
      <link>https://forem.com/nextideatech/pre-screening-questions-for-nearshore-software-developers-hmn</link>
      <guid>https://forem.com/nextideatech/pre-screening-questions-for-nearshore-software-developers-hmn</guid>
      <description>&lt;p&gt;Thinking of hiring nearshore developers? You’re making a smart move! These developers strike the perfect balance in software development: they’re typically in your time zone, culturally aligned, and more cost-effective compared to onshore options. However, selecting the right talent is key. Here’s where effective pre-screening questions for nearshore software developers become essential. This process isn’t […]&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.nextideatech.com/pre-screening-questions-for-nearshore-software-developers/" rel="noopener noreferrer"&gt;Pre-Screening Questions For Nearshore Software Developers&lt;/a&gt; appeared first on &lt;a href="https://blog.nextideatech.com" rel="noopener noreferrer"&gt;Next Idea Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>Nearshore Software Development in Mexico: The Complete Guide 2023</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Sun, 26 Nov 2023 15:32:39 +0000</pubDate>
      <link>https://forem.com/nextideatech/nearshore-software-development-in-mexico-the-complete-guide-2023-4bc0</link>
      <guid>https://forem.com/nextideatech/nearshore-software-development-in-mexico-the-complete-guide-2023-4bc0</guid>
      <description>&lt;p&gt;Mexico, a vibrant and innovative country with a thriving software development industry, has for decades been viewed as a solid nearshore software development destination for tech companies looking to develop pools of talent outside the U.S. Mexico is reaping the benefits not only of geographical proximity and cultural affinity, but also of a growing talent pool of highly skilled software engineers available at knock-down prices.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.nextideatech.com/nearshore-software-development-in-mexico/" rel="noopener noreferrer"&gt;Nearshore Software Development in Mexico: The Complete Guide 2023&lt;/a&gt; appeared first on &lt;a href="https://blog.nextideatech.com" rel="noopener noreferrer"&gt;Next Idea Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>nearshoreoutsourcing</category>
    </item>
    <item>
      <title>Nearshore IT Staff Augmentation: Best Practices for Success</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Sun, 26 Nov 2023 15:27:27 +0000</pubDate>
      <link>https://forem.com/nextideatech/nearshore-it-staff-augmentation-best-practices-for-success-2e3</link>
      <guid>https://forem.com/nextideatech/nearshore-it-staff-augmentation-best-practices-for-success-2e3</guid>
      <description>&lt;p&gt;In this guide, you will learn how IT staff augmentation works and why you should give it some thought. The guide will also examine the advantages and best practices of this innovative strategy.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.nextideatech.com/it-staff-augmentation-benefits-and-best-practices-for-success/" rel="noopener noreferrer"&gt;Nearshore IT Staff Augmentation: Best Practices for Success&lt;/a&gt; appeared first on &lt;a href="https://blog.nextideatech.com" rel="noopener noreferrer"&gt;Next Idea Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>howtohire</category>
      <category>recruitinginsights</category>
      <category>itstaffaugmentation</category>
      <category>staffaugmentation</category>
    </item>
    <item>
      <title>How to Successfully Onboard Nearshore Software Developers Remotely</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Sun, 12 Nov 2023 17:09:18 +0000</pubDate>
      <link>https://forem.com/nextideatech/how-to-successfully-onboard-nearshore-software-developers-remotely-1aje</link>
      <guid>https://forem.com/nextideatech/how-to-successfully-onboard-nearshore-software-developers-remotely-1aje</guid>
      <description>&lt;p&gt;Today’s post is all about the onboarding process of nearshore software developers working remotely from a different country. This blog post will provide step-by-step instructions for how to onboard new developers remotely and make them feel like a part of the team even before their first day of work.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.nextideatech.com/how-to-successfully-onboard-nearshore-software-developers-remotely/" rel="noopener noreferrer"&gt;How to Successfully Onboard Nearshore Software Developers Remotely&lt;/a&gt; appeared first on &lt;a href="https://blog.nextideatech.com" rel="noopener noreferrer"&gt;Next Idea Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>howtohire</category>
      <category>recruitinginsights</category>
      <category>remotework</category>
      <category>nearshoredevelopers</category>
    </item>
    <item>
      <title>GPT-4 Vision API Is a Game Changer</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Wed, 08 Nov 2023 20:48:59 +0000</pubDate>
      <link>https://forem.com/nextideatech/gpt-4-vision-api-is-a-game-changer-1615</link>
      <guid>https://forem.com/nextideatech/gpt-4-vision-api-is-a-game-changer-1615</guid>
      <description>&lt;p&gt;&lt;strong&gt;gpt-4-vision-preview&lt;/strong&gt; is the latest and (arguably) the most powerful &lt;a href="https://blog.nextideatech.com/openai-gpt-3-5-turbo-instruct/" rel="noopener noreferrer"&gt;model &lt;/a&gt;released on November 7 2023 during &lt;a href="https://devday.openai.com/" rel="noopener noreferrer"&gt;OpenAI’s DevDay&lt;/a&gt; presentation and it has been the talk of social media merely hours after it became available.&lt;/p&gt;
 

&lt;p&gt;Developers have already created apps that actively recognize what’s happening during a web live stream in real-time.&lt;/p&gt;

&lt;p&gt;Or this person that incorporated just about every OpenAI API to analyze Messi highlights video using &lt;strong&gt;gpt-4-vision-preview&lt;/strong&gt; model, create voiceover script based on the video frames then generate audio using OpenAI &lt;a href="https://platform.openai.com/docs/guides/text-to-speech" rel="noopener noreferrer"&gt;Text-to-Speech&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;Using gpt-4-vision-preview Model With Python&lt;/h3&gt;

&lt;p&gt;First install the &lt;em&gt;openai&lt;/em&gt; pip module&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pip &lt;span class="token function"&gt;install&lt;/span&gt; --upgrade openai &lt;span class="token comment"&gt;#to ensure we are using the latest version&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next, we initialize OpenAI object with our API key and create an instance.&lt;/p&gt;

&lt;p&gt;How to obtain your OpenAI API key?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;a href="https://platform.openai.com/api-keys" rel="noreferrer noopener"&gt;API keys – OpenAI API&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Click “Create new secret key”&lt;/li&gt;
&lt;li&gt;Provide a name and be sure to copy your new key.&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code&gt;client &lt;span class="token operator"&gt;=&lt;/span&gt; OpenAI&lt;span class="token punctuation"&gt;(&lt;/span&gt;api_key&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token string"&gt;"sk_YOUR_OPENAI_KEY"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Making your first call with gpt-4-vision-preview Model&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;import&lt;/span&gt; os
&lt;span class="token keyword"&gt;from&lt;/span&gt; openai &lt;span class="token keyword"&gt;import&lt;/span&gt; OpenAI
&lt;span class="token keyword"&gt;from&lt;/span&gt; dotenv &lt;span class="token keyword"&gt;import&lt;/span&gt; load_dotenv
&lt;span class="token keyword"&gt;import&lt;/span&gt; base64
&lt;span class="token keyword"&gt;import&lt;/span&gt; mimetypes
load_dotenv&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;

client &lt;span class="token operator"&gt;=&lt;/span&gt; OpenAI&lt;span class="token punctuation"&gt;(&lt;/span&gt;api_key&lt;span class="token operator"&gt;=&lt;/span&gt;os&lt;span class="token punctuation"&gt;.&lt;/span&gt;getenv&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;"OPENAI_API_KEY"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;

&lt;span class="token keyword"&gt;def&lt;/span&gt; &lt;span class="token function"&gt;image_to_base64&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;image_path&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
    &lt;span class="token comment"&gt;# Guess the MIME type of the image&lt;/span&gt;
    mime_type&lt;span class="token punctuation"&gt;,&lt;/span&gt; _ &lt;span class="token operator"&gt;=&lt;/span&gt; mimetypes&lt;span class="token punctuation"&gt;.&lt;/span&gt;guess_type&lt;span class="token punctuation"&gt;(&lt;/span&gt;image_path&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    
    &lt;span class="token keyword"&gt;if&lt;/span&gt; &lt;span class="token keyword"&gt;not&lt;/span&gt; mime_type &lt;span class="token keyword"&gt;or&lt;/span&gt; &lt;span class="token keyword"&gt;not&lt;/span&gt; mime_type&lt;span class="token punctuation"&gt;.&lt;/span&gt;startswith&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;'image'&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
        &lt;span class="token keyword"&gt;raise&lt;/span&gt; ValueError&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;"The file type is not recognized as an image"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    
    &lt;span class="token comment"&gt;# Read the image binary data&lt;/span&gt;
    &lt;span class="token keyword"&gt;with&lt;/span&gt; &lt;span class="token builtin"&gt;open&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;image_path&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token string"&gt;'rb'&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token keyword"&gt;as&lt;/span&gt; image_file&lt;span class="token punctuation"&gt;:&lt;/span&gt;
        encoded_string &lt;span class="token operator"&gt;=&lt;/span&gt; base64&lt;span class="token punctuation"&gt;.&lt;/span&gt;b64encode&lt;span class="token punctuation"&gt;(&lt;/span&gt;image_file&lt;span class="token punctuation"&gt;.&lt;/span&gt;read&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;.&lt;/span&gt;decode&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;'utf-8'&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    
    &lt;span class="token comment"&gt;# Format the result with the appropriate prefix&lt;/span&gt;
    image_base64 &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token string-interpolation"&gt;&lt;span&gt;f"data:&lt;/span&gt;&lt;span&gt;&lt;span&gt;{&lt;/span&gt;mime_type&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span&gt;;base64,&lt;/span&gt;&lt;span&gt;&lt;span&gt;{&lt;/span&gt;encoded_string&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;/span&gt;
    
    &lt;span class="token keyword"&gt;return&lt;/span&gt; image_base64

base64_string &lt;span class="token operator"&gt;=&lt;/span&gt; image_to_base64&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;"image1.jpg"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;


response &lt;span class="token operator"&gt;=&lt;/span&gt; client&lt;span class="token punctuation"&gt;.&lt;/span&gt;chat&lt;span class="token punctuation"&gt;.&lt;/span&gt;completions&lt;span class="token punctuation"&gt;.&lt;/span&gt;create&lt;span class="token punctuation"&gt;(&lt;/span&gt;
    model&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token string"&gt;"gpt-4-vision-preview"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    messages&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;
        &lt;span class="token punctuation"&gt;{&lt;/span&gt;
            &lt;span class="token string"&gt;"role"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"user"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
            &lt;span class="token string"&gt;"content"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token punctuation"&gt;[&lt;/span&gt;
                &lt;span class="token punctuation"&gt;{&lt;/span&gt;&lt;span class="token string"&gt;"type"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"text"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token string"&gt;"text"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"Describe the attached image"&lt;/span&gt;&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
                &lt;span class="token punctuation"&gt;{&lt;/span&gt;
                    &lt;span class="token string"&gt;"type"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"image_url"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
                    &lt;span class="token string"&gt;"image_url"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token punctuation"&gt;{&lt;/span&gt;
                        &lt;span class="token string"&gt;"url"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; base64_string&lt;span class="token punctuation"&gt;,&lt;/span&gt;
                        &lt;span class="token string"&gt;"detail"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"low"&lt;/span&gt;
                    &lt;span class="token punctuation"&gt;}&lt;/span&gt;
                &lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
            &lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        &lt;span class="token punctuation"&gt;}&lt;/span&gt;
    &lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    max_tokens&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token number"&gt;300&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
&lt;span class="token punctuation"&gt;)&lt;/span&gt;

&lt;span class="token keyword"&gt;print&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;response&lt;span class="token punctuation"&gt;.&lt;/span&gt;choices&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token number"&gt;0&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;.&lt;/span&gt;message&lt;span class="token punctuation"&gt;.&lt;/span&gt;content&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Stepping Through the Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;image_to_base64&lt;/code&gt; function is defined to convert an image file to a base64-encoded string. It first checks if the file is an image and then reads and encodes the binary data of the image. Use this option to submit local images. &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;def image_to_base64(image_path):
    ...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You may also submit image URLs using the below example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;response &lt;span class="token operator"&gt;=&lt;/span&gt; client&lt;span class="token punctuation"&gt;.&lt;/span&gt;chat&lt;span class="token punctuation"&gt;.&lt;/span&gt;completions&lt;span class="token punctuation"&gt;.&lt;/span&gt;create&lt;span class="token punctuation"&gt;(&lt;/span&gt;
    model&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token string"&gt;"gpt-4-vision-preview"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    messages&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;
        &lt;span class="token punctuation"&gt;{&lt;/span&gt;
            &lt;span class="token string"&gt;"role"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"user"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
            &lt;span class="token string"&gt;"content"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token punctuation"&gt;[&lt;/span&gt;    
                &lt;span class="token punctuation"&gt;{&lt;/span&gt;
                    &lt;span class="token string"&gt;"type"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"text"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
                    &lt;span class="token string"&gt;"text"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"What’s in these images? Is there any difference between them?"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
                &lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
                &lt;span class="token punctuation"&gt;{&lt;/span&gt;
                    &lt;span class="token string"&gt;"type"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"image_url"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
                    &lt;span class="token string"&gt;"image_url"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string"&gt;"https://www.goodfreephotos.com/albums/other-landscapes/rover-and-landscape-scenery.jpg"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
                &lt;span class="token punctuation"&gt;}&lt;/span&gt;
            &lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        &lt;span class="token punctuation"&gt;}&lt;/span&gt;
    &lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    max_tokens&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token number"&gt;300&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;The Completion parameters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You may be familiar with the &lt;em&gt;message&lt;/em&gt; object If you have used the &lt;a href="https://blog.nextideatech.com/chat-with-documents-using-langchain-gpt-4-python/" rel="noopener noreferrer"&gt;OpenAI API&lt;/a&gt; in the past. With the release of &lt;em&gt;gpt-4-vision-preview&lt;/em&gt; model, OpenAI has introduced a new message type; “image_url”. &lt;/p&gt;

&lt;p&gt;The &lt;em&gt;url &lt;/em&gt;parameter accepts base 64 encoded images or image URLs.&lt;/p&gt;

&lt;p&gt;Adjusting the ‘&lt;em&gt;detail&lt;/em&gt;‘ parameter in the GPT-4 Vision API affects the resolution and token budget used to interpret images. Setting ‘detail’ to ‘low’ restricts the model to a 512 x 512 pixel, low-resolution version of the image, using 65 tokens. This mode is quicker and more token-efficient, suitable for scenarios where detailed analysis isn’t critical. Opting for ‘high’ engages the high-resolution mode, which initially presents the model with the low-resolution image, followed by high-resolution 512px segments of the image, with each segment allocated a 130-token budget for a thorough examination.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Describe the attached image"},
                {
                    "type": "image_url",
                    "image_url": {
                        "url": base64_string,
                        "detail": "low"
                    }
                },
            ],
        }
    ]&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;GPT-4 Vision API Pricing&lt;/h3&gt;

&lt;p&gt;As shown below, OpenAI prices the vision capability based on image resolution. For example a 512×512 image will cost $0.00255 in “high” detail more, or 0.00085 for “low” model. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-1024x365.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-1024x365.png" alt="GPT-4 Turbo pricing"&gt;&lt;/a&gt;GPT-4 Vision API Pricing&lt;/p&gt;

&lt;p&gt;This may not seem like a lot but cost does add up when processing hundreds or thousands of images. To control your input image sizes, use the below code to resize them:&lt;/p&gt;

&lt;p&gt;Ensure you have the Pillow library installed&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pip &lt;span class="token function"&gt;install&lt;/span&gt; Pillow &lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;from&lt;/span&gt; PIL &lt;span class="token keyword"&gt;import&lt;/span&gt; Image
&lt;span class="token keyword"&gt;import&lt;/span&gt; os

&lt;span class="token keyword"&gt;def&lt;/span&gt; &lt;span class="token function"&gt;resize_image&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;image_path&lt;span class="token punctuation"&gt;,&lt;/span&gt; new_width&lt;span class="token punctuation"&gt;,&lt;/span&gt; new_height&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
    &lt;span class="token keyword"&gt;with&lt;/span&gt; Image&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token builtin"&gt;open&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;image_path&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token keyword"&gt;as&lt;/span&gt; img&lt;span class="token punctuation"&gt;:&lt;/span&gt;
        &lt;span class="token comment"&gt;# Resize the image&lt;/span&gt;
        img &lt;span class="token operator"&gt;=&lt;/span&gt; img&lt;span class="token punctuation"&gt;.&lt;/span&gt;resize&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;new_width&lt;span class="token punctuation"&gt;,&lt;/span&gt; new_height&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; Image&lt;span class="token punctuation"&gt;.&lt;/span&gt;ANTIALIAS&lt;span class="token punctuation"&gt;)&lt;/span&gt;

        &lt;span class="token comment"&gt;# Save the resized image&lt;/span&gt;
        base&lt;span class="token punctuation"&gt;,&lt;/span&gt; ext &lt;span class="token operator"&gt;=&lt;/span&gt; os&lt;span class="token punctuation"&gt;.&lt;/span&gt;path&lt;span class="token punctuation"&gt;.&lt;/span&gt;splitext&lt;span class="token punctuation"&gt;(&lt;/span&gt;image_path&lt;span class="token punctuation"&gt;)&lt;/span&gt;
        new_image_path &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token string-interpolation"&gt;&lt;span&gt;f"&lt;/span&gt;&lt;span&gt;&lt;span&gt;{&lt;/span&gt;base&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span&gt;_resized&lt;/span&gt;&lt;span&gt;&lt;span&gt;{&lt;/span&gt;ext&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;/span&gt;
        img&lt;span class="token punctuation"&gt;.&lt;/span&gt;save&lt;span class="token punctuation"&gt;(&lt;/span&gt;new_image_path&lt;span class="token punctuation"&gt;)&lt;/span&gt;

        &lt;span class="token keyword"&gt;print&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string-interpolation"&gt;&lt;span&gt;f"Image saved as &lt;/span&gt;&lt;span&gt;&lt;span&gt;{&lt;/span&gt;new_image_path&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;

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

&lt;h3&gt;Real World Use of GPT-4 Vision API: Enhancing Web Experience with a Chrome Extension&lt;/h3&gt;

&lt;p&gt;Ok so GPT-4 Vision API is cool and all – people have used it to seamlessly create soccer highlight commentary and interact with Webcams but let’s put the &lt;em&gt;gpt-4-vision-preview&lt;/em&gt; to the test and see how it fairs with real world problems.&lt;/p&gt;

&lt;h3&gt;Browser Extension – GPT Vision Assistant&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-2-1024x450.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-2-1024x450.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Chrome extension is designed to harness the GPT-4 Vision API works in a streamlined three-step process: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First&lt;/strong&gt;, it captures a screenshot of the current tab. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-3-1024x528.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-3-1024x528.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second&lt;/strong&gt;, the user is prompted to input a specific question or instruction, articulating what they seek to learn or accomplish with regard to the captured image. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-4.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finally&lt;/strong&gt;, this input, along with the screenshot, is sent as a request to the OpenAI API. The &lt;em&gt;gpt-4-vision-preview&lt;/em&gt; models returns its findings or outputs directly within the extension interface, displaying the results for the user to review. This seamless integration offers a powerful tool for real-time image analysis and interaction, all without leaving the browser tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-5.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Other Use Cases With GPT-4 Vision API&lt;/h2&gt;

&lt;p&gt;The GPT-4 Vision API’s capabilities extend beyond simple image recognition and analysis; they open up a world of possibilities for enhancing and streamlining our interactions with digital content. For this purpose, we created a Chrome Extension that leverages this advanced API stands as a testament to its practical utility in everyday web usage. Here are other use cases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Quality Assurance for Websites&lt;/strong&gt;: Website developers and QA testers can use the extension to take screenshots of web pages and submit them directly to the GPT-4 Vision API with prompts like “Identify any visual inconsistencies across these screenshots” or “Does this layout comply with web accessibility standards?” The API can analyze the images for color contrast, element alignment, responsive design issues, and more, providing quick feedback that would traditionally require meticulous manual review.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UX/UI Design Feedback&lt;/strong&gt;: Designers can capture snapshots of their work and ask the model questions such as “What improvements can be made to this user interface to enhance user experience?” or “What are the best practices missing from this design?” This not only speeds up the iterative process of design but also injects an objective, data-driven perspective into creative workflows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Management and Moderation&lt;/strong&gt;: For content managers and online moderators, the extension could be used to screen website content. By taking screenshots of various posts, images, or comments and querying the GPT-4 Vision API, the system could assist in identifying inappropriate content or copyright issues, streamlining the moderation process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Educational Content Interaction&lt;/strong&gt;: Students and educators could use the extension to capture diagrams, equations, or charts from educational websites and ask the model to explain or solve them. This interactive approach could enhance online learning by providing instant assistance and explanations for complex visual information.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-7-1024x626.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.nextideatech.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fimage-7-1024x626.png" alt=""&gt;&lt;/a&gt;GPT-4 Vision API answering a math question&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Competitor Analysis&lt;/strong&gt;: Marketing professionals might employ the extension to capture the layout of competitors’ websites, asking the model to analyze and compare branding consistency, messaging clarity, and call-to-action placements. This competitive intelligence can be invaluable for strategic planning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accessibility Auditing&lt;/strong&gt;: The extension could also be used to assist with ensuring web accessibility. Users could take snapshots of websites and ask the model to check if the images contain proper alt text or if the color schemes used are suitable for color-blind individuals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Documentation&lt;/strong&gt;: IT professionals and developers could use the extension to document the behavior of web applications. By taking screenshots and prompting the API to describe the process flow or detect anomalies, they could generate documentation or troubleshooting guides more efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Generation from Designs&lt;/strong&gt;: A revolutionary use case would be for front-end developers to send UX designs to the OpenAI API and ask it to generate the necessary HTML/CSS/JavaScript code. This could potentially reduce development time by providing a starting point for building out web interfaces.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If interested in the extension or other custom solutions using OpenAI, please email info@nextideated.com&lt;/p&gt;
                    

</description>
    </item>
    <item>
      <title>Nearshore MERN Developers</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Fri, 13 Oct 2023 14:45:58 +0000</pubDate>
      <link>https://forem.com/nextideatech/nearshore-mern-developers-14k6</link>
      <guid>https://forem.com/nextideatech/nearshore-mern-developers-14k6</guid>
      <description>&lt;p&gt;In the ever evolving world of &lt;a href="https://blog.nextideatech.com/chatgpt-vision-what-is-it-how-can-it-do-for-my-business/" rel="noopener noreferrer"&gt;web development&lt;/a&gt;, having a sturdy, scalable, and dynamic web application is like having a superpower. It sets you apart in the bustling online arena. A significant player in this domain is the MERN stack—a blend of MongoDB, Express.js, React.js, and Node.js, making the journey from development to deployment smooth and swift. Now, when the goal is to build such robust applications without burning a hole in your pocket, turning your gaze towards nearshore development realms is a wise move. In this guide, we’ll unearth the steps to hiring MERN stack nearshore developers, ensuring your project is in adept hands from start to finish.&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;What Is MERN Stack?&lt;/h3&gt;

&lt;p&gt;The acronym &lt;a href="https://blog.nextideatech.com/how-to-get-started-with-the-mern-stack-a-comprehensive-guide/" rel="noopener noreferrer"&gt;MERN&lt;/a&gt; stands for MongoDB, Express.js, React.js, and Node.js, which together form a powerful stack for building top-notch web applications. Now, if you’re on a budget or looking to tap into a diverse talent pool, casting your net towards nearshore waters is a smart move. Let’s venture into the nitty-gritty of hiring MERN stack nearshore developers to propel your project to new heights.&lt;/p&gt;

&lt;h3&gt;Why MERN Stack?&lt;/h3&gt;

&lt;p&gt;The MERN Stack is a highly popular choice among developers and &lt;a href="https://www.nobledesktop.com/classes-near-me/blog/what-is-the-mern-stack#:~:text=High%2Dprofile%20companies%20like%20Netflix,use%20in%20the%20past%20year." rel="noreferrer noopener"&gt;businesses&lt;/a&gt; looking to build scalable, high-performance web applications. Its component technologies – MongoDB, Express.js, React.js, and Node.js, create a seamless framework that supports the development of robust applications efficiently. For instance, the flexibility and document-based structure of MongoDB make data handling a breeze. Express.js facilitates swift backend development, while React.js is revered for its declarative and efficient JavaScript library for building user interfaces. Lastly, Node.js, with its non-blocking I/O and event-driven architecture, ensures a lightweight and efficient application.&lt;/p&gt;

&lt;h3&gt;Why Nearshore MERN Developers?&lt;/h3&gt;

&lt;p&gt;Opting for &lt;a href="https://blog.nextideatech.com/nearshore-software-development-in-argentina-the-complete-guide-for-2023/" rel="noopener noreferrer"&gt;nearshore&lt;/a&gt; MERN developers amalgamates the technical prowess of the MERN stack with the cost-effectiveness and geographical proximity of nearshore outsourcing. Nearshore developers offer a balance between quality and affordability, while their closer location facilitates better communication and collaboration. Moreover, the MERN stack’s popularity in burgeoning tech hubs in nearshore regions ensures a rich talent pool. By hiring nearshore MERN developers, you not only gain access to top-notch technical expertise but also enjoy smoother project management, ultimately steering your web development project towards success.&lt;/p&gt;

&lt;h3&gt;Understanding Your Project Inside Out&lt;/h3&gt;

&lt;p&gt;The first step in any recruitment venture is understanding what you need. It’s like going grocery shopping; having a list can be a lifesaver. Delve into your project and carve out a clear, detailed job description. This will act as your compass in the hiring journey, ensuring you find the right fit for your technical and creative needs.&lt;/p&gt;

&lt;h3&gt;Scoping Out the Right Regions&lt;/h3&gt;

&lt;p&gt;When we say nearshore, we mean regions close to your country but boasting a thriving tech landscape. &lt;a href="https://blog.nextideatech.com/which-countries-have-the-best-software-developers-in-latin-america/" rel="noopener noreferrer"&gt;Latin America&lt;/a&gt;, for instance, is a goldmine of tech talent with developers who are not just skilled but also share a similar time zone with the US. This geographical proximity is what makes nearshore hiring a sweet spot between cost-effectiveness and quality.&lt;/p&gt;

&lt;h3&gt;Diving into the Nearshore Development Firms&lt;/h3&gt;

&lt;p&gt;Now, onto the exciting part – scouting for nearshore development firms that specialize in the MERN stack. Dive into some research, look for firms with a trail of successful projects, and sift through client testimonials. Platforms like Clutch.co can be your trusty flashlight in the dark, helping you find firms that resonate with your project’s ethos.&lt;/p&gt;

&lt;h3&gt;The Technical Rundown&lt;/h3&gt;

&lt;p&gt;Your nearshore developers need to know their stuff, and a thorough technical evaluation is non-negotiable. Arrange for interviews, ask for portfolios, and if possible, throw in a coding test or two. This stage will help you gauge their command over MERN stack and their problem-solving abilities.&lt;/p&gt;

&lt;h3&gt;Tuning into the Communication Frequency&lt;/h3&gt;

&lt;p&gt;Communication is the glue that holds offshore teams together. Ensure that your nearshore developers have a solid grasp of English or any language your team is comfortable with. Moreover, cultural compatibility is a plus as it fosters a smoother collaboration and a harmonious work environment.&lt;/p&gt;

&lt;h3&gt;Talking Numbers: Compensation&lt;/h3&gt;

&lt;p&gt;While nearshore hiring is cost-effective, offering a fair compensation is key to attracting and retaining the crème de la crème of MERN stack developers. Do a bit of homework on the prevailing market rates in the nearshore region, and craft a competitive package.&lt;/p&gt;

&lt;h3&gt;Test the Waters with a Trial Project&lt;/h3&gt;

&lt;p&gt;Before going full throttle, engage your nearshore team in a small trial project. This is like a test drive, giving you a feel of their technical capabilities, work ethic, and how well they gel with your in-house team.&lt;/p&gt;

&lt;h3&gt;Cultivating a Long-term Rapport&lt;/h3&gt;

&lt;p&gt;Building a rapport with your nearshore team isn’t a one-off task but a long-term investment. Regular check-ins, constructive feedback, and celebrating wins, however small, foster a healthy, long-term working relationship.&lt;/p&gt;

&lt;p&gt;Navigating the waters of nearshore hiring may seem a tad intimidating initially, but with a methodical approach, it’s a voyage towards a skilled, cost-effective, and harmonious tech team. Your dream MERN stack nearshore team is out there, and with the right approach, you’ll reel them in to kick your project up a notch.&lt;/p&gt;
                    

</description>
    </item>
    <item>
      <title>ChatGPT Vision</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Mon, 09 Oct 2023 14:44:19 +0000</pubDate>
      <link>https://forem.com/nextideatech/chatgpt-vision-2haf</link>
      <guid>https://forem.com/nextideatech/chatgpt-vision-2haf</guid>
      <description>&lt;p&gt;OpenAI’s &lt;a href="https://blog.nextideatech.com/openai-gpt-3-5-turbo-instruct/" rel="noopener noreferrer"&gt;ChatGPT&lt;/a&gt; Vision (or &lt;a href="https://openai.com/research/gpt-4v-system-card" rel="noreferrer noopener"&gt;GPT-4V&lt;/a&gt;) is creating a buzz in the artificial intelligence community. But what is it, and how can you tap into its potential to streamline and automate your business? In this overview, we’ll demystify ChatGPT Vision, discuss its strengths and limitations, and shed light on how to utilize it effectively.&lt;/p&gt;

&lt;h2&gt;ChatGPT Vision Spotlight&lt;/h2&gt;

&lt;p&gt;OpenAI is constantly enhancing its chatbot with innovative additions.  Understanding ChatGPT Vision Beyond the catchy news titles, ChatGPT Vision isn’t a system that sees as humans do. It’s an AI chatbot equipped with a unique feature: image interpretation. Picture it as a digital era’s visual detective.&lt;/p&gt;

&lt;p&gt;Social media has been abuzz about the things you can do with ChatGPT Vision. From creating a web app by merely uploading a Figma screenshot:&lt;/p&gt;

&lt;p&gt;To Suggesting recipes by simply snapping a picture of your refrigerator’s content:&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;How does it do it?&lt;/h2&gt;

&lt;p&gt;While the headlines might be sensationalized, ChatGPT Vision isn’t a robot that sees like a human. &lt;/p&gt;

&lt;p&gt;The underlying technology that allows &lt;em&gt;&lt;strong&gt;ChatGPT Vision&lt;/strong&gt;&lt;/em&gt; to process and understand images is built upon a combination of techniques from computer vision, deep learning, and natural language processing. Here’s a technical breakdown:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Computer Vision &amp;amp; Deep Learning&lt;/strong&gt;:&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feature Extraction&lt;/strong&gt;: Images are represented as arrays of pixel values. For an untrained observer, this is just a massive list of numbers, but for a machine learning model, especially convolutional neural networks (CNNs), these pixel values are inputs that can be processed to detect patterns, edges, textures, colors, and other visual features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Object Detection&lt;/strong&gt;: Certain architectures of &lt;a href="https://www.v7labs.com/blog/yolo-object-detection" rel="noreferrer noopener"&gt;CNNs, such as YOLO (You Only Look Once)&lt;/a&gt; and SSD (Single Shot Multibox Detector), can identify multiple objects within an image by drawing bounding boxes around them. This is more than just feature extraction; it’s recognizing and localizing objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image Classification&lt;/strong&gt;: Models like &lt;a href="https://www.analyticsvidhya.com/blog/2022/09/image-classification-in-stl-10-dataset-using-resnet-50-deep-learning-model/" rel="noreferrer noopener"&gt;ResNet&lt;/a&gt;, VGG, and MobileNet can label an entire image based on its primary content. For instance, recognizing an image as containing a cat or a dog.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semantic Segmentation&lt;/strong&gt;: Some models can classify each pixel of an image into a category, which helps in understanding the image at a very granular level.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optical Character Recognition (OCR)&lt;/strong&gt;:&lt;ul&gt;
&lt;li&gt;If there’s a need to extract text from images, OCR technologies come into play. OCR converts images of typed or handwritten text into machine-encoded text. Under the hood, OCR models might also use deep learning, but their training and architecture are specialized for recognizing characters and words in a variety of fonts and backgrounds.&lt;/li&gt;
&lt;li&gt;There are popular OCR libraries like Tesseract which are widely used, but there are also deep learning-based methods that can achieve even better accuracy, especially in challenging conditions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Combining Vision and Language&lt;/strong&gt;:&lt;ul&gt;
&lt;li&gt;Once objects, features, or text are extracted from an image, it’s often important to combine this information with natural language processing (NLP) techniques. This helps in generating descriptions, answering questions about the image, or even translating the detected text.&lt;/li&gt;
&lt;li&gt;Models like OpenAI’s CLIP (Contrastive Language–Image Pre-training) are trained on a large number of images and their descriptions, allowing them to understand images in the context of natural language queries.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Differentiating Between Text, Pixels, and Visual Objects&lt;/strong&gt;:&lt;ul&gt;
&lt;li&gt;At the basic level, everything in an image is just pixels. However, deep learning models can learn the patterns that differentiate objects from the background, text from non-text regions, and so on.&lt;/li&gt;
&lt;li&gt;For instance, the patterns of pixels that typically represent text (straight lines, curves of letters, spacing between characters) are different from the patterns of pixels that represent natural objects. Models trained for OCR will thus specialize in recognizing these text-like patterns.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;How can ChatGPT Vision help your business?&lt;/h2&gt;

&lt;p&gt;For tech businesses, especially those in the SaaS, Digital Business world, GPT4-V can offer a range of opportunities to innovate and enhance their offerings. Here’s how they can leverage these capabilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Customer Support &amp;amp; Troubleshooting&lt;/strong&gt;:&lt;ul&gt;&lt;li&gt;Users can send screenshots or photos of issues they’re encountering. ChatGPT Vision can recognize common errors, interface elements, or problematic configurations and guide users toward a solution.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI/UX Feedback&lt;/strong&gt;:&lt;ul&gt;&lt;li&gt;Founders can gather visual feedback on their software interfaces. Users can submit screenshots, and the chatbot can analyze common points of confusion or suggest design improvements based on patterns it recognizes.
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation Assistance&lt;/strong&gt;:&lt;ul&gt;&lt;li&gt;Instead of scrolling through long FAQs, users can snap a picture of the part of the software they’re struggling with. ChatGPT Vision can then provide relevant documentation or tutorial links.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feature Onboarding&lt;/strong&gt;:&lt;ul&gt;&lt;li&gt;As new features are rolled out, users can interact with the chatbot using screenshots to get personalized walkthroughs, ensuring they understand and adopt new functionalities.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Competitor Analysis&lt;/strong&gt;:&lt;ul&gt;&lt;li&gt;By feeding the chatbot screenshots of competitor software, SaaS founders can get insights into design trends, feature commonalities, or potential areas for differentiation.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;The Impact on Digital Businesses&lt;/h2&gt;

&lt;p&gt;It’s tough to predict what’s just a passing trend in AI and what’s here to stay. While some &lt;a href="https://www.digitaltrends.com/computing/chatgpts-bing-browsing-feature-disabled-over-paywall-flaw/" rel="noreferrer noopener"&gt;ChatGPT updates got a lot of buzz but then faded&lt;/a&gt;, things look different with the latest visual features. &lt;/p&gt;

&lt;p&gt;OpenAI is working on better image tools, like an updated &lt;a href="https://www.theverge.com/2023/9/20/23881241/openai-dalle-third-version-generative-ai" rel="noreferrer noopener"&gt;Dall-E 3&lt;/a&gt;, and they’re planning to add it to ChatGPT. And with companies like&lt;a href="https://www.techtarget.com/searchenterpriseai/news/366537291/Googles-upgrade-of-AI-chatbot-Bard-could-change-search" rel="noreferrer noopener"&gt; Google possibly adding visual features to their chatbots&lt;/a&gt;, this might not just be a fleeting trend. It feels like we’re at the beginning of something big in how businesses use AI.&lt;/p&gt;
                    

</description>
    </item>
    <item>
      <title>ChatGPT With SQL Database using LangChain</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Thu, 05 Oct 2023 13:10:46 +0000</pubDate>
      <link>https://forem.com/nextideatech/chatgpt-with-sql-database-using-langchain-3ph2</link>
      <guid>https://forem.com/nextideatech/chatgpt-with-sql-database-using-langchain-3ph2</guid>
      <description>&lt;h2&gt;Introduction to LangChain&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://blog.nextideatech.com/chat-with-documents-using-langchain-gpt-4-python/" rel="noopener noreferrer"&gt;LangChain&lt;/a&gt; is a revolutionary technology that serves as a bridge between natural language processing (NLP), ChatGPT and databases. It allows users to interact with their databases using natural language, making it easier to retrieve, manipulate, and manage data without the need for intricate SQL queries. LangChain leverages advanced NLP techniques to understand user queries and translate them into SQL, enabling seamless communication with databases.&lt;/p&gt;

&lt;h2&gt;Why LangChain?&lt;/h2&gt;

&lt;p&gt;As we mentioned in &lt;a href="https://blog.nextideatech.com/chat-with-documents-using-langchain-gpt-4-python/" rel="noopener noreferrer"&gt;this &lt;/a&gt;article, LangChain fills a crucial need in the realm of Large Language Models (LLMs). While LLMs excel at a wide range of tasks, they may fall short when it comes to providing specific answers or deep domain expertise. To address this limitation, LangChain adds data-awareness and agentic capabilities to LLMs, allowing applications to connect to external data sources and engage in interactive, context-aware interactions. This integration empowers developers to build more powerful and specialized language model applications that can provide targeted and nuanced responses, bridging the gap between LLMs and domain-specific knowledge requirements.&lt;/p&gt;

&lt;h2&gt;How LangChain Works with SQL Databases&lt;/h2&gt;

&lt;p&gt;LangChain can be integrated with SQL databases to facilitate natural language interactions. Users can ask questions or make requests in plain English, and LangChain translates these into the corresponding SQL queries. This interaction enables users, even those without technical expertise in SQL, to access and manage their database information efficiently.&lt;/p&gt;

&lt;h2&gt;Step 1: Installing Dependencies&lt;/h2&gt;

&lt;p&gt;Start by creating and activating a virtual environment. Execute the following commands:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;python -m venv venv
&lt;span class="token builtin class-name"&gt;source&lt;/span&gt; venv/bin/activate &lt;span class="token comment"&gt;# for Ubuntu&lt;/span&gt;
venv/Scripts/activate &lt;span class="token comment"&gt;# for Windows&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once the virtual environment is activated, install the necessary packages:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pip &lt;span class="token function"&gt;install&lt;/span&gt; langchain langchain-experimental openai&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Step 2: OpenAI API Key&lt;/h2&gt;

&lt;p&gt;LangChain is compatible with &lt;a href="https://python.langchain.com/docs/modules/model_io/models/llms/" rel="noreferrer noopener"&gt;several LLMs&lt;/a&gt;, but using OpenAI models often yields better results. &lt;/p&gt;

&lt;p&gt;To use LangChain with OpenAI models, you need an OpenAI key. Follow the steps below to create a new OpenAI key:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit &lt;a href="https://platform.openai.com/" rel="noopener noreferrer"&gt;platform.openai.com&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click on your name or icon, located on the top right corner, and select “View API Keys” or follow this &lt;a href="https://platform.openai.com/account/api-keys" rel="noopener noreferrer"&gt;link&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click on the “Create new secret key” button to generate a new OpenAI key.&lt;/li&gt;
&lt;li&gt;We will use the API key in the next segment where we will write chat function.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Step 3: Creating a Python Script with LangChain + ChatGPT&lt;/h2&gt;

&lt;p&gt;Create a new Python file named &lt;code&gt;langchain_sql_chat.py&lt;/code&gt; and add the following code to it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;import&lt;/span&gt; os
&lt;span class="token keyword"&gt;from&lt;/span&gt; langchain&lt;span class="token punctuation"&gt;.&lt;/span&gt;utilities &lt;span class="token keyword"&gt;import&lt;/span&gt; SQLDatabase
&lt;span class="token keyword"&gt;from&lt;/span&gt; langchain&lt;span class="token punctuation"&gt;.&lt;/span&gt;llms &lt;span class="token keyword"&gt;import&lt;/span&gt; OpenAI
&lt;span class="token keyword"&gt;from&lt;/span&gt; langchain_experimental&lt;span class="token punctuation"&gt;.&lt;/span&gt;sql &lt;span class="token keyword"&gt;import&lt;/span&gt; SQLDatabaseChain

os&lt;span class="token punctuation"&gt;.&lt;/span&gt;environ&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token string"&gt;'OPENAI_API_KEY'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token string"&gt;'OPENAI API KEY from Step 2'&lt;/span&gt;

db &lt;span class="token operator"&gt;=&lt;/span&gt; SQLDatabase&lt;span class="token punctuation"&gt;.&lt;/span&gt;from_uri&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;"mysql://username:password@hostname/database_name"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;

llm &lt;span class="token operator"&gt;=&lt;/span&gt; OpenAI&lt;span class="token punctuation"&gt;(&lt;/span&gt;temperature&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token number"&gt;1&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; verbose&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token boolean"&gt;True&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
db_chain &lt;span class="token operator"&gt;=&lt;/span&gt; SQLDatabaseChain&lt;span class="token punctuation"&gt;.&lt;/span&gt;from_llm&lt;span class="token punctuation"&gt;(&lt;/span&gt;llm&lt;span class="token punctuation"&gt;,&lt;/span&gt; db&lt;span class="token punctuation"&gt;,&lt;/span&gt; verbose&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token boolean"&gt;True&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;

&lt;span class="token keyword"&gt;def&lt;/span&gt; &lt;span class="token function"&gt;chat_with_sql&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
    &lt;span class="token keyword"&gt;print&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;"Type 'exit' to quit"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;

    &lt;span class="token keyword"&gt;while&lt;/span&gt; &lt;span class="token boolean"&gt;True&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
        prompt &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token builtin"&gt;input&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;"Enter a prompt: "&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;

        &lt;span class="token keyword"&gt;if&lt;/span&gt; prompt&lt;span class="token punctuation"&gt;.&lt;/span&gt;lower&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token operator"&gt;==&lt;/span&gt; &lt;span class="token string"&gt;'exit'&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
            &lt;span class="token keyword"&gt;print&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;'Exiting...'&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
            &lt;span class="token keyword"&gt;break&lt;/span&gt;
        &lt;span class="token keyword"&gt;else&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
            &lt;span class="token keyword"&gt;try&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;

                &lt;span class="token keyword"&gt;print&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;db_chain&lt;span class="token punctuation"&gt;.&lt;/span&gt;run&lt;span class="token punctuation"&gt;(&lt;/span&gt;prompt&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
            &lt;span class="token keyword"&gt;except&lt;/span&gt; Exception &lt;span class="token keyword"&gt;as&lt;/span&gt; e&lt;span class="token punctuation"&gt;:&lt;/span&gt;
                &lt;span class="token keyword"&gt;print&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;e&lt;span class="token punctuation"&gt;)&lt;/span&gt;

chat_with_sql&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The above code connects to a SQL database defined by connection string &lt;em&gt;mysql://username:password@hostname/database_name&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ensure that you replace &lt;code&gt;username&lt;/code&gt;, &lt;code&gt;password&lt;/code&gt;, &lt;code&gt;hostname&lt;/code&gt;, and &lt;code&gt;database_name&lt;/code&gt; with your actual database credentials and details.&lt;/p&gt;

&lt;h2&gt;The SQL Database&lt;/h2&gt;

&lt;p&gt;For the purpose of this article, we are using an inventory database, which is a structured repository designed to manage various aspects of stock levels in a retail environment. This database contains several tables, each serving a specific purpose in inventory management. The &lt;strong&gt;&lt;code&gt;products&lt;/code&gt; &lt;/strong&gt;table holds essential information about the items, including product ID, name, description, and price.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;products.sql&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;CREATE&lt;/span&gt; &lt;span class="token keyword"&gt;TABLE&lt;/span&gt; products &lt;span class="token punctuation"&gt;(&lt;/span&gt;
    product_id &lt;span class="token keyword"&gt;INT&lt;/span&gt; &lt;span class="token keyword"&gt;PRIMARY&lt;/span&gt; &lt;span class="token keyword"&gt;KEY&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    product_name &lt;span class="token keyword"&gt;VARCHAR&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number"&gt;255&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token operator"&gt;NOT&lt;/span&gt; &lt;span class="token boolean"&gt;NULL&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    description &lt;span class="token keyword"&gt;TEXT&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    price &lt;span class="token keyword"&gt;DECIMAL&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number"&gt;10&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token number"&gt;2&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token operator"&gt;NOT&lt;/span&gt; &lt;span class="token boolean"&gt;NULL&lt;/span&gt; &lt;span class="token keyword"&gt;CHECK&lt;/span&gt; &lt;span class="token punctuation"&gt;(&lt;/span&gt;price &lt;span class="token operator"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="token number"&gt;0&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;suppliers.sql&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;CREATE&lt;/span&gt; &lt;span class="token keyword"&gt;TABLE&lt;/span&gt; suppliers &lt;span class="token punctuation"&gt;(&lt;/span&gt;
    supplier_id &lt;span class="token keyword"&gt;INT&lt;/span&gt; &lt;span class="token keyword"&gt;PRIMARY&lt;/span&gt; &lt;span class="token keyword"&gt;KEY&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    supplier_name &lt;span class="token keyword"&gt;VARCHAR&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number"&gt;255&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token operator"&gt;NOT&lt;/span&gt; &lt;span class="token boolean"&gt;NULL&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    contact_name &lt;span class="token keyword"&gt;VARCHAR&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number"&gt;255&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    contact_email &lt;span class="token keyword"&gt;VARCHAR&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number"&gt;255&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    contact_phone &lt;span class="token keyword"&gt;VARCHAR&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number"&gt;20&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;inventory.sql&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;CREATE&lt;/span&gt; &lt;span class="token keyword"&gt;TABLE&lt;/span&gt; inventory &lt;span class="token punctuation"&gt;(&lt;/span&gt;
    inventory_id &lt;span class="token keyword"&gt;INT&lt;/span&gt; &lt;span class="token keyword"&gt;PRIMARY&lt;/span&gt; &lt;span class="token keyword"&gt;KEY&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    product_id &lt;span class="token keyword"&gt;INT&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    supplier_id &lt;span class="token keyword"&gt;INT&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    quantity_in_stock &lt;span class="token keyword"&gt;INT&lt;/span&gt; &lt;span class="token operator"&gt;NOT&lt;/span&gt; &lt;span class="token boolean"&gt;NULL&lt;/span&gt; &lt;span class="token keyword"&gt;CHECK&lt;/span&gt; &lt;span class="token punctuation"&gt;(&lt;/span&gt;quantity_in_stock &lt;span class="token operator"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="token number"&gt;0&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    last_stocked_date &lt;span class="token keyword"&gt;DATE&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    &lt;span class="token keyword"&gt;FOREIGN&lt;/span&gt; &lt;span class="token keyword"&gt;KEY&lt;/span&gt; &lt;span class="token punctuation"&gt;(&lt;/span&gt;product_id&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token keyword"&gt;REFERENCES&lt;/span&gt; products&lt;span class="token punctuation"&gt;(&lt;/span&gt;product_id&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    &lt;span class="token keyword"&gt;FOREIGN&lt;/span&gt; &lt;span class="token keyword"&gt;KEY&lt;/span&gt; &lt;span class="token punctuation"&gt;(&lt;/span&gt;supplier_id&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token keyword"&gt;REFERENCES&lt;/span&gt; suppliers&lt;span class="token punctuation"&gt;(&lt;/span&gt;supplier_id&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Chat with your data using LangChain + ChatGPT&lt;/h2&gt;

&lt;p&gt;Now that we have our code ready, run the function using:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
python langchain_sql_chat.py&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The following prompt should appear&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Enter a prompt:&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To query the database, ask questions such as “&lt;em&gt;How many units of Product X are in stock&lt;/em&gt;“&lt;/p&gt;

&lt;p&gt;You should see the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Type &lt;span class="token string"&gt;'exit'&lt;/span&gt; to quit
&lt;span class="token operator"&gt;&amp;gt;&lt;/span&gt; Entering new SQLDatabaseChain chain&lt;span class="token punctuation"&gt;..&lt;/span&gt;.
    How many &lt;span class="token function"&gt;units&lt;/span&gt; of Product X are &lt;span class="token keyword"&gt;in&lt;/span&gt; stock?
    SQLQuery:SELECT quantity_in_stock FROM &lt;span class="token string"&gt;"inventory"&lt;/span&gt; WHERE product_id &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token punctuation"&gt;(&lt;/span&gt;SELECT product_id FROM &lt;span class="token string"&gt;"products"&lt;/span&gt; WHERE product_name &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token string"&gt;'Product X'&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
    SQLResult: &lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number"&gt;15&lt;/span&gt;,&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;
    Answer:There are &lt;span class="token number"&gt;15&lt;/span&gt; &lt;span class="token function"&gt;units&lt;/span&gt; of Product X &lt;span class="token keyword"&gt;in&lt;/span&gt; stock.
    &lt;span class="token operator"&gt;&amp;gt;&lt;/span&gt; Finished chain.

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

&lt;p&gt;&lt;strong&gt;More complex questions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s ask a question that requires a JOIN statement.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Type &lt;span class="token string"&gt;'exit'&lt;/span&gt; to quit
&lt;span class="token operator"&gt;&amp;gt;&lt;/span&gt; Entering new SQLDatabaseChain chain&lt;span class="token punctuation"&gt;..&lt;/span&gt;.
    List all products with &lt;span class="token function"&gt;less&lt;/span&gt; than &lt;span class="token number"&gt;10&lt;/span&gt; &lt;span class="token function"&gt;units&lt;/span&gt; &lt;span class="token keyword"&gt;in&lt;/span&gt; stock.
    SQLQuery:SELECT product_name FROM &lt;span class="token string"&gt;"products"&lt;/span&gt; INNER JOIN &lt;span class="token string"&gt;"inventory"&lt;/span&gt; ON products.product_id &lt;span class="token operator"&gt;=&lt;/span&gt; inventory.product_id WHERE quantity_in_stock &lt;span class="token operator"&gt;&amp;lt;&lt;/span&gt; &lt;span class="token number"&gt;10&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
    SQLResult: &lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;'Product A'&lt;/span&gt;,&lt;span class="token punctuation"&gt;)&lt;/span&gt;, &lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;'Product B'&lt;/span&gt;,&lt;span class="token punctuation"&gt;)&lt;/span&gt;, &lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;'Product C'&lt;/span&gt;,&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;
    Answer:Products with &lt;span class="token function"&gt;less&lt;/span&gt; than &lt;span class="token number"&gt;10&lt;/span&gt; &lt;span class="token function"&gt;units&lt;/span&gt; &lt;span class="token keyword"&gt;in&lt;/span&gt; stock are Product A, Product B, and Product C.
    &lt;span class="token operator"&gt;&amp;gt;&lt;/span&gt; Finished chain.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;LangChain was able to deduce that a “JOIN” statement is required in order to satisfy the prompt.&lt;/p&gt;

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

&lt;p&gt;This guide serves as a foundational step to get started with LangChain and Database implementations, enabling you to interact conversationally with your SQL database. By following the outlined steps, you can leverage the power of Langchain to make database interactions more user-friendly and efficient. &lt;/p&gt;

&lt;p&gt;Whether you are managing an inventory database or any other type of database, LangChain, combined with GPT, translates your natural language inquiries into precise SQL queries, allowing for seamless communication with your database.&lt;/p&gt;

&lt;p&gt;Embark on your software development adventure with &lt;a href="https://nextideatech.com" rel="noopener noreferrer"&gt;Next Idea Tech&lt;/a&gt;! As a distinguished software development and nearshore outsourcing firm, we deliver a plethora of business solutions tailored to your needs. We are here to connect you with the cream of the crop in talent for your projects. Our mission is to pair you with seasoned professionals who are experts in their fields. We boast a team of experienced developers, testers, project managers, and marketing specialists, all poised to contribute to your success!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nextideatech.com/contact" rel="noopener noreferrer"&gt;Let’s discuss&lt;/a&gt; your business aspirations! We extend complimentary consultations to understand your project better. &lt;/p&gt;
                    

</description>
    </item>
    <item>
      <title>Which Countries Have the Best Software Developers in Latin America</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Thu, 31 Aug 2023 16:15:53 +0000</pubDate>
      <link>https://forem.com/nextideatech/which-countries-have-the-best-software-developers-in-latin-america-47pf</link>
      <guid>https://forem.com/nextideatech/which-countries-have-the-best-software-developers-in-latin-america-47pf</guid>
      <description>&lt;p&gt;In a market where demand exceeds supply and rates are rising, this article helps answer a question being asked across the North American tech industry: where are the best developers in Latin America and what are their rates? This article will give you a summary of these questions and tell you why the Latin American territory has the most coveted software developers.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.nextideatech.com/which-countries-have-the-best-software-developers-in-latin-america/" rel="noopener noreferrer"&gt;Which Countries Have the Best Software Developers in Latin America&lt;/a&gt; appeared first on &lt;a href="https://blog.nextideatech.com" rel="noopener noreferrer"&gt;Next Idea Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>howtohire</category>
      <category>recruitinginsights</category>
      <category>latamdevelopers</category>
      <category>latinamericadevelope</category>
    </item>
    <item>
      <title>ChatGPT Chatbot For Google Docs</title>
      <dc:creator>Zak Elmeghni</dc:creator>
      <pubDate>Fri, 23 Jun 2023 16:48:28 +0000</pubDate>
      <link>https://forem.com/nextideatech/chatgpt-chatbot-for-google-docs-2mp</link>
      <guid>https://forem.com/nextideatech/chatgpt-chatbot-for-google-docs-2mp</guid>
      <description>&lt;p&gt;ChatGPT has certainly carved a niche for itself in the realm of AI, but its closed-source nature and inability to access external datasets can sometimes limit its use, especially when it comes to personal documents. But what if you could leverage the capabilities of Python, Google Docs, ChatGPT, and LangChain to create your own advanced “Google Docs ChatGPT chatbot”?&lt;/p&gt;

&lt;p&gt;Imagine having a Google Docs ChatGPT chatbot that can interact directly with files stored in your Google Drive. &lt;/p&gt;

&lt;p&gt;So, whether you’re a &lt;a href="https://blog.nextideatech.com/nearshore-software-development-in-argentina-the-complete-guide-for-2023/" rel="noopener noreferrer"&gt;developer&lt;/a&gt;, a tech enthusiast, or someone who just wants to streamline their work on Google Docs, stick around. This guide on creating your own “Google Docs ChatGPT chatbot” might just be the solution you’ve been seeking!&lt;/p&gt;

&lt;p&gt;This article will cover:&lt;/p&gt;

&lt;ul id="langchain-document-loaders"&gt;
&lt;li&gt;What is LangChain?&lt;/li&gt;
&lt;li&gt;Openai / ChatGPT Limitation&lt;/li&gt;
&lt;li&gt;Why Use a Google Docs ChatGPT Chatbot?&lt;/li&gt;
&lt;li&gt;LangChain Document Loaders&lt;/li&gt;
&lt;li&gt;Setting up Google API Credentials&lt;/li&gt;
&lt;li&gt;Step by step: How to build Google Docs ChatGPT Chatbot&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="what-is-langchain"&gt;What is LangChain?&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/hwchase17/langchain" rel="noreferrer noopener"&gt;LangChain &lt;/a&gt;is an innovative framework that is designed around the use of Large Language Models (LLMs). It was created by Harrison Chase and first introduced in late 2022. This powerful tool has grown popular due to the rise of generative AI and advancements in LLMs, like Google’s LaMDA chatbot, BLOOM, and OpenAI’s GPT-3.5 models.&lt;/p&gt;

&lt;p&gt;What makes LangChain unique is its ability to ‘chain’ together various components, thus enabling advanced applications of LLMs. These applications range from chatbots and generative question-answering (GQA) to summarization tasks and more.&lt;/p&gt;

&lt;p&gt;LangChain incorporates multiple key components in its structure. It uses ‘&lt;a href="https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/" rel="noreferrer noopener"&gt;Prompt templates&lt;/a&gt;‘ which are predefined templates that can be adjusted to suit various types of prompts. These include prompts for chatbot-like interactions, question-answering in the style of ‘Explain it Like I’m Five’, and more.&lt;/p&gt;

&lt;p&gt;Another critical part of LangChain is the LLMs themselves, including models like GPT-3 and BLOOM. These large language models form the core of LangChain’s functionality.&lt;/p&gt;

&lt;p&gt;Then we have ‘Agents’, which use LLMs to determine the appropriate actions to take. They leverage tools like web search or calculators and wrap them into a logical operation loop.&lt;/p&gt;

&lt;h2 id="openai-gpt-limiation"&gt;Openai / ChatGPT Limitation&lt;/h2&gt;

&lt;p&gt;OpenAI’s API and ChatGPT have a key drawback: they struggle with large custom datasets. The &lt;a href="https://platform.openai.com/docs/api-reference/chat/create#chat/create-max_tokens" rel="noreferrer noopener"&gt;max_token &lt;/a&gt;limit means you can’t put a lot of data into the context window. Plus, they’re not set up to handle individual document collections well. But LangChain helps to solve this. It uses &lt;a href="https://js.langchain.com/docs/modules/indexes/document_loaders/" rel="noreferrer noopener"&gt;Document Loaders&lt;/a&gt; to import and adapt data, so it works well with ChatGPT. This allows &lt;a href="https://www.nextideatech.com/nearshore/software-development-services" rel="noopener noreferrer"&gt;developers&lt;/a&gt; to make better use of their unique datasets with large language models.&lt;/p&gt;

&lt;h2 id="why-google-docs-chatgpt-chatbot"&gt;Why Use a Google Docs ChatGPT Chatbot?&lt;/h2&gt;

&lt;p&gt;Why should you build a “Google Docs ChatGPT Chatbot”? The answer is simple – it provides you with the ability to converse directly with your Google Docs documents. By harnessing the capabilities of ChatGPT, langchain, and Python, this chatbot transforms your documents into an interactive platform. Imagine needing information about a company process or having questions about onboarding – with this chatbot, the answers are just a conversation away. It’s not just about accessing information, it’s about streamlining communication and making knowledge sharing more efficient.&lt;/p&gt;

&lt;h2 id="what-is-langchain-document-loaders"&gt;LangChain Document Loaders&lt;/h2&gt;

&lt;p&gt;LangChain’s &lt;a href="https://python.langchain.com/docs/modules/data_connection/document_loaders/" rel="noreferrer noopener"&gt;document loaders&lt;/a&gt; provide a robust solution for importing data from various sources and transforming it into Document objects. A Document object essentially contains a piece of text along with any associated metadata. The power of LangChain lies in its variety of document loaders. These include the &lt;a href="https://python.langchain.com/docs/modules/data_connection/document_loaders/how_to/csv" rel="noopener noreferrer"&gt;CSV | 🦜️🔗 Langchain&lt;/a&gt; for working with CSV files, PDFLoader for handling PDF documents, a File Directory loader for importing data from a file system, and a JSON loader for processing JSON data.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;loader &lt;span class="token operator"&gt;=&lt;/span&gt; GoogleDriveLoader&lt;span class="token punctuation"&gt;(&lt;/span&gt;
        credentials_path&lt;span class="token operator"&gt;=&lt;/span&gt;CLIENT_SECRET_FILE&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        token_path&lt;span class="token operator"&gt;=&lt;/span&gt;TOKEN_FILE&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        folder_id&lt;span class="token operator"&gt;=&lt;/span&gt;GOOGLE_DRIVER_FOLDER_ID&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        recursive&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token boolean"&gt;False&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        file_types&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token string"&gt;"sheet"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token string"&gt;"document"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token string"&gt;"pdf"&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    &lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;span class="token keyword"&gt;return&lt;/span&gt; loader&lt;span class="token punctuation"&gt;.&lt;/span&gt;load&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What’s truly useful about these document loaders is their ‘load’ method. It extracts data from a configured source and turns it into Document objects. For more efficient memory utilization, LangChain also supports ‘lazy load’. This feature progressively loads data into memory as and when required, rather than loading it all at once. This functionality is not just limited to standard text files. For instance, LangChain can load the text contents of a web page or even fetch and process the &lt;a href="https://github.com/hwchase17/langchain/blob/master/langchain/document_loaders/youtube.py" rel="noreferrer noopener"&gt;transcript of a YouTube video&lt;/a&gt;, expanding the scope of data sources you can tap into.&lt;/p&gt;

&lt;h2 id="setting-google-api-credentials"&gt;Setting up Google API Credentials&lt;/h2&gt;

&lt;p&gt;In order to build our Google Docs ChatGPT chatbot, we will use GoogleDriveLoader document loader. &lt;/p&gt;

&lt;p&gt;The GoogleDriveLoader is a document loader that allows you to ingest data from Google Docs into your LangChain project. It can load from a list of Google Docs document IDs or a folder ID. &lt;/p&gt;

&lt;p&gt;To use the GoogleDriveLoader, you need to have a &lt;a href="https://developers.google.com/workspace/guides/create-credentials" rel="noreferrer noopener"&gt;Google Cloud project&lt;/a&gt; and enable the Google Drive API. You also need to authorize credentials for a desktop app and install the necessary Python packages. Once you have set up the loader, you can use it to fetch data from Google Docs and integrate it into your LangChain project. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting up your Google Drive API credentials&lt;/strong&gt; is an essential step when you’re looking to leverage Google Drive functionalities in your application. Let’s break it down step by step.&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;
&lt;strong&gt;Creating a new Google Cloud Project&lt;/strong&gt;: Start by visiting your Google Cloud Console at &lt;a href="https://console.cloud.google.com/" rel="noopener noreferrer"&gt;https://console.cloud.google.com&lt;/a&gt;. If you’re not already signed into your Google account, you’ll be prompted to do so. Once in the Console, you can create a new project by clicking on the project dropdown (a triangle next to your Project Name) in the top left corner. A panel will slide open with a list of your projects and a ‘NEW PROJECT’ button at the top. Click on it, name your new project, and create it.&lt;/li&gt;&lt;/ol&gt;



&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pzQ7srYJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.nextideatech.com/wp-content/uploads/2023/06/image-1024x396.png" alt="" width="800" height="309"&gt;Setting up Google Cloud API for ChatGPT Chatbot



&lt;ol&gt;&lt;li&gt;
&lt;strong&gt;Enabling the Google Drive API&lt;/strong&gt;: After creating your project, you need to enable the Google Drive API for it. This can be done by visiting the ‘Library’ in the left sidebar. Here, search for ‘Google Drive API’, click on the resulting option, and then click ‘Enable’. If you don’t see the ‘Enable’ button immediately, you may need to refresh the page or navigate back to it once your new project is fully set up.&lt;/li&gt;&lt;/ol&gt;



&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--no8Kgi_v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.nextideatech.com/wp-content/uploads/2023/06/image-1-1024x249.png" alt="" width="800" height="195"&gt;



&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yyw_Ug82--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.nextideatech.com/wp-content/uploads/2023/06/image-2.png" alt="" width="800" height="396"&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Setting up Google API Credentials&lt;/strong&gt;: This process involves four main steps:&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Authorize credentials for a desktop app&lt;/strong&gt;: In the Google Cloud Console, navigate to ‘Credentials’ under ‘APIs &amp;amp; Services’. Click on ‘Create Credentials’ and select ‘OAuth client ID’. In the ‘Application type’, choose ‘Desktop app’. Enter a name for your OAuth client ID and click ‘Create’.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download your credentials&lt;/strong&gt;: After creating, download the credentials by clicking on the download icon (a down arrow) next to the client ID you’ve just created. This will download a JSON file, such as &lt;code&gt;client_secret_23429870XXXXXXXXXXXXXX.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configure your consent screen&lt;/strong&gt;: Go to ‘OAuth consent screen’ under ‘APIs &amp;amp; Services’ and fill out the necessary details. This includes the app name, user support email, developer contact information, and more. This is the information users will see when your app requests access to their data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add yourself as a test user&lt;/strong&gt;: On the same ‘OAuth consent screen’, scroll down to the ‘Test users’ section and click on ‘Add Users’. Enter your email and save. This is especially important when your app is in a testing phase. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storing your Credentials&lt;/strong&gt;: The credentials you downloaded come in a JSON file, which by default, LangChain expects to be stored at &lt;code&gt;~/.credentials/credentials.json&lt;/code&gt;. However for the sake of this project, we will place the &lt;em&gt;credentials.json&lt;/em&gt; in the project root directory and point it using the &lt;em&gt;GOOGLE_APPLICATION_CREDENTIALS&lt;/em&gt; variable.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="step-by-step-google-docs-chatgpt-python"&gt;Step by step: How to build Google Docs ChatGPT chatbot&lt;/h2&gt;

&lt;h4&gt;Installing Python dependencies&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;pip &lt;span class="token function"&gt;install&lt;/span&gt; openai
pip &lt;span class="token function"&gt;install&lt;/span&gt; langchain
pip &lt;span class="token function"&gt;install&lt;/span&gt; openai
pip &lt;span class="token function"&gt;install&lt;/span&gt; chromadb
pip &lt;span class="token function"&gt;install&lt;/span&gt; PyPDF2
pip &lt;span class="token function"&gt;install&lt;/span&gt; sentence_transformers
pip &lt;span class="token function"&gt;install&lt;/span&gt; torch
pip &lt;span class="token function"&gt;install&lt;/span&gt; --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: when running the application, you may receive an error message &lt;em&gt;AssertionError: Torch not compiled with CUDA enabled&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This is because the code relies on &lt;em&gt;torch&lt;/em&gt; which needs to be installed as follows in order to &lt;a href="https://medium.com/@jjlovesstudying/python-cuda-set-up-on-windows-10-for-gpu-support-78126284b085" rel="noreferrer noopener"&gt;support CUDA&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pip uninstall torch
pip cache purge
pip &lt;span class="token function"&gt;install&lt;/span&gt; torch -f https://download.pytorch.org/whl/torch_stable.html&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Code Walkthrough&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;load_documents(&lt;/code&gt;)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;def&lt;/span&gt; &lt;span class="token function"&gt;load_documents&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
    loader &lt;span class="token operator"&gt;=&lt;/span&gt; GoogleDriveLoader&lt;span class="token punctuation"&gt;(&lt;/span&gt;
        credentials_path&lt;span class="token operator"&gt;=&lt;/span&gt;CLIENT_SECRET_FILE&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        token_path&lt;span class="token operator"&gt;=&lt;/span&gt;TOKEN_FILE&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        folder_id&lt;span class="token operator"&gt;=&lt;/span&gt;GOOGLE_DRIVER_FOLDER_ID&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        recursive&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token boolean"&gt;False&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
        file_types&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token string"&gt;"sheet"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token string"&gt;"document"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token string"&gt;"pdf"&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;
    &lt;span class="token punctuation"&gt;)&lt;/span&gt;
    &lt;span class="token keyword"&gt;return&lt;/span&gt; loader&lt;span class="token punctuation"&gt;.&lt;/span&gt;load&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;load_documents()&lt;/code&gt; function is used to load documents from a specific Google Drive folder. The &lt;code&gt;GoogleDriveLoader&lt;/code&gt; class from the &lt;code&gt;langchain.document_loaders&lt;/code&gt; module is instantiated with several arguments: a path to the client secret file for authentication (&lt;code&gt;CLIENT_SECRET_FILE&lt;/code&gt;), a path to the token file (&lt;code&gt;TOKEN_FILE&lt;/code&gt;), and the ID of the Google Drive folder containing the documents (&lt;code&gt;GOOGLE_DRIVER_FOLDER_ID&lt;/code&gt;). The &lt;code&gt;recursive&lt;/code&gt; argument is set to &lt;code&gt;False&lt;/code&gt;, which means the loader will not look for files in sub-folders of the specified folder. The &lt;code&gt;file_types&lt;/code&gt; argument lists the types of files to load from the folder (in this case, Google Sheets, Google Docs, and PDF files). The function returns the loaded documents.&lt;br&gt;&lt;strong&gt;file_types&lt;/strong&gt;: denotes the file types you want to index. “&lt;em&gt;document&lt;/em&gt;” corresponds to “Google Docs” file type. GoogleDriveLoader &lt;em&gt;will not&lt;/em&gt; index “.doc” or “.docx” files that you manually uploaded to the target folder.&lt;/p&gt;

&lt;h5&gt;Getting Google Drive Folder_ID&lt;/h5&gt;

&lt;p&gt;Getting the ID of a Google Drive folder is quite straightforward. Follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First, you’ll need to open your Google Drive in a web browser. This can be done by visiting the URL: &lt;a href="https://drive.google.com/" rel="noopener noreferrer"&gt;https://drive.google.com&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to the folder whose ID you want to retrieve.&lt;/li&gt;
&lt;li&gt;Once you’re inside the folder, look at the URL in your web browser’s address bar. It should look something like this: &lt;code&gt;https://drive.google.com/drive/u/0/folders/1A2B3CDEFGH456I7J89K&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The part of the URL after ‘folders/’ is the ID of the Google Drive folder. In the example above, the folder ID is &lt;code&gt;1A2B3CDEFGH456I7J89K&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Copy this ID and use it for “GOOGLE_DRIVER_FOLDER_ID” variable in your code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vPSWOeqn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.nextideatech.com/wp-content/uploads/2023/06/image-3-1024x249.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vPSWOeqn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.nextideatech.com/wp-content/uploads/2023/06/image-3-1024x249.png" alt="" width="800" height="195"&gt;&lt;/a&gt;Getting your Google Drive Folder ID&lt;/p&gt;

&lt;p&gt;&lt;code&gt;split_documents(docs)&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;def&lt;/span&gt; &lt;span class="token function"&gt;split_documents&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;docs&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
    text_splitter &lt;span class="token operator"&gt;=&lt;/span&gt; RecursiveCharacterTextSplitter&lt;span class="token punctuation"&gt;(&lt;/span&gt;chunk_size&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token number"&gt;4000&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; chunk_overlap&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token number"&gt;0&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; separators&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token string"&gt;" "&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token string"&gt;","&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token string"&gt;"\n"&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    &lt;span class="token keyword"&gt;return&lt;/span&gt; text_splitter&lt;span class="token punctuation"&gt;.&lt;/span&gt;split_documents&lt;span class="token punctuation"&gt;(&lt;/span&gt;docs&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;split_documents(docs)&lt;/code&gt; function is used to split the loaded documents into chunks. The &lt;code&gt;RecursiveCharacterTextSplitter&lt;/code&gt; class from the &lt;code&gt;langchain.text_splitter&lt;/code&gt; module is instantiated with specified arguments: &lt;code&gt;chunk_size=4000&lt;/code&gt; indicating that each chunk will contain approximately 4000 characters, &lt;code&gt;chunk_overlap=0&lt;/code&gt; indicating that there will be no overlapping characters between the chunks, and &lt;code&gt;separators=[" ", ",", "\n"]&lt;/code&gt; indicating the preferred points (space, comma, or newline) at which to split the text. The function returns the document text split into chunks.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;generate_embeddings()&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;def&lt;/span&gt; &lt;span class="token function"&gt;generate_embeddings&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
    &lt;span class="token keyword"&gt;return&lt;/span&gt; HuggingFaceEmbeddings&lt;span class="token punctuation"&gt;(&lt;/span&gt;model_name&lt;span class="token operator"&gt;=&lt;/span&gt;HUGGINGFACE_MODEL&lt;span class="token punctuation"&gt;,&lt;/span&gt; model_kwargs&lt;span class="token operator"&gt;=&lt;/span&gt;MODEL_KWARGS&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;generate_embeddings()&lt;/code&gt; function creates an instance of the &lt;code&gt;HuggingFaceEmbeddings&lt;/code&gt; class from the &lt;code&gt;langchain.embeddings&lt;/code&gt; module. The instance is created with the specified model name (&lt;code&gt;HUGGINGFACE_MODEL&lt;/code&gt;) and additional keyword arguments (&lt;code&gt;MODEL_KWARGS&lt;/code&gt;), which in this case is to specify that the model should run on a CUDA-enabled GPU. The function returns the HuggingFace embeddings generator.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;create_chroma_db(texts, embeddings)&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;def&lt;/span&gt; &lt;span class="token function"&gt;create_chroma_db&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;texts&lt;span class="token punctuation"&gt;,&lt;/span&gt; embeddings&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
    &lt;span class="token keyword"&gt;if&lt;/span&gt; &lt;span class="token keyword"&gt;not&lt;/span&gt; os&lt;span class="token punctuation"&gt;.&lt;/span&gt;path&lt;span class="token punctuation"&gt;.&lt;/span&gt;exists&lt;span class="token punctuation"&gt;(&lt;/span&gt;PERSIST_DIRECTORY&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
        &lt;span class="token keyword"&gt;return&lt;/span&gt; Chroma&lt;span class="token punctuation"&gt;.&lt;/span&gt;from_documents&lt;span class="token punctuation"&gt;(&lt;/span&gt;texts&lt;span class="token punctuation"&gt;,&lt;/span&gt; embeddings&lt;span class="token punctuation"&gt;,&lt;/span&gt; persist_directory&lt;span class="token operator"&gt;=&lt;/span&gt;PERSIST_DIRECTORY&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    &lt;span class="token keyword"&gt;else&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
        &lt;span class="token keyword"&gt;return&lt;/span&gt; Chroma&lt;span class="token punctuation"&gt;(&lt;/span&gt;embedding_function&lt;span class="token operator"&gt;=&lt;/span&gt;embeddings&lt;span class="token punctuation"&gt;,&lt;/span&gt; persist_directory&lt;span class="token operator"&gt;=&lt;/span&gt;PERSIST_DIRECTORY&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;create_chroma_db(texts, embeddings)&lt;/code&gt; function creates a Chroma database that stores the embeddings for the chunks of text. The &lt;code&gt;Chroma&lt;/code&gt; class is from the &lt;code&gt;langchain.vectorstores&lt;/code&gt; module. If the specified persistence directory (&lt;code&gt;PERSIST_DIRECTORY&lt;/code&gt;) does not exist, it creates a new Chroma database using the texts and their corresponding embeddings. If the directory already exists, it assumes the Chroma database has already been created, and just loads it using the &lt;code&gt;Chroma()&lt;/code&gt; constructor, which needs the embeddings function and the persistence directory as arguments.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;create_retriever(db)&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;def create_retriever(db):
    return db.as_retriever(search_kwargs={"k": RETRIEVER_K_ARG})
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;create_retriever(db)&lt;/code&gt; function creates a retriever object from the Chroma database. The retriever will be used to find the most relevant chunks of text based on a given query. The &lt;code&gt;.as_retriever()&lt;/code&gt; method of the Chroma database object is used to create the retriever. The &lt;code&gt;search_kwargs&lt;/code&gt; parameter is used to configure the search behavior of the retriever; here, it sets the “k” parameter, which determines the number of top results to retrieve.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;create_index(llm, retriever)&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;def create_index(llm, retriever):
    return RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;create_index(llm, retriever)&lt;/code&gt; function uses the &lt;code&gt;RetrievalQA&lt;/code&gt; class from the &lt;code&gt;langchain.chains&lt;/code&gt; module to create an index that combines a language model (llm) and a retriever. The &lt;code&gt;from_chain_type()&lt;/code&gt; static method is used to create the index, with “default” as the chain type, and the provided language model and retriever as arguments.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;create_llm()&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;def create_llm():
    return ChatOpenAI(temperature=0, model_name=OPENA_AI_MODEL)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;create_llm()&lt;/code&gt; function is used to instantiate an instance of the &lt;code&gt;ChatOpenAI&lt;/code&gt; class from the &lt;code&gt;langchain.chat_models&lt;/code&gt; module, which represents a language model. The &lt;code&gt;temperature&lt;/code&gt; parameter is set to &lt;code&gt;0&lt;/code&gt;, indicating that the model’s outputs will be deterministic (i.e., always choosing the most probable next word). The &lt;code&gt;model_name&lt;/code&gt; is set to &lt;code&gt;OPENA_AI_MODEL&lt;/code&gt;, a constant that refers to a specific version of the OpenAI model to use (in this case, “gpt-4-0314”). The function returns the instantiated language model.&lt;/p&gt;

&lt;p&gt;main()&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="token keyword"&gt;def&lt;/span&gt; &lt;span class="token function"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
    docs &lt;span class="token operator"&gt;=&lt;/span&gt; load_documents&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    texts &lt;span class="token operator"&gt;=&lt;/span&gt; split_documents&lt;span class="token punctuation"&gt;(&lt;/span&gt;docs&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    embeddings &lt;span class="token operator"&gt;=&lt;/span&gt; generate_embeddings&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    db &lt;span class="token operator"&gt;=&lt;/span&gt; create_chroma_db&lt;span class="token punctuation"&gt;(&lt;/span&gt;texts&lt;span class="token punctuation"&gt;,&lt;/span&gt; embeddings&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    retriever &lt;span class="token operator"&gt;=&lt;/span&gt; create_retriever&lt;span class="token punctuation"&gt;(&lt;/span&gt;db&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    llm &lt;span class="token operator"&gt;=&lt;/span&gt; create_llm&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
    qa &lt;span class="token operator"&gt;=&lt;/span&gt; create_index&lt;span class="token punctuation"&gt;(&lt;/span&gt;llm&lt;span class="token punctuation"&gt;,&lt;/span&gt; retriever&lt;span class="token punctuation"&gt;)&lt;/span&gt;

    &lt;span class="token keyword"&gt;while&lt;/span&gt; &lt;span class="token boolean"&gt;True&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
        query &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token builtin"&gt;input&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string"&gt;"&amp;gt; "&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
        &lt;span class="token keyword"&gt;if&lt;/span&gt; query&lt;span class="token punctuation"&gt;.&lt;/span&gt;lower&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token operator"&gt;==&lt;/span&gt; &lt;span class="token string"&gt;"exit"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
            exit&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
        answer &lt;span class="token operator"&gt;=&lt;/span&gt; qa&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;{&lt;/span&gt;&lt;span class="token string"&gt;"query"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt; &lt;span class="token string-interpolation"&gt;&lt;span&gt;f"### Instructions. &lt;/span&gt;&lt;span&gt;&lt;span&gt;{&lt;/span&gt;PRE_PROMPT_INSTRUCTIONS&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span&gt; ###Prompt &lt;/span&gt;&lt;span&gt;&lt;span&gt;{&lt;/span&gt;query&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
        &lt;span class="token keyword"&gt;print&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;answer&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token string"&gt;'result'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;

&lt;span class="token keyword"&gt;if&lt;/span&gt; __name__ &lt;span class="token operator"&gt;==&lt;/span&gt; &lt;span class="token string"&gt;"__main__"&lt;/span&gt;&lt;span class="token punctuation"&gt;:&lt;/span&gt;
    main&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;main()&lt;/code&gt; function orchestrates the entire process of loading, processing, and querying documents.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The function then enters an infinite loop, where it repeatedly asks the user for a query (with &lt;code&gt;input("&amp;gt; ")&lt;/code&gt;). The loop continues until the user enters “exit”, at which point the program exits.&lt;/li&gt;
&lt;li&gt;If the input isn’t “exit”, the function treats the input as a query and passes it to the &lt;code&gt;qa&lt;/code&gt; object (the index created earlier), which is responsible for producing a response. This response is then printed out.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;First run&lt;br&gt;&lt;/strong&gt;The first time you correctly execute your program, it will automatically open a web browser prompting you to sign in to your Google account. You should log in with the account that you previously set up as a test user during the preparation stage. Once you’ve successfully authenticated your account, the application will quietly generate a &lt;code&gt;token.json&lt;/code&gt; file and download it.&lt;/p&gt;

&lt;p&gt; Note: the token file name is whatever value you specify in TOKEN_FILE variable. &lt;/p&gt;

&lt;p&gt;This file will contain the necessary tokens to access your Google account and it will be used for future sessions, eliminating the need for you to manually log in each time you run the program.&lt;/p&gt;

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

&lt;p&gt;This kind of chatbot has a wide variety of use-cases, especially where dealing with large amounts of text data is involved. Here are a few examples:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Research:&lt;/strong&gt; If you’re a researcher dealing with a large corpus of articles, papers, or reports, this program can help you find relevant information quickly. Instead of manually reading through each document, you can query the system and get the information you need.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Legal Work:&lt;/strong&gt; In legal professions, there’s often a need to comb through large volumes of legal documents, cases, or laws to find relevant references or precedents. This system could drastically reduce the time spent on such tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customer Support:&lt;/strong&gt; This could be used in a company’s customer support to quickly find answers to customer queries based on a large database of product manuals, previous support tickets, and other documentation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Education:&lt;/strong&gt; Teachers and students could use this to quickly find relevant study material from a large corpus of textbooks, articles, and other educational resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Creation:&lt;/strong&gt; Writers and content creators could use it to quickly find inspiration, references, or background information from a vast collection of documents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Business Intelligence:&lt;/strong&gt; Companies could use this system to extract insights from a vast amount of business reports, meeting minutes, or emails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Healthcare:&lt;/strong&gt; Medical practitioners can use it to search through a large collection of medical literature, case studies, research papers, and find treatment options, diagnose diseases, etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can find the code in &lt;a href="https://github.com/NextIdeaTechUS/LangChain_GDrive_GPT_Python" rel="noreferrer noopener"&gt;this&lt;/a&gt; github repository&lt;/p&gt;

&lt;h2&gt;&lt;br&gt;&lt;/h2&gt;

                 

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