update workflows
This commit is contained in:
236
workflows/kQIViyYKgY1d4E99.json
Normal file
236
workflows/kQIViyYKgY1d4E99.json
Normal file
@@ -0,0 +1,236 @@
|
||||
{
|
||||
"id": "kQIViyYKgY1d4E99",
|
||||
"name": "RizonHelp IRC Bot",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"httpMethod": "POST",
|
||||
"path": "rizonhelp",
|
||||
"responseMode": "lastNode",
|
||||
"options": {}
|
||||
},
|
||||
"id": "webhook-trigger",
|
||||
"name": "Webhook Trigger",
|
||||
"position": [
|
||||
-560,
|
||||
208
|
||||
],
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"typeVersion": 2,
|
||||
"webhookId": "7c1b6e59-8b48-498c-b166-55127d0e298f"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "// Format response for IRC - handle various QA Chain output formats\nconst input = $input.first().json;\n\n// Extract response text\nlet response = '';\nif (typeof input.response === 'string') {\n response = input.response;\n} else if (typeof input.text === 'string') {\n response = input.text;\n} else if (typeof input.output === 'string') {\n response = input.output;\n} else if (input.response && typeof input.response.text === 'string') {\n response = input.response.text;\n} else {\n response = JSON.stringify(input);\n}\n\nconst lowerResponse = response.toLowerCase();\n\n// REJECT patterns - common off-topic response indicators\nconst rejectPatterns = [\n '__ignore__',\n 'no_response',\n \"i don't know\",\n \"i do not know\",\n \"you're welcome\",\n \"is there anything else\",\n \"can i help you with\",\n \"what do you need help with\",\n \"how can i assist\",\n \"hello.\",\n \"hi there\",\n \"hi!\",\n \"hello!\",\n \"not in the context\",\n \"not related to\",\n \"no information about\",\n \"not mentioned\",\n \"outside the scope\",\n \"large language model\",\n \"llm\",\n \"artificial intelligence\",\n \"ai model\",\n \"i am an ai\",\n \"i'm an ai\",\n \"as an ai\",\n \"i am a bot\",\n \"i'm a bot\"\n];\n\n// REQUIRE patterns - valid responses MUST contain at least one of these\nconst requirePatterns = [\n '/msg',\n '/ns',\n '/cs',\n '/hs',\n '/bs',\n '/mode',\n '/join',\n '/part',\n '/kick',\n '/ban',\n '/topic',\n 'wiki.rizon.net',\n 'chanserv',\n 'nickserv',\n 'hostserv',\n 'memoserv',\n 'botserv',\n 'operserv'\n];\n\n// Check for rejection patterns\nconst hasRejectPattern = rejectPatterns.some(p => lowerResponse.includes(p));\n\n// Check for required patterns (valid IRC help content)\nconst hasRequiredPattern = requirePatterns.some(p => lowerResponse.includes(p));\n\n// Reject if: empty, has reject pattern, OR lacks any valid IRC content\nif (response.trim() === '' || hasRejectPattern || !hasRequiredPattern) {\n return { json: { response: '', wiki_url: null } };\n}\n\n// Extract wiki URL if mentioned\nlet wikiUrl = null;\nconst wikiMatch = response.match(/https:\\/\\/wiki\\.rizon\\.net\\S*/);\nif (wikiMatch) {\n wikiUrl = wikiMatch[0].replace(/[).,]$/, '');\n}\n\nreturn {\n json: {\n response: response.trim().replace(/\\n/g, ' '),\n wiki_url: wikiUrl\n }\n};"
|
||||
},
|
||||
"id": "response-formatter",
|
||||
"name": "Response Formatter",
|
||||
"position": [
|
||||
160,
|
||||
208
|
||||
],
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"value": "nvidia_nim/moonshotai/kimi-k2.5",
|
||||
"mode": "list",
|
||||
"cachedResultName": "nvidia_nim/moonshotai/kimi-k2.5"
|
||||
},
|
||||
"options": {
|
||||
"timeout": 30000
|
||||
}
|
||||
},
|
||||
"id": "55629594-7004-4807-94a8-c842558e5db9",
|
||||
"name": "Chat Model Primary",
|
||||
"position": [
|
||||
-432,
|
||||
480
|
||||
],
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"typeVersion": 1.2,
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "sxSUdecXdMfKPuTu",
|
||||
"name": "llm-proxy.ext.ben.io"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"promptType": "define",
|
||||
"text": "={{ $json.body.question }}",
|
||||
"options": {
|
||||
"systemPromptTemplate": "Rizon IRC help context:\n{context}\n\nYou answer \"how do I\" questions about Rizon IRC using the context above.\nFormat: [command] - More info: [URL]\n\nIMPORTANT: If the user's question is NOT asking something relevant to IRC, output ONLY this exact text with no explanation:\n__IGNORE__\n\nThings that are NOT IRC help questions (output __IGNORE__):\n- Statements like \"thanks\", \"ok\", \"interesting\", \"cool\"\n- Random text that isn't a question\n- Greetings like \"hello\", \"hi\"\n- Anything not asking how to use IRC or IRC services"
|
||||
}
|
||||
},
|
||||
"id": "bc8a8f9c-dfa8-4b64-ac87-b81ebed1e9fa",
|
||||
"name": "QA Chain",
|
||||
"position": [
|
||||
-304,
|
||||
208
|
||||
],
|
||||
"retryOnFail": true,
|
||||
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"topK": 5
|
||||
},
|
||||
"id": "922a7ee0-42bc-4d92-9c11-16772f20119d",
|
||||
"name": "Vector Store Retriever",
|
||||
"position": [
|
||||
-208,
|
||||
432
|
||||
],
|
||||
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"cachedResultName": "rizon-help",
|
||||
"mode": "list",
|
||||
"value": "rizon-help"
|
||||
},
|
||||
"options": {
|
||||
"contentPayloadKey": "page_content"
|
||||
}
|
||||
},
|
||||
"id": "31f65541-f828-45ca-bc2e-64118aa718c7",
|
||||
"name": "Qdrant Vector Store",
|
||||
"position": [
|
||||
-208,
|
||||
640
|
||||
],
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"typeVersion": 1.3,
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "Qtd00hn8bJt3xzhU",
|
||||
"name": "Qdrant Local"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"content": "## Model Notes\n\nfast dedalus model: \n* dedaluslabs/moonshot/kimi-k2-thinking-turbo"
|
||||
},
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
-1040,
|
||||
256
|
||||
],
|
||||
"id": "a8dcf9fe-8728-4af8-a1e5-7a0d62ff26d6",
|
||||
"name": "Sticky Note"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"model": "embeddinggemma:latest"
|
||||
},
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOllama",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
-128,
|
||||
848
|
||||
],
|
||||
"id": "14c8c8f8-e081-4dc7-9eb5-971aa152a92c",
|
||||
"name": "Embeddings Ollama",
|
||||
"credentials": {
|
||||
"ollamaApi": {
|
||||
"id": "l1g3pgQImkg18AzR",
|
||||
"name": "Ollama account"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Chat Model Primary": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"index": 0,
|
||||
"node": "QA Chain",
|
||||
"type": "ai_languageModel"
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"QA Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"index": 0,
|
||||
"node": "Response Formatter",
|
||||
"type": "main"
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qdrant Vector Store": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"index": 0,
|
||||
"node": "Vector Store Retriever",
|
||||
"type": "ai_vectorStore"
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Retriever": {
|
||||
"ai_retriever": [
|
||||
[
|
||||
{
|
||||
"index": 0,
|
||||
"node": "QA Chain",
|
||||
"type": "ai_retriever"
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"index": 0,
|
||||
"node": "QA Chain",
|
||||
"type": "main"
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings Ollama": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1",
|
||||
"callerPolicy": "workflowsFromSameOwner",
|
||||
"availableInMCP": false
|
||||
},
|
||||
"triggerCount": 1,
|
||||
"versionId": "f5d59633-0e3c-4a64-a228-655e71ae20b3",
|
||||
"owner": {
|
||||
"type": "personal",
|
||||
"projectId": "FeLO36wNUAcn61Wj",
|
||||
"projectName": "Ben W <admin@ben.io>",
|
||||
"personalEmail": "admin@ben.io"
|
||||
},
|
||||
"parentFolderId": "caxOx4NfY2vHcoNv",
|
||||
"isArchived": false
|
||||
}
|
||||
Reference in New Issue
Block a user