Add local proxy server for AI draft button; point button at /api/claude

This commit is contained in:
2026-08-20 14:49:26 -07:00
parent ee8f869905
commit e5c01003f8
7 changed files with 269 additions and 11 deletions

View File

@@ -653,7 +653,7 @@ document.getElementById('btnAddBc').addEventListener('click', ()=>{
/* ===== AI: draft breadcrumb fields from methodology ===== */
async function callClaude(prompt){
const response = await fetch("https://api.anthropic.com/v1/messages", {
const response = await fetch("/api/claude", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ model: "claude-sonnet-4-6", max_tokens: 1000, messages: [{ role: "user", content: prompt }] })