@prestyj/ai 4.12.0 → 4.12.1
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/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1035,6 +1035,7 @@ function parseToolArguments(argsJson) {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
|
|
1037
1037
|
// src/providers/anthropic.ts
|
|
1038
|
+
var NON_STREAMING_TIMEOUT_MS = 60 * 60 * 1e3;
|
|
1038
1039
|
var anthropicClientCache = /* @__PURE__ */ new Map();
|
|
1039
1040
|
function createClient(options) {
|
|
1040
1041
|
const isOAuth = options.apiKey?.startsWith("sk-ant-oat");
|
|
@@ -1201,8 +1202,9 @@ async function* runStream(options) {
|
|
|
1201
1202
|
...betaHeaders.length ? { headers: { "anthropic-beta": betaHeaders.join(",") } } : {}
|
|
1202
1203
|
};
|
|
1203
1204
|
if (!useStreaming) {
|
|
1205
|
+
const nonStreamingClient = client.withOptions({ timeout: NON_STREAMING_TIMEOUT_MS });
|
|
1204
1206
|
try {
|
|
1205
|
-
const message = await
|
|
1207
|
+
const message = await nonStreamingClient.messages.create(
|
|
1206
1208
|
{ ...params, stream: false },
|
|
1207
1209
|
requestOptions
|
|
1208
1210
|
);
|