<?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 Venkata Yedida on Medium]]></title>
        <description><![CDATA[Stories by Venkata Yedida on Medium]]></description>
        <link>https://medium.com/@venkatayedida?source=rss-b2c6d18bc47e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*xgLZqzK9w0uAlpbF</url>
            <title>Stories by Venkata Yedida on Medium</title>
            <link>https://medium.com/@venkatayedida?source=rss-b2c6d18bc47e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 21:32:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@venkatayedida/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[Using Llama2 LLM from Ollama]]></title>
            <link>https://medium.com/@venkatayedida/the-simplest-way-to-access-llm-in-the-local-dcf6c406dbfe?source=rss-b2c6d18bc47e------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcf6c406dbfe</guid>
            <dc:creator><![CDATA[Venkata Yedida]]></dc:creator>
            <pubDate>Fri, 01 Mar 2024 05:13:15 GMT</pubDate>
            <atom:updated>2024-03-04T18:58:22.154Z</atom:updated>
            <content:encoded><![CDATA[<p>We can run LLMs locally with the help of <a href="https://ollama.com/blog">Ollama</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LerIVun83OTTEZFAZ7D8KQ.png" /><figcaption>Running Large Language models with Ollama</figcaption></figure><p><strong>What are the main benefits of Ollama?</strong></p><p>Ollama is a tool that allows users to set up and run large language models (LLM) locally. The main advantage that Ollama provides is great power to leverage powerful language models. On top of that, users can customize their models.</p><p><strong>Ollama Supporting platforms:</strong></p><p>Mac, Linux, and Windows (preview)</p><p><strong>Features:</strong></p><ul><li>Run large language models locally.</li><li>Support models like Llama 2, Mistral, Gemma 2B, Gemma 7B, LLaVA and many more</li><li>Can customize models based on user needs.</li><li>easy setup with user-friendly UI</li></ul><p><strong>How to Run locally?</strong></p><p><strong>Step 1: Download and Installation</strong></p><p>macOS — <a href="https://ollama.com/download/Ollama-darwin.zip">Download</a> (and install)</p><p>Linux</p><pre>curl -fsSL https://ollama.com/install.sh | sh</pre><p>Windows OS (Preview) — <a href="https://ollama.com/download/OllamaSetup.exe">Download</a> (and install)</p><p>Docker — <a href="https://hub.docker.com/r/ollama/ollama">Ollama Docker image</a> (pull and run it )</p><p><strong>Step 2: Run it</strong></p><p>Linux:</p><p>a. you can run “ollama” in your terminal. If it&#39;s installed successfully you will see help commands.</p><p>b. run : “ollama serve”</p><p>c. run: “ollama run modelname” . (model name can be: llama2)</p><p><strong>Step 3: Ready to use</strong></p><p><strong>Frequently Asked Questions:</strong></p><p><strong>Can I run LLM’s locally?</strong></p><p>Yes you can with <a href="https://ollama.com/">Ollama</a></p><p><strong>How much RAM I should have to run locally?</strong></p><p>Depends on the model you choose to run and the parameters. Varies from 8GB to 32GB</p><p><strong>Do I have to pay for usage?</strong></p><p>Ollama is open-source, so it does not cost.</p><p><strong>Does it take hours to run?</strong></p><p>It’s not usually if you have good internet and a machine minimum of 8GB RAM. you can get it up and running in minutes.</p><p><strong>How to reach the community?</strong></p><p>You can reach the community at Ollama <a href="https://discord.com/invite/ollama">Discord</a></p><p><strong>References:</strong></p><ul><li><a href="https://ollama.com/">Ollama</a></li><li>Ollama <a href="https://github.com/ollama/ollama.git">GitHub</a></li><li>Ollama <a href="https://ollama.com/library">Model Library</a></li><li>Llama2: Meta’s foundational “open source” model.</li></ul><p>#ollama #llm #opensourcetools #ai</p><p><strong>Video</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_83Cb0li1ko&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_83Cb0li1ko&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/39fc752f7eb732c48809f91fe2c40ffd/href">https://medium.com/media/39fc752f7eb732c48809f91fe2c40ffd/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcf6c406dbfe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Gemma from HugginFace in Python]]></title>
            <link>https://medium.com/@venkatayedida/using-gemma-from-python-8cefd3cc0e85?source=rss-b2c6d18bc47e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cefd3cc0e85</guid>
            <category><![CDATA[google-llm]]></category>
            <category><![CDATA[llm-model]]></category>
            <category><![CDATA[google-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[gemma]]></category>
            <dc:creator><![CDATA[Venkata Yedida]]></dc:creator>
            <pubDate>Sun, 25 Feb 2024 21:36:34 GMT</pubDate>
            <atom:updated>2024-02-25T22:47:16.219Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I will try to explain step by step how to consume the gemma model from HuggingFace in Python code.</p><figure><img alt="Gemma Graphic image" src="https://cdn-images-1.medium.com/max/687/1*oUzj9cozTU4hPd4KfGB1Tw.png" /><figcaption>Geema LLM from Google</figcaption></figure><p>There are different ways to consume Gemma models, One of the ways is with <a href="https://huggingface.co/blog/gemma">HuggingFace</a> and I will try to explain how we can consume them. Google made it easy to consume Gemma LLMs.</p><p>It is easy to consume gemma models but make sure you meet some configurations while you are implementing this. Will try to cover the configurations in the article.</p><p><strong>Step 1</strong>: <strong>Project Set up</strong></p><p>Create a new project (gemma-test) in IDE (I am using for this example IntelliJ IDEA) and create a new file with the .py extension (gemma-7b.py). We will try to consume the Gemma 7b model from Google.</p><p>If you are running the model in CPU, you can use the below code from HuggingFace. Basically in this code, we will consume gemma from transformers.</p><p>Note: you can use python3 as an interpreter for this project.</p><pre>from transformers import AutoTokenizer, AutoModelForCausalLM<br><br>tokenizer = AutoTokenizer.from_pretrained(&quot;google/gemma-7b&quot;)<br>model = AutoModelForCausalLM.from_pretrained(&quot;google/gemma-7b&quot;)<br><br>input_text = &quot;what you know about universe&quot;<br>input_ids = tokenizer(input_text, return_tensors=&quot;pt&quot;)<br><br>outputs = model.generate(**input_ids)<br>print(tokenizer.decode(outputs[0]))</pre><ul><li>We created a new project and Python file with transformer code to consumer Gemma. Select Python as an interpreter in the project, this comes if you already installed Python.</li></ul><p><strong>Step 2:</strong> <strong>Virtual Environment Set up</strong></p><p>Before running the gemma-7b.py file. It is good to set up a virtual environment (venv) for several reasons like dependency management and version management.</p><p>To set up the virtual environment you can run,</p><p><strong>Create the Virtual Environment:</strong></p><pre>cd path/to/your/project<br>python3 -m venv venv<br>source venv/bin/activate # On Linux or macOS <br>venv\Scripts\activate # On windows</pre><ul><li>We created a virtual environment for Python3 and activated it.</li></ul><p><strong>Step 3: Install Dependencies:</strong></p><p>To install the dependencies create a requirements.txt file and this will install dependencies in a new virtual environment. For consuming gemma from HuggingFace we will use a transformer and torch dependencies,</p><pre>transformers==4.38.1<br>torch==2.2.1</pre><p>requirements.txt is used to manage project dependencies. Run the pip command to get installed the dependencies.</p><pre>pip install --upgrade pip # is used to upgrade python installer for package <br>pip install -r requirements.txt</pre><ul><li>We installed the dependencies needed before running the Python file to the consumer gemma model from HuggingFace.</li></ul><p><strong>Step 4: Let’s run the gemma.py</strong></p><p>To run the gemma-7b.py file created, we can use,</p><pre>python3 gemma-7b.py</pre><p><strong>Step5: Final Outcome</strong></p><p>Once the model is downloaded and loaded, you will answer for the input_text that is provided in the code (gemma-7b-py).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KmfDTKk-QIlYP6nbrGXb-A.png" /></figure><p>Note: The first time when you run the py file it will take time to download the models and they will stored in the cache. When you run it next time it fetches from the cache.</p><p><strong>Helpful Troubleshoot steps:</strong></p><ul><li>Before you run the Python file, log in to HiggingFace with the API key from CLI.</li><li>The most common error: “<em>ValueError: Tokenizer class GemmaTokenizer does not exist or is not currently imported.” </em>To solve this error try to uninstall the pip transformers package “pip uninstall transformers” and install again by running “pip install -U transformers”. It has solved the error.</li><li>If you get any errors please feel free to reach out, will try to help.</li></ul><p><strong>Summary:</strong></p><ul><li>We created a new project and Python file with transformer code to consumer Gemma. Select Python as an interpreter in the project, this comes if you already installed Python.</li><li>We created a virtual environment for Python3 and activated it.</li><li>We installed the dependencies needed before running the Python file to the consumer gemma model from HuggingFace.</li></ul><p><strong>References:</strong></p><ul><li><a href="https://blog.google/technology/developers/gemma-open-models/">Gemma: Introducing new state-of-the-art open models</a></li><li><a href="https://huggingface.co/blog/gemma">Welcome Gemma — Google’s new open LLM</a></li><li>HuggingFace API Key generation: <a href="https://huggingface.co/settings/tokens">https://huggingface.co/settings/tokens</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cefd3cc0e85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basics of Linters]]></title>
            <link>https://medium.com/@venkatayedida/linters-7d8f50f605a9?source=rss-b2c6d18bc47e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d8f50f605a9</guid>
            <category><![CDATA[code-linters]]></category>
            <dc:creator><![CDATA[Venkata Yedida]]></dc:creator>
            <pubDate>Sat, 02 Sep 2023 07:20:38 GMT</pubDate>
            <atom:updated>2023-09-13T15:42:54.758Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ODzMeWUc2RsUt3QG" /></figure><p><strong>What are Linters?</strong></p><p>Linters are tools that <strong>analyze your source code to flag programming errors, bugs, stylistic errors, and suspicious constructs</strong>. They play a crucial role in maintaining code quality and consistency in software development. Linters can be used for various programming languages and can help identify issues that might otherwise lead to runtime errors or unexpected behavior.</p><p>Here are some key features and benefits of using linters:</p><ol><li><strong>Code Quality:</strong> Linters help improve the overall quality of your code by identifying potential issues early in the development process. This can lead to fewer bugs and smoother code reviews.</li><li><strong>Consistency</strong>: Linters enforce coding standards and best practices, ensuring that all developers on a team follow the same conventions. This makes the codebase more readable and maintainable.</li><li><strong>Static Analysis</strong>: Linters perform static code analysis, meaning they analyze the code without executing it. This allows them to catch issues that might not be immediately obvious during development.</li><li><strong>Syntax and Style Checking:</strong> Linters check for correct syntax and coding style based on predefined rules. This helps prevent common mistakes and enforces consistent formatting.</li><li><strong>Code Smells</strong>: Linters can identify “code smells,” which are indications of potential problems, such as long functions, complex conditions, or duplicated code.</li><li><strong>Security</strong>: Some linters can also identify security vulnerabilities or potential security risks in your code, helping you write more secure software.</li><li><strong>Customization</strong>: Linters often allow you to customize the rules and configurations according to your project’s requirements. This flexibility ensures that you can tailor the linting process to your specific needs.</li><li><strong>Integration</strong>: Linters can be integrated into your development workflow, including code editors, continuous integration (CI) pipelines, and version control systems. This ensures that code is consistently checked before it gets merged or deployed.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d8f50f605a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basics of Hoppscotch (API Testing Platform)]]></title>
            <link>https://medium.com/@venkatayedida/basics-of-hoppscotch-api-testing-platform-63578eade418?source=rss-b2c6d18bc47e------2</link>
            <guid isPermaLink="false">https://medium.com/p/63578eade418</guid>
            <category><![CDATA[api-testing-tools]]></category>
            <category><![CDATA[api-test-automation]]></category>
            <category><![CDATA[api-test]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[api-testing]]></category>
            <dc:creator><![CDATA[Venkata Yedida]]></dc:creator>
            <pubDate>Tue, 18 Jul 2023 12:05:34 GMT</pubDate>
            <atom:updated>2023-09-11T14:37:43.496Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhREmAOzm-2smwCPaZIF9w.png" /></figure><p><strong>What is Hoppscotch ?</strong></p><p>Hoppscotch is a lightweight <strong>free</strong> and <strong>open-source</strong> <strong>API development and testing tool</strong> that provides a user-friendly interface for interacting with APIs. It is available as a <strong>web application </strong>and as a <strong>browser extension</strong>, making it easily accessible and convenient for developers and testers.</p><p>The primary goal of Hoppscotch is to simplify the process of testing and debugging APIs by providing a straightforward and intuitive user interface.</p><p><strong>Protocols Supported:</strong></p><ul><li><a href="https://docs.hoppscotch.io/documentation/protocols/rest">REST platform</a></li><li><a href="https://docs.hoppscotch.io/documentation/protocols/graphql">GraphQL platform</a></li><li><a href="https://docs.hoppscotch.io/documentation/protocols/realtime">Realtime platform</a></li></ul><p><strong>Features of Hoppscotch</strong></p><ul><li><strong>REST API Testing</strong>: Hoppscotch’s REST API platform allows you to test and troubleshoot our API endpoints quickly and easily. You can handle your API requests more efficiently by utilizing capabilities such as environments, collections, and history.</li><li><strong>GraphQL API Testing: </strong>Hoppscotch’s GraphQL API platform allows you to test and play with GraphQL. GraphQL platform also supports environments, collections, and history.</li><li><strong>Realtime API Testing: </strong>Hoppscotch’s Realtime API platform enables to test of real-time APIs easily, currently it supports different protocols like WebSocket, SSE, Socket.IO, and MQTT</li><li><strong>Environments</strong>: An environment facilitates the creation of variables that can be reused in requests and scripts. Environments are especially helpful when managing shared data with a group. To use the same set of requests (collections) in different environments, we can construct environments like dev, staging, and prod.</li><li><strong>Workspaces: </strong>Hoppscotch allows you to use your own workspace known as “My Workspace” or establish a workspace for your teams to collaborate on. We can create a team (workspace) and invite team members to the required workspace, and the three roles that assist members in the workspace are Owner, Editor, and Viewer.</li><li><strong>Interceptor: </strong>Hoppscotch Interceptor works as a middleware layer between the client and the server, enabling users to inspect and modify the data flowing between them. It is particularly useful for testing APIs with different headers, query parameters, or authentication methods.</li><li><strong>Scripts: </strong>Hoppscotch provides JavaScript APIs for writing pre-request scripts and building tests with the “pw” object.</li><li><strong>Collections: </strong>Hoppscotch uses collections to help you arrange your API calls. You can make collections and populate them with requests to share with your team or utilize later. Hoppscotch, OpenAPI, and Postman collections can also be imported and exported.</li><li><strong>History</strong>: Hoppscotch keeps track of your requests and responses.</li><li><strong>Authorization: </strong>Hoppsctoch provides an Authorization feature in REST, and GraphQL platforms to authenticate your APIs. Currently it supports Basic Auth, Bearer Token, OAuth 2.0, and API Key</li><li><strong>User Experience- Shortcuts</strong>: Hoppscotch provides you with a shortcut menu that helps to navigate the UI, which helps to improve the user experience</li><li><strong>User Experience — Customization: </strong>Hoppscotch helps you to customize your experience.</li></ul><p><strong>History of Hoppscotch</strong></p><p><a href="https://dev.to/liyasthomas">Liyas Thomas</a> created Hoppscotch, below is the story from Liyas,</p><blockquote><strong><em>Story this far:</em></strong><em> I joined Zartek, which is a start-up based in Kochi, Kerala where I work as a full-stack developer.</em></blockquote><blockquote><em>The story behind Hoppscotch: The very first task I was assigned is an API integration of an old project. That’s when I came across Postman API testing tool. Postman has separate builds targeted to each operating system made with Electron. I use a low-end PC and can’t possibly afford to run another Electron app. From that moment onwards, I wanted to make an API testing platform which is:</em></blockquote><blockquote><em>Open Sourced 💚</em></blockquote><blockquote><em>Runs online</em></blockquote><blockquote><em>Have multi-platform support</em></blockquote><blockquote><em>Have multi-device support</em></blockquote><blockquote><em>Accessible from anywhere</em></blockquote><blockquote><em>That’s how Hoppscotch was born (this is not at all an alternative to Postman — yet, it does the job very beautifully and minimally. It needs more features and love which I hope we all can give by </em><a href="https://github.com/hoppscotch/hoppscotch"><em>contributing on GitHub</em></a><em>).</em></blockquote><blockquote><em>When I did a background check on API request builders, Postman offered various Plans &amp; Pricing, there were a lot of other API request builders based on cURL, etc. But none of them seems simple, minimal, and efficient.</em></blockquote><blockquote><em>That’s why I created my own API request builder with pure JavaScript (I used Vue.js) + HTML + CSS 💖</em></blockquote><p>Hoppscotch, previously known as Postwoman, is an open-source project with an interesting history. Here’s a brief overview of its evolution:</p><ol><li>Postwoman (2019–2020): As mentioned above Postwoman was initially created by Liyas Thomas, an open-source enthusiast and software developer. It started as a side project, aiming to provide developers with a simple and efficient way to interact with APIs. The tool gained popularity quickly due to its user-friendly interface and capabilities, attracting a growing community of users and contributors.</li><li>Renaming to Hoppscotch (2020): In November 2020, the project underwent a name change from “Postwoman” to “Hoppscotch.” The decision to rebrand the tool was made to avoid potential trademark conflicts and to give the project a distinct identity. Despite the name change, the core functionality and purpose of the tool remained the same.</li><li>Continued Development and Community Support: After the rebranding, Hoppscotch continued to see active development and gained even more popularity among developers. The project remained open-source, which allowed the community to contribute code improvements, new features, and bug fixes. Hoppscotch also started to receive positive feedback and praise from developers who found it to be a valuable tool for API development and testing.</li><li>Expansion of Features: Over time, Hoppscotch evolved to include additional features and enhancements, such as support for environment variables, authentication methods, and the ability to organize API requests into collections. These improvements further solidified its position as a robust API development and testing tool.</li><li>Web and Browser Extension Versions: Hoppscotch is available as a web application that users can access through their browsers. Additionally, it is available as a browser extension, making it even more convenient for developers to access and use the tool while working on different projects.</li><li>Active Community and GitHub Repository: Hoppscotch’s active community of users and contributors continues to play a vital role in its development and success. The GitHub repository of Hoppscotch serves as a central hub for discussing new ideas, reporting bugs, submitting pull requests, and keeping track of the tool’s progress.</li></ol><p>As with any open-source project, the history of Hoppscotch is ongoing, and its development and growth are driven by the contributions and support of the community. The tool’s commitment to being free, open-source, and user-friendly makes it a popular choice for developers seeking a straightforward solution for API development and testing.</p><p><strong>Why Hoppscotch and How to use Hoppscotch ? &gt; WIP</strong></p><p><strong>References</strong></p><ol><li><a href="https://docs.hoppscotch.io/guides/getting-started/introduction">https://docs.hoppscotch.io/guides/getting-started/introduction</a></li><li><a href="https://github.com/hoppscotch/hoppscotch">https://github.com/hoppscotch/hoppscotch</a></li><li><a href="https://dev.to/liyasthomas/i-created-postwoman-an-online-open-source-api-request-builder-41md">https://dev.to/liyasthomas/i-created-postwoman-an-online-open-source-api-request-builder-41md</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63578eade418" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Regression Analysis in Machine Learning]]></title>
            <link>https://medium.com/@venkatayedida/regression-analysis-in-machine-learning-5fdb835df57f?source=rss-b2c6d18bc47e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fdb835df57f</guid>
            <dc:creator><![CDATA[Venkata Yedida]]></dc:creator>
            <pubDate>Sat, 04 Feb 2023 19:32:29 GMT</pubDate>
            <atom:updated>2023-02-04T19:32:29.241Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is Regression Analysis?</strong></p><p>Regression analysis in machine learning is a method used to predict a numerical value based on other information. It’s like trying to guess a number based on some clues. For example, if you want to predict the price of a house, you could use the size of the house, the number of bedrooms, and the neighborhood it’s in as clues. The machine learning algorithm would use these clues to come up with a prediction of what the price of the house should be.</p><p>It’s a type of supervised learning, which means the algorithm is given examples of correct answers (in this case, the correct price of the house) to learn from. Once the algorithm has learned from these examples, it can be given new information (like the size, number of bedrooms, and neighborhood of a new house) and use what it has learned to predict the price of the new house.</p><p>Linear and multiple linear regression are the most common types of regression in machine learning, which are used for simple and straightforward problems. And for more complex problems, other regression techniques such as polynomial regression, decision tree regression, and random forest regression are used.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fdb835df57f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unit Testing]]></title>
            <link>https://medium.com/@venkatayedida/unit-testing-f176cbc908e4?source=rss-b2c6d18bc47e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f176cbc908e4</guid>
            <dc:creator><![CDATA[Venkata Yedida]]></dc:creator>
            <pubDate>Wed, 01 Feb 2023 21:26:48 GMT</pubDate>
            <atom:updated>2023-02-01T21:26:48.347Z</atom:updated>
            <content:encoded><![CDATA[<p>Simple Defintion:</p><p>Unit testing is a way to test small parts of a computer program to make sure they work properly. Think of it like checking that each piece of a puzzle fits together before putting the whole puzzle together. This way, if something is not working right, it’s easier to find and fix the problem.</p><p>A unit is the smallest part of a computer program, like a tiny building block. Unit testing makes sure that each tiny building block works well on its own so that when they are put together, the whole program will work well.</p><p>Text Book Definition:</p><p>Unit testing is a method of testing individual units or components of a software application. It is typically done by developers and is used to ensure that the individual units of the software are working as intended. Unit tests are usually automated and are designed to test specific parts of the code, such as a particular function or method. Unit testing is done at the lowest level of the software development process, where individual units of code are tested in isolation.</p><p>Advanteages:</p><ol><li>It helps to identify bugs early in the development process, before they become more difficult and expensive to fix.</li><li>It helps to ensure that changes to the code do not introduce new bugs.</li><li>It makes the code more modular and easier to understand and maintain.</li><li>It helps to improve the overall quality and reliability of the software.</li></ol><p>3 Phases in Unit Testing</p><ol><li>Initailizing the small piece of an app that needs to tested (System Under Test)</li><li>Then apply stimulus/trigger to the system under test</li><li>finally , observe the result by asserting</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f176cbc908e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Slack with OpenAI API (#ChatGPT)]]></title>
            <link>https://medium.com/@venkatayedida/integrating-slack-with-openai-api-chatgpt-80e47e474b77?source=rss-b2c6d18bc47e------2</link>
            <guid isPermaLink="false">https://medium.com/p/80e47e474b77</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[openai-api]]></category>
            <category><![CDATA[slack-apps]]></category>
            <category><![CDATA[slack]]></category>
            <dc:creator><![CDATA[Venkata Yedida]]></dc:creator>
            <pubDate>Thu, 26 Jan 2023 08:46:29 GMT</pubDate>
            <atom:updated>2023-02-06T17:18:49.468Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXBmSuQMKhvw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXBmSuQMKhvw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FXBmSuQMKhvw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d8539344ac4f560d2c6d10f8ab9e2cc/href">https://medium.com/media/7d8539344ac4f560d2c6d10f8ab9e2cc/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*qC2uyNBmlRGLBY-0PgV98A.png" /><figcaption>Slack integration with OpenAI API</figcaption></figure><p><a href="https://slack.com/">Slack</a> is one of the most used communication platforms today, especially for communication in both enterprises and smaller groups. In enterprises, Slack is often used as a central hub for communication between teams, departments, and remote workers. In fact, there are a lot of spaces for smaller groups, such as startups or non-profit organizations, and students from universities or study groups, use a lot for communication.</p><p><a href="https://openai.com/blog/chatgpt/">ChatGPT</a> is a conversational language tool developed by <a href="https://openai.com/">OpenAI</a>, that is capable of understanding and responding to various forms of human input, making it well-suited for applications such as chatbots, virtual assistants, and interactive language interfaces.</p><p>OpenAI offers API (Application Programming Interface) to allow developers to access the company’s cutting-edge machine learning models, including natural language processing (NLP) models like GPT-3.</p><p>There are several use cases for integrating Slack with OpenAI’s API, particularly for the ChatGPT model. Some of the advantages of such integration include:</p><ol><li><strong>Improved productivity: </strong>ChatGPT can be integrated with Slack to create a virtual assistant that can respond to user queries, schedule meetings, and perform other tasks, reducing the time and effort required for users to perform these tasks manually.</li><li><strong>Automated customer service:</strong> ChatGPT can be integrated with Slack to create a chatbot that can respond to customer queries and provide support, reducing the need for human customer service representatives.</li><li><strong>Enhanced communication:</strong> ChatGPT can be integrated with Slack to improve communication between team members by providing automated responses and clarification on various topics, reducing the need for multiple back-and-forth communication</li><li><strong>Improved decision making</strong>: ChatGPT can be integrated with Slack to provide automated insights, summaries, and recommendations based on data, helping teams to make better decisions faster</li><li><strong>Language Translation:</strong> ChatGPT can be integrated with Slack to enable Language Translation between team members, improving communication between team members who speak different languages.</li></ol><p>Overall, integrating Slack with OpenAI’s API can help organizations and smaller groups to improve productivity, communication, and decision-making by providing automated support and assistance in a range of different areas.</p><p><strong>Technical Solution:</strong> There are different ways of doing this integration, here is one way with pipedream and python.</p><p>workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*tJaKRaXsvAoeOr45" /></figure><p>Create a workflow in pipedream and click on “slack”,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*jPv9KwmyNlKa87H_" /></figure><p>Select “New Message in Channels”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*QwGCNco4D6e6xxdP" /></figure><p>Select your slack account, and channels that you want to integrate with OpenAI, Ignore Bots: True. Click on create a source, this will set up your trigger, and now this step is ready to capture the events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/0*lBxr7SGhfkJSCbKh" /></figure><p>Once your trigger is started listening send a message in your slack channel to test the trigger then you will see something like the below once you receive the message,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/0*5Xp5MX_vucOqbJKb" /></figure><p>Here you will the message you have sent, in my example it is “test” which is in the “steps.event.text “.</p><p>Let’s continue to the next step, now we have our message in text, which has to be extracted and sent to OpenAI API. Click on “+” and select on Python</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*8-MlcpCs4KkERbZa" /></figure><p>After you selected Python, you will something like the below, Click on “Run Python Code”,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*Smd-6fMzmyKlv4_0" /></figure><p>Go to the Code section, and add the below code snippet to extract the slack message and which will send it to the OpenAI API.</p><pre>import os<br>import openai<br>from jsonpath_ng import jsonpath, parse<br></pre><pre>def handler(pd: &quot;pipedream&quot;):<br>    openai.api_key = os.environ.get(&quot;openai_api_key&quot;)<br>    user_reqeust = pd.steps[&quot;trigger&quot;][&quot;event&quot;][&quot;text&quot;]<br> <br>    <br>    response = openai.Completion.create(<br>        model=&quot;text-davinci-003&quot;,<br>        prompt=user_reqeust,<br>        temperature=0.7,<br>        max_tokens=256,<br>        top_p=1,<br>        frequency_penalty=0,<br>        presence_penalty=0<br>    )</pre><pre>    jsonpath_expression = parse(&#39;choices[*].text&#39;)</pre><pre>    for match in jsonpath_expression.find(response):<br>        response_to_user = match.value<br>        print(f&#39;Answer: {match.value}&#39;)</pre><pre>    return {&#39;response_to_user&#39;:response_to_user}</pre><blockquote><strong>Note</strong>: I am using an environment variable to get the openai_api_key, if you want to hardcode it please use “ openai.api_key = “api-key” ”</blockquote><p>Now we have a response for the prompt, this has to be sent as a reply to the user in slack. Add one more step, select slack again and select “Reply to message Thread” to send a reply to the user conversation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*ZFibqMpjC8yPCUWT" /></figure><p>Now, configure the step to send the reply.</p><ul><li>Select your slack account,</li><li>Select timestamp (ts in your result of the trigger). This will help you to reply to the same conversation.</li><li>Select the channel. This is the same as in the first step trigger</li><li>In the Text, the field selects the response that we are returning in the OpenAPI Pyhton step. The path will look something similar to below,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/0*d4w0SFgD_zJHnE2F" /></figure><p>Once you test this the message flow is completed and the reply to slack with the response is sent. The flow looks like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*W1ySAZyyR-cy6Hjr" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80e47e474b77" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>