ticketlens 0.1.22 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -49,14 +49,16 @@ async function callAnthropic({ brief, apiKey, fetcher, timeoutMs, prompt, maxTok
|
|
|
49
49
|
'anthropic-version': '2023-06-01',
|
|
50
50
|
},
|
|
51
51
|
body: JSON.stringify({
|
|
52
|
-
model: 'claude-
|
|
52
|
+
model: 'claude-3-5-haiku-20241022',
|
|
53
53
|
max_tokens: maxTokens,
|
|
54
54
|
messages: [{ role: 'user', content: prompt + brief }],
|
|
55
55
|
}),
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
if (!res.ok) {
|
|
59
|
-
|
|
59
|
+
let detail = '';
|
|
60
|
+
try { detail = (await res.json()).error?.message || ''; } catch {}
|
|
61
|
+
const err = new Error(`Anthropic API error ${res.status}${detail ? ': ' + detail : ''}`);
|
|
60
62
|
err.status = res.status;
|
|
61
63
|
throw err;
|
|
62
64
|
}
|
|
@@ -81,7 +83,9 @@ async function callOpenAi({ brief, apiKey, fetcher, timeoutMs, prompt, maxTokens
|
|
|
81
83
|
});
|
|
82
84
|
|
|
83
85
|
if (!res.ok) {
|
|
84
|
-
|
|
86
|
+
let detail = '';
|
|
87
|
+
try { detail = (await res.json()).error?.message || ''; } catch {}
|
|
88
|
+
const err = new Error(`OpenAI API error ${res.status}${detail ? ': ' + detail : ''}`);
|
|
85
89
|
err.status = res.status;
|
|
86
90
|
throw err;
|
|
87
91
|
}
|