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.pswp.cn/news/714516.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/714516.shtml
英文地址,請注明出處:http://en.pswp.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;則此時將股票賣出…