Claude: Add additional telemetry to know if Claude integration can be successfully used

This commit is contained in:
Alessandro Pignotti 2025-03-14 09:52:47 +01:00
parent 6fd483b81e
commit 91f68ce044

View File

@ -114,10 +114,14 @@ async function sendMessages(handleTool)
} }
} }
if(response.stop_reason == "end_turn") if(response.stop_reason == "end_turn")
{
tryPlausible("ClaudeAI Success");
aiActivity.set(false); aiActivity.set(false);
} }
}
catch(e) catch(e)
{ {
tryPlausible("ClaudeAI Error");
if(e.status == 401) if(e.status == 401)
{ {
addMessageInternal('error', 'Invalid API key'); addMessageInternal('error', 'Invalid API key');