@jupyterlite/ai 0.17.0 → 0.18.0
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/lib/agent.d.ts +12 -9
- package/lib/agent.js +38 -51
- package/lib/chat-model-handler.d.ts +2 -3
- package/lib/chat-model-handler.js +2 -1
- package/lib/chat-model.d.ts +110 -8
- package/lib/chat-model.js +322 -63
- package/lib/components/save-button.d.ts +2 -2
- package/lib/index.js +29 -49
- package/lib/models/settings-model.js +1 -0
- package/lib/providers/built-in-providers.js +1 -1
- package/lib/providers/{generated-context-windows.d.ts → generated-model-info.d.ts} +2 -2
- package/lib/providers/generated-model-info.js +502 -0
- package/lib/providers/model-info.d.ts +3 -0
- package/lib/providers/model-info.js +33 -0
- package/lib/tokens.d.ts +85 -12
- package/lib/widgets/ai-settings.js +5 -0
- package/lib/widgets/main-area-chat.d.ts +2 -3
- package/lib/widgets/main-area-chat.js +2 -4
- package/package.json +3 -3
- package/schema/settings-model.json +6 -0
- package/src/agent.ts +46 -56
- package/src/chat-model-handler.ts +4 -2
- package/src/chat-model.ts +435 -90
- package/src/components/save-button.tsx +3 -3
- package/src/index.ts +52 -74
- package/src/models/settings-model.ts +1 -0
- package/src/providers/built-in-providers.ts +1 -1
- package/src/providers/generated-model-info.ts +508 -0
- package/src/providers/model-info.ts +57 -0
- package/src/tokens.ts +87 -12
- package/src/widgets/ai-settings.tsx +26 -0
- package/src/widgets/main-area-chat.ts +5 -8
- package/lib/providers/generated-context-windows.js +0 -96
- package/src/providers/generated-context-windows.ts +0 -102
package/lib/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { IStatusBar } from '@jupyterlab/statusbar';
|
|
|
11
11
|
import { PathExt } from '@jupyterlab/coreutils';
|
|
12
12
|
import { ITranslator, nullTranslator } from '@jupyterlab/translation';
|
|
13
13
|
import { fileUploadIcon, saveIcon, settingsIcon, Toolbar, ToolbarButton } from '@jupyterlab/ui-components';
|
|
14
|
-
import {
|
|
14
|
+
import { UUID } from '@lumino/coreutils';
|
|
15
15
|
import { DisposableSet } from '@lumino/disposable';
|
|
16
16
|
import { IComponentsRendererFactory } from 'jupyter-chat-components';
|
|
17
17
|
import { ISecretsManager, SecretsManager } from 'jupyter-secrets-manager';
|
|
@@ -386,12 +386,10 @@ const plugin = {
|
|
|
386
386
|
// Check if AI is currently writing (streaming)
|
|
387
387
|
const aiWriting = writers.some(writer => writer.user.username === 'ai-assistant');
|
|
388
388
|
if (aiWriting) {
|
|
389
|
-
widget.inputToolbarRegistry?.hide('send');
|
|
390
389
|
widget.inputToolbarRegistry?.show('stop');
|
|
391
390
|
}
|
|
392
391
|
else {
|
|
393
392
|
widget.inputToolbarRegistry?.hide('stop');
|
|
394
|
-
widget.inputToolbarRegistry?.show('send');
|
|
395
393
|
}
|
|
396
394
|
}
|
|
397
395
|
model.writersChanged?.connect(writersChanged);
|
|
@@ -439,19 +437,29 @@ const plugin = {
|
|
|
439
437
|
});
|
|
440
438
|
registerCommands(app, rmRegistry, chatPanel, attachmentOpenerRegistry, inputToolbarFactory, settingsModel, chatCommandRegistry, tracker, modelHandler, trans, themeManager, labShell, palette, documentManager);
|
|
441
439
|
/**
|
|
442
|
-
* The callback
|
|
440
|
+
* The callback for grouped tool calls permission decisions.
|
|
443
441
|
*/
|
|
444
|
-
function
|
|
445
|
-
const model = tracker.find(chat => chat.model.name ===
|
|
442
|
+
function toolCallPermissionDecision(sessionId, toolCallId, optionId) {
|
|
443
|
+
const model = tracker.find(chat => chat.model.name === sessionId)
|
|
444
|
+
?.model;
|
|
446
445
|
if (!model) {
|
|
447
446
|
return;
|
|
448
447
|
}
|
|
448
|
+
const isApproved = optionId === 'approve';
|
|
449
449
|
isApproved
|
|
450
|
-
? model.agentManager.approveToolCall(
|
|
451
|
-
: model.agentManager.rejectToolCall(
|
|
450
|
+
? model.agentManager.approveToolCall(toolCallId)
|
|
451
|
+
: model.agentManager.rejectToolCall(toolCallId);
|
|
452
452
|
}
|
|
453
453
|
if (chatComponentsFactory) {
|
|
454
|
-
chatComponentsFactory.
|
|
454
|
+
chatComponentsFactory.toolCallPermissionDecision =
|
|
455
|
+
toolCallPermissionDecision;
|
|
456
|
+
chatComponentsFactory.removeQueuedMessage = (targetId, messageId) => {
|
|
457
|
+
const model = tracker.find(chat => chat.model.name === targetId)?.model;
|
|
458
|
+
if (!model) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
model.removeQueuedMessage(messageId);
|
|
462
|
+
};
|
|
455
463
|
}
|
|
456
464
|
return tracker;
|
|
457
465
|
}
|
|
@@ -502,11 +510,12 @@ function registerCommands(app, rmRegistry, chatPanel, attachmentOpenerRegistry,
|
|
|
502
510
|
}
|
|
503
511
|
});
|
|
504
512
|
const openInMain = (model) => {
|
|
513
|
+
const inputToolbarRegistry = inputToolbarFactory.create();
|
|
505
514
|
const content = new ChatWidget({
|
|
506
515
|
model,
|
|
507
516
|
rmRegistry,
|
|
508
517
|
themeManager: themeManager ?? null,
|
|
509
|
-
inputToolbarRegistry
|
|
518
|
+
inputToolbarRegistry,
|
|
510
519
|
attachmentOpenerRegistry,
|
|
511
520
|
chatCommandRegistry
|
|
512
521
|
});
|
|
@@ -771,54 +780,25 @@ function registerCommands(app, rmRegistry, chatPanel, attachmentOpenerRegistry,
|
|
|
771
780
|
console.error('Error while moving the chat to main area: there is no reference model');
|
|
772
781
|
return false;
|
|
773
782
|
}
|
|
774
|
-
// Listen for the widget updated in tracker, to ensure the previous model name
|
|
775
|
-
// has been updated. This is required to remove the widget from the restorer
|
|
776
|
-
// when the previous widget is disposed.
|
|
777
|
-
const trackerUpdated = new PromiseDelegate();
|
|
778
|
-
const widgetUpdated = (_, widget) => {
|
|
779
|
-
if (widget.model === previousModel) {
|
|
780
|
-
trackerUpdated.resolve(true);
|
|
781
|
-
}
|
|
782
|
-
};
|
|
783
|
-
tracker.widgetUpdated.connect(widgetUpdated);
|
|
784
|
-
// Rename temporary the previous model to be able to reuse this name for the new
|
|
785
|
-
// model. The previous is intended to be disposed anyway.
|
|
786
|
-
previousModel.name = UUID.uuid4();
|
|
787
|
-
// Create a new model by duplicating the previous model attributes.
|
|
788
|
-
const model = modelRegistry.createModel({
|
|
789
|
-
name: args.name,
|
|
790
|
-
activeProvider: previousModel.agentManager.activeProvider,
|
|
791
|
-
tokenUsage: previousModel.agentManager.tokenUsage,
|
|
792
|
-
messages: previousModel.messages,
|
|
793
|
-
autosave: previousModel.autosave,
|
|
794
|
-
title: previousModel.title
|
|
795
|
-
});
|
|
796
|
-
// Wait (with timeout) for the tracker to have updated the previous widget.
|
|
797
|
-
const status = await Promise.any([
|
|
798
|
-
trackerUpdated.promise,
|
|
799
|
-
new Promise(r => setTimeout(() => {
|
|
800
|
-
r(false);
|
|
801
|
-
}, 2000))
|
|
802
|
-
]);
|
|
803
|
-
tracker.widgetUpdated.disconnect(widgetUpdated);
|
|
804
|
-
if (!status) {
|
|
805
|
-
return false;
|
|
806
|
-
}
|
|
807
783
|
if (area === 'main') {
|
|
808
|
-
|
|
784
|
+
// Temporarily bypass model disposal to transport model to main view
|
|
785
|
+
// to keep the conversation when switching views
|
|
786
|
+
// TODO: Remove this code when jupyter-chat PR #423 is merged and released
|
|
787
|
+
const originalDispose = previousModel.dispose.bind(previousModel);
|
|
788
|
+
previousModel.dispose = () => { };
|
|
809
789
|
if (previousWidget instanceof ChatWidget) {
|
|
810
|
-
// Clean up the side-panel model entry before disposing the previous
|
|
811
|
-
// widget/model state.
|
|
812
790
|
if (!disposeSideChatModel(previousModel)) {
|
|
813
791
|
previousWidget.dispose();
|
|
814
|
-
previousModel.dispose();
|
|
815
792
|
}
|
|
816
793
|
}
|
|
794
|
+
// Restore model disposal and transport to main view
|
|
795
|
+
previousModel.dispose = originalDispose;
|
|
796
|
+
openInMain(previousModel);
|
|
817
797
|
}
|
|
818
798
|
else {
|
|
799
|
+
// MainAreaChat disposal does not dispose the model internally, so this is safe.
|
|
819
800
|
previousWidget?.dispose();
|
|
820
|
-
|
|
821
|
-
chatPanel.open({ model });
|
|
801
|
+
chatPanel.open({ model: previousModel });
|
|
822
802
|
}
|
|
823
803
|
return true;
|
|
824
804
|
},
|
|
@@ -19,6 +19,7 @@ export class AISettingsModel extends VDomModel {
|
|
|
19
19
|
diffDisplayMode: 'split',
|
|
20
20
|
skillsPaths: ['.agents/skills', '_agents/skills'],
|
|
21
21
|
chatBackupDirectory: '',
|
|
22
|
+
autoTitle: false,
|
|
22
23
|
commandsRequiringApproval: [
|
|
23
24
|
'notebook:restart-run-all',
|
|
24
25
|
'notebook:run-cell',
|
|
@@ -3,7 +3,7 @@ import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
|
|
3
3
|
import { createMistral } from '@ai-sdk/mistral';
|
|
4
4
|
import { createOpenAI } from '@ai-sdk/openai';
|
|
5
5
|
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
|
|
6
|
-
import { BUILT_IN_PROVIDER_MODEL_INFO } from './generated-
|
|
6
|
+
import { BUILT_IN_PROVIDER_MODEL_INFO } from './generated-model-info';
|
|
7
7
|
/**
|
|
8
8
|
* Anthropic provider
|
|
9
9
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file is generated by `jlpm sync:model-
|
|
2
|
+
* This file is generated by `jlpm sync:model-info`.
|
|
3
3
|
* Source: https://models.dev/api.json
|
|
4
4
|
* Backed by: https://github.com/anomalyco/models.dev
|
|
5
|
-
* Generated: 2026-04-
|
|
5
|
+
* Generated: 2026-04-28T11:55:05.327Z
|
|
6
6
|
*/
|
|
7
7
|
import type { IProviderModelInfo } from '../tokens';
|
|
8
8
|
export declare const BUILT_IN_PROVIDER_MODEL_INFO: Record<string, Record<string, IProviderModelInfo>>;
|
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is generated by `jlpm sync:model-info`.
|
|
3
|
+
* Source: https://models.dev/api.json
|
|
4
|
+
* Backed by: https://github.com/anomalyco/models.dev
|
|
5
|
+
* Generated: 2026-04-28T11:55:05.327Z
|
|
6
|
+
*/
|
|
7
|
+
export const BUILT_IN_PROVIDER_MODEL_INFO = {
|
|
8
|
+
anthropic: {
|
|
9
|
+
'claude-opus-4-6': {
|
|
10
|
+
contextWindow: 1000000,
|
|
11
|
+
supportsImages: true,
|
|
12
|
+
supportsPdf: true,
|
|
13
|
+
supportsAudio: false
|
|
14
|
+
},
|
|
15
|
+
'claude-sonnet-4-6': {
|
|
16
|
+
contextWindow: 1000000,
|
|
17
|
+
supportsImages: true,
|
|
18
|
+
supportsPdf: true,
|
|
19
|
+
supportsAudio: false
|
|
20
|
+
},
|
|
21
|
+
'claude-opus-4-5': {
|
|
22
|
+
contextWindow: 200000,
|
|
23
|
+
supportsImages: true,
|
|
24
|
+
supportsPdf: true,
|
|
25
|
+
supportsAudio: false
|
|
26
|
+
},
|
|
27
|
+
'claude-opus-4-5-20251101': {
|
|
28
|
+
contextWindow: 200000,
|
|
29
|
+
supportsImages: true,
|
|
30
|
+
supportsPdf: true,
|
|
31
|
+
supportsAudio: false
|
|
32
|
+
},
|
|
33
|
+
'claude-sonnet-4-5': {
|
|
34
|
+
contextWindow: 200000,
|
|
35
|
+
supportsImages: true,
|
|
36
|
+
supportsPdf: true,
|
|
37
|
+
supportsAudio: false
|
|
38
|
+
},
|
|
39
|
+
'claude-sonnet-4-5-20250929': {
|
|
40
|
+
contextWindow: 200000,
|
|
41
|
+
supportsImages: true,
|
|
42
|
+
supportsPdf: true,
|
|
43
|
+
supportsAudio: false
|
|
44
|
+
},
|
|
45
|
+
'claude-haiku-4-5': {
|
|
46
|
+
contextWindow: 200000,
|
|
47
|
+
supportsImages: true,
|
|
48
|
+
supportsPdf: true,
|
|
49
|
+
supportsAudio: false
|
|
50
|
+
},
|
|
51
|
+
'claude-haiku-4-5-20251001': {
|
|
52
|
+
contextWindow: 200000,
|
|
53
|
+
supportsImages: true,
|
|
54
|
+
supportsPdf: true,
|
|
55
|
+
supportsAudio: false
|
|
56
|
+
},
|
|
57
|
+
'claude-opus-4-1': {
|
|
58
|
+
contextWindow: 200000,
|
|
59
|
+
supportsImages: true,
|
|
60
|
+
supportsPdf: true,
|
|
61
|
+
supportsAudio: false
|
|
62
|
+
},
|
|
63
|
+
'claude-opus-4-1-20250805': {
|
|
64
|
+
contextWindow: 200000,
|
|
65
|
+
supportsImages: true,
|
|
66
|
+
supportsPdf: true,
|
|
67
|
+
supportsAudio: false
|
|
68
|
+
},
|
|
69
|
+
'claude-opus-4-0': {
|
|
70
|
+
contextWindow: 200000,
|
|
71
|
+
supportsImages: true,
|
|
72
|
+
supportsPdf: true,
|
|
73
|
+
supportsAudio: false
|
|
74
|
+
},
|
|
75
|
+
'claude-opus-4-20250514': {
|
|
76
|
+
contextWindow: 200000,
|
|
77
|
+
supportsImages: true,
|
|
78
|
+
supportsPdf: true,
|
|
79
|
+
supportsAudio: false
|
|
80
|
+
},
|
|
81
|
+
'claude-sonnet-4-0': {
|
|
82
|
+
contextWindow: 200000,
|
|
83
|
+
supportsImages: true,
|
|
84
|
+
supportsPdf: true,
|
|
85
|
+
supportsAudio: false
|
|
86
|
+
},
|
|
87
|
+
'claude-sonnet-4-20250514': {
|
|
88
|
+
contextWindow: 200000,
|
|
89
|
+
supportsImages: true,
|
|
90
|
+
supportsPdf: true,
|
|
91
|
+
supportsAudio: false
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
google: {
|
|
95
|
+
'gemini-3.1-pro-preview': {
|
|
96
|
+
contextWindow: 1048576,
|
|
97
|
+
supportsImages: true,
|
|
98
|
+
supportsPdf: true,
|
|
99
|
+
supportsAudio: true
|
|
100
|
+
},
|
|
101
|
+
'gemini-3.1-pro-preview-customtools': {
|
|
102
|
+
contextWindow: 1048576,
|
|
103
|
+
supportsImages: true,
|
|
104
|
+
supportsPdf: true,
|
|
105
|
+
supportsAudio: true
|
|
106
|
+
},
|
|
107
|
+
'gemini-3.1-flash-image-preview': {
|
|
108
|
+
contextWindow: 131072,
|
|
109
|
+
supportsImages: true,
|
|
110
|
+
supportsPdf: true,
|
|
111
|
+
supportsAudio: false
|
|
112
|
+
},
|
|
113
|
+
'gemini-3.1-flash-lite-preview': {
|
|
114
|
+
contextWindow: 1048576,
|
|
115
|
+
supportsImages: true,
|
|
116
|
+
supportsPdf: true,
|
|
117
|
+
supportsAudio: true
|
|
118
|
+
},
|
|
119
|
+
'gemini-3-flash-preview': {
|
|
120
|
+
contextWindow: 1048576,
|
|
121
|
+
supportsImages: true,
|
|
122
|
+
supportsPdf: true,
|
|
123
|
+
supportsAudio: true
|
|
124
|
+
},
|
|
125
|
+
'gemini-2.5-pro': {
|
|
126
|
+
contextWindow: 1048576,
|
|
127
|
+
supportsImages: true,
|
|
128
|
+
supportsPdf: true,
|
|
129
|
+
supportsAudio: true
|
|
130
|
+
},
|
|
131
|
+
'gemini-2.5-flash': {
|
|
132
|
+
contextWindow: 1048576,
|
|
133
|
+
supportsImages: true,
|
|
134
|
+
supportsPdf: true,
|
|
135
|
+
supportsAudio: true
|
|
136
|
+
},
|
|
137
|
+
'gemini-2.5-flash-image': {
|
|
138
|
+
contextWindow: 32768,
|
|
139
|
+
supportsImages: true,
|
|
140
|
+
supportsPdf: false,
|
|
141
|
+
supportsAudio: false
|
|
142
|
+
},
|
|
143
|
+
'gemini-2.5-flash-lite': {
|
|
144
|
+
contextWindow: 1048576,
|
|
145
|
+
supportsImages: true,
|
|
146
|
+
supportsPdf: true,
|
|
147
|
+
supportsAudio: true
|
|
148
|
+
},
|
|
149
|
+
'gemini-flash-latest': {
|
|
150
|
+
contextWindow: 1048576,
|
|
151
|
+
supportsImages: true,
|
|
152
|
+
supportsPdf: true,
|
|
153
|
+
supportsAudio: true
|
|
154
|
+
},
|
|
155
|
+
'gemini-flash-lite-latest': {
|
|
156
|
+
contextWindow: 1048576,
|
|
157
|
+
supportsImages: true,
|
|
158
|
+
supportsPdf: true,
|
|
159
|
+
supportsAudio: true
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
mistral: {
|
|
163
|
+
'mistral-large-latest': {
|
|
164
|
+
contextWindow: 262144,
|
|
165
|
+
supportsImages: true,
|
|
166
|
+
supportsPdf: false,
|
|
167
|
+
supportsAudio: false
|
|
168
|
+
},
|
|
169
|
+
'mistral-medium-latest': {
|
|
170
|
+
contextWindow: 128000,
|
|
171
|
+
supportsImages: true,
|
|
172
|
+
supportsPdf: false,
|
|
173
|
+
supportsAudio: false
|
|
174
|
+
},
|
|
175
|
+
'mistral-medium-2508': {
|
|
176
|
+
contextWindow: 262144,
|
|
177
|
+
supportsImages: true,
|
|
178
|
+
supportsPdf: false,
|
|
179
|
+
supportsAudio: false
|
|
180
|
+
},
|
|
181
|
+
'mistral-small-latest': {
|
|
182
|
+
contextWindow: 256000,
|
|
183
|
+
supportsImages: true,
|
|
184
|
+
supportsPdf: false,
|
|
185
|
+
supportsAudio: false
|
|
186
|
+
},
|
|
187
|
+
'mistral-small-2506': {
|
|
188
|
+
contextWindow: 128000,
|
|
189
|
+
supportsImages: true,
|
|
190
|
+
supportsPdf: false,
|
|
191
|
+
supportsAudio: false
|
|
192
|
+
},
|
|
193
|
+
'ministral-3b-latest': {
|
|
194
|
+
contextWindow: 128000,
|
|
195
|
+
supportsImages: false,
|
|
196
|
+
supportsPdf: false,
|
|
197
|
+
supportsAudio: false
|
|
198
|
+
},
|
|
199
|
+
'ministral-8b-latest': {
|
|
200
|
+
contextWindow: 128000,
|
|
201
|
+
supportsImages: false,
|
|
202
|
+
supportsPdf: false,
|
|
203
|
+
supportsAudio: false
|
|
204
|
+
},
|
|
205
|
+
'magistral-small-latest': {
|
|
206
|
+
contextWindow: 128000,
|
|
207
|
+
supportsImages: false,
|
|
208
|
+
supportsPdf: false,
|
|
209
|
+
supportsAudio: false
|
|
210
|
+
},
|
|
211
|
+
'magistral-small': {
|
|
212
|
+
contextWindow: 128000,
|
|
213
|
+
supportsImages: false,
|
|
214
|
+
supportsPdf: false,
|
|
215
|
+
supportsAudio: false
|
|
216
|
+
},
|
|
217
|
+
'magistral-medium-latest': {
|
|
218
|
+
contextWindow: 128000,
|
|
219
|
+
supportsImages: false,
|
|
220
|
+
supportsPdf: false,
|
|
221
|
+
supportsAudio: false
|
|
222
|
+
},
|
|
223
|
+
'pixtral-large-latest': {
|
|
224
|
+
contextWindow: 128000,
|
|
225
|
+
supportsImages: true,
|
|
226
|
+
supportsPdf: false,
|
|
227
|
+
supportsAudio: false
|
|
228
|
+
},
|
|
229
|
+
'codestral-latest': {
|
|
230
|
+
contextWindow: 256000,
|
|
231
|
+
supportsImages: false,
|
|
232
|
+
supportsPdf: false,
|
|
233
|
+
supportsAudio: false
|
|
234
|
+
},
|
|
235
|
+
'devstral-latest': {
|
|
236
|
+
contextWindow: 128000,
|
|
237
|
+
supportsImages: false,
|
|
238
|
+
supportsPdf: false,
|
|
239
|
+
supportsAudio: false
|
|
240
|
+
},
|
|
241
|
+
'devstral-small-2507': {
|
|
242
|
+
contextWindow: 128000,
|
|
243
|
+
supportsImages: false,
|
|
244
|
+
supportsPdf: false,
|
|
245
|
+
supportsAudio: false
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
openai: {
|
|
249
|
+
'gpt-5.4': {
|
|
250
|
+
contextWindow: 1050000,
|
|
251
|
+
supportsImages: true,
|
|
252
|
+
supportsPdf: true,
|
|
253
|
+
supportsAudio: false
|
|
254
|
+
},
|
|
255
|
+
'gpt-5.4-mini': {
|
|
256
|
+
contextWindow: 400000,
|
|
257
|
+
supportsImages: true,
|
|
258
|
+
supportsPdf: false,
|
|
259
|
+
supportsAudio: false
|
|
260
|
+
},
|
|
261
|
+
'gpt-5.4-nano': {
|
|
262
|
+
contextWindow: 400000,
|
|
263
|
+
supportsImages: true,
|
|
264
|
+
supportsPdf: false,
|
|
265
|
+
supportsAudio: false
|
|
266
|
+
},
|
|
267
|
+
'gpt-5.2': {
|
|
268
|
+
contextWindow: 400000,
|
|
269
|
+
supportsImages: true,
|
|
270
|
+
supportsPdf: false,
|
|
271
|
+
supportsAudio: false
|
|
272
|
+
},
|
|
273
|
+
'gpt-5.2-2025-12-11': {
|
|
274
|
+
contextWindow: 400000,
|
|
275
|
+
supportsImages: true,
|
|
276
|
+
supportsPdf: false,
|
|
277
|
+
supportsAudio: false
|
|
278
|
+
},
|
|
279
|
+
'gpt-5.2-chat-latest': {
|
|
280
|
+
contextWindow: 128000,
|
|
281
|
+
supportsImages: true,
|
|
282
|
+
supportsPdf: false,
|
|
283
|
+
supportsAudio: false
|
|
284
|
+
},
|
|
285
|
+
'gpt-5.2-pro': {
|
|
286
|
+
contextWindow: 400000,
|
|
287
|
+
supportsImages: true,
|
|
288
|
+
supportsPdf: false,
|
|
289
|
+
supportsAudio: false
|
|
290
|
+
},
|
|
291
|
+
'gpt-5.2-pro-2025-12-11': {
|
|
292
|
+
contextWindow: 400000,
|
|
293
|
+
supportsImages: true,
|
|
294
|
+
supportsPdf: false,
|
|
295
|
+
supportsAudio: false
|
|
296
|
+
},
|
|
297
|
+
'gpt-5.2-codex': {
|
|
298
|
+
contextWindow: 400000,
|
|
299
|
+
supportsImages: true,
|
|
300
|
+
supportsPdf: true,
|
|
301
|
+
supportsAudio: false
|
|
302
|
+
},
|
|
303
|
+
'gpt-5.1': {
|
|
304
|
+
contextWindow: 400000,
|
|
305
|
+
supportsImages: true,
|
|
306
|
+
supportsPdf: false,
|
|
307
|
+
supportsAudio: false
|
|
308
|
+
},
|
|
309
|
+
'gpt-5.1-2025-11-13': {
|
|
310
|
+
contextWindow: 400000,
|
|
311
|
+
supportsImages: true,
|
|
312
|
+
supportsPdf: false,
|
|
313
|
+
supportsAudio: false
|
|
314
|
+
},
|
|
315
|
+
'gpt-5.1-chat-latest': {
|
|
316
|
+
contextWindow: 128000,
|
|
317
|
+
supportsImages: true,
|
|
318
|
+
supportsPdf: false,
|
|
319
|
+
supportsAudio: false
|
|
320
|
+
},
|
|
321
|
+
'gpt-5': {
|
|
322
|
+
contextWindow: 400000,
|
|
323
|
+
supportsImages: true,
|
|
324
|
+
supportsPdf: false,
|
|
325
|
+
supportsAudio: false
|
|
326
|
+
},
|
|
327
|
+
'gpt-5-2025-08-07': {
|
|
328
|
+
contextWindow: 400000,
|
|
329
|
+
supportsImages: true,
|
|
330
|
+
supportsPdf: false,
|
|
331
|
+
supportsAudio: false
|
|
332
|
+
},
|
|
333
|
+
'gpt-5-chat-latest': {
|
|
334
|
+
contextWindow: 400000,
|
|
335
|
+
supportsImages: true,
|
|
336
|
+
supportsPdf: false,
|
|
337
|
+
supportsAudio: false
|
|
338
|
+
},
|
|
339
|
+
'gpt-5-mini': {
|
|
340
|
+
contextWindow: 400000,
|
|
341
|
+
supportsImages: true,
|
|
342
|
+
supportsPdf: false,
|
|
343
|
+
supportsAudio: false
|
|
344
|
+
},
|
|
345
|
+
'gpt-5-mini-2025-08-07': {
|
|
346
|
+
contextWindow: 400000,
|
|
347
|
+
supportsImages: true,
|
|
348
|
+
supportsPdf: false,
|
|
349
|
+
supportsAudio: false
|
|
350
|
+
},
|
|
351
|
+
'gpt-5-nano': {
|
|
352
|
+
contextWindow: 400000,
|
|
353
|
+
supportsImages: true,
|
|
354
|
+
supportsPdf: false,
|
|
355
|
+
supportsAudio: false
|
|
356
|
+
},
|
|
357
|
+
'gpt-5-nano-2025-08-07': {
|
|
358
|
+
contextWindow: 400000,
|
|
359
|
+
supportsImages: true,
|
|
360
|
+
supportsPdf: false,
|
|
361
|
+
supportsAudio: false
|
|
362
|
+
},
|
|
363
|
+
'o4-mini': {
|
|
364
|
+
contextWindow: 200000,
|
|
365
|
+
supportsImages: true,
|
|
366
|
+
supportsPdf: false,
|
|
367
|
+
supportsAudio: false
|
|
368
|
+
},
|
|
369
|
+
'o4-mini-2025-04-16': {
|
|
370
|
+
contextWindow: 200000,
|
|
371
|
+
supportsImages: true,
|
|
372
|
+
supportsPdf: false,
|
|
373
|
+
supportsAudio: false
|
|
374
|
+
},
|
|
375
|
+
'o3-pro': {
|
|
376
|
+
contextWindow: 200000,
|
|
377
|
+
supportsImages: true,
|
|
378
|
+
supportsPdf: false,
|
|
379
|
+
supportsAudio: false
|
|
380
|
+
},
|
|
381
|
+
o3: {
|
|
382
|
+
contextWindow: 200000,
|
|
383
|
+
supportsImages: true,
|
|
384
|
+
supportsPdf: true,
|
|
385
|
+
supportsAudio: false
|
|
386
|
+
},
|
|
387
|
+
'o3-2025-04-16': {
|
|
388
|
+
contextWindow: 200000,
|
|
389
|
+
supportsImages: true,
|
|
390
|
+
supportsPdf: true,
|
|
391
|
+
supportsAudio: false
|
|
392
|
+
},
|
|
393
|
+
'o3-mini': {
|
|
394
|
+
contextWindow: 200000,
|
|
395
|
+
supportsImages: false,
|
|
396
|
+
supportsPdf: false,
|
|
397
|
+
supportsAudio: false
|
|
398
|
+
},
|
|
399
|
+
'o3-mini-2025-01-31': {
|
|
400
|
+
contextWindow: 200000,
|
|
401
|
+
supportsImages: false,
|
|
402
|
+
supportsPdf: false,
|
|
403
|
+
supportsAudio: false
|
|
404
|
+
},
|
|
405
|
+
o1: {
|
|
406
|
+
contextWindow: 200000,
|
|
407
|
+
supportsImages: true,
|
|
408
|
+
supportsPdf: true,
|
|
409
|
+
supportsAudio: false
|
|
410
|
+
},
|
|
411
|
+
'o1-2024-12-17': {
|
|
412
|
+
contextWindow: 200000,
|
|
413
|
+
supportsImages: true,
|
|
414
|
+
supportsPdf: true,
|
|
415
|
+
supportsAudio: false
|
|
416
|
+
},
|
|
417
|
+
'gpt-4.1': {
|
|
418
|
+
contextWindow: 1047576,
|
|
419
|
+
supportsImages: true,
|
|
420
|
+
supportsPdf: true,
|
|
421
|
+
supportsAudio: false
|
|
422
|
+
},
|
|
423
|
+
'gpt-4.1-2025-04-14': {
|
|
424
|
+
contextWindow: 1047576,
|
|
425
|
+
supportsImages: true,
|
|
426
|
+
supportsPdf: true,
|
|
427
|
+
supportsAudio: false
|
|
428
|
+
},
|
|
429
|
+
'gpt-4.1-mini': {
|
|
430
|
+
contextWindow: 1047576,
|
|
431
|
+
supportsImages: true,
|
|
432
|
+
supportsPdf: true,
|
|
433
|
+
supportsAudio: false
|
|
434
|
+
},
|
|
435
|
+
'gpt-4.1-mini-2025-04-14': {
|
|
436
|
+
contextWindow: 1047576,
|
|
437
|
+
supportsImages: true,
|
|
438
|
+
supportsPdf: true,
|
|
439
|
+
supportsAudio: false
|
|
440
|
+
},
|
|
441
|
+
'gpt-4.1-nano': {
|
|
442
|
+
contextWindow: 1047576,
|
|
443
|
+
supportsImages: true,
|
|
444
|
+
supportsPdf: false,
|
|
445
|
+
supportsAudio: false
|
|
446
|
+
},
|
|
447
|
+
'gpt-4.1-nano-2025-04-14': {
|
|
448
|
+
contextWindow: 1047576,
|
|
449
|
+
supportsImages: true,
|
|
450
|
+
supportsPdf: false,
|
|
451
|
+
supportsAudio: false
|
|
452
|
+
},
|
|
453
|
+
'gpt-4o': {
|
|
454
|
+
contextWindow: 128000,
|
|
455
|
+
supportsImages: true,
|
|
456
|
+
supportsPdf: true,
|
|
457
|
+
supportsAudio: false
|
|
458
|
+
},
|
|
459
|
+
'gpt-4o-2024-05-13': {
|
|
460
|
+
contextWindow: 128000,
|
|
461
|
+
supportsImages: true,
|
|
462
|
+
supportsPdf: false,
|
|
463
|
+
supportsAudio: false
|
|
464
|
+
},
|
|
465
|
+
'gpt-4o-2024-08-06': {
|
|
466
|
+
contextWindow: 128000,
|
|
467
|
+
supportsImages: true,
|
|
468
|
+
supportsPdf: false,
|
|
469
|
+
supportsAudio: false
|
|
470
|
+
},
|
|
471
|
+
'gpt-4o-2024-11-20': {
|
|
472
|
+
contextWindow: 128000,
|
|
473
|
+
supportsImages: true,
|
|
474
|
+
supportsPdf: false,
|
|
475
|
+
supportsAudio: false
|
|
476
|
+
},
|
|
477
|
+
'gpt-4o-mini': {
|
|
478
|
+
contextWindow: 128000,
|
|
479
|
+
supportsImages: true,
|
|
480
|
+
supportsPdf: true,
|
|
481
|
+
supportsAudio: false
|
|
482
|
+
},
|
|
483
|
+
'gpt-4o-mini-2024-07-18': {
|
|
484
|
+
contextWindow: 128000,
|
|
485
|
+
supportsImages: true,
|
|
486
|
+
supportsPdf: true,
|
|
487
|
+
supportsAudio: false
|
|
488
|
+
},
|
|
489
|
+
'gpt-3.5-turbo': {
|
|
490
|
+
contextWindow: 16385,
|
|
491
|
+
supportsImages: false,
|
|
492
|
+
supportsPdf: false,
|
|
493
|
+
supportsAudio: false
|
|
494
|
+
},
|
|
495
|
+
'gpt-3.5-turbo-0125': {
|
|
496
|
+
contextWindow: 16385,
|
|
497
|
+
supportsImages: false,
|
|
498
|
+
supportsPdf: false,
|
|
499
|
+
supportsAudio: false
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { IProviderConfig, IProviderInfo, IProviderModelInfo, IProviderRegistry } from '../tokens';
|
|
2
2
|
export declare function getProviderModelInfo(providerInfo: IProviderInfo | null | undefined, model: string | undefined): IProviderModelInfo | undefined;
|
|
3
|
+
export declare function modelSupportsImages(providerConfig: IProviderConfig | undefined, providerRegistry?: IProviderRegistry): boolean;
|
|
4
|
+
export declare function modelSupportsPdf(providerConfig: IProviderConfig | undefined, providerRegistry?: IProviderRegistry): boolean;
|
|
5
|
+
export declare function modelSupportsAudio(providerConfig: IProviderConfig | undefined, providerRegistry?: IProviderRegistry): boolean;
|
|
3
6
|
export declare function getEffectiveContextWindow(providerConfig: IProviderConfig | undefined, providerRegistry?: IProviderRegistry): number | undefined;
|