<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Uliyahoo on Medium]]></title>
        <description><![CDATA[Stories by Uliyahoo on Medium]]></description>
        <link>https://medium.com/@uli_69172?source=rss-dda62c58fe84------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4aTJIpAhXffigdyH</url>
            <title>Stories by Uliyahoo on Medium</title>
            <link>https://medium.com/@uli_69172?source=rss-dda62c58fe84------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:17:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@uli_69172/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Build an AI-Powered Resume & Cover Letter Generator (CopilotKit, LangChain, Tavily & Next.js)]]></title>
            <link>https://medium.com/@uli_69172/build-an-ai-powered-resume-cover-letter-generator-copilotkit-langchain-tavily-next-js-8ca9a2f18aec?source=rss-dda62c58fe84------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ca9a2f18aec</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[langchain]]></category>
            <dc:creator><![CDATA[Uliyahoo]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 14:03:00 GMT</pubDate>
            <atom:updated>2024-06-26T14:03:00.970Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*MYMtXFJK_CGRRqxXRxoE0A.gif" /></figure><h3>TL;DR</h3><p>Building a great project is the best resume for an aspiring developer.</p><p>Well, today we will hit two birds with one stone; I will teach you how to build a cutting-edge, AI-powered application that will generate your resume &amp; cover letter based on your LinkedIn, GitHub &amp; X.</p><p>This project &amp; your ensuing resume will blow away any employer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Gx21scWavyLG1cIY.gif" /></figure><p>We’ll cover how to:</p><ul><li>Build the resume &amp; cover letter generator web app using Next.js, TypeScript, and Tailwind CSS.</li><li>Use CopilotKit to integrate AI functionalities into the resume &amp; cover letter generator.</li><li>Use Langchain and Tavily to scrape your LinkedIn, GitHub, or X profile content.</li></ul><h3>CopilotKit: The open-source framework for building in-app AI copilots</h3><p>CopilotKit is an <a href="https://github.com/CopilotKit/CopilotKit">open-source AI copilot platform</a>. We make it easy to integrate powerful AI into your React apps.</p><p>Build:</p><ul><li>ChatBot: Context-aware in-app chatbots that can take actions in-app 💬</li><li>CopilotTextArea: AI-powered textFields with context-aware autocomplete &amp; insertions 📝</li><li>Co-Agents: In-app AI agents that can interact with your app &amp; users 🤖</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*O6Yc9EPSC8bThwuI.gif" /></figure><p><a href="https://git.new/devtoarticle1">Star CopilotKit ⭐️</a></p><h3>Prerequisites</h3><p>To fully understand this tutorial, you need to have a basic understanding of React or Next.js.</p><p>Here are the tools required to build the AI-powered resume and cover letter generator:</p><ul><li><a href="https://github.com/remarkjs/react-markdown">React Markdown</a> — a <strong>React</strong> component that can be given a string of markdown to safely render to React elements.</li><li><a href="https://www.langchain.com/">Langchain</a> — provides a framework that enables AI agents to search the web, research and scrape any topic or link.</li><li><a href="https://platform.openai.com/api-keys">OpenAI API</a> — provides an API key that enables you to carry out various tasks using ChatGPT models.</li><li><a href="https://tavily.com/">Tavily AI</a> — a search engine that enables AI agents to conduct research or scrape data and access real-time knowledge within the application.</li><li><a href="https://github.com/CopilotKit">CopilotKit</a> — an open-source copilot framework for building custom AI chatbots, in-app AI agents, and text areas.</li></ul><h3>Project Set up and Package Installation</h3><p>First, create a Next.js application by running the code snippet below in your terminal:</p><pre>npx create-next-app@latest airesumecoverlettergenerator</pre><p>Select your preferred configuration settings. For this tutorial, we’ll be using TypeScript and Next.js App Router.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*Tq1lO6HOQCstQao4.png" /></figure><p>Next, install the React Markdown and OpenAI packages with their dependencies.</p><pre>npm i react-markdown openai</pre><p>Finally, install the CopilotKit packages. These packages enable us to retrieve data from the React state and add AI copilot to the application.</p><pre>npm install @copilotkit/react-ui @copilotkit/react-core @copilotkit/backend</pre><p>Congratulations! You’re now ready to build an AI-powered resume and cover letter generator.</p><h3>Building The Resume &amp; Cover Letter Generator Frontend</h3><p>In this section, I will walk you through the process of creating the Resume &amp; cover letter generator frontend with static content to define the generator’s user interface.</p><p>To get started, go to /[root]/src/app in your code editor and create a folder called components. Inside the components folder, create a file named Resume.tsx</p><p>In the Resume.tsx file, add the following code that defines a React functional component called <strong>Resume</strong>.</p><pre>&quot;use client&quot;; </pre><pre>// Import React and necessary hooks from the react library<br>import React from &quot;react&quot;;<br>import { useState } from &quot;react&quot;;<br>// Import the ReactMarkdown component to render markdown content<br>import ReactMarkdown from &quot;react-markdown&quot;;<br>// Import the Link component from Next.js for navigation<br>import Link from &quot;next/link&quot;;</pre><pre>function Resume() {<br>  // State variables to store the resume and cover letter content<br>  const [coverLetter, setCoverLetter] = useState(&quot;&quot;);<br>  const [resume, setResume] = useState(&quot;&quot;);</pre><pre>  return (<br>    // Main container with flex layout, full width, and minimum height of screen<br>    &lt;div className=&quot;flex flex-col w-full min-h-screen bg-gray-100 dark:bg-gray-800&quot;&gt;<br>      {/* Header section with a fixed height, padding, and border at the bottom */}<br>      &lt;header className=&quot;flex items-center h-16 px-4 border-b shrink-0 md:px-6 bg-white dark:bg-gray-900&quot;&gt;<br>        {/* Link component for navigation with custom styles */}<br>        &lt;Link<br>          href=&quot;#&quot;<br>          className=&quot;flex items-center gap-2 text-lg font-semibold md:text-base&quot;<br>          prefetch={false}&gt;<br>          &lt;span className=&quot;sr-only text-gray-500&quot;&gt;Resume Dashboard&lt;/span&gt;<br>          &lt;h1&gt;Resume &amp; Cover Letter Generator&lt;/h1&gt;<br>        &lt;/Link&gt;<br>      &lt;/header&gt;<br>      {/* Main content area with padding */}<br>      &lt;main className=&quot;flex-1 p-4 md:p-8 lg:p-10&quot;&gt;<br>        {/* Container for the content with maximum width and centered alignment */}<br>        &lt;div className=&quot;max-w-4xl mx-auto grid gap-8&quot;&gt;<br>          {/* Section for displaying the resume */}<br>          &lt;section&gt;<br>            &lt;div className=&quot;bg-white dark:bg-gray-900 rounded-lg shadow-sm&quot;&gt;<br>              &lt;div className=&quot;p-6 md:p-8&quot;&gt;<br>                &lt;h2 className=&quot;text-lg font-bold&quot;&gt;Resume&lt;/h2&gt;<br>                &lt;div className=&quot;my-6&quot; /&gt;<br>                &lt;div className=&quot;grid gap-6&quot;&gt;<br>                  {/* Conditional rendering of the resume content */}<br>                  {resume ? (<br>                    &lt;ReactMarkdown&gt;{resume}&lt;/ReactMarkdown&gt;<br>                  ) : (<br>                    &lt;div&gt;No Resume To Display&lt;/div&gt;<br>                  )}<br>                &lt;/div&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/section&gt;<br>          {/* Section for displaying the cover letter */}<br>          &lt;section&gt;<br>            &lt;div className=&quot;bg-white dark:bg-gray-900 rounded-lg shadow-sm&quot;&gt;<br>              &lt;div className=&quot;p-6 md:p-8&quot;&gt;<br>                &lt;h2 className=&quot;text-lg font-bold&quot;&gt;Cover Letter&lt;/h2&gt;<br>                &lt;div className=&quot;my-6&quot; /&gt;<br>                &lt;div className=&quot;grid gap-4&quot;&gt;<br>                  {/* Conditional rendering of the cover letter content */}<br>                  {coverLetter ? (<br>                    &lt;ReactMarkdown&gt;{coverLetter}&lt;/ReactMarkdown&gt;<br>                  ) : (<br>                    &lt;div&gt;No Cover Letter To Display&lt;/div&gt;<br>                  )}<br>                &lt;/div&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/section&gt;<br>        &lt;/div&gt;<br>      &lt;/main&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><pre>export default Resume;</pre><p>Next, go to /[root]/src/page.tsx file, and add the following code that imports Resume component and defines a functional component named Home.</p><pre>import Resume from &quot;./components/Resume&quot;;<br><br>export default function Home() {<br>  return &lt;Resume /&gt;;<br>}</pre><p>Finally, run the command npm run dev on the command line and then navigate to <a href="http://localhost:3000/">http://localhost:3000/</a>.</p><p>Now you should view the resume and cover letter generator frontend on your browser, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*wup-pLjSo3FEKBtB.png" /></figure><p>Congratulations! You’re now ready to add AI functionalities to the AI-powered resume and cover letter generator.</p><h3>Integrating AI Functionalities To The Resume &amp; Cover Letter Generator Using CopilotKit</h3><p>In this section, you will learn how to add an AI copilot to the Resume &amp; Cover Letter generator to generate resume and cover letter using CopilotKit.</p><p>CopilotKit offers both frontend and <a href="https://docs.copilotkit.ai/getting-started/quickstart-backend">backend</a> packages. They enable you to plug into the React states and process application data on the backend using AI agents.</p><p>First, let’s add the CopilotKit React components to the Resume &amp; Cover Letter generator frontend.</p><h3>Adding CopilotKit to the To-Do List Generator Frontend</h3><p>Here, I will walk you through the process of integrating the Resume &amp; Cover Letter generator with the CopilotKit frontend to facilitate Resume &amp; Cover Letter generation.</p><p>To get started, use the code snippet below to import useCopilotReadable, and useCopilotAction, custom hooks at the top of the /src/app/components/Resume.tsx file.</p><pre>import { useCopilotAction, useCopilotReadable } from &quot;@copilotkit/react-core&quot;;</pre><p>Inside the Resume function, below the state variables, add the following code that uses the useCopilotReadable hook to add the Resume &amp; Cover Letter that will be generated as context for the in-app chatbot. The hook makes the Resume &amp; Cover Letter readable to the copilot.</p><pre>useCopilotReadable({<br>    description: &quot;The user&#39;s cover letter.&quot;,<br>    value: coverLetter,<br>  });<br><br>useCopilotReadable({<br>    description: &quot;The user&#39;s resume.&quot;,<br>    value: resume,<br>  });</pre><p>Below the code above, add the following code that uses the useCopilotAction hook to set up an action called createCoverLetterAndResume which will enable the generation of resume and cover letter.</p><p>The action takes two parameters called coverLetterMarkdown and resumeMarkdownwhich enables the generation of resume and cover letter. It contains a handler function that generates resume and cover letter based on a given prompt.</p><p>Inside the handler function, coverLetter and resume states are updated with the newly generated resume and cover letter markdown, as shown below.</p><pre>useCopilotAction(<br>  {<br>    // Define the name of the action<br>    name: &quot;createCoverLetterAndResume&quot;,<br>    // Provide a description for the action<br>    description: &quot;Create a cover letter and resume for a job application.&quot;,<br>    // Define the parameters required for the action<br>    parameters: [<br>      {<br>        // Name of the first parameter<br>        name: &quot;coverLetterMarkdown&quot;,<br>        // Type of the first parameter<br>        type: &quot;string&quot;,<br>        // Description of the first parameter<br>        description:<br>          &quot;Markdown text for a cover letter to introduce yourself and briefly summarize your professional background.&quot;,<br>        // Mark the first parameter as required<br>        required: true,<br>      },<br>      {<br>        // Name of the second parameter<br>        name: &quot;resumeMarkdown&quot;,<br>        // Type of the second parameter<br>        type: &quot;string&quot;,<br>        // Description of the second parameter<br>        description:<br>          &quot;Markdown text for a resume that displays your professional background and relevant skills.&quot;,<br>        // Mark the second parameter as required<br>        required: true,<br>      },<br>    ],<br>    // Define the handler function to be executed when the action is called<br>    handler: async ({ coverLetterMarkdown, resumeMarkdown }) =&gt; {<br>      // Update the state with the provided cover letter markdown text<br>      setCoverLetter(coverLetterMarkdown);<br>      // Update the state with the provided resume markdown text<br>      setResume(resumeMarkdown);<br>    },<br>  },<br>  // Empty dependency array, indicating this effect does not depend on any props or state<br>  [],<br>);</pre><p>After that, go to /[root]/src/app/page.tsx file and import CopilotKit frontend packages and styles at the top using the code below.</p><pre>import { CopilotKit } from &quot;@copilotkit/react-core&quot;;<br>import { CopilotSidebar } from &quot;@copilotkit/react-ui&quot;;<br>import &quot;@copilotkit/react-ui/styles.css&quot;;</pre><p>Then use CopilotKit to wrap the CopilotSidebar and Resume components, as shown below. The CopilotKit component specifies the URL for CopilotKit&#39;s backend endpoint (/api/copilotkit/) while the CopilotSidebar renders the in-app chatbot that you can give prompts to generate resume and cover letter.</p><pre>export default function Home() {<br>  return (<br>    &lt;CopilotKit runtimeUrl=&quot;/api/copilotkit&quot;&gt;<br>      &lt;CopilotSidebar<br>        instructions={&quot;Help the user create a cover letter and resume&quot;}<br>        labels={{<br>          initial:<br>            &quot;Welcome to the cover letter app! Add your LinkedIn, X, or GitHub profile link below.&quot;,<br>        }}<br>        defaultOpen={true}<br>        clickOutsideToClose={false}&gt;<br>        &lt;Resume /&gt;<br>      &lt;/CopilotSidebar&gt;<br>    &lt;/CopilotKit&gt;<br>  );<br>}</pre><p>After that, run the development server and navigate to <a href="http://localhost:3000/">http://localhost:3000</a>. You should see that the in-app chatbot was integrated into the Resume and Cover Letter generator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*A8k7MTiB0GWYG3ac.png" /></figure><h3>Adding CopilotKit Backend to the Blog</h3><p>Here, I will walk you through the process of integrating the Resume and Cover Letter generator with the CopilotKit backend that handles requests from frontend, and provides function calling and various LLM backends such as GPT.</p><p>Also, we will integrate an AI agent named Tavily that can scrape content on any given link on the web.</p><p>To get started, create a file called .env.local in the root directory. Then add the environment variables below in the file that hold your ChatGPT and Tavily Search API keys.</p><pre>OPENAI_API_KEY=&quot;Your ChatGPT API key&quot;<br>TAVILY_API_KEY=&quot;Your Tavily Search API key&quot;<br>OPENAI_MODEL=gpt-4-1106-preview</pre><p>To get the ChatGPT API key, navigate to <a href="https://platform.openai.com/api-keys">https://platform.openai.com/api-keys</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*uuEEy7Q5h8o3D1EY.jpg" /></figure><p>To get the Tavily Search API key, navigate to <a href="https://app.tavily.com/home">https://app.tavily.com/home</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*LlYhuB1xlN0lUY0a.jpg" /></figure><p>After that, go to /[root]/src/app and create a folder called api. In the api folder, create a folder called copilotkit.</p><p>In the copilotkit folder, create a file called tavily.ts and add the following code. The code defines an asynchronous function <strong>scrape</strong> that takes a link as input, sends this link to Tavily API, processes the JSON response, and then uses OpenAI&#39;s language model to generate a summary of the response in plain English.</p><pre>// Import the OpenAI library<br>import OpenAI from &quot;openai&quot;;</pre><pre>// Define an asynchronous function named `scrape` that takes a search query string as an argument<br>export async function scrape(query: string) {<br>  // Send a POST request to the specified API endpoint with the search query and other parameters<br>  const response = await fetch(&quot;https://api.tavily.com/search&quot;, {<br>    method: &quot;POST&quot;, // HTTP method<br>    headers: {<br>      &quot;Content-Type&quot;: &quot;application/json&quot;, // Specify the request content type as JSON<br>    },<br>    body: JSON.stringify({<br>      api_key: process.env.TAVILY_API_KEY, // API key from environment variables<br>      query, // The search query passed to the function<br>      search_depth: &quot;basic&quot;, // Search depth parameter<br>      include_answer: true, // Include the answer in the response<br>      include_images: false, // Do not include images in the response<br>      include_raw_content: false, // Do not include raw content in the response<br>      max_results: 20, // Limit the number of results to 20<br>    }),<br>  });</pre><pre>  // Parse the JSON response from the API<br>  const responseJson = await response.json();</pre><pre>  // Instantiate the OpenAI class<br>  const openai = new OpenAI();</pre><pre>  // Use the OpenAI API to create a completion based on the JSON response<br>  const completion = await openai.chat.completions.create({<br>    messages: [<br>      {<br>        role: &quot;system&quot;, // Set the role of the message to system<br>        content: `Summarize the following JSON to answer the research query \`&quot;${query}&quot;\`: ${JSON.stringify(<br>          responseJson<br>        )} in plain English.`, // Provide the JSON response to be summarized<br>      },<br>    ],<br>    model: process.env.OPENAI_MODEL || &quot;gpt-4&quot;, // Specify the OpenAI model, defaulting to GPT-4 if not set in environment variables<br>  });</pre><pre>  // Return the content of the first message choice from the completion response<br>  return completion.choices[0].message.content;<br>}</pre><p>Next, create a file called route.ts in the copilotkit folder, and add the following code. The code sets up a scraping action using the CopilotKit framework to fetch and summarize content based on a given link.</p><p>Then it defines an action that calls the scrape function and returns the result. If the required API key is available, it adds this action to the CopilotKit runtime and responds to a POST request using the OpenAI model specified in the environment variables.</p><pre>// Import necessary modules and functions<br>import { CopilotRuntime, OpenAIAdapter } from &quot;@copilotkit/backend&quot;;<br>import { Action } from &quot;@copilotkit/shared&quot;;<br>import { scrape } from &quot;./tavily&quot;; // Import the previously defined scrape function</pre><pre>// Define a scraping action with its name, description, parameters, and handler function<br>const scrapingAction: Action&lt;any&gt; = {<br>  name: &quot;scrapeContent&quot;, // Name of the action<br>  description: &quot;Call this function to scrape content from a url in a query.&quot;, // Description of the action<br>  parameters: [<br>    {<br>      name: &quot;query&quot;, // Name of the parameter<br>      type: &quot;string&quot;, // Type of the parameter<br>      description:<br>        &quot;The query for scraping content. 5 characters or longer. Might be multiple words&quot;, // Description of the parameter<br>    },<br>  ],<br>  // Handler function to execute when the action is called<br>  handler: async ({ query }) =&gt; {<br>    console.log(&quot;Scraping query: &quot;, query); // Log the query to the console<br>    const result = await scrape(query); // Call the scrape function with the query and await the result<br>    console.log(&quot;Scraping result: &quot;, result); // Log the result to the console<br>    return result; // Return the result<br>  },<br>};</pre><pre>// Define an asynchronous POST function to handle POST requests<br>export async function POST(req: Request): Promise&lt;Response&gt; {<br>  const actions: Action&lt;any&gt;[] = []; // Initialize an empty array to store actions<br>  // Check if the TAVILY_API_KEY environment variable is set<br>  if (process.env[&quot;TAVILY_API_KEY&quot;]) {<br>    actions.push(scrapingAction); // Add the scraping action to the actions array<br>  }<br>  // Create a new instance of CopilotRuntime with the defined actions<br>  const copilotKit = new CopilotRuntime({<br>    actions: actions,<br>  });</pre><pre>  const openaiModel = process.env[&quot;OPENAI_MODEL&quot;]; // Get the OpenAI model from environment variables</pre><pre>  // Return the response from CopilotKit, using the OpenAIAdapter with the specified model<br>  return copilotKit.response(req, new OpenAIAdapter({ model: openaiModel }));<br>}</pre><h3>How To Generate Resume and Cover Letter</h3><p>Now go to the in-app chatbot you integrated earlier and add a LinkedIn, GitHub or X profile link then press enter.</p><p>Once you have added the link, the chatbot will use LangChain and Tavily to scrape content from link profile. Then it will use the content to generate a Resume and Cover Letter.</p><p>The resume generated should look as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Yv_02HVz7D5p-j3B.png" /></figure><p>The cover letter generated should look as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*iyDzA-uZAb3UGwdt.png" /></figure><p>Congratulations! You’ve completed the project for this tutorial.</p><h3>Conclusion</h3><p>You can now build an awesome AI-powered resume generator to both hone in your AI building skills and simplify your job search process!</p><p>Please remember to like &amp; save this article if you enjoyed it and let me know what topics you’d want to see covered next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ca9a2f18aec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build: chat with your resume (Next.js, OpenAI, & CopilotKit)]]></title>
            <link>https://medium.com/@uli_69172/how-to-build-chat-with-your-resume-next-js-openai-copilotkit-b9dfefc5658b?source=rss-dda62c58fe84------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9dfefc5658b</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Uliyahoo]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 03:46:29 GMT</pubDate>
            <atom:updated>2024-02-07T03:46:29.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*u64efpWLFi6lDBoAMP4LbA.gif" /><figcaption>AI resume baby</figcaption></figure><h3>TL;DR</h3><p>In this article, you will learn how to build an AI-powered resume builder application using Nextjs, CopilotKit &amp; OpenAI. <br>We will cover:</p><ul><li>Leverage ChatGPT to write your resume &amp; cover letter 📑</li><li>Gradually improve your resume by chatting with it 💬</li><li>Export your resume &amp; cover letter into a PDF 🖨️</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*PZWlFUVa8Pcw4twM.gif" /></figure><h3>CopilotKit: Build deeply integrated in-app AI chatbots 💬</h3><p>Just a quick background about us. CopilotKit is the <a href="https://github.com/CopilotKit/CopilotKit">open-source AI copilot platform.</a> We make it easy to integrate powerful AI chatbots into your react apps. Fully customizable and deeply integrated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*UAxuwqVMLGv-szj0.gif" /></figure><p><a href="https://github.com/CopilotKit/CopilotKit">Star CopilotKit ⭐️</a></p><p>Now back to the article.</p><h3>Prerequisites</h3><p>To get started with this tutorial, you need the following installed on your computer:</p><ul><li>A text editor (e.g., Visual Studio Code)</li><li>Node.js</li><li>A package manager</li></ul><h3>Creating The Resume App Frontend With NextJS</h3><p><strong>Step 1:</strong> Open the command prompt and execute the following command.</p><pre>npx create-next-app@latest</pre><p><strong>Step 2:</strong> You will be prompted to select some options, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*JrCMMYP0Ziovuwja.png" /></figure><p><strong>Step 3:</strong> Open the newly created Nextjs project using a text editor of your choice. Then, run the command below on the command line to install Preline UI with NextJS using Tailwind CSS. Follow <a href="https://preline.co/docs/frameworks-nextjs.html">this guide</a> to complete the Preline setup.</p><pre>npm install preline</pre><p><strong>Step 4:</strong> On the resume/app/page.tsx file, add the following code content.</p><pre>export default function Home() {<br>  return (<br>    &lt;&gt;<br>      &lt;header className=&quot;flex flex-wrap sm:justify-start sm:flex-nowrap z-50 w-full bg-slate-900 bg-gradient-to-b from-violet-600/[.15] via-transparent text-sm py-3 sm:py-0 dark:bg-gray-800 dark:border-gray-700&quot;&gt;<br>        &lt;nav<br>          className=&quot;relative max-w-7xl w-full mx-auto px-4 sm:flex sm:items-center sm:justify-between sm:px-6 lg:px-8 &quot;<br>          aria-label=&quot;Global&quot;&gt;<br>          &lt;div className=&quot;flex items-center justify-between&quot;&gt;<br>            &lt;a<br>              className=&quot;flex-none text-xl text-gray-200 font-semibold dark:text-white py-8&quot;<br>              href=&quot;#&quot;<br>              aria-label=&quot;Brand&quot;&gt;<br>              ResumeBuilder<br>            &lt;/a&gt;<br>          &lt;/div&gt;<br>        &lt;/nav&gt;<br>      &lt;/header&gt;<br>      {/* &lt;!-- Hero --&gt; */}<br>      &lt;div className=&quot;bg-slate-900 h-screen&quot;&gt;<br>        &lt;div className=&quot;bg-gradient-to-b from-violet-600/[.15] via-transparent&quot;&gt;<br>          &lt;div className=&quot;max-w-[85rem] mx-auto px-4 sm:px-6 lg:px-8 py-24 space-y-8&quot;&gt;<br>            {/* &lt;!-- Title --&gt; */}<br>            &lt;div className=&quot;max-w-3xl text-center mx-auto pt-10&quot;&gt;<br>              &lt;h1 className=&quot;block font-medium text-gray-200 text-4xl sm:text-5xl md:text-6xl lg:text-7xl&quot;&gt;<br>                Craft A Compelling Resume With AI Resume Builder<br>              &lt;/h1&gt;<br>            &lt;/div&gt;<br>            {/* &lt;!-- End Title --&gt; */}</pre><pre>            &lt;div className=&quot;max-w-3xl text-center mx-auto&quot;&gt;<br>              &lt;p className=&quot;text-lg text-gray-400&quot;&gt;<br>                ResumeBuilder helps you create a resume that effectively<br>                highlights your skills and experience.<br>              &lt;/p&gt;<br>            &lt;/div&gt;</pre><pre>            {/* &lt;!-- Buttons --&gt; */}<br>            &lt;div className=&quot;text-center&quot;&gt;<br>              &lt;a<br>                className=&quot;inline-flex justify-center items-center gap-x-3 text-center bg-gradient-to-tl from-blue-600 to-violet-600 shadow-lg shadow-transparent hover:shadow-blue-700/50 border border-transparent text-white text-sm font-medium rounded-full focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2 focus:ring-offset-white py-3 px-6 dark:focus:ring-offset-gray-800&quot;<br>                href=&quot;#&quot;&gt;<br>                Get started<br>                &lt;svg<br>                  className=&quot;flex-shrink-0 w-4 h-4&quot;<br>                  xmlns=&quot;http://www.w3.org/2000/svg&quot;<br>                  width=&quot;24&quot;<br>                  height=&quot;24&quot;<br>                  viewBox=&quot;0 0 24 24&quot;<br>                  fill=&quot;none&quot;<br>                  stroke=&quot;currentColor&quot;<br>                  stroke-width=&quot;2&quot;<br>                  stroke-linecap=&quot;round&quot;<br>                  stroke-linejoin=&quot;round&quot;&gt;<br>                  &lt;path d=&quot;m9 18 6-6-6-6&quot; /&gt;<br>                &lt;/svg&gt;<br>              &lt;/a&gt;<br>            &lt;/div&gt;<br>            {/* &lt;!-- End Buttons --&gt; */}<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>      {/* &lt;!-- End Hero --&gt; */}<br>    &lt;/&gt;<br>  );<br>}</pre><p><strong>Step 5:</strong> Run the command <em>npm run dev</em> on the command line. Navigate to <a href="http://localhost:3000/">http://localhost:3000/</a>, and you should see the newly created NextJS project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Iv17swQRPYpfTCCJ.png" /></figure><h3>Fetching Resume Data From GitHub Using GitHub GraphQL</h3><p><strong>Step 1:</strong> Install the Axios HTTP client using the command below.</p><pre>npm i axios</pre><p><strong>Step 2:</strong> In the app folder, create a folder called API. Then, create a folder called GitHub in the API folder. Create a file called route.ts in the GitHub folder and add the following code.</p><pre>import { NextResponse } from &quot;next/server&quot;;<br>import axios from &quot;axios&quot;;</pre><pre>// Environment variables for GitHub API token and user details<br>const GITHUB_TOKEN = &quot;Your GitHub personal access token&quot;;<br>const GITHUB_USERNAME = &quot;Your GitHub account username&quot;;</pre><pre>// Axios instance for GitHub GraphQL API<br>const githubApi = axios.create({<br>  baseURL: &quot;https://api.github.com/graphql&quot;,<br>  headers: {<br>    Authorization: `bearer ${GITHUB_TOKEN}`,<br>    &quot;Content-Type&quot;: &quot;application/json&quot;,<br>  },<br>});</pre><pre>// GraphQL query to fetch user and repository data<br>const getUserAndReposQuery = `<br>  query {<br>    user(login: &quot;${GITHUB_USERNAME}&quot;) {<br>      name<br>      email<br>      company<br>      bio<br>      repositories(first: 3, orderBy: {field: CREATED_AT, direction: DESC}) {<br>        edges {<br>          node {<br>            name<br>            url<br>            description<br>            createdAt<br>            ... on Repository {<br>              primaryLanguage{<br>                name<br>              }<br>                stargazers {<br>                  totalCount<br>                }<br>              }<br>          }<br>        }<br>      }<br>    }<br>  }<br>`;</pre><pre>// API route to handle resume data fetching<br>export async function GET(request: any) {<br>  try {<br>    // Fetch data from GitHub<br>    const response = await githubApi.post(&quot;&quot;, { query: getUserAndReposQuery });<br>    const userData = response.data.data.user;</pre><pre>    // Format resume data<br>    const resumeData = {<br>      name: userData.name,<br>      email: userData.email,<br>      company: userData.company,<br>      bio: userData.bio,<br>      repositories: userData.repositories.edges.map((repo: any) =&gt; ({<br>        name: repo.node.name,<br>        url: repo.node.url,<br>        created: repo.node.createdAt,<br>        description: repo.node.description,<br>        language: repo.node.primaryLanguage.name,<br>        stars: repo.node.stargazers.totalCount,<br>      })),<br>    };</pre><pre>    // Return formatted resume data<br>    return NextResponse.json(resumeData);<br>  } catch (error) {<br>    console.error(&quot;Error fetching data from GitHub:&quot;, error);<br>    return NextResponse.json({ message: &quot;Internal Server Error&quot; });<br>  }<br>}</pre><p><strong>Step 3:</strong> In the app folder, create a folder called Components. Then, create a file called githubdata.tsx in the components folder and add the following code.</p><pre>&quot;use client&quot;;</pre><pre>import React, { useEffect, useState } from &quot;react&quot;;<br>import axios from &quot;axios&quot;;</pre><pre>// Resume data interface<br>interface ResumeData {<br>    name: string;<br>    email: string;<br>    company: string;<br>    bio: string;<br>    repositories: {<br>      name: string;<br>      url: string;<br>      created: string;<br>      description: string;<br>      language: string;<br>      stars: number;<br>    }[];<br>  }<br></pre><pre>  export const useGithubData = () =&gt; {<br>    const [resumeData, setResumeData] = useState&lt;ResumeData | null&gt;(null);</pre><pre>    // Fetch resume data from API<br>    useEffect(() =&gt; {<br>        axios<br>        .get(&quot;/api/github&quot;)<br>        .then((response) =&gt; {<br>            setResumeData(response.data);<br>        })<br>    }, []);</pre><pre>  return { resumeData, };<br>  }</pre><h3>Creating Cover Letter And Resume Functionality</h3><p><strong>Step 1:</strong> Install the CopilotKit frontend packages by running the command below on the command line.</p><pre>npm i @copilotkit/react-core @copilotkit/react-ui @copilotkit/react-textarea</pre><p><strong>Step 2:</strong> Create a file called resume.tsx in the components folder. Then import useMakeCopilotReadable, useMakeCopilotActionable, and useGithubData custom hooks at the top of the file as shown below.</p><pre>import React, { useState } from &quot;react&quot;;<br>import { useGithubData } from &quot;./githubdata&quot;;<br>import {<br>    useMakeCopilotReadable,<br>    useMakeCopilotActionable,<br>  } from &quot;@copilotkit/react-core&quot;;</pre><p><strong>Step 3:</strong> Create a component called CoverLetterAndResume. Inside the component, use the useGithubData hook to retrieve data fetched from GitHub. Then, declare a state variable called createCoverLetterAndResume and a function called setCreateCoverLetterAndResume that updates it. Initialize useState with an object containing two properties letter and resume, as shown below.</p><pre>export const CoverLetterAndResume = () =&gt; {<br>    const {resumeData } = useGithubData();<br>    const [createCoverLetterAndResume, setCreateCoverLetterAndResume] = useState({<br>      letter: &quot;&quot;,<br>      resume: &quot;&quot;<br>    });<br>}</pre><p><strong>Step 4:</strong> Use the useMakeCopilotReadable hook to add data fetched from GitHub as context for the in-app chatbot.</p><pre>useMakeCopilotReadable(JSON.stringify(resumeData));</pre><p><strong>Step 5:</strong> Use the useMakeCopilotActionable hook to set up an action called createCoverLetterAndResume with a description and an implementation function that updates the createCoverLetterAndResume state with the provided cover letter and resume, as shown below.</p><pre>useMakeCopilotActionable(<br>    {<br>      name: &quot;createCoverLetterAndResume&quot;,<br>      description:<br>        &quot;Create a cover letter and resume for a software developer job application.&quot;,<br>      argumentAnnotations: [<br>        {<br>          name: &quot;coverLetterMarkdown&quot;,<br>          type: &quot;string&quot;,<br>          description:<br>            &quot;Markdown text for a cover letter to introduce yourself and briefly summarize your professional background as a software developer.&quot;,<br>          required: true,<br>        },<br>        {<br>          name: &quot;resumeMarkdown&quot;,<br>          type: &quot;string&quot;,<br>          description:<br>            &quot;Markdown text for a resume that displays your professional background and relevant skills.&quot;,<br>          required: true,<br>        },<br>      ],<br>      implementation: async (coverLetterMarkdown, resumeMarkdown) =&gt; {<br>        setCreateCoverLetterAndResume((prevState) =&gt; ({<br>          ...prevState,<br>          letter: coverLetterMarkdown,<br>          resume: resumeMarkdown,<br>        }));<br>      },<br>    },<br>    []<br>  );</pre><p><strong>Step 6:</strong> Outside the CoverLetterAndResume component, create a component called CoverLetterResume that displays the cover letter and resume on the web app UI.</p><pre>type CoverLetterResumeProps = {<br>  letter: string;<br>  resume: string;<br>};</pre><pre>const CoverLetterResume = ({ letter, resume }: CoverLetterResumeProps) =&gt; {<br>  return (<br>    &lt;div className=&quot;px-4 sm:px-6 lg:px-8 bg-slate-50 py-4&quot;&gt;<br>      &lt;div className=&quot;sm:flex sm:items-center&quot;&gt;<br>        &lt;div className=&quot;sm:flex-auto&quot;&gt;<br>          &lt;h1 className=&quot;text-3xl font-semibold leading-6 text-gray-900&quot;&gt;<br>            ResumeBuilder<br>          &lt;/h1&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>      {/* Cover Letter Start */}<br>      &lt;div className=&quot;mt-8 flow-root bg-slate-200&quot;&gt;<br>        &lt;div className=&quot;-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8&quot;&gt;<br>          &lt;div className=&quot;inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8&quot;&gt;<br>            &lt;div&gt;<br>              &lt;h2 className=&quot;text-lg font-semibold leading-6 text-gray-900 mb-4 p-2&quot;&gt;<br>                Cover Letter<br>              &lt;/h2&gt;<br>              &lt;div className=&quot;min-w-full divide-y divide-gray-300 p-2&quot;&gt;<br>                {/* &lt;Thead /&gt; */}<br>                &lt;div className=&quot;divide-y divide-gray-200 bg-white p-2&quot;&gt;<br>                  &lt;ReactMarkdown&gt;{letter}&lt;/ReactMarkdown&gt;<br>                &lt;/div&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>      {/* Cover Letter End */}<br>      {/* Cover Letter Preview Start */}<br>      &lt;div className=&quot;mt-8 flow-root bg-slate-200&quot;&gt;<br>        &lt;div className=&quot;-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8&quot;&gt;<br>          &lt;div className=&quot;inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8&quot;&gt;<br>            &lt;div&gt;<br>              &lt;h2 className=&quot;text-lg font-semibold leading-6 text-gray-900 mb-4 p-2&quot;&gt;<br>                Cover Letter Preview<br>              &lt;/h2&gt;<br>              &lt;div className=&quot;min-w-full divide-y divide-gray-300&quot;&gt;<br>                {/* &lt;Thead /&gt; */}<br>                &lt;div className=&quot;divide-y divide-gray-200 bg-white&quot;&gt;<br>                  &lt;textarea<br>                    className=&quot;p-2&quot;<br>                    id=&quot;coverLetter&quot;<br>                    value={letter}<br>                    rows={20}<br>                    cols={113}<br>                  /&gt;<br>                &lt;/div&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>      {/* Cover Letter Preview End */}<br>      {/* Resume Start */}<br>      &lt;div className=&quot;mt-8 flow-root bg-slate-200&quot;&gt;<br>        &lt;div className=&quot;-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8&quot;&gt;<br>          &lt;div className=&quot;inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8&quot;&gt;<br>            &lt;h2 className=&quot;text-lg font-semibold leading-6 text-gray-900 mb-4 p-2&quot;&gt;<br>              Resume<br>            &lt;/h2&gt;<br>            &lt;div className=&quot;min-w-full divide-y divide-gray-300&quot;&gt;<br>              {/* &lt;Thead /&gt; */}<br>              &lt;div className=&quot;divide-y divide-gray-200 bg-white&quot;&gt;<br>                &lt;ReactMarkdown&gt;{resume}&lt;/ReactMarkdown&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>      {/* Resume End */}<br>      {/* Cover Letter Preview Start */}<br>      &lt;div className=&quot;mt-8 flow-root bg-slate-200&quot;&gt;<br>        &lt;div className=&quot;-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8&quot;&gt;<br>          &lt;div className=&quot;inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8&quot;&gt;<br>            &lt;div&gt;<br>              &lt;h2 className=&quot;text-lg font-semibold leading-6 text-gray-900 mb-4 p-2&quot;&gt;<br>                Cover Letter Preview<br>              &lt;/h2&gt;<br>              &lt;div className=&quot;min-w-full divide-y divide-gray-300&quot;&gt;<br>                {/* &lt;Thead /&gt; */}<br>                &lt;div className=&quot;divide-y divide-gray-200 bg-white&quot;&gt;<br>                  {/* {letter} */}<br>                  {/* &lt;ReactMarkdown&gt;{letter}&lt;/ReactMarkdown&gt; */}<br>                  &lt;textarea<br>                    className=&quot;p-2&quot;<br>                    id=&quot;resume&quot;<br>                    value={resume}<br>                    rows={20}<br>                    cols={113}<br>                  /&gt;<br>                &lt;/div&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>      {/* Cover Letter Preview End */}<br>    &lt;/div&gt;<br>  );<br>};</pre><p><strong>Step 7:</strong> Then return the CoverLetterResume component inside the CoverLetterAndResume component as shown below.</p><pre>return &lt;CoverLetterResume {...createCoverLetterAndResume}/&gt;;</pre><p><strong>Step 8:</strong> Create a folder called resumeandcoverletter in the app folder. Then, create a file called page.tsx and add the following code.</p><pre>&quot;use client&quot;;<br>import { CopilotProvider } from &quot;@copilotkit/react-core&quot;;<br>import { CopilotSidebarUIProvider } from &quot;@copilotkit/react-ui&quot;;<br>import &quot;@copilotkit/react-textarea/styles.css&quot;; // also import this if you want to use the CopilotTextarea component<br>import &quot;@copilotkit/react-ui/styles.css&quot;; // also import this if you want to use the chatbot component<br>import React, { useEffect, useState } from &quot;react&quot;;<br>import { CoverLetterAndResume } from &quot;../components/resume&quot;;</pre><pre>function buildResume () {<br>  return (<br>    &lt;CopilotProvider chatApiEndpoint=&quot;./../api/copilotkit/chat&quot;&gt;<br>      &lt;CopilotSidebarUIProvider&gt;<br>        &lt;CoverLetterAndResume /&gt;<br>      &lt;/CopilotSidebarUIProvider&gt;<br>    &lt;/CopilotProvider&gt;<br>  );<br>}</pre><pre>export default buildResume;</pre><p><strong>Step 9:</strong> Install openai package using the command below.</p><pre>npm i openai</pre><p><strong>Step 10:</strong> In the app folder, create a folder called API. Then, create a folder called copilotkit in the API folder. In the copilotkit folder, create a folder called chat. Then, create a file called route.ts in the chat folder and add the following code.</p><pre>import OpenAI from &quot;openai&quot;;</pre><pre>const openai = new OpenAI({<br>  apiKey: &quot;Your ChatGPT API key&quot;,<br>});</pre><pre>export const runtime = &quot;edge&quot;;</pre><pre>export async function POST(req: Request): Promise&lt;Response&gt; {<br>  try {<br>    const forwardedProps = await req.json();</pre><pre>    const stream = openai.beta.chat.completions<br>      .stream({<br>        model: &quot;gpt-4-1106-preview&quot;,<br>        ...forwardedProps,<br>        stream: true,<br>      })<br>      .toReadableStream();</pre><pre>    return new Response(stream);<br>  } catch (error: any) {<br>    return new Response(&quot;&quot;, { status: 500, statusText: error.error.message });<br>  }<br>}</pre><p><strong>Step 11:</strong> On the page.tsx file in the app folder, add a link in the ‘Get Started’ button that navigates to the resumeandcoverletter page, as shown below.</p><pre>&lt;div className=&quot;text-center&quot;&gt;<br>              &lt;Link<br>                className=&quot;inline-flex justify-center items-center gap-x-3 text-center bg-gradient-to-tl from-blue-600 to-violet-600 shadow-lg shadow-transparent hover:shadow-blue-700/50 border border-transparent text-white text-sm font-medium rounded-full focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2 focus:ring-offset-white py-3 px-6 dark:focus:ring-offset-gray-800&quot;<br>                href=&quot;/resumeandcoverletter&quot;&gt;<br>                Get started<br>                &lt;svg<br>                  className=&quot;flex-shrink-0 w-4 h-4&quot;<br>                  xmlns=&quot;http://www.w3.org/2000/svg&quot;<br>                  width=&quot;24&quot;<br>                  height=&quot;24&quot;<br>                  viewBox=&quot;0 0 24 24&quot;<br>                  fill=&quot;none&quot;<br>                  stroke=&quot;currentColor&quot;<br>                  stroke-width=&quot;2&quot;<br>                  stroke-linecap=&quot;round&quot;<br>                  stroke-linejoin=&quot;round&quot;&gt;<br>                  &lt;path d=&quot;m9 18 6-6-6-6&quot; /&gt;<br>                &lt;/svg&gt;<br>              &lt;/Link&gt;<br>            &lt;/div&gt;</pre><p><strong>Step 12:</strong> Navigate to <a href="http://localhost:3000/">http://localhost:3000/</a>, click the ‘Get Started’ button, and you will be redirected to the resumeandcoverletter page that is integrated with a chatbot, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*LBr7oY03paK_j3Iv.png" /></figure><p><strong>Step 13:</strong> Give the chatbot on the right side a prompt like “create a cover letter and resume.” The chatbot will start generating a response, and once it is done, it will display the generated cover letter and resume on the left side of the page, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*w2d2Uyvl-X_KTbYE.png" /></figure><h3>Creating Update Cover Letter Functionality</h3><p><strong>Step 1:</strong> Declare a variable called updateLetter that holds the cover letter generated earlier.</p><pre>const updateLetter = createCoverLetterAndResume.letter;</pre><p><strong>Step 2:</strong> Use the useMakeCopilotReadable hook to add updateLetter as context for the in-app chatbot.</p><pre>useMakeCopilotReadable(&quot;Cover Letter:&quot; + JSON.stringify(updateLetter));</pre><p><strong>Step 3:</strong> Use the useMakeCopilotActionable hook to set up an action called updateCoverLetter with a description and an implementation function that updates the createCoverLetterAndResume state with the provided cover letter update, as shown below.</p><pre>useMakeCopilotActionable(<br>    {<br>      name: &quot;updateCoverLetter&quot;,<br>      description:<br>        &quot;Update cover letter for a software developer job application.&quot;,<br>      argumentAnnotations: [<br>        {<br>          name: &quot;updateCoverLetterMarkdown&quot;,<br>          type: &quot;string&quot;,<br>          description:<br>            &quot;Update markdown text for a cover letter to introduce yourself and briefly summarize your professional background as a software developer.&quot;,<br>          required: true,<br>        },<br>        {<br>          name: &quot;resumeMarkdown&quot;,<br>          type: &quot;string&quot;,<br>          description:<br>            &quot;Markdown text for a resume that displays your professional background and relevant skills.&quot;,<br>          required: true,<br>        },<br>      ],<br>      implementation: async (updatedCoverLetterMarkdown) =&gt; {<br>        setCreateCoverLetterAndResume((prevState) =&gt; ({<br>          ...prevState,<br>          letter: updatedCoverLetterMarkdown,<br>        }));<br>      },<br>    },<br>    []<br>  );</pre><p><strong>Step 4:</strong> Give the chatbot a prompt like “Update the cover letter and add that I am applying for a technical writing role at CopilotKit.” As shown below, you can see the cover letter was updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*BR6AXC0G1EwMa6qC.png" /></figure><h3>Creating Update Resume Functionality</h3><p><strong>Step 1:</strong> Declare a variable called updateResume that holds the cover letter generated earlier.</p><pre>const updateResume = createCoverLetterAndResume.resume;</pre><p><strong>Step 2:</strong> Use the useMakeCopilotReadable hook to add updateResume as context for the in-app chatbot.</p><pre>useMakeCopilotReadable(&quot;Resume:&quot; + JSON.stringify(updateResume));</pre><p><strong>Step 3:</strong> Use the useMakeCopilotActionable hook to set up an action called updateResume with a description and an implementation function that updates the createCoverLetterAndResume state with the provided cover letter update, as shown below.</p><pre>useMakeCopilotActionable(<br>    {<br>      name: &quot;updateResume&quot;,<br>      description: &quot;Update resume for a software developer job application.&quot;,<br>      argumentAnnotations: [<br>        {<br>          name: &quot;updateResumeMarkdown&quot;,<br>          type: &quot;string&quot;,<br>          description:<br>            &quot;Update markdown text for a resume that displays your professional background and relevant skills.&quot;,<br>          required: true,<br>        },<br>      ],<br>      implementation: async (updatedResumeMarkdown) =&gt; {<br>        setCreateCoverLetterAndResume((prevState) =&gt; ({<br>          ...prevState,<br>          resume: updatedResumeMarkdown,<br>        }));<br>      },<br>    },<br>    []<br>  );</pre><p><strong>Step 4:</strong> Give the chatbot a prompt like “Update the resume and add my name as John Doe and my email as <a href="/service/mailto:johndoe@example.com">johndoe@example.com</a>.” As shown below, you can see the resume was updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*BmyB4s-PgjIm2nIH.png" /></figure><h3>Creating Download Cover Letter And Resume Pdfs Functionality</h3><p><strong>Step 1:</strong> Install jsPDF, a library for generating PDFs in JavaScript.</p><pre>npm i jspdf</pre><p><strong>Step 2:</strong> Inside the CoverLetterAndResume component, use the useMakeCopilotActionable hook to set up an action named “downloadPdfs” with a description and an implementation function that uses the jsPDF library to create PDFs for the cover letter and resume and then saves them, as shown below.</p><pre>function addTextToPDF(doc: any, text: any, x: any, y: any, maxWidth: any) {<br>    // Split the text into lines<br>    const lines = doc.splitTextToSize(text, maxWidth);</pre><pre>    // Add lines to the document<br>    doc.text(lines, x, y);<br>  }</pre><pre>  useMakeCopilotActionable(<br>    {<br>      name: &quot;downloadPdfs&quot;,<br>      description: &quot;Download pdfs of the cover letter and resume.&quot;,<br>      argumentAnnotations: [<br>        {<br>          name: &quot;coverLetterPdfA4&quot;,<br>          type: &quot;string&quot;,<br>          description:<br>            &quot;A Pdf that contains the cover letter converted from markdown text and fits A4 paper.&quot;,<br>          required: true,<br>        },<br>        {<br>          name: &quot;resumePdfA4Paper&quot;,<br>          type: &quot;string&quot;,<br>          description:<br>            &quot;A Pdf that contains the resume converted from markdown text and fits A4 paper.&quot;,<br>          required: true,<br>        },<br>      ],<br>      implementation: async () =&gt; {</pre><pre>          const marginLeft = 10;<br>          const marginTop = 10;<br>          const maxWidth = 180;</pre><pre>          const coverLetterDoc = new jsPDF();<br>          addTextToPDF(<br>            coverLetterDoc,<br>            createCoverLetterAndResume.letter,<br>            marginLeft,<br>            marginTop,<br>            maxWidth<br>          );<br>          coverLetterDoc.save(&quot;coverLetter.pdf&quot;);</pre><pre>          const resumeDoc = new jsPDF();<br>          addTextToPDF(<br>            resumeDoc,<br>            createCoverLetterAndResume.resume,<br>            marginLeft,<br>            marginTop,<br>            maxWidth<br>          );<br>          resumeDoc.save(&quot;resume.pdf&quot;);<br>      },<br>    },<br>    [createCoverLetterAndResume]<br>  );</pre><p><strong>Step 3:</strong> Go back to the chatbot in the web app and give it the prompt “Download pdfs of the cover letter and resume.” The PDFs will start downloading, and if you open the coverLetter.pdf, you should see the cover letter generated, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*q9ShP64i9SSIcfaB.png" /></figure><h3>Conclusion</h3><p>In conclusion, you can use CopilotKit to build in-app AI chatbots that can see the current app state and take action inside your app. The AI chatbot can talk to your app frontend, backend, and third-party services.</p><p>For the full source-code: <br><a href="https://github.com/TheGreatBonnie/AIPoweredResumeBuilder">https://github.com/TheGreatBonnie/AIPoweredResumeBuilder</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9dfefc5658b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[✨7 Libraries to Build Cutting-Edge AI Features (like a Ninja) ️]]></title>
            <link>https://medium.com/@uli_69172/7-libraries-to-build-cutting-edge-ai-features-like-a-ninja-%EF%B8%8F-7592eb2647c7?source=rss-dda62c58fe84------2</link>
            <guid isPermaLink="false">https://medium.com/p/7592eb2647c7</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Uliyahoo]]></dc:creator>
            <pubDate>Fri, 26 Jan 2024 13:02:16 GMT</pubDate>
            <atom:updated>2024-01-26T13:02:16.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*IRot-lPNFnpJPWTzuNKTnQ.gif" /></figure><p>With the right libraries any developer can build powerful AI features into their applications.</p><p>In this list, I’ve compiled 7 awesome AI libraries you can use to (relatively) easily ship features today.</p><p>Don’t forget to star these libraries to show them your support.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*BPQy3_fN0T0IFvJe.gif" /></figure><p><a href="https://github.com/CopilotKit/CopilotKit">Star ⭐️</a></p><h3>1. <a href="https://github.com/CopilotKit/CopilotKit">CopilotPortal</a>: Build an app-native AI chatbot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*v31PJN2hv3FdbbOv.png" /></figure><p>In-app AI chatbot assistant that can ‘see’ your current app state and take actions in the frontend and backend.</p><p>A set of fully customizable react components &amp; hooks and the architecture for establishing the interaction between the LLM and your app.</p><p>Define <em>useMakeCopilotReadable</em>, <em>useMakeCopilotActionable</em>, and <em>CopilotSidebarUIProvider</em> to get it running.</p><pre>import &quot;@copilotkit/react-ui/styles.css&quot;;<br>import { CopilotProvider } from &quot;@copilotkit/react-core&quot;;<br>import { CopilotSidebarUIProvider } from &quot;@copilotkit/react-ui&quot;;</pre><pre>export default function App(): JSX.Element {<br>  return (<br>  &lt;CopilotProvider chatApiEndpoint=&quot;/api/copilotkit/chat&quot;&gt;<br>      &lt;CopilotSidebarUIProvider&gt;</pre><pre>        &lt;YourContent /&gt;</pre><pre>      &lt;/CopilotSidebarUIProvider&gt;<br>    &lt;/CopilotProvider&gt;<br>  );<br>}</pre><p><a href="https://github.com/CopilotKit/CopilotKit">Star CopilotPortal ⭐️</a></p><h3>2. <a href="https://github.com/gabrielchua/RAGxplorer">RAGxplorer</a> — Visualise and explore your RAG documents</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*8pIduuDlrvvef0tg.png" /></figure><p>RAGxplorer is a Python tool for visualizing RAG (Retrieval-Augmented Generation) documents in machine learning and natural language processing.</p><p>Interactively explore the connections and content within docs used in your RAG process.</p><p>To set up RAGxplorer, define your RAG checkpoint path in the code and install the specified dependencies.</p><pre>import streamlit as st<br>from utils.rag import build_vector_database</pre><pre>st.set_page_config(page_title=&quot;RAGxplorer&quot;, page_icon=&quot;🔍&quot;)<br>uploaded_file = st.file_uploader(&quot;Upload your PDF&quot;, type=&#39;pdf&#39;)<br>query = st.text_input(&quot;Enter your query&quot;)<br>search = st.button(&quot;Search&quot;)<br>top_k = st.number_input(&quot;Number of Chunks&quot;, value=5, min_value=1)<br>st.session_state[&quot;chroma&quot;] = build_vector_database(uploaded_file, ...)<br>st.session_state[&#39;retrieved_id&#39;] = query_chroma(...)<br>plot_embeddings(...)</pre><p><a href="https://github.com/gabrielchua/RAGxplorer">Star RAGxplorer ⭐️</a></p><h3>3. <a href="https://github.com/assafelovic/gpt-researcher">Tavily GPT Researcher</a> — Get an LLM to Search the Web &amp; Databases</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*-WGUVwCDKwEZrBsF.png" /></figure><p>Tavily enables you to add GPT-powered research and content generation tools to your React applications, enhancing their data processing and content creation capabilities.</p><pre># Create an assistant<br>assistant = client.beta.assistants.create(<br>    instructions=assistant_prompt_instruction,<br>    model=&quot;gpt-4-1106-preview&quot;,<br>    tools=[{<br>        &quot;type&quot;: &quot;function&quot;,<br>        &quot;function&quot;: {<br>            &quot;name&quot;: &quot;tavily_search&quot;,<br>            &quot;description&quot;: &quot;Get information on recent events from the web.&quot;,<br>            &quot;parameters&quot;: {<br>                &quot;type&quot;: &quot;object&quot;,<br>                &quot;properties&quot;: {<br>                    &quot;query&quot;: {&quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;The search query to use. For example: &#39;Latest news on Nvidia stock performance&#39;&quot;},<br>                },<br>                &quot;required&quot;: [&quot;query&quot;]<br>            }<br>        }<br>    }]<br>)</pre><p><a href="https://github.com/assafelovic/gpt-researcher">Star Tavily ⭐️</a></p><h3>4. <a href="https://github.com/pezzolabs/pezzo">Pezzo.ai</a> — Developer first LLMOps platform</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*md9JZuKmuEVCnxaD.jpeg" /></figure><p>Centralized platform for managing your OpenAI calls.</p><p>Optimize your prompts &amp; token use. Keep track of your AI use.</p><p>Free &amp; easy to integrate.</p><pre>const prompt = await pezzo.getPrompt(&quot;AnalyzeSentiment&quot;);<br>const response = await openai.chat.completions.create(prompt);</pre><p><a href="https://github.com/pezzolabs/pezzo">Star Pezzo ⭐️</a></p><h3>5. <a href="https://github.com/confident-ai/deepeval">DeepEval</a> — Evaluate LLM, RAG &amp; Fine-Tuning Performance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*mG75DYSxnQVifid3.jpeg" /></figure><p>DeepEval is an open-source framework that simplifies the evaluation of LLMs by treating evaluations as unit tests.</p><p>It provides various metrics to assess LLM outputs, and its modular design allows developers to customize their evaluation pipelines</p><p>To use it, you install the library, write test cases, and run these to evaluate your LLM’s performance.</p><pre>Pytest Integration: </pre><pre>from deepeval import assert_test<br>from deepeval.metrics import HallucinationMetric<br>from deepeval.test_case import LLMTestCase</pre><pre>test_case = LLMTestCase(<br> input=&quot;How many evaluation metrics does DeepEval offers?&quot;,<br> actual_output=&quot;14+ evaluation metrics&quot;,<br> context=[&quot;DeepEval offers 14+ evaluation metrics&quot;]<br>)<br>metric = HallucinationMetric(minimum_score=0.7)</pre><pre>def test_hallucination():<br>  assert_test(test_case, [metric])</pre><p><a href="https://github.com/confident-ai/deepeval">Star DeepEval ⭐️</a></p><h3>6. <a href="https://github.com/RecursivelyAI/CopilotKit">CopilotTextarea</a> — AI-powered Writing in React Apps</h3><p>GIF</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*_uch4_NMKJCot3oP.gif" /></figure><p>A drop-in replacement for any react &lt;textarea&gt; with the features of Github CopilotX.</p><p>Autocompletes, insertions, edits.</p><p>Can be fed any context in real time or by the developer ahead of time.</p><pre>import { CopilotTextarea } from &quot;@copilotkit/react-textarea&quot;;<br>import { CopilotProvider } from &quot;@copilotkit/react-core&quot;;<br></pre><pre>// Provide context...<br>useMakeCopilotReadable(...)</pre><pre>// in your component...<br>&lt;CopilotProvider&gt;<br>    &lt;CopilotTextarea/&gt;<br>&lt;/CopilotProvider&gt;`</pre><p><a href="https://github.com/RecursivelyAI/CopilotKit">Star CopilotTextarea ⭐️</a></p><h3>7.<a href="https://github.com/swirlai/swirl-search">SwirlSearch</a> — AI powered search.</h3><p>GIF</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*N20ldHp7LPy5V9Po.gif" /></figure><p>Swirl Search is an open-source platform that uses AI to search multiple data sources simultaneously and to provide drafted reports on them.</p><p>It can search across various sources, including search engines, databases, and cloud services, and is designed to be set up easily by following the installation instructions provided in the repository.</p><p>Swirl Search is built on the Python/Django stack, released under the Apache 2.0 license, and is available as a Docker image, making it accessible and customizable for users.</p><p><a href="https://github.com/swirlai/swirl-search">Star SwirlSearch ⭐️</a></p><p>Thanks for reading! Don’t forget to bookmark the article, give your reactions, and to support and checkout the awesome libraries mentioned.</p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7592eb2647c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[✨ 7 AI Libraries EVERY Dev Needs to Know (to be a wiz)‍♂️ ]]></title>
            <link>https://medium.com/@uli_69172/7-ai-libraries-every-dev-needs-to-know-to-be-a-wiz-%EF%B8%8F-1594782f7fae?source=rss-dda62c58fe84------2</link>
            <guid isPermaLink="false">https://medium.com/p/1594782f7fae</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Uliyahoo]]></dc:creator>
            <pubDate>Tue, 05 Dec 2023 20:46:17 GMT</pubDate>
            <atom:updated>2023-12-05T20:46:17.642Z</atom:updated>
            <content:encoded><![CDATA[<h3>TL;DR</h3><p>These days, any dev can build powerful things with AI.</p><p>No need to be a ML expert.</p><p>Here are the 7 best libraries you can use to supercharge your development and to impress users with state-of-the-art AI features.</p><p>These can give your project magical powers, so DON’T FORGET TO STAR &amp; SUPPORT THEM 🌟</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*lP2Q8B5rQZiXm61YrObqrQ.gif" /></figure><h3>1. <a href="https://github.com/RecursivelyAI/CopilotKit">CopilotTextarea</a> — AI-powered Writing in React Apps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*oZonuOK2w76oxc7X.png" /></figure><p>A drop-in replacement for any react &lt;textarea&gt; with the features of Github CopilotX.</p><p>Autocompletes, insertions, edits.</p><p>Can be fed any context in real time or by the developer ahead of time.</p><pre>import { CopilotTextarea } from &quot;@copilotkit/react-textarea&quot;;<br>import { CopilotProvider } from &quot;@copilotkit/react-core&quot;;<br></pre><pre>// Provide context...<br>useMakeCopilotReadable(...)</pre><pre>// in your component...<br>&lt;CopilotProvider&gt;<br>    &lt;CopilotTextarea/&gt;<br>&lt;/CopilotProvider&gt;`</pre><p><a href="https://github.com/RecursivelyAI/CopilotKit">Star CopilotTextarea ⭐️</a></p><h3>2. Tavily GPT Researcher — Get an LLM to Search the Web &amp; Databases</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*_O_CYegjR1byC0kt.png" /></figure><p>Tavily enables you to add GPT-powered research and content generation tools to your React applications, enhancing their data processing and content creation capabilities.</p><pre># Create an assistant<br>assistant = client.beta.assistants.create(<br>    instructions=assistant_prompt_instruction,<br>    model=&quot;gpt-4-1106-preview&quot;,<br>    tools=[{<br>        &quot;type&quot;: &quot;function&quot;,<br>        &quot;function&quot;: {<br>            &quot;name&quot;: &quot;tavily_search&quot;,<br>            &quot;description&quot;: &quot;Get information on recent events from the web.&quot;,<br>            &quot;parameters&quot;: {<br>                &quot;type&quot;: &quot;object&quot;,<br>                &quot;properties&quot;: {<br>                    &quot;query&quot;: {&quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;The search query to use. For example: &#39;Latest news on Nvidia stock performance&#39;&quot;},<br>                },<br>                &quot;required&quot;: [&quot;query&quot;]<br>            }<br>        }<br>    }]<br>)</pre><p><a href="https://github.com/assafelovic/gpt-researcher">Star Tavily ⭐️</a></p><h3>3. Pezzo.ai — Observability, Cost &amp; Prompt Engineering Platform</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*B4cHUuqpkV_2Xwgk.jpeg" /></figure><p>Centralized platform for managing your OpenAI calls.</p><p>Optimize your prompts &amp; token use. Keep track of your AI use.</p><p>Free &amp; easy to integrate.</p><pre>const prompt = await pezzo.getPrompt(&quot;AnalyzeSentiment&quot;);<br>const response = await openai.chat.completions.create(prompt);</pre><p><a href="https://github.com/pezzolabs/pezzo">Star Pezzo ⭐️</a></p><h3>4. <a href="https://github.com/RecursivelyAI/CopilotKit">CopilotPortal</a>: Embed an actionable LLM chatbot inside your app.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*_3wmmXjIJeddkITL.png" /></figure><p>A context-aware LLM chatbot inside your application that answers questions and takes actions.</p><p>Get a working chatBot with a few lines of code, then customize and embed as deeply as you need to.</p><pre>import &quot;@copilotkit/react-ui/styles.css&quot;;<br>import { CopilotProvider } from &quot;@copilotkit/react-core&quot;;<br>import { CopilotSidebarUIProvider } from &quot;@copilotkit/react-ui&quot;;</pre><pre>export default function App(): JSX.Element {<br>  return (<br>  &lt;CopilotProvider chatApiEndpoint=&quot;/api/copilotkit/chat&quot;&gt;<br>      &lt;CopilotSidebarUIProvider&gt;</pre><pre>        &lt;YourContent /&gt;</pre><pre>      &lt;/CopilotSidebarUIProvider&gt;<br>    &lt;/CopilotProvider&gt;<br>  );<br>}</pre><p><a href="https://github.com/RecursivelyAI/CopilotKit">Star CopilotPortal ⭐️</a></p><h3>5. LangChain — Pull together AIs into action chains.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*KAqq0e4VUbiEcrqQ.png" /></figure><p>Easy-to-use API and library for adding LLMs into apps.</p><p>Link together different AI components and models.</p><p>Easily embed context and semantic data for powerful integrations.</p><pre>from langchain.llms import OpenAI<br>from langchain import PromptTemplate<br>llm = OpenAI(model_name=&quot;text-davinci-003&quot;, openai_api_key=&quot;YourAPIKey&quot;)  # Notice &quot;food&quot; below, that is a placeholder for another value later<br>template = &quot;&quot;&quot; I really want to eat {food}. How much should I eat? Respond in one short sentence &quot;&quot;&quot;</pre><pre>prompt = PromptTemplate(<br>    input_variables=[&quot;food&quot;],<br>    template=template,<br>)</pre><pre>final_prompt = prompt.format(food=&quot;Chicken&quot;)</pre><pre>print(f&quot;Final Prompt: {final_prompt}&quot;)</pre><pre>print(&quot;-----------&quot;)</pre><pre>print(f&quot;LLM Output: {llm(final_prompt)}&quot;)</pre><p><a href="https://github.com/langchain-ai/langchain">Star LangChain ⭐️</a></p><h3>6. <a href="https://github.com/weaviate/weaviate">Weaviate</a> — Vector Database for AI-Enhanced Projects</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*uvvdhtCJAiuWnMmn.png" /></figure><p>Weaviate is a vector database optimized for fast, efficient searches across large datasets.</p><p>It supports integration with AI models and services from providers like OpenAI and Hugging Face, enabling advanced tasks such as data classification and natural language processing.</p><p>It’s a cloud-native solution and highly scalable to meet evolving data demands.</p><pre>import weaviate<br>import json</pre><pre>client = weaviate.Client(<br>    embedded_options=weaviate.embedded.EmbeddedOptions(),<br>)</pre><pre>uuid = client.data_object.create({</pre><pre>})</pre><pre>obj = client.data_object.get_by_id(uuid, class_name=&#39;MyClass&#39;)</pre><pre>print(json.dumps(obj, indent=2))</pre><p><a href="https://github.com/weaviate/weaviate">Star Weaviate ⭐️</a></p><h3>7. <a href="https://github.com/imartinez/privateGPT">PrivateGPT</a> — Chat with your Docs, 100% privately 💡</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*zE6FU4ML1XCZW5sx.jpg" /></figure><p>PrivateGPT allows for secure, GPT-driven document interaction within your applications, ensuring data privacy and enhancing context-aware processing capabilities.</p><p>PrivateGPT ensures privacy by locally processing and storing documents and context, without sending data to external servers.</p><pre>from privategpt import PrivateGPT, DocumentIngestion, ChatCompletion</pre><pre>client = PrivateGPT(api_key=&#39;your_api_key&#39;)</pre><pre>def process_documents_and_chat(query, documents):<br>    ingestion_result = DocumentIngestion(client, documents)<br>    chat_result = ChatCompletion(client, query, context=ingestion_result.context)<br>    return chat_result</pre><pre>documents = [&#39;doc1.txt&#39;, &#39;doc2.txt&#39;]<br>query = &quot;What is the summary of the documents?&quot;<br>result = process_documents_and_chat(query, documents)<br>print(result)</pre><p><a href="https://github.com/imartinez/privateGPT">Star PrivateGPT ⭐️</a></p><h3>[Bonus Library]. SwirlSearch — AI powered search.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*L85Tfv2lL8JtEs7S.png" /></figure><p>LLM-powered search, summaries and output.</p><p>Searches multiple content sources simultaneously into integrated output.</p><p>Powerful for tailored in-app integrations of various data sources.</p><p><a href="https://github.com/swirlai/swirl-search">Star SwirlSearch ⭐️</a></p><p>Thanks for reading!</p><p>I hope these help you build some awesome stuff with AI.</p><p>Please like if you enjoyed &amp; comment any other libraries or topics you would like to see.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1594782f7fae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>