Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation of the Lanflow Lab #31

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,539 changes: 3,539 additions & 0 deletions Class-Labs/Lab-7(Langflow-Nocodetoll)/Langlow NoCode JSON File LAB.json

Large diffs are not rendered by default.

131 changes: 131 additions & 0 deletions Class-Labs/Lab-7(Langflow-Nocodetoll)/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
**"In this lab, we will create an agent that writes blogs for you based on prompts you provide. First, we use the Composio component, which automatically reads the email of the person you enter in the chatbot. If a URL is found in the email body, the agent will extract content from that URL and generate a blog based on the prompt you define.

To build this, we are using LangFlow, a Node.js-based tool platform.

Let’s get started!"**

In the rapidly evolving world of artificial intelligence, the rise of no-code platforms has revolutionized the way we approach AI development. LangFlow, a powerful and innovative tool, has emerged as a game-changer in this space, offering a user-friendly and accessible way to create AI applications without the need for extensive coding knowledge.

## What is Langflow?
LangFlow is a cutting-edge no-code AI ecosystem that enables developers, entrepreneurs, and even non-technical individuals to build AI applications with ease. It provides a visually appealing and intuitive drag-and-drop interface, allowing users to create AI workflows by connecting reusable components. This modular and interactive design fosters rapid experimentation and prototyping, making it an ideal tool for both beginners and experienced AI enthusiasts.

## Key Features of LangFlow
- One of the standout features of LangFlow is its dynamic input capabilities, which allow for easy customization using curly brackets {}. This flexibility enables users to tailor their AI applications to specific needs and requirements, ensuring that the final product is customized to their unique use case.

- Another notable aspect of LangFlow is its fine-tuning capabilities, which enable users to maximize the potential of Large Language Models (LLMs). By fine-tuning these models with custom training data from CSV or JSON files, users can create highly specialized AI applications that cater to their specific domains or industries.

- LangFlow’s Python-native architecture leverages powerful data manipulation and machine learning libraries, ensuring that users have access to cutting-edge tools and technologies. This foundation allows for seamless integration with various tools and stacks, making it easy for teams to incorporate LangFlow into their existing workflows.

## Explanation of Langflow

LangFlow simplifies the process of integrating and orchestrating LLMs by offering:

- **Graphical Interface:** Users can design AI pipelines visually, making it easier to experiment with different model configurations.

- **Modular Components:** Pre-built components allow seamless integration of APIs, data sources, and AI functionalities.

- **Customizable Workflows:** Users can define unique workflows tailored to specific use cases, from chatbots to automated content generation.

- **Support for Multiple LLMs:** LangFlow supports various models, including OpenAI's GPT, Hugging Face models, and others.

- **Flexibility:** Workflows can be exported and deployed as APIs, making it easy to integrate with existing applications.

## Use Cases of LangFlow
- LangFlow’s versatility is showcased through its wide range of use cases. One of the most exciting applications is the ability to build local RAG (Retrieval Augmented Generation) chatbots by integrating with embedding models like Ollama. This feature enables the creation of highly personalized and context-aware conversational agents that can engage with users in a natural and intelligent manner.

- Another compelling use case is the ability to chat with documents in various formats, including PDFs, DOCX, TXT, and websites. This feature allows users to extract valuable insights and information from large volumes of data, making it an ideal tool for research, analysis, and knowledge management.

- LangFlow also excels in automating workflows and tasks, thanks to its seamless integration with over 5000+ integrations through Zapier. By connecting LangFlow with other tools and platforms, users can streamline their processes, reduce manual effort, and increase efficiency across various domains.

## Setup the Project

- Go to the LangFlow page and click on "Get Started for Free", as shown in the image below.

![Langflow Screenshot](./Images/Screenshot%20(1515).png)

- Create your account on LangFlow.

![Langflow Screenshot](./Images/Screenshot%20(1516).png)

- After creating your account, click on "New Flow".

![Langflow Screenshot](./Images/Screenshot%20(1517).png)

- Now click on Blank Flow, as we are building it from scratch.

![Langflow Screenshot](./Images/Screenshot%20(1518).png)

- Now, click on the untitled document above, and in the dropdown, click on the Import Option to import the JSON file that has been provided to you.

![Langflow Screenshot](./Images/Screenshot%20(1520).png)

- Now, you will see that your project has been successfully imported, and you can view all the agents.

![Langflow Screenshot](./Images/img1.png)

- To use the first component, you'll need an API key from composio. You can obtain a free API key with some initial credits by visiting the following URL: [https://app.composio.dev/developers]. Once you have your key, you can proceed with the integration.

![Langflow Screenshot](./Images/Screenshot%20(1549).png)

- Once you have the key, enter it in the designated field and click 'Refresh.' Next, select 'GMAIL' as the app name and choose 'GMAIL_FETCH_EMAIL' as the action to use.
🔹 Note: You will see that my auth status is green. However, when you run it for the first time, you will need to authenticate it. An authentication option will appear, and you must complete the authentication process before proceeding."**

![Langflow Screenshot](./Images/Refresh%20Button.png)

![Langflow Screenshot](./Images/Screenshot%20(1551).png)

- Provide the Open API Key to the agent and the Open API Key component to enable authentication and access. Ensure that the API key is securely stored and used only for authorized requests.

![Langflow Screenshot](./Images/Screenshot%20(1552).png)

- In the Text Section Component, click on the text, and you can define the styling of your blog, such as the tone, the heading, etc.

![Langflow Screenshot](./Images/Screenshot%20(1555).png)

- Now, from here, you can edit your prompt and click on Check, then Save.

![Langflow Screenshot](./Images/Screenshot%20(1554).png)

- Now, click on the Playground Section.

![Langflow Screenshot](./Images/Screenshot%20(1553).png)

- In the Playground section, enter a query such as: 'Please provide me the latest email from this particular user.' The system will then fetch and display the email body of the specified email.
Example:
Input: "Give me the recent email from [email protected]"

![Langflow Screenshot](./Images/Screenshot%20(1556).png)

- In the Playground section, enter a query such as: 'Please provide me the latest email from this particular user.' The system will fetch and display the email body of the specified email.

Additionally, it will automatically generate a blog by extracting the URL from the email and using its content as a reference.

Example:

Input: "Give me the recent email from [email protected]"
Output:
Fetched Email Body: [Email content]
Generated Blog: [Auto-written blog based on the extracted URL]"

![Langflow Screenshot](./Images/Screenshot%20(1556).png)

- ⚠️ Note: If no URL is found in the email body, the URL component will fail, and the blog generation will not proceed.

![Langflow Screenshot](./Images/Screenshot%20(1557).png)

- The Blog Output .

![Langflow Screenshot](./Images/Screenshot%20(1558).png)



## Conclusion
LangFlow is a transformative tool that is reshaping the landscape of AI development. By providing a no-code platform that is both powerful and accessible, LangFlow is democratizing AI and empowering individuals from all backgrounds to create innovative solutions. Whether you are an entrepreneur looking to build a chatbot, a researcher seeking to analyze large datasets, or a business owner aiming to automate workflows, LangFlow has something to offer.

As we look to the future, it is clear that no-code AI development platforms like LangFlow will play a crucial role in driving the widespread adoption of AI technologies. By making AI development more accessible and user-friendly, these tools will enable a new generation of innovators to harness the power of AI and create solutions that positively impact the world around us.


## Reference Tutorial Video
[Get Started With Lanflow](https://youtu.be/LPfstlhSA_w?si=HMYVZ5q60IBJ7H9x)