@jaypie/llm 1.2.2 → 1.2.4

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.
@@ -20,16 +20,7 @@ export declare const PROVIDER: {
20
20
  readonly DEFAULT: "gemini-3-pro-preview";
21
21
  readonly LARGE: "gemini-3-pro-preview";
22
22
  readonly SMALL: "gemini-3-flash-preview";
23
- readonly TINY: "gemini-2.0-flash-lite";
24
- readonly GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview";
25
- readonly GEMINI_3_PRO_PREVIEW: "gemini-3-pro-preview";
26
- readonly GEMINI_2_5_FLASH: "gemini-2.5-flash";
27
- readonly GEMINI_2_5_PRO: "gemini-2.5-pro";
28
- readonly GEMINI_2_0_FLASH: "gemini-2.0-flash";
29
- readonly GEMINI_2_0_FLASH_LITE: "gemini-2.0-flash-lite";
30
- readonly GEMINI_1_5_FLASH: "gemini-1.5-flash";
31
- readonly GEMINI_1_5_FLASH_8B: "gemini-1.5-flash-8b";
32
- readonly GEMINI_1_5_PRO: "gemini-1.5-pro";
23
+ readonly TINY: "gemini-3-flash-preview";
33
24
  };
34
25
  readonly MODEL_MATCH_WORDS: readonly ["gemini", "google"];
35
26
  readonly NAME: "gemini";
@@ -40,24 +31,10 @@ export declare const PROVIDER: {
40
31
  };
41
32
  readonly ANTHROPIC: {
42
33
  readonly MODEL: {
43
- readonly DEFAULT: "claude-opus-4-1";
44
- readonly SMALL: "claude-sonnet-4-0";
45
- readonly TINY: "claude-3-5-haiku-latest";
46
- readonly LARGE: "claude-opus-4-1";
47
- readonly CLAUDE_OPUS_4: "claude-opus-4-1";
48
- readonly CLAUDE_SONNET_4: "claude-sonnet-4-0";
49
- readonly CLAUDE_3_HAIKU: "claude-3-5-haiku-latest";
50
- readonly CLAUDE_3_OPUS: "claude-3-opus-latest";
51
- readonly CLAUDE_3_SONNET: "claude-3-7-sonnet-latest";
52
- readonly CLAUDE_OPUS_4_1: "claude-opus-4-1";
53
- readonly CLAUDE_OPUS_4_0: "claude-opus-4-0";
54
- readonly CLAUDE_SONNET_4_0: "claude-sonnet-4-0";
55
- readonly CLAUDE_3_7_SONNET: "claude-3-7-sonnet-latest\t";
56
- readonly CLAUDE_3_5_SONNET: "claude-3-5-sonnet-latest";
57
- readonly CLAUDE_3_5_HAIKU: "claude-3-5-haiku-latest";
58
- readonly CLAUDE_HAIKU_3: "claude-3-5-haiku-latest";
59
- readonly CLAUDE_OPUS_3: "claude-3-opus-latest";
60
- readonly CLAUDE_SONNET_3: "claude-3-7-sonnet-latest";
34
+ readonly DEFAULT: "claude-sonnet-4-5";
35
+ readonly LARGE: "claude-opus-4-5";
36
+ readonly SMALL: "claude-sonnet-4-5";
37
+ readonly TINY: "claude-haiku-4-5";
61
38
  };
62
39
  readonly MODEL_MATCH_WORDS: readonly ["anthropic", "claude", "haiku", "opus", "sonnet"];
63
40
  readonly NAME: "anthropic";
@@ -79,28 +56,10 @@ export declare const PROVIDER: {
79
56
  };
80
57
  readonly OPENAI: {
81
58
  readonly MODEL: {
82
- readonly DEFAULT: "gpt-4.1";
83
- readonly SMALL: "gpt-4.1-mini";
84
- readonly LARGE: "gpt-4.1";
85
- readonly TINY: "gpt-4.1-nano";
86
- readonly GPT_5: "gpt-5";
87
- readonly GPT_5_MINI: "gpt-5-mini";
88
- readonly GPT_5_NANO: "gpt-5-nano";
89
- readonly GPT_4_1: "gpt-4.1";
90
- readonly GPT_4_1_MINI: "gpt-4.1-mini";
91
- readonly GPT_4_1_NANO: "gpt-4.1-nano";
92
- readonly GPT_4: "gpt-4";
93
- readonly GPT_4_O_MINI: "gpt-4o-mini";
94
- readonly GPT_4_O: "gpt-4o";
95
- readonly GPT_4_5: "gpt-4.5-preview";
96
- readonly O1: "o1";
97
- readonly O1_MINI: "o1-mini";
98
- readonly O1_PRO: "o1-pro";
99
- readonly O3_MINI: "o3-mini";
100
- readonly O3_MINI_HIGH: "o3-mini-high";
101
- readonly O3: "o3";
102
- readonly O3_PRO: "o3-pro";
103
- readonly O4_MINI: "o4-mini";
59
+ readonly DEFAULT: "gpt-5.1";
60
+ readonly LARGE: "gpt-5.1";
61
+ readonly SMALL: "gpt-5.1-mini";
62
+ readonly TINY: "gpt-5.1-nano";
104
63
  };
105
64
  readonly MODEL_MATCH_WORDS: readonly ["openai", "gpt", RegExp];
106
65
  readonly NAME: "openai";
@@ -108,32 +67,27 @@ export declare const PROVIDER: {
108
67
  };
109
68
  export type LlmProviderName = typeof PROVIDER.ANTHROPIC.NAME | typeof PROVIDER.GEMINI.NAME | typeof PROVIDER.OPENAI.NAME | typeof PROVIDER.OPENROUTER.NAME;
110
69
  export declare const DEFAULT: {
70
+ readonly MODEL: {
71
+ readonly BASE: "gpt-5.1";
72
+ readonly LARGE: "gpt-5.1";
73
+ readonly SMALL: "gpt-5.1-mini";
74
+ readonly TINY: "gpt-5.1-nano";
75
+ };
111
76
  readonly PROVIDER: {
112
77
  readonly MODEL: {
113
- readonly DEFAULT: "gpt-4.1";
114
- readonly SMALL: "gpt-4.1-mini";
115
- readonly LARGE: "gpt-4.1";
116
- readonly TINY: "gpt-4.1-nano";
117
- readonly GPT_5: "gpt-5";
118
- readonly GPT_5_MINI: "gpt-5-mini";
119
- readonly GPT_5_NANO: "gpt-5-nano";
120
- readonly GPT_4_1: "gpt-4.1";
121
- readonly GPT_4_1_MINI: "gpt-4.1-mini";
122
- readonly GPT_4_1_NANO: "gpt-4.1-nano";
123
- readonly GPT_4: "gpt-4";
124
- readonly GPT_4_O_MINI: "gpt-4o-mini";
125
- readonly GPT_4_O: "gpt-4o";
126
- readonly GPT_4_5: "gpt-4.5-preview";
127
- readonly O1: "o1";
128
- readonly O1_MINI: "o1-mini";
129
- readonly O1_PRO: "o1-pro";
130
- readonly O3_MINI: "o3-mini";
131
- readonly O3_MINI_HIGH: "o3-mini-high";
132
- readonly O3: "o3";
133
- readonly O3_PRO: "o3-pro";
134
- readonly O4_MINI: "o4-mini";
78
+ readonly DEFAULT: "gpt-5.1";
79
+ readonly LARGE: "gpt-5.1";
80
+ readonly SMALL: "gpt-5.1-mini";
81
+ readonly TINY: "gpt-5.1-nano";
135
82
  };
136
83
  readonly MODEL_MATCH_WORDS: readonly ["openai", "gpt", RegExp];
137
84
  readonly NAME: "openai";
138
85
  };
139
86
  };
87
+ export declare const ALL: {
88
+ readonly BASE: readonly ["claude-sonnet-4-5", "gemini-3-pro-preview", "gpt-5.1"];
89
+ readonly COMBINED: readonly ["claude-sonnet-4-5", "claude-opus-4-5", "claude-sonnet-4-5", "claude-haiku-4-5", "gemini-3-pro-preview", "gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-3-flash-preview", "gpt-5.1", "gpt-5.1", "gpt-5.1-mini", "gpt-5.1-nano"];
90
+ readonly LARGE: readonly ["claude-opus-4-5", "gemini-3-pro-preview", "gpt-5.1"];
91
+ readonly SMALL: readonly ["claude-sonnet-4-5", "gemini-3-flash-preview", "gpt-5.1-mini"];
92
+ readonly TINY: readonly ["claude-haiku-4-5", "gemini-3-flash-preview", "gpt-5.1-nano"];
93
+ };
@@ -37,24 +37,10 @@ const PROVIDER = {
37
37
  GEMINI: {
38
38
  // https://ai.google.dev/gemini-api/docs/models
39
39
  MODEL: {
40
- // Jaypie Aliases
41
40
  DEFAULT: "gemini-3-pro-preview",
42
41
  LARGE: "gemini-3-pro-preview",
43
42
  SMALL: "gemini-3-flash-preview",
44
- TINY: "gemini-2.0-flash-lite",
45
- // Gemini 3 Models
46
- GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview",
47
- GEMINI_3_PRO_PREVIEW: "gemini-3-pro-preview",
48
- // Gemini 2.5 Models
49
- GEMINI_2_5_FLASH: "gemini-2.5-flash",
50
- GEMINI_2_5_PRO: "gemini-2.5-pro",
51
- // Gemini 2.0 Models
52
- GEMINI_2_0_FLASH: "gemini-2.0-flash",
53
- GEMINI_2_0_FLASH_LITE: "gemini-2.0-flash-lite",
54
- // Gemini 1.5 Models (backward compatibility)
55
- GEMINI_1_5_FLASH: "gemini-1.5-flash",
56
- GEMINI_1_5_FLASH_8B: "gemini-1.5-flash-8b",
57
- GEMINI_1_5_PRO: "gemini-1.5-pro",
43
+ TINY: "gemini-3-flash-preview",
58
44
  },
59
45
  MODEL_MATCH_WORDS: ["gemini", "google"],
60
46
  NAME: "gemini",
@@ -66,29 +52,10 @@ const PROVIDER = {
66
52
  ANTHROPIC: {
67
53
  // https://docs.anthropic.com/en/docs/about-claude/models/overview
68
54
  MODEL: {
69
- // Jaypie Aliases
70
- DEFAULT: "claude-opus-4-1",
71
- SMALL: "claude-sonnet-4-0",
72
- TINY: "claude-3-5-haiku-latest",
73
- LARGE: "claude-opus-4-1",
74
- // Latests
75
- CLAUDE_OPUS_4: "claude-opus-4-1",
76
- CLAUDE_SONNET_4: "claude-sonnet-4-0",
77
- CLAUDE_3_HAIKU: "claude-3-5-haiku-latest",
78
- CLAUDE_3_OPUS: "claude-3-opus-latest",
79
- CLAUDE_3_SONNET: "claude-3-7-sonnet-latest",
80
- // Specifics
81
- CLAUDE_OPUS_4_1: "claude-opus-4-1",
82
- CLAUDE_OPUS_4_0: "claude-opus-4-0",
83
- CLAUDE_SONNET_4_0: "claude-sonnet-4-0",
84
- CLAUDE_3_7_SONNET: "claude-3-7-sonnet-latest ",
85
- CLAUDE_3_5_SONNET: "claude-3-5-sonnet-latest",
86
- CLAUDE_3_5_HAIKU: "claude-3-5-haiku-latest",
87
- // _Note: Claude reversed the order of model name and version in 4_
88
- // Backward compatibility
89
- CLAUDE_HAIKU_3: "claude-3-5-haiku-latest",
90
- CLAUDE_OPUS_3: "claude-3-opus-latest",
91
- CLAUDE_SONNET_3: "claude-3-7-sonnet-latest",
55
+ DEFAULT: "claude-sonnet-4-5",
56
+ LARGE: "claude-opus-4-5",
57
+ SMALL: "claude-sonnet-4-5",
58
+ TINY: "claude-haiku-4-5",
92
59
  },
93
60
  MODEL_MATCH_WORDS: [
94
61
  "anthropic",
@@ -117,30 +84,10 @@ const PROVIDER = {
117
84
  OPENAI: {
118
85
  // https://platform.openai.com/docs/models
119
86
  MODEL: {
120
- // Jaypie Aliases
121
- DEFAULT: "gpt-4.1",
122
- SMALL: "gpt-4.1-mini",
123
- LARGE: "gpt-4.1",
124
- TINY: "gpt-4.1-nano",
125
- // OpenAI Official
126
- GPT_5: "gpt-5",
127
- GPT_5_MINI: "gpt-5-mini",
128
- GPT_5_NANO: "gpt-5-nano",
129
- GPT_4_1: "gpt-4.1",
130
- GPT_4_1_MINI: "gpt-4.1-mini",
131
- GPT_4_1_NANO: "gpt-4.1-nano",
132
- GPT_4: "gpt-4",
133
- GPT_4_O_MINI: "gpt-4o-mini",
134
- GPT_4_O: "gpt-4o",
135
- GPT_4_5: "gpt-4.5-preview",
136
- O1: "o1",
137
- O1_MINI: "o1-mini",
138
- O1_PRO: "o1-pro",
139
- O3_MINI: "o3-mini",
140
- O3_MINI_HIGH: "o3-mini-high",
141
- O3: "o3",
142
- O3_PRO: "o3-pro",
143
- O4_MINI: "o4-mini",
87
+ DEFAULT: "gpt-5.1",
88
+ LARGE: "gpt-5.1",
89
+ SMALL: "gpt-5.1-mini",
90
+ TINY: "gpt-5.1-nano",
144
91
  },
145
92
  MODEL_MATCH_WORDS: ["openai", "gpt", /^o\d/],
146
93
  NAME: "openai",
@@ -148,11 +95,55 @@ const PROVIDER = {
148
95
  };
149
96
  // Last: Defaults
150
97
  const DEFAULT = {
98
+ MODEL: {
99
+ BASE: PROVIDER.OPENAI.MODEL.DEFAULT,
100
+ LARGE: PROVIDER.OPENAI.MODEL.LARGE,
101
+ SMALL: PROVIDER.OPENAI.MODEL.SMALL,
102
+ TINY: PROVIDER.OPENAI.MODEL.TINY,
103
+ },
151
104
  PROVIDER: PROVIDER.OPENAI,
152
105
  };
106
+ // Only include "first class" models, not OpenRouter or other proxy services
107
+ const ALL = {
108
+ BASE: [
109
+ PROVIDER.ANTHROPIC.MODEL.DEFAULT,
110
+ PROVIDER.GEMINI.MODEL.DEFAULT,
111
+ PROVIDER.OPENAI.MODEL.DEFAULT,
112
+ ],
113
+ COMBINED: [
114
+ PROVIDER.ANTHROPIC.MODEL.DEFAULT,
115
+ PROVIDER.ANTHROPIC.MODEL.LARGE,
116
+ PROVIDER.ANTHROPIC.MODEL.SMALL,
117
+ PROVIDER.ANTHROPIC.MODEL.TINY,
118
+ PROVIDER.GEMINI.MODEL.DEFAULT,
119
+ PROVIDER.GEMINI.MODEL.LARGE,
120
+ PROVIDER.GEMINI.MODEL.SMALL,
121
+ PROVIDER.GEMINI.MODEL.TINY,
122
+ PROVIDER.OPENAI.MODEL.DEFAULT,
123
+ PROVIDER.OPENAI.MODEL.LARGE,
124
+ PROVIDER.OPENAI.MODEL.SMALL,
125
+ PROVIDER.OPENAI.MODEL.TINY,
126
+ ],
127
+ LARGE: [
128
+ PROVIDER.ANTHROPIC.MODEL.LARGE,
129
+ PROVIDER.GEMINI.MODEL.LARGE,
130
+ PROVIDER.OPENAI.MODEL.LARGE,
131
+ ],
132
+ SMALL: [
133
+ PROVIDER.ANTHROPIC.MODEL.SMALL,
134
+ PROVIDER.GEMINI.MODEL.SMALL,
135
+ PROVIDER.OPENAI.MODEL.SMALL,
136
+ ],
137
+ TINY: [
138
+ PROVIDER.ANTHROPIC.MODEL.TINY,
139
+ PROVIDER.GEMINI.MODEL.TINY,
140
+ PROVIDER.OPENAI.MODEL.TINY,
141
+ ],
142
+ };
153
143
 
154
144
  var constants = /*#__PURE__*/Object.freeze({
155
145
  __proto__: null,
146
+ ALL: ALL,
156
147
  DEFAULT: DEFAULT,
157
148
  PROVIDER: PROVIDER
158
149
  });
@@ -1936,27 +1927,16 @@ class GeminiAdapter extends BaseProviderAdapter {
1936
1927
  // Export singleton instance
1937
1928
  const geminiAdapter = new GeminiAdapter();
1938
1929
 
1939
- // OpenAI reasoning models that support extended thinking
1940
- const REASONING_MODELS = [
1941
- // GPT-5 series
1942
- PROVIDER.OPENAI.MODEL.GPT_5,
1943
- PROVIDER.OPENAI.MODEL.GPT_5_MINI,
1944
- PROVIDER.OPENAI.MODEL.GPT_5_NANO,
1945
- // O-series
1946
- PROVIDER.OPENAI.MODEL.O1,
1947
- PROVIDER.OPENAI.MODEL.O1_MINI,
1948
- PROVIDER.OPENAI.MODEL.O1_PRO,
1949
- PROVIDER.OPENAI.MODEL.O3,
1950
- PROVIDER.OPENAI.MODEL.O3_MINI,
1951
- PROVIDER.OPENAI.MODEL.O3_MINI_HIGH,
1952
- PROVIDER.OPENAI.MODEL.O3_PRO,
1953
- PROVIDER.OPENAI.MODEL.O4_MINI,
1930
+ // Patterns for OpenAI reasoning models that support extended thinking
1931
+ const REASONING_MODEL_PATTERNS = [
1932
+ /^gpt-[5-9]/, // GPT-5 and above (gpt-5, gpt-5.1, gpt-5.2, gpt-6, etc.)
1933
+ /^o\d/, // O-series (o1, o3, o4, o5, etc.)
1954
1934
  ];
1955
1935
  /**
1956
1936
  * Check if a model is a reasoning model that supports extended thinking
1957
1937
  */
1958
1938
  function isReasoningModel(model) {
1959
- return REASONING_MODELS.some((reasoningModel) => model === reasoningModel || model.startsWith(`${reasoningModel}-`));
1939
+ return REASONING_MODEL_PATTERNS.some((pattern) => pattern.test(model));
1960
1940
  }
1961
1941
  //
1962
1942
  //
@@ -2929,6 +2909,15 @@ class Toolkit {
2929
2909
  const toolCopy = { ...tool };
2930
2910
  delete toolCopy.call;
2931
2911
  delete toolCopy.message;
2912
+ // Convert Zod schema to JSON Schema if needed
2913
+ if (toolCopy.parameters instanceof v4.z.ZodType) {
2914
+ const jsonSchema = v4.z.toJSONSchema(toolCopy.parameters);
2915
+ // Remove $schema property (causes issues with some providers)
2916
+ if (jsonSchema.$schema) {
2917
+ delete jsonSchema.$schema;
2918
+ }
2919
+ toolCopy.parameters = jsonSchema;
2920
+ }
2932
2921
  if (this.explain && toolCopy.parameters?.type === "object") {
2933
2922
  if (toolCopy.parameters?.properties) {
2934
2923
  if (!toolCopy.parameters.properties.__Explanation) {