LangFlow——一款可轻松实验和原型化 LangChain流水线的AI项目

LangFlow——一款可轻松实验和原型化 LangChain流水线的AI项目。

前言
在人工智能兴起的当下,AI正在重塑着很多行业。今天介绍的是一款近期登上github热门的一款可轻松实验和原型化 LangChain[1] 流水线的AI项目—LangFlow。

在这里插入图片描述

Flowise——通过拖放界面构建定制的LLM流程

⛓️ LangFlow
一种轻松实验和原型化 LangChain[2] 流水线的方式 ~

体验地址:https://huggingface.co/spaces/Logspace/LangFlow

📦 安装

本地安装
您可以通过pip安装LangFlow:

pip install langflow

然后运行:

python -m langflow

或者

langflow

在Google Cloud Platform上部署Langflow
请按照我们的逐步指南,在Google Cloud Platform (GCP) 上使用Google Cloud Shell部署Langflow。该指南可在Langflow在Google Cloud Platform上的部署[3]文档中找到。

或者,点击下面的 "在Cloud Shell中打开"按钮,在Google Cloud Shell中启动,并克隆Langflow存储库,然后启动一个交互式教程 ,引导您完成设置所需资源和在GCP项目上部署Langflow的过程。链接[4]

在Jina AI Cloud[5]上部署Langflow
Langflow与langchain-serve集成,提供了一键部署到Jina AI Cloud的功能。

首先使用以下命令安装langchain-serve:

pip install -U langchain-serve

然后运行:

langflow --jcloud

🎉 Langflow服务器成功部署在Jina AI Cloud上 🎉
🔗 点击链接打开服务器(请允许服务器启动大约1-2分钟):https://.wolf.jina.ai/
📖 了解更多关于管理服务器的信息:https://github.com/jina-ai/langchain-serve

完成的示例:
在这里插入图片描述

API使用方法
您可以直接在浏览器中使用Langflow,也可以使用Jina AI Cloud上的API端点与服务器进行交互。

用python api的使用方式:


import requestsBASE_API_URL = "https://langflow-e3dd8820ec.wolf.jina.ai/api/v1/predict"
FLOW_ID = "864c4f98-2e59-468b-8e13-79cd8da07468"
# You can tweak the flow by adding a tweaks dictionary
# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}}
TWEAKS = {
"ChatOpenAI-g4jEr": {},
"ConversationChain-UidfJ": {}
}def run_flow(message: str, flow_id: str, tweaks: dict = None) -> dict:"""Run a flow with a given message and optional tweaks.:param message: The message to send to the flow:param flow_id: The ID of the flow to run:param tweaks: Optional tweaks to customize the flow:return: The JSON response from the flow"""api_url = f"{BASE_API_URL}/{flow_id}"payload = {"message": message}if tweaks:payload["tweaks"] = tweaksresponse = requests.post(api_url, json=payload)return response.json()# Setup any tweaks you want to apply to the flow
print(run_flow("Your message", flow_id=FLOW_ID, tweaks=TWEAKS))
{"result": "Great choice! Bangalore in the 1920s was a vibrant city with a rich cultural and political scene. Here are some suggestions for things to see and do:\n\n1. Visit the Bangalore Palace - built in 1887, this stunning palace is a perfect example of Tudor-style architecture. It was home to the Maharaja of Mysore and is now open to the public.\n\n2. Attend a performance at the Ravindra Kalakshetra - this cultural center was built in the 1920s and is still a popular venue for music and dance performances.\n\n3. Explore the neighborhoods of Basavanagudi and Malleswaram - both of these areas have retained much of their old-world charm and are great places to walk around and soak up the atmosphere.\n\n4. Check out the Bangalore Club - founded in 1868, this exclusive social club was a favorite haunt of the British expat community in the 1920s.\n\n5. Attend a meeting of the Indian National Congress - founded in 1885, the INC was a major force in the Indian independence movement and held many meetings and rallies in Bangalore in the 1920s.\n\nHope you enjoy your trip to 1920s Bangalore!"
}

🎨 创建流程
使用LangFlow创建流程非常简单。只需将侧边栏的组件拖放到画布上,并将它们连接在一起以创建您的流水线。LangFlow提供了一系列的LangChain组件[6]可供选择,包括LLMs、提示序列化器、代理和链。

通过编辑提示参数、链接链式和代理、跟踪代理的思考过程以及导出流程,来进行探索。

完成后,您可以将流程导出为JSON文件,以与LangChain一起使用。要这样做,请单击画布右上角的“导出”按钮,然后在Python中,您可以使用以下代码加载流程:


from langflow import load_flow_from_jsonflow = load_flow_from_json("path/to/flow.json")
# 现在您可以像使用任何链式一样使用它
flow("Hey, have you heard of LangFlow?")

👋 贡献
我们欢迎来自各个层次的开发者为我们在GitHub上的开源项目做出贡献。如果您想要贡献,请查阅我们的贡献指南[7]并帮助我们使LangFlow更加易用。

加入我们的Discord[8]服务器,提问、提建议和展示您的项目!🦾

📄 许可证
LangFlow使用MIT许可证发布。有关详细信息,请参阅LICENSE文件。

参考资料

https://github.com/logspace-ai/langflow

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/714516.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MCTP Control Protocol

MCTP control message用于在MCTP通信的协议中,来设置和初始化MCTP通信。 本文基于 SMBus/I2C 来实现 MCTP Control Protocol,SMBus/I2C 包格式如下: Management Component Transport Protocol (MCTP) SMBus/I2C Transport Binding Specific…

Flask学习笔记

不论POST请求还是GET请求都支持在 URL 中添加变量&#xff0c;可以选择性的加上一个转换器&#xff0c;为变量指定数据类型。 history_alarm.route(/test/<int:post_id>, methods[POST]) def test(post_id):print(f"参数类型为&#xff1a;{type(post_id)}")i…

VUE3中的组件传值

一、父传子(props) 在子组件中可以使用defineProps接收父组件向子组件的传值 父组件fatherPage.vue&#xff1a; <template><div class"father"><button click"a a 1">按钮</button><childPage :a"a" /><…

clickhouse的多路径存储策略

存储策略 clickhouse从19.15开始&#xff0c;MergeTree实现了自定义存储策略的功能&#xff1a; JBOD策略&#xff1a;这种策略适合服务器挂多磁盘但没做raid的场景。JBOD是一种轮询策略&#xff0c;每次执行INSERT或者MERGE&#xff0c;所以产生的新分区会轮询写入各个磁盘。…

C#面:Application , Cookie 和 Session 会话有什么不同

Application、Cookie 和 Session 是在Web开发中常用的三种会话管理方式 Application&#xff08;应用程序&#xff09;&#xff1a; Application 是在服务器端保存数据的一种方式&#xff0c;它可以在整个应用程序的生命周期内共享数据。Application 对象是在应用程序启动时创…

Nginx 隐藏版本信息和logo

1.隐藏版本信息 http {### 隐藏版本号 server_tokens off; } 2.隐藏图标 2.1 cd nginx 安装的路径 cd/XXXX/nginx-1.2.0 2.2 编辑文件 vim src/core/nginx.h 修改define nginx_ver 中的内容 vim src/http/ngx_http_special_response.c 修改 u_char ngx_http_error_tail[]…

java 基础(核心知识搭配代码)

前言 java的学习分为了上部分以及下部分进行学习&#xff0c;上部分就是对于java的基础知识&#xff0c;面向对象上&#xff0c;面向对象下&#xff0c;异常操作&#xff0c;javaApi&#xff1b;下部主要是集合&#xff0c;泛型&#xff0c;反射&#xff0c;IO流&#xff0c;J…

Grid-Based Continuous Normal Representation for Anomaly Detection 论文阅读

Grid-Based Continuous Normal Representation for Anomaly Detection 论文阅读 摘要简介方法3.1 Normal Representation3.2 Feature Refinement3.3 Training and Inference 4 实验结果5 总结 文章信息&#xff1a; 原文链接&#xff1a;https://arxiv.org/abs/2402.18293 源码…

ChatGPT4.0使用次数限制解读

ChatGPT4.0使用次数限制解读 ChatGPT4.0简介 ChatGPT4.0&#xff0c;由OpenAI开发的先进通用聊天机器人模型&#xff0c;基于GPT4技术构建&#xff0c;为用户提供了自然语言处理等多项任务的解决方案。 ChatGPT4.0使用次数限制 在日常使用过程中&#xff0c;用户会遇到Chat…

【MIT 6.S081】2020, 实验记录(6),Lab: Copy-on-Write Fork

目录 Task: Implement copy-on writestep 1&#xff1a;对内存块进行引用计数step 2&#xff1a;uvmcopy 实现 fork 时将 parent 的物理页映射到 child 中step 3&#xff1a;在 usertrap 中增加对 page fault 的处理执行测试 官方说明&#xff1a;Lab: Copy-on-Write Fork for …

IP地址工具,判断IP是否在指定范围内(支持ipv6)

常用方法&#xff0c;判断一个ip是否在指定的ip范围内&#xff0c;范围可能包括起始ip范围或者掩码形式&#xff0c;无其它依赖&#xff0c; package com.yk.ip;import java.math.BigInteger; import java.net.InetAddress; import java.net.UnknownHostException; import jav…

操作系统-文件原理

目录 一、磁盘 1.1 磁盘结构 1. 盘片&#xff1a; 2. 盘面&#xff1a; 3. 磁头&#xff1a; 4. 磁道&#xff1a; 5. 扇区&#xff1a; 6. 磁道密度和扇区密度&#xff1a; 1.2 磁盘访问 1. 寻道&#xff08;Seeking&#xff09;&#xff1a; 2. 延迟旋转&#xff…

C++进阶-- map和set

关联式容器 在前面&#xff0c;我们所学的vector、list、deque&#xff0c;这些都是序列容器&#xff0c;也就是底层为线性序列的数据结构。 而关联式容器是C标准库中的一种类别&#xff0c;用于存储键值对&#xff08;key-value pair&#xff09;&#xff0c;关联式容器中的元…

vxe-table编辑单元格动态插槽slot的使用

业务场景&#xff1a;表格中只有特定某一行的的单元格可以编辑&#xff0c;列很多&#xff0c;为每个列写个插槽要写很多重复代码&#xff0c;所以这里使用动态插槽&#xff0c;简化代码量。显示编辑图标&#xff0c;点击编辑图标隐藏。失去焦点保存调后台接口。 解决办法&…

Linux多线程服务端编程:使用muduo C++网络库 学习笔记 附录C 关于Boost的看法

这是作者为电子工业出版社出版的《Boost程序库完全开发指南》写的推荐序&#xff0c;此处节选了作者对在C工程项目中使用Boost的看法。 最近一年&#xff08;这篇文章写于2010年8月&#xff09;作者电话面试了数十位C应聘者。惯用的暖场问题是“工作中使用过STL的哪些组件&…

十行代码开发一个AI应用

Semantic Kernal 简介 Semantic Kernel (SK) is a lightweight SDK that lets you easily mix conventional programming languages with the latest in Large Language Model (LLM) AI "prompts" with templating, chaining, and planning capabilities out-of-the-…

关于vue中关于eslint报错的问题

1 代码保存的时候会自动将单引号报错为双引号 导致eslint报错的问题&#xff0c; 解决思路&#xff1a; 在项目根目录下新建一个.prettierrc.json文件 { “tabWidth”: 2,“useTabs”: false,“singleQuote”: true,“semi”: false} 2 关于报错代码的时候 出现尾随逗号报错…

Zabbix 系统告警“More than 75% used in the configuration cache”处理办法

Zabbix系统报错提示 Zabbix 系统告警“More than 75% used in the configuration cache”&#xff0c;看了一下意思是可用的配置缓存超过75%。 修改缓存大小 vim /etc/zabbix/zabbix_server.confesc : /CacheSize 找到配置 将64M改大一点&#xff0c;保存退出。 重启zabbix…

WPF常用mvvm开源框架介绍 vue的mvvm设计模式鼻祖

WPF&#xff08;Windows Presentation Foundation&#xff09;是一个用于构建桌面应用程序的.NET框架&#xff0c;它支持MVVM&#xff08;Model-View-ViewModel&#xff09;架构模式来分离UI逻辑和业务逻辑。以下是一些常用的WPF MVVM开源框架&#xff1a; Prism Prism是由微软…

代码随想录算法训练营 Day32 | LeetCode122.买卖股票的最佳时机II、LeetCode55. 跳跃游戏、LeetCode45.跳跃游戏II

LeetCode122.买卖股票的最佳时机II 那么这里面根据贪心思想&#xff1a; 1、在最低点时买入&#xff0c;如果该点比上一点价格更低&#xff0c;只有两种情况&#xff1a;上一点为买入点&#xff0c;则此时更新买入点&#xff1b;上一点不是买入点&#xff0c;则此时将股票卖出…