抱歉,您的瀏覽器無法訪問本站
本頁面需要瀏覽器支持(啟用)JavaScript
了解詳情 >

安裝完成後且新增 LLM Keys 後,先製作一個簡單的 workflow 進行測試,這個 workflow 主要串接 Chat TiggerAI AgentChat ModelMemory Modules 組合起來。

1. 使用 UI 搭建 Workflow

1.1 建立 Chat tigger

第 1/6 步: Create workflow

第 2/6 步: 點擊 "+" icon

第 3/6 步: 搜尋功能 "Chat" 並選擇

在搜尋欄位輸入 Chat,並選擇 Chat 功能選單。

第 4/6 步: 選擇 Tigger 並新增節點

展開 Tigger 功能,並選擇 “On new Chat event“ 節點

第 6/6 步: 關閉 Chat Tigger 設定

新增節點後,會自動跳出設定視窗,可以先將設定視窗關閉。

完成

1.2 建立 AI agent 節點

第 1/5 步: 新增 AI agent 節點

打開節點功能搜尋選單,並輸入 AI agent 後選擇 AI agent 功能。

第 2/5 步: 關閉節點設定

一樣先關閉節點設定視窗。

第 3/5 步: 建立節點連線

對著起始節點的 + 按著右鍵不放,連接到目標節點。

完成後如下圖:

第 4/5 步: 加入 Chat Model

點擊 AI Agent 節點的 Chat Model+ icon 後,在搜尋介面輸入 Google。並選擇 Google Vertex Chat Model

第 5/5 步: 選擇服務帳號

  1. Credential 選擇建立好的 Google Service Account API
  2. Project ID 選擇 From list 並選擇 Google Project 的名稱
  3. 完成後點選右上角關閉按鈕

完成

1.3 測試工作流

第 1/3 步:開啟聊天介面

第 2/3 步:輸入測試訊息並送出

第 3/3 步:測試結果會顯示於聊天視窗

2. 完整 Workflow 的 json 程式碼

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
"nodes": [
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.4,
"position": [
-384,
32
],
"id": "f57d9f0a-06e8-4066-8fd2-a9a2a6d52d32",
"name": "When chat message received",
"webhookId": "382fe3c0-68d7-4200-ba83-4ea8d91df9b0"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3.1,
"position": [
-160,
32
],
"id": "8ba7b7b2-b2c3-4145-a871-7cdf29309c40",
"name": "AI Agent"
},
{
"parameters": {
"projectId": {
"__rl": true,
"value": "sixth-embassy-502516-c3",
"mode": "list",
"cachedResultName": "GoogleLLM"
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleVertex",
"typeVersion": 1,
"position": [
-160,
240
],
"id": "732df07a-d9bd-49e0-b2af-379db1f3d1fa",
"name": "Google Vertex Chat Model",
"credentials": {
"googleApi": {
"id": "GRHQqJtY3NQqoKdE",
"name": "Google Service Account account"
}
}
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Google Vertex Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "fd4f12f561b24775bc1dbf895c94763f0418144c33fba348cb4402d0c431cb75"
}
}

留言