This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"uuid": "__LINK_0__", | |
"name": "Tarjeta", | |
"label": "Nuevo Flow", | |
"sort": 0, | |
"sensitive": false, | |
"keyword": [ | |
"tarjeta", | |
"targeta" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "My workflow", | |
"nodes": [ | |
{ | |
"parameters": { | |
"options": {} | |
}, | |
"id": "32a160fa-88df-41dd-9949-18d98a70574d", | |
"name": "When chat message received", | |
"type": "@n8n/n8n-nodes-langchain.chatTrigger", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"uuid": "random", | |
"name": "Bienvenida y Ofertas Iniciales", | |
"label": "Nuevo Flow", | |
"sensitive": false, | |
"keyword": ["buenas", "hola", "hello"], | |
"answers": [ | |
{ | |
"options": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ (() => { | |
const gap = 45 | |
const startDate = new Date($json["body"]["startDate"]); | |
const endDate = new Date(startDate.getTime() + (gap * 60 * 1000)); | |
const formatNumber = (num) => (num < 10 ? '0' : '') + num; | |
const formattedDate = endDate.getFullYear() + '/' + | |
formatNumber(endDate.getMonth() + 1) + '/' + | |
formatNumber(endDate.getDate()) + ' ' + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { generateExternalApiKey } = require('./generate-external-key'); | |
const generateBodyContainer = (tenant = {}) => { | |
const { botName, userId, uuid, openAiKey } = tenant; | |
const sessions = `${uuid}_sessions` | |
const EXTERNAL_API_KEY = generateExternalApiKey(userId); | |
const OPENAI_API_KEY = openAiKey ?? process.env.OPENAI_API_KEY | |
return { | |
Name: `${botName.replace(/\s+/g, '')}-${uuid}`, | |
Image: process.env.CONTAINER_IMAGE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios').default; | |
const https = require('https'); | |
class PortainerRequest { | |
#axios = axios; | |
#URL = process.env.PORTAINER_URL | |
constructor() { | |
this.#axios = axios.create({ | |
httpsAgent: new https.Agent({ | |
rejectUnauthorized: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createBot, createProvider, createFlow, addKeyword, MemoryDB, utils } from '@bot-whatsapp/bot' | |
import { BaileysProvider } from '@bot-whatsapp/provider-baileys' | |
const welcomeFlow = addKeyword(['hello', 'hi']).addAnswer('Ey! welcome') | |
const emailValidationFlow = addKeyword(utils.setEvent('EMAIL_VALIDATION')) | |
.addAnswer('¿Cual es tu nombre?', { capture: true }) | |
.addAnswer('¿Cual es tu edad?', { capture: true }) | |
.addAnswer('Gracias!!') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const typing = async function (ctx: any, provider: any) { | |
if (provider && provider?.vendor && provider.vendor?.sendPresenceUpdate) { | |
const id = ctx.key.remoteJid | |
await provider.vendor.sendPresenceUpdate('composing', id) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Actualizar la lista de paquetes disponibles | |
sudo apt update | |
# Instalar Nginx | |
sudo apt install -y nginx | |
# Comprobar si Nginx se instaló correctamente | |
if [ $? -eq 0 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Document } from 'langchain/document'; | |
import { readFile } from 'fs/promises'; | |
import { BaseDocumentLoader } from 'langchain/document_loaders'; | |
export abstract class BufferLoader extends BaseDocumentLoader { | |
constructor(public filePathOrBlob: string | Blob) { | |
super(); | |
} | |
protected abstract parse( |