@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.js CHANGED
@@ -980,6 +980,7 @@ function parseToolArguments(argsJson) {
980
980
  }
981
981
 
982
982
  // src/providers/anthropic.ts
983
+ var NON_STREAMING_TIMEOUT_MS = 60 * 60 * 1e3;
983
984
  var anthropicClientCache = /* @__PURE__ */ new Map();
984
985
  function createClient(options) {
985
986
  const isOAuth = options.apiKey?.startsWith("sk-ant-oat");
@@ -1146,8 +1147,9 @@ async function* runStream(options) {
1146
1147
  ...betaHeaders.length ? { headers: { "anthropic-beta": betaHeaders.join(",") } } : {}
1147
1148
  };
1148
1149
  if (!useStreaming) {
1150
+ const nonStreamingClient = client.withOptions({ timeout: NON_STREAMING_TIMEOUT_MS });
1149
1151
  try {
1150
- const message = await client.messages.create(
1152
+ const message = await nonStreamingClient.messages.create(
1151
1153
  { ...params, stream: false },
1152
1154
  requestOptions
1153
1155
  );