call-ai 0.10.2 → 0.11.0-dev-preview3

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.
Files changed (71) hide show
  1. package/README.md +60 -58
  2. package/api-core.d.ts +13 -0
  3. package/{dist/api-core.js → api-core.js} +51 -126
  4. package/api-core.js.map +1 -0
  5. package/api.d.ts +4 -0
  6. package/api.js +364 -0
  7. package/api.js.map +1 -0
  8. package/api.ts.off +595 -0
  9. package/{dist/error-handling.d.ts → error-handling.d.ts} +4 -2
  10. package/{dist/error-handling.js → error-handling.js} +34 -70
  11. package/error-handling.js.map +1 -0
  12. package/image.d.ts +2 -0
  13. package/{dist/image.js → image.js} +10 -33
  14. package/image.js.map +1 -0
  15. package/index.d.ts +6 -0
  16. package/index.js +7 -0
  17. package/index.js.map +1 -0
  18. package/index.ts.bak +16 -0
  19. package/key-management.d.ts +29 -0
  20. package/key-management.js +189 -0
  21. package/key-management.js.map +1 -0
  22. package/{dist/non-streaming.d.ts → non-streaming.d.ts} +5 -8
  23. package/{dist/non-streaming.js → non-streaming.js} +28 -87
  24. package/non-streaming.js.map +1 -0
  25. package/package.json +15 -31
  26. package/response-metadata.d.ts +6 -0
  27. package/response-metadata.js +22 -0
  28. package/response-metadata.js.map +1 -0
  29. package/strategies/index.d.ts +2 -0
  30. package/strategies/index.js +3 -0
  31. package/strategies/index.js.map +1 -0
  32. package/strategies/model-strategies.d.ts +6 -0
  33. package/{dist/strategies → strategies}/model-strategies.js +26 -72
  34. package/strategies/model-strategies.js.map +1 -0
  35. package/strategies/strategy-selector.d.ts +2 -0
  36. package/strategies/strategy-selector.js +66 -0
  37. package/strategies/strategy-selector.js.map +1 -0
  38. package/streaming.d.ts +4 -0
  39. package/{dist/streaming.js → streaming.js} +66 -184
  40. package/streaming.js.map +1 -0
  41. package/streaming.ts.off +571 -0
  42. package/tsconfig.json +18 -0
  43. package/types.d.ts +226 -0
  44. package/types.js +33 -0
  45. package/types.js.map +1 -0
  46. package/utils.d.ts +32 -0
  47. package/utils.js +129 -0
  48. package/utils.js.map +1 -0
  49. package/version.d.ts +1 -0
  50. package/version.js +2 -0
  51. package/version.js.map +1 -0
  52. package/dist/api-core.d.ts +0 -40
  53. package/dist/api.d.ts +0 -15
  54. package/dist/api.js +0 -498
  55. package/dist/image.d.ts +0 -12
  56. package/dist/index.d.ts +0 -7
  57. package/dist/index.js +0 -32
  58. package/dist/key-management.d.ts +0 -43
  59. package/dist/key-management.js +0 -312
  60. package/dist/response-metadata.d.ts +0 -18
  61. package/dist/response-metadata.js +0 -44
  62. package/dist/strategies/index.d.ts +0 -5
  63. package/dist/strategies/index.js +0 -21
  64. package/dist/strategies/model-strategies.d.ts +0 -24
  65. package/dist/strategies/strategy-selector.d.ts +0 -8
  66. package/dist/strategies/strategy-selector.js +0 -79
  67. package/dist/streaming.d.ts +0 -7
  68. package/dist/types.d.ts +0 -226
  69. package/dist/types.js +0 -5
  70. package/dist/utils.d.ts +0 -8
  71. package/dist/utils.js +0 -52
package/api.js ADDED
@@ -0,0 +1,364 @@
1
+ import { CallAIError } from "./types.js";
2
+ import { chooseSchemaStrategy } from "./strategies/index.js";
3
+ import { responseMetadata, boxString, getMeta } from "./response-metadata.js";
4
+ import { keyStore, globalDebug } from "./key-management.js";
5
+ import { handleApiError, checkForInvalidModelError } from "./error-handling.js";
6
+ import { createBackwardCompatStreamingProxy } from "./api-core.js";
7
+ import { extractContent, extractClaudeResponse, PACKAGE_VERSION } from "./non-streaming.js";
8
+ import { createStreamingGenerator } from "./streaming.js";
9
+ import { callAiEnv, callAiFetch } from "./utils.js";
10
+ export { getMeta };
11
+ const FALLBACK_MODEL = "openrouter/auto";
12
+ export function callAi(prompt, options = {}) {
13
+ const schemaStrategy = chooseSchemaStrategy(options.model, options.schema || null);
14
+ if (!options.stream && schemaStrategy.shouldForceStream) {
15
+ return bufferStreamingResults(prompt, options);
16
+ }
17
+ if (options.stream !== true) {
18
+ return callAINonStreaming(prompt, options);
19
+ }
20
+ const streamPromise = (async () => {
21
+ const { endpoint, requestOptions, model, schemaStrategy } = prepareRequestParams(prompt, { ...options, stream: true });
22
+ const debug = options.debug || globalDebug;
23
+ if (debug) {
24
+ console.log(`[callAi:${PACKAGE_VERSION}] Making fetch request to: ${endpoint}`);
25
+ console.log(`[callAi:${PACKAGE_VERSION}] With model: ${model}`);
26
+ console.log(`[callAi:${PACKAGE_VERSION}] Request headers:`, JSON.stringify(requestOptions.headers));
27
+ }
28
+ let response;
29
+ try {
30
+ response = await callAiFetch(options)(endpoint, requestOptions);
31
+ if (options.debug) {
32
+ console.log(`[callAi:${PACKAGE_VERSION}] Fetch completed with status:`, response.status, response.statusText);
33
+ console.log(`[callAi:${PACKAGE_VERSION}] Response headers:`);
34
+ response.headers.forEach((value, name) => {
35
+ console.log(`[callAi:${PACKAGE_VERSION}] ${name}: ${value}`);
36
+ });
37
+ const diagnosticResponse = response.clone();
38
+ try {
39
+ const responseText = await diagnosticResponse.text();
40
+ console.log(`[callAi:${PACKAGE_VERSION}] First 500 chars of response body:`, responseText.substring(0, 500) + (responseText.length > 500 ? "..." : ""));
41
+ }
42
+ catch (e) {
43
+ console.log(`[callAi:${PACKAGE_VERSION}] Could not read response body for diagnostics:`, e);
44
+ }
45
+ }
46
+ }
47
+ catch (fetchError) {
48
+ if (options.debug) {
49
+ console.error(`[callAi:${PACKAGE_VERSION}] Network error during fetch:`, fetchError);
50
+ }
51
+ throw fetchError;
52
+ }
53
+ const contentType = response?.headers?.get?.("content-type") || "";
54
+ if (options.debug) {
55
+ console.log(`[callAi:${PACKAGE_VERSION}] Response.ok =`, response.ok);
56
+ console.log(`[callAi:${PACKAGE_VERSION}] Response.status =`, response.status);
57
+ console.log(`[callAi:${PACKAGE_VERSION}] Response.statusText =`, response.statusText);
58
+ console.log(`[callAi:${PACKAGE_VERSION}] Response.type =`, response.type);
59
+ console.log(`[callAi:${PACKAGE_VERSION}] Content-Type =`, contentType);
60
+ }
61
+ const hasHttpError = !response.ok || response.status >= 400;
62
+ const hasJsonError = contentType.includes("application/json");
63
+ if (hasHttpError || hasJsonError) {
64
+ if (options.debug) {
65
+ console.log(`[callAi:${PACKAGE_VERSION}] ⚠️ Error detected - HTTP Status: ${response.status}, Content-Type: ${contentType}`);
66
+ }
67
+ if (!options.skipRetry) {
68
+ const clonedResponse = response.clone();
69
+ let isInvalidModel = false;
70
+ try {
71
+ const modelCheckResult = await checkForInvalidModelError(clonedResponse, model, options.debug);
72
+ isInvalidModel = modelCheckResult.isInvalidModel;
73
+ if (isInvalidModel) {
74
+ if (options.debug) {
75
+ console.log(`[callAi:${PACKAGE_VERSION}] Retrying with fallback model: ${FALLBACK_MODEL}`);
76
+ }
77
+ return (await callAi(prompt, {
78
+ ...options,
79
+ model: FALLBACK_MODEL,
80
+ }));
81
+ }
82
+ }
83
+ catch (modelCheckError) {
84
+ console.error(`[callAi:${PACKAGE_VERSION}] Error during model check:`, modelCheckError);
85
+ // Continue with normal error handling
86
+ }
87
+ }
88
+ try {
89
+ const errorBody = await response.text();
90
+ if (options.debug) {
91
+ console.log(`[callAi:${PACKAGE_VERSION}] Error body:`, errorBody);
92
+ }
93
+ try {
94
+ const errorJson = JSON.parse(errorBody);
95
+ if (options.debug) {
96
+ console.log(`[callAi:${PACKAGE_VERSION}] Parsed error:`, errorJson);
97
+ }
98
+ let errorMessage = "";
99
+ if (errorJson.error && typeof errorJson.error === "object" && errorJson.error.message) {
100
+ errorMessage = errorJson.error.message;
101
+ }
102
+ else if (errorJson.error && typeof errorJson.error === "string") {
103
+ errorMessage = errorJson.error;
104
+ }
105
+ else if (errorJson.message) {
106
+ errorMessage = errorJson.message;
107
+ }
108
+ else {
109
+ errorMessage = `API returned ${response.status}: ${response.statusText}`;
110
+ }
111
+ if (!errorMessage.includes(response.status.toString())) {
112
+ errorMessage = `${errorMessage} (Status: ${response.status})`;
113
+ }
114
+ if (options.debug) {
115
+ console.log(`[callAi:${PACKAGE_VERSION}] Extracted error message:`, errorMessage);
116
+ }
117
+ const error = new CallAIError({
118
+ message: errorMessage,
119
+ status: response.status,
120
+ statusText: response.statusText,
121
+ details: errorJson,
122
+ contentType,
123
+ });
124
+ throw error;
125
+ }
126
+ catch (jsonError) {
127
+ if (options.debug) {
128
+ console.log(`[callAi:${PACKAGE_VERSION}] JSON parse error:`, jsonError);
129
+ }
130
+ let errorMessage = "";
131
+ if (errorBody && errorBody.trim().length > 0) {
132
+ errorMessage = errorBody.length > 100 ? errorBody.substring(0, 100) + "..." : errorBody;
133
+ }
134
+ else {
135
+ errorMessage = `API error: ${response.status} ${response.statusText}`;
136
+ }
137
+ if (!errorMessage.includes(response.status.toString())) {
138
+ errorMessage = `${errorMessage} (Status: ${response.status})`;
139
+ }
140
+ if (options.debug) {
141
+ console.log(`[callAi:${PACKAGE_VERSION}] Extracted text error message:`, errorMessage);
142
+ }
143
+ const error = new CallAIError({
144
+ message: errorMessage,
145
+ status: response.status,
146
+ statusText: response.statusText,
147
+ details: errorBody,
148
+ contentType,
149
+ });
150
+ throw error;
151
+ }
152
+ }
153
+ catch (responseError) {
154
+ if (responseError instanceof Error) {
155
+ throw responseError;
156
+ }
157
+ const error = new CallAIError({
158
+ message: `API returned ${response.status}: ${response.statusText}`,
159
+ status: response.status,
160
+ statusText: response.statusText,
161
+ contentType,
162
+ });
163
+ throw error;
164
+ }
165
+ }
166
+ if (options.debug) {
167
+ console.log(`[callAi:${PACKAGE_VERSION}] Response OK, creating streaming generator`);
168
+ }
169
+ return createStreamingGenerator(response, options, schemaStrategy, model);
170
+ })();
171
+ if (process.env.NODE_ENV !== "production") {
172
+ if (options.debug) {
173
+ console.warn(`[callAi:${PACKAGE_VERSION}] No await found - using legacy streaming pattern. This will be removed in a future version and may cause issues with certain models.`);
174
+ }
175
+ }
176
+ return createBackwardCompatStreamingProxy(streamPromise);
177
+ }
178
+ async function bufferStreamingResults(prompt, options) {
179
+ const streamingOptions = {
180
+ ...options,
181
+ stream: true,
182
+ };
183
+ try {
184
+ const generator = (await callAi(prompt, streamingOptions));
185
+ const isClaudeJson = /claude/.test(options.model || "") && options.schema;
186
+ if (isClaudeJson) {
187
+ let lastChunk = "";
188
+ for await (const chunk of generator) {
189
+ lastChunk = chunk;
190
+ }
191
+ return lastChunk;
192
+ }
193
+ else {
194
+ let result = "";
195
+ for await (const chunk of generator) {
196
+ result += chunk;
197
+ }
198
+ return result;
199
+ }
200
+ }
201
+ catch (error) {
202
+ await handleApiError(error, "Buffered streaming", options.debug, {
203
+ apiKey: options.apiKey,
204
+ endpoint: options.endpoint,
205
+ skipRefresh: options.skipRefresh,
206
+ refreshToken: options.refreshToken,
207
+ updateRefreshToken: options.updateRefreshToken,
208
+ });
209
+ return bufferStreamingResults(prompt, {
210
+ ...options,
211
+ apiKey: keyStore().current,
212
+ });
213
+ }
214
+ throw new Error("Unexpected code path in bufferStreamingResults");
215
+ }
216
+ function prepareRequestParams(prompt, options) {
217
+ const apiKey = options.apiKey ||
218
+ keyStore().current ||
219
+ callAiEnv.CALLAI_API_KEY ||
220
+ null;
221
+ const schema = options.schema || null;
222
+ const schemaStrategy = chooseSchemaStrategy(options.model, schema);
223
+ const model = schemaStrategy.model;
224
+ const customChatOrigin = options.chatUrl || callAiEnv.CALLAI_CHAT_URL || null;
225
+ const endpoint = options.endpoint ||
226
+ (customChatOrigin ? `${customChatOrigin}/api/v1/chat/completions` : "https://openrouter.ai/api/v1/chat/completions");
227
+ const messages = Array.isArray(prompt) ? prompt : [{ role: "user", content: prompt }];
228
+ const requestParams = {
229
+ model,
230
+ messages,
231
+ stream: options.stream !== undefined ? options.stream : false,
232
+ };
233
+ if (options.temperature !== undefined) {
234
+ requestParams.temperature = options.temperature;
235
+ }
236
+ if (options.topP !== undefined) {
237
+ requestParams.top_p = options.topP;
238
+ }
239
+ if (options.maxTokens !== undefined) {
240
+ requestParams.max_tokens = options.maxTokens;
241
+ }
242
+ if (options.stop) {
243
+ requestParams.stop = Array.isArray(options.stop) ? options.stop : [options.stop];
244
+ }
245
+ if (options.responseFormat === "json") {
246
+ requestParams.response_format = { type: "json_object" };
247
+ }
248
+ if (schema) {
249
+ Object.assign(requestParams, schemaStrategy.prepareRequest(schema, messages));
250
+ }
251
+ const headers = {
252
+ Authorization: `Bearer ${apiKey}`,
253
+ "Content-Type": "application/json",
254
+ "HTTP-Referer": options.referer || "https://vibes.diy",
255
+ "X-Title": options.title || "Vibes",
256
+ };
257
+ if (options.headers) {
258
+ Object.assign(headers, options.headers);
259
+ }
260
+ const requestOptions = {
261
+ method: "POST",
262
+ headers: {
263
+ ...headers,
264
+ "Content-Type": "application/json",
265
+ },
266
+ body: JSON.stringify(requestParams),
267
+ };
268
+ if (!apiKey) {
269
+ throw new Error("API key is required. Provide it via options.apiKey or set window.CALLAI_API_KEY");
270
+ }
271
+ if (options.debug) {
272
+ console.log(`[callAi-prepareRequest:raw] Endpoint: ${endpoint}`);
273
+ console.log(`[callAi-prepareRequest:raw] Model: ${model}`);
274
+ console.log(`[callAi-prepareRequest:raw] Payload:`, JSON.stringify(requestParams));
275
+ }
276
+ return { apiKey, model, endpoint, requestOptions, schemaStrategy };
277
+ }
278
+ async function callAINonStreaming(prompt, options = {}, isRetry = false) {
279
+ try {
280
+ const startTime = Date.now();
281
+ const meta = {
282
+ model: options.model || "unknown",
283
+ timing: {
284
+ startTime: startTime,
285
+ },
286
+ };
287
+ const { endpoint, requestOptions, model, schemaStrategy } = prepareRequestParams(prompt, options);
288
+ const response = await callAiFetch(options)(endpoint, requestOptions);
289
+ if (!response.ok || response.status >= 400) {
290
+ const { isInvalidModel } = await checkForInvalidModelError(response, model, options.debug);
291
+ if (isInvalidModel && !options.skipRetry) {
292
+ return callAINonStreaming(prompt, { ...options, model: FALLBACK_MODEL }, true);
293
+ }
294
+ const error = new CallAIError({
295
+ message: `HTTP error! Status: ${response.status}`,
296
+ status: response.status,
297
+ statusCode: response.status,
298
+ contentType: "text/plain",
299
+ });
300
+ throw error;
301
+ }
302
+ let result;
303
+ if (/claude/i.test(model)) {
304
+ try {
305
+ result = await extractClaudeResponse(response);
306
+ }
307
+ catch (error) {
308
+ handleApiError(error, "Claude API response processing failed", options.debug);
309
+ }
310
+ }
311
+ else {
312
+ result = await response.json();
313
+ }
314
+ if (options.debug) {
315
+ console.log(`[callAi-nonStreaming:raw] Response:`, JSON.stringify(result));
316
+ }
317
+ if (result.error) {
318
+ if (options.debug) {
319
+ console.error("API returned an error:", result.error);
320
+ }
321
+ if (!isRetry &&
322
+ !options.skipRetry &&
323
+ result.error.message &&
324
+ result.error.message.toLowerCase().includes("not a valid model")) {
325
+ if (options.debug) {
326
+ console.warn(`Model ${model} error, retrying with ${FALLBACK_MODEL}`);
327
+ }
328
+ return callAINonStreaming(prompt, { ...options, model: FALLBACK_MODEL }, true);
329
+ }
330
+ return JSON.stringify({
331
+ error: result.error,
332
+ message: result.error.message || "API returned an error",
333
+ });
334
+ }
335
+ const content = extractContent(result, schemaStrategy);
336
+ if (result) {
337
+ meta.rawResponse = result;
338
+ }
339
+ meta.model = model;
340
+ if (meta.timing) {
341
+ meta.timing.endTime = Date.now();
342
+ meta.timing.duration = meta.timing.endTime - meta.timing.startTime;
343
+ }
344
+ const processedContent = schemaStrategy.processResponse(content);
345
+ const boxed = boxString(processedContent);
346
+ responseMetadata.set(boxed, meta);
347
+ return processedContent;
348
+ }
349
+ catch (error) {
350
+ await handleApiError(error, "Non-streaming API call", options.debug, {
351
+ apiKey: options.apiKey,
352
+ endpoint: options.endpoint,
353
+ skipRefresh: options.skipRefresh,
354
+ refreshToken: options.refreshToken,
355
+ updateRefreshToken: options.updateRefreshToken,
356
+ });
357
+ return callAINonStreaming(prompt, {
358
+ ...options,
359
+ apiKey: keyStore().current,
360
+ }, true);
361
+ }
362
+ throw new Error("Unexpected code path in callAINonStreaming");
363
+ }
364
+ //# sourceMappingURL=api.js.map
package/api.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../jsr/api.ts"],"names":[],"mappings":"AAGA,OAAO,E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