<%*
try {
  const out = await tp.ai.chat("Say 'OK' if you can read this.");
  new Notice("AI replied: " + (typeof out === "string" ? out.slice(0,60) : JSON.stringify(out).slice(0,60)));
} catch (e) {
  console.error(e);
  new Notice("AI call threw an error (check console).");
}
%>
