@jaypie/llm 1.2.26 → 1.2.28
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/cjs/constants.d.ts +4 -4
- package/dist/cjs/index.cjs +5 -7
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/constants.d.ts +4 -4
- package/dist/esm/index.js +5 -7
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const PROVIDER: {
|
|
|
5
5
|
};
|
|
6
6
|
readonly MODEL: {
|
|
7
7
|
readonly DEFAULT: "claude-sonnet-4-6";
|
|
8
|
-
readonly LARGE: "claude-opus-4-
|
|
8
|
+
readonly LARGE: "claude-opus-4-7";
|
|
9
9
|
readonly SMALL: "claude-sonnet-4-6";
|
|
10
10
|
readonly TINY: "claude-haiku-4-5";
|
|
11
11
|
};
|
|
@@ -51,7 +51,7 @@ export declare const PROVIDER: {
|
|
|
51
51
|
readonly OPENROUTER: {
|
|
52
52
|
readonly MODEL: {
|
|
53
53
|
readonly DEFAULT: "anthropic/claude-sonnet-4-6";
|
|
54
|
-
readonly LARGE: "anthropic/claude-opus-4-
|
|
54
|
+
readonly LARGE: "anthropic/claude-opus-4-7";
|
|
55
55
|
readonly SMALL: "anthropic/claude-sonnet-4-6";
|
|
56
56
|
readonly TINY: "anthropic/claude-haiku-4-5";
|
|
57
57
|
};
|
|
@@ -98,8 +98,8 @@ export declare const DEFAULT: {
|
|
|
98
98
|
};
|
|
99
99
|
export declare const ALL: {
|
|
100
100
|
readonly BASE: readonly ["claude-sonnet-4-6", "gemini-3.1-pro-preview", "gpt-5.4", "grok-4.20-0309-reasoning"];
|
|
101
|
-
readonly COMBINED: readonly ("claude-sonnet-4-6" | "claude-opus-4-
|
|
102
|
-
readonly LARGE: readonly ["claude-opus-4-
|
|
101
|
+
readonly COMBINED: readonly ("claude-sonnet-4-6" | "claude-opus-4-7" | "claude-haiku-4-5" | "gemini-3.1-pro-preview" | "gemini-3-flash-preview" | "gemini-3.1-flash-lite-preview" | "gpt-5.4" | "gpt-5.4-mini" | "gpt-5.4-nano" | "grok-4.20-0309-reasoning" | "grok-4.20-0309-non-reasoning" | "grok-4-1-fast-non-reasoning")[];
|
|
102
|
+
readonly LARGE: readonly ["claude-opus-4-7", "gemini-3.1-pro-preview", "gpt-5.4", "grok-4.20-0309-reasoning"];
|
|
103
103
|
readonly SMALL: readonly ["claude-sonnet-4-6", "gemini-3-flash-preview", "gpt-5.4-mini", "grok-4.20-0309-non-reasoning"];
|
|
104
104
|
readonly TINY: readonly ["claude-haiku-4-5", "gemini-3.1-flash-lite-preview", "gpt-5.4-nano", "grok-4-1-fast-non-reasoning"];
|
|
105
105
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const FIRST_CLASS_PROVIDER = {
|
|
|
15
15
|
// https://docs.anthropic.com/en/docs/about-claude/models/overview
|
|
16
16
|
ANTHROPIC: {
|
|
17
17
|
DEFAULT: "claude-sonnet-4-6",
|
|
18
|
-
LARGE: "claude-opus-4-
|
|
18
|
+
LARGE: "claude-opus-4-7",
|
|
19
19
|
SMALL: "claude-sonnet-4-6",
|
|
20
20
|
TINY: "claude-haiku-4-5",
|
|
21
21
|
},
|
|
@@ -1760,8 +1760,6 @@ class GeminiAdapter extends BaseProviderAdapter {
|
|
|
1760
1760
|
contents: geminiRequest.contents,
|
|
1761
1761
|
config: geminiRequest.config,
|
|
1762
1762
|
});
|
|
1763
|
-
// Track current function call being built
|
|
1764
|
-
let currentFunctionCall = null;
|
|
1765
1763
|
// Track usage for final chunk
|
|
1766
1764
|
let inputTokens = 0;
|
|
1767
1765
|
let outputTokens = 0;
|
|
@@ -1782,7 +1780,7 @@ class GeminiAdapter extends BaseProviderAdapter {
|
|
|
1782
1780
|
// Handle function calls
|
|
1783
1781
|
if (part.functionCall) {
|
|
1784
1782
|
const functionCall = part.functionCall;
|
|
1785
|
-
currentFunctionCall = {
|
|
1783
|
+
const currentFunctionCall = {
|
|
1786
1784
|
id: functionCall.id || this.generateCallId(),
|
|
1787
1785
|
name: functionCall.name || "",
|
|
1788
1786
|
arguments: functionCall.args || {},
|
|
@@ -1802,7 +1800,6 @@ class GeminiAdapter extends BaseProviderAdapter {
|
|
|
1802
1800
|
metadata,
|
|
1803
1801
|
},
|
|
1804
1802
|
};
|
|
1805
|
-
currentFunctionCall = null;
|
|
1806
1803
|
}
|
|
1807
1804
|
}
|
|
1808
1805
|
}
|
|
@@ -5392,14 +5389,13 @@ function formatUserMessage$2(message, { data, placeholders: placeholders$1 } = {
|
|
|
5392
5389
|
function prepareMessages$2(message, { data, placeholders } = {}) {
|
|
5393
5390
|
const logger = getLogger$3();
|
|
5394
5391
|
const messages = [];
|
|
5395
|
-
let systemInstruction;
|
|
5396
5392
|
// Note: Gemini handles system prompts differently via systemInstruction config
|
|
5397
5393
|
// This function is kept for compatibility but system prompts should be passed
|
|
5398
5394
|
// via the systemInstruction parameter in generateContent
|
|
5399
5395
|
const userMessage = formatUserMessage$2(message, { data, placeholders });
|
|
5400
5396
|
messages.push(userMessage);
|
|
5401
5397
|
logger.trace(`User message: ${userMessage.content?.length} characters`);
|
|
5402
|
-
return { messages, systemInstruction };
|
|
5398
|
+
return { messages, systemInstruction: undefined };
|
|
5403
5399
|
}
|
|
5404
5400
|
|
|
5405
5401
|
class GeminiProvider {
|
|
@@ -6422,8 +6418,10 @@ const weather = {
|
|
|
6422
6418
|
}
|
|
6423
6419
|
catch (error) {
|
|
6424
6420
|
if (error instanceof Error) {
|
|
6421
|
+
// eslint-disable-next-line preserve-caught-error -- package targets ES2020; Error `cause` option requires ES2022
|
|
6425
6422
|
throw new Error(`Weather API error: ${error.message}`);
|
|
6426
6423
|
}
|
|
6424
|
+
// eslint-disable-next-line preserve-caught-error -- package targets ES2020; Error `cause` option requires ES2022
|
|
6427
6425
|
throw new Error("Unknown error occurred while fetching weather data");
|
|
6428
6426
|
}
|
|
6429
6427
|
},
|