Chainlit / docs

9 stars 59 forks source link

Copilot instructions don't match cookbook #126

Open dahifi opened 2 months ago

dahifi commented 2 months ago

The script snippet at https://docs.chainlit.io/deployment/copilot needs to be updated to include this listener, which appears to the correct way to do this in the cookbook and the community.

    window.addEventListener("chainlit-call-fn", (e) => {
      const { name, args, callback } = e.detail;
      if (name === "test") {
        callback("You sent: " + args.msg);
      }
    });

Should solve https://github.com/Chainlit/chainlit/issues/929