Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.plazbot.com/llms.txt

Use this file to discover all available pages before exploring further.

Introduccion

Con el SDK de Plazbot puedes crear Portales de IA con experiencia tipo ChatGPT para tus clientes. Implementa IA para Atencion al Cliente, Ventas, Soporte y mas.

Inicializacion

import { Plazbot } from 'plazbot';

const plazbot = new Plazbot({
  workspaceId: "YOUR_WORKSPACE_ID",
  apiKey: "YOUR_API_KEY",
  zone: "LA"
});

// Usar: plazbot.portal.addPortal(...)

Creacion del Portal

Crea un nuevo portal con la configuracion de interfaz (titulo, subtitulo, marca, tema).
Es fundamental asociar al menos un agente a un portal para que funcione. Sin agentes asociados, el portal no se cargara.
Importante: Los agentes asociados a Portales deben tener useToolCalling: true activado para que el streaming SSE funcione correctamente. Los nuevos agentes ya se crean con esta opcion activada por defecto.
Con un portal puedes tener multiples agentes: uno para Ventas, otro para Soporte, otro para Atencion al Cliente, etc.
const portalCreated = await plazbot.portal.addPortal({
  name: "Portal de Busqueda",
  zone: "LA",
  title: "Centro de Ayuda",
  subtitle: "Pregunta lo que necesites",
  logo: "https://tu-dominio.com/logo.png",
  logodark: "https://tu-dominio.com/logo-dark.png",
  access: "direct",  // "direct" o "form"
  theme: "light",     // "light" o "dark"
  disabled: false,
  brandOff: false,
});

const portalId = portalCreated.id;
const portalUrl = portalCreated.url;
Al crear el portal recibiras la URL publica:
https://appla.plazbot.com/portal?id={PORTAL_ID}&workspaceId={WORKSPACE_ID}
Campos del Portal
CampoTipoDescripcion
namestringNombre del portal
titlestringTitulo que aparece en la parte superior
subtitlestringTexto descriptivo debajo del titulo
logostringURL del logo en modo claro (PNG/JPG)
logodarkstringURL del logo en modo oscuro (PNG/JPG)
accessstring"direct" o "form"
themestring"light" o "dark"
disabledbooleanActivar/desactivar portal
brandOffbooleanOcultar marca Plazbot
zonestring"LA" o "EU"

Asociar Agente al Portal

await plazbot.portal.addAgentToPortal({
  portalId: portalId,
  id: agentId
});

Remover Agente del Portal

await plazbot.portal.removeAgentFromPortal({
  portalId: portalId,
  id: agentId
});
Agrega enlaces externos al portal. Maximo 5 enlaces. Se abren en una nueva ventana.
await plazbot.portal.addLinkToPortal({
  portalId: portalId,
  value: "Blog",
  url: "https://www.plazbot.com/blog"
});

await plazbot.portal.addLinkToPortal({
  portalId: portalId,
  value: "Documentacion",
  url: "https://docs.plazbot.com"
});

await plazbot.portal.addLinkToPortal({
  portalId: portalId,
  value: "Discord",
  url: "https://discord.gg/SgyAtrwzp7"
});

Obtener Portal

const portalInfo = await plazbot.portal.getPortal(portalId);
Elimina todos los links configurados del portal.
await plazbot.portal.clearLinks(portalId);

Actualizar Portal

await plazbot.portal.updatePortal({
  id: portalId,
  name: "Portal Actualizado",
  theme: "dark"
});

Eliminar Portal

await plazbot.portal.deletePortal(portalId);