claudius-chat-widget
    Preparing search index...

    Function pluginCannedResponses

    • Reference plugin that answers matching messages locally, without calling the API. The first rule whose matcher fires short-circuits the send via ctx.respondWith, so the network is never hit for that turn.

      Parameters

      Returns ClaudiusPlugin

      <ChatWidget
      apiUrl={url}
      plugins={[pluginCannedResponses({
      rules: [
      { match: "hours", reply: "We're open 9-5, Mon-Fri." },
      { match: /pricing|cost/i, reply: "See https://example.com/pricing." },
      ],
      })]}
      />