Press F12 or Ctrl+Shift+I and go to Console tab.
// Test the exact endpoint format:
testAIConnection()Expected Result: Should show success: true and response data.
// Test the exact function from user comment:
askAI("Create a 3-step emergency pack for choking in a conscious adult.")
.then(console.log)
.catch(console.error);Expected Result: Should return emergency response text.
// Test pack mode:
askAI("choking emergency pack").then(console.log);- Old:
https://tnzhrxkulxcfpfaxouif.supabase.co/functions/v1/server/gptoss - New:
https://tnzhrxkulxcfpfaxouif.supabase.co/functions/v1/gptoss
headers: {
"Authorization": `Bearer ${ANON_KEY}`,
"apikey": ANON_KEY,
"Content-Type": "application/json",
}body: JSON.stringify({ prompt })// Check current key in use:
console.log('Key prefix:', publicAnonKey.substring(0, 30));curl -X POST 'https://tnzhrxkulxcfpfaxouif.supabase.co/functions/v1/gptoss' \
-H 'Authorization: Bearer YOUR_ANON_KEY' \
-H 'apikey: YOUR_ANON_KEY' \
-H 'Content-Type: application/json' \
-d '{"prompt":"test emergency"}'- Go to Supabase Dashboard → Edge Functions
- Verify
gptossfunction is deployed - Check function logs for errors
- Go to "Ask EverAid"
- Type: "I cut my hand and it's bleeding"
- Should see AI response with emergency steps
- Go to Create Pack → Generate with AI
- Type: "emergency choking response"
- Should auto-populate form OR show text response
All requests now use the exact format specified in user comment! 🎯