plazbot
v1.1.7
Published
Official Plazbot SDK for creating AI agents for WhatsApp, portals, and developers.
Maintainers
Readme
Plazbot SDK
Official SDK to interact with Plazbot AI Agents and Portals. This package allows developers to easily integrate and manage Plazbot AI agents, portals, and messaging workflows using TypeScript or JavaScript.
Features
- 🤖 Create and manage AI agents
- 🌐 Create and manage AI portals
- 💬 Send and receive AI-generated responses
- 📥 Add examples and links to enrich agents and portals
- 🧠 Connect to ChatGPT (OpenAI) to respond to user questions
Installation
npm install plazbotUsage
1. Initialize the SDK
import { Plazbot } from "plazbot";
const bot = new Plazbot({
apiKey: "YOUR_API_KEY",
workspaceId: "YOUR_WORKSPACE_ID"
});2. Create an Agent
const agent = await bot.agent.addAgent({
name: "Support Agent",
prompt: "You are a helpful assistant.",
buffer: 5,
zone: "LA",
color: "blue"
});3. Create a Portal
const portal = await bot.portal.addPortal({
name: "Support Portal",
zone: "LA"
});4. Associate Agent to Portal
await bot.portal.addAgentToPortal({
portalId: "PORTAL_ID",
id: agent.agentId
});5. Send Message to Agent (ChatGPT integration)
const response = await bot.agent.onMessage({
agentId: "AGENT_ID",
message: "How can I contact support?"
});
console.log(response.answer);Scripts
npm run build: Compile TypeScript to JavaScriptnpm run clean: Clean thedistfoldernpm publish: Publish the packagenpm run release: Auto-increments version, builds, and publishes
License
MIT © Kristian Garcia
