Soliplex Chat Widget — Plone Integration

This example embeds the Soliplex chat widget on a Plone page and wires up the Plone client-side tools from plone_soliplex_tool.js. With these tools the agent can identify the logged-in user, search the site, and answer questions like “What are the most recent changes in my folder?”

Wiring

<!-- 1. Load the widget bundle and the Plone tools -->
<script src="soliplex-chat.js"></script>
<script src="plone_soliplex_tool.js"></script>

<script>
  // 2. (Optional) point the Plone client at your site root and tune behaviour.
  //    When omitted, the site root is auto-detected and same-origin cookies /
  //    a Volto "auth_token" JWT are used for authentication.
  PloneSoliplex.configure({
    // baseUrl: "https://plone.example.com",
    // memberFolderBase: "/Members",   // where per-user folders live
    // userId: "bob",                  // force a user id if auto-detect fails
  });

  // 3. Initialize the widget with the Plone tool definitions.
  SoliplexChat.init({
    baseUrl: "https://soliplex.example.com",
    roomId: "assistant",
    title: "Plone Assistant",
    tools: PloneSoliplex.getToolDefinitions(),
  });
</script>

Tools provided

Combining with your own tools

SoliplexChat.init({
  baseUrl: "https://soliplex.example.com",
  roomId: "assistant",
  tools: [
    ...PloneSoliplex.getToolDefinitions(),
    {
      name: "get_page_info",
      description: "Get information about the current page",
      parameters: { type: "object", properties: {} },
      handler: async () => ({ title: document.title, url: location.href }),
    },
  ],
});