Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@builderbot-plugins/langchain
Advanced tools
This is a plugin for @builderbot/bot that use Langchain
CAPTURE THE INTENTION'S USER
import "dotenv/config"
import { EVENTS, MemoryDB, createBot, createFlow, createProvider } from "@builderbot/bot"
import { TelegramProvider } from "@builderbot-plugins/telegram"
import { createFlowRouting, structuredOutput } from "src"
import z from "zod"
const welcome = createFlowRouting
.setKeyword(EVENTS.WELCOME)
.setIntentions({
intentions: ['greeting','closure'],
description: `GREETING: si el usuario saluda\nCLOSURE: si el usuario se despide o agradece por cualquier cosa`
})
.setAIModel({ modelName: 'gemini' })
.create({
afterEnd(flow) {
return flow.addAction((_, { state }) => {
console.log(state.get('intention'))
state.clear()
})
},
})
const main = async () => {
const provider = createProvider(TelegramProvider)
createBot({
database: new MemoryDB(),
provider,
flow: createFlow([welcome])
})
}
main()
CREATE STRUCTURED RESPONSE
import "dotenv/config"
import { EVENTS, MemoryDB, createBot, createFlow, createProvider } from "@builderbot/bot"
import { TelegramProvider } from "@builderbot-plugins/telegram"
import { createFlowRouting, structuredOutput } from "src"
import z from "zod"
const welcome = structuredOutput
.setKeyword(EVENTS.WELCOME)
.setAIModel({ modelName: 'gemini' })
.setZodSchema(z.object({
name: z.string()
.nullable()
.describe('El nombre de la persona que interactua') }))
.create({
afterEnd(flow) {
return flow.addAction((_, { state }) => {
console.log(state.get('schema'))
state.clear()
})
},
})
const main = async () => {
const provider = createProvider(TelegramProvider)
createBot({
database: new MemoryDB(),
provider,
flow: createFlow([welcome])
})
}
main()
CREATE AI RESPONSE
import "dotenv/config"
import { EVENTS, MemoryDB, createBot, createFlow, createProvider } from "@builderbot/bot"
import { TelegramProvider } from "@builderbot-plugins/telegram"
import { createFlowRouting, structuredOutput } from "src"
import z from "zod"
const welcome = createAIFlow
.setKeyword(EVENTS.WELCOME)
.setAIModel({ modelName: 'gemini' })
.setZodSchema(
z.object({
name: z.string().nullable().describe('El nombre de la persona por la cual pregunta el usuario'),
age: z.number().nullable().describe('La edad de la persona por la cual pregunta el usuario')
})
)
.create({
afterEnd(flow) {
return flow.addAction((_, { state }) => {
console.log(state.get('aiAnswer'))
state.clear()
})
}
})
const main = async () => {
const provider = createProvider(TelegramProvider)
createBot({
database: new MemoryDB(),
provider,
flow: createFlow([welcome])
})
}
main()
FAQs
This is a plugin for @builderbot/bot that use Langchain
We found that @builderbot-plugins/langchain demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.