@yourgpt/llm-sdk 2.0.1 → 2.0.2-beta.2
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/adapters/index.d.mts +27 -4
- package/dist/adapters/index.d.ts +27 -4
- package/dist/adapters/index.js +395 -25
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +395 -25
- package/dist/adapters/index.mjs.map +1 -1
- package/dist/index.d.mts +24 -5
- package/dist/index.d.ts +24 -5
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -4
- package/dist/index.mjs.map +1 -1
- package/dist/providers/anthropic/index.d.mts +1 -2
- package/dist/providers/anthropic/index.d.ts +1 -2
- package/dist/providers/anthropic/index.js +108 -12
- package/dist/providers/anthropic/index.js.map +1 -1
- package/dist/providers/anthropic/index.mjs +108 -12
- package/dist/providers/anthropic/index.mjs.map +1 -1
- package/dist/providers/azure/index.d.mts +1 -2
- package/dist/providers/azure/index.d.ts +1 -2
- package/dist/providers/azure/index.js.map +1 -1
- package/dist/providers/azure/index.mjs.map +1 -1
- package/dist/providers/google/index.d.mts +1 -2
- package/dist/providers/google/index.d.ts +1 -2
- package/dist/providers/google/index.js +61 -2
- package/dist/providers/google/index.js.map +1 -1
- package/dist/providers/google/index.mjs +61 -2
- package/dist/providers/google/index.mjs.map +1 -1
- package/dist/providers/ollama/index.d.mts +8 -3
- package/dist/providers/ollama/index.d.ts +8 -3
- package/dist/providers/ollama/index.js +227 -17
- package/dist/providers/ollama/index.js.map +1 -1
- package/dist/providers/ollama/index.mjs +227 -17
- package/dist/providers/ollama/index.mjs.map +1 -1
- package/dist/providers/openai/index.d.mts +1 -2
- package/dist/providers/openai/index.d.ts +1 -2
- package/dist/providers/openai/index.js +57 -3
- package/dist/providers/openai/index.js.map +1 -1
- package/dist/providers/openai/index.mjs +57 -3
- package/dist/providers/openai/index.mjs.map +1 -1
- package/dist/providers/openrouter/index.d.mts +56 -3
- package/dist/providers/openrouter/index.d.ts +56 -3
- package/dist/providers/openrouter/index.js +90 -276
- package/dist/providers/openrouter/index.js.map +1 -1
- package/dist/providers/openrouter/index.mjs +89 -277
- package/dist/providers/openrouter/index.mjs.map +1 -1
- package/dist/providers/xai/index.d.mts +1 -2
- package/dist/providers/xai/index.d.ts +1 -2
- package/dist/providers/xai/index.js.map +1 -1
- package/dist/providers/xai/index.mjs.map +1 -1
- package/dist/{base-DdxolpKP.d.mts → types-C_f95PKp.d.mts} +434 -3
- package/dist/{base-DdxolpKP.d.ts → types-C_f95PKp.d.ts} +434 -3
- package/package.json +1 -1
- package/dist/types-Ck25ZYma.d.mts +0 -323
- package/dist/types-Dsz8SpdB.d.ts +0 -323
|
@@ -1,166 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/providers/openrouter/provider.ts
|
|
4
|
-
var OPENROUTER_MODELS = {
|
|
5
|
-
// OpenAI
|
|
6
|
-
"openai/gpt-4o": {
|
|
7
|
-
vision: true,
|
|
8
|
-
tools: true,
|
|
9
|
-
jsonMode: true,
|
|
10
|
-
maxTokens: 128e3
|
|
11
|
-
},
|
|
12
|
-
"openai/gpt-4o-mini": {
|
|
13
|
-
vision: true,
|
|
14
|
-
tools: true,
|
|
15
|
-
jsonMode: true,
|
|
16
|
-
maxTokens: 128e3
|
|
17
|
-
},
|
|
18
|
-
"openai/gpt-4-turbo": {
|
|
19
|
-
vision: true,
|
|
20
|
-
tools: true,
|
|
21
|
-
jsonMode: true,
|
|
22
|
-
maxTokens: 128e3
|
|
23
|
-
},
|
|
24
|
-
"openai/o1": {
|
|
25
|
-
vision: true,
|
|
26
|
-
tools: false,
|
|
27
|
-
jsonMode: false,
|
|
28
|
-
maxTokens: 128e3
|
|
29
|
-
},
|
|
30
|
-
"openai/o1-mini": {
|
|
31
|
-
vision: true,
|
|
32
|
-
tools: false,
|
|
33
|
-
jsonMode: false,
|
|
34
|
-
maxTokens: 128e3
|
|
35
|
-
},
|
|
36
|
-
// Anthropic
|
|
37
|
-
"anthropic/claude-3.5-sonnet": {
|
|
38
|
-
vision: true,
|
|
39
|
-
tools: true,
|
|
40
|
-
jsonMode: true,
|
|
41
|
-
maxTokens: 2e5
|
|
42
|
-
},
|
|
43
|
-
"anthropic/claude-3.5-sonnet-20241022": {
|
|
44
|
-
vision: true,
|
|
45
|
-
tools: true,
|
|
46
|
-
jsonMode: true,
|
|
47
|
-
maxTokens: 2e5
|
|
48
|
-
},
|
|
49
|
-
"anthropic/claude-3-opus": {
|
|
50
|
-
vision: true,
|
|
51
|
-
tools: true,
|
|
52
|
-
jsonMode: true,
|
|
53
|
-
maxTokens: 2e5
|
|
54
|
-
},
|
|
55
|
-
"anthropic/claude-3-sonnet": {
|
|
56
|
-
vision: true,
|
|
57
|
-
tools: true,
|
|
58
|
-
jsonMode: true,
|
|
59
|
-
maxTokens: 2e5
|
|
60
|
-
},
|
|
61
|
-
"anthropic/claude-3-haiku": {
|
|
62
|
-
vision: true,
|
|
63
|
-
tools: true,
|
|
64
|
-
jsonMode: true,
|
|
65
|
-
maxTokens: 2e5
|
|
66
|
-
},
|
|
67
|
-
// Google
|
|
68
|
-
"google/gemini-pro-1.5": {
|
|
69
|
-
vision: true,
|
|
70
|
-
tools: true,
|
|
71
|
-
jsonMode: true,
|
|
72
|
-
maxTokens: 1e6
|
|
73
|
-
},
|
|
74
|
-
"google/gemini-flash-1.5": {
|
|
75
|
-
vision: true,
|
|
76
|
-
tools: true,
|
|
77
|
-
jsonMode: true,
|
|
78
|
-
maxTokens: 1e6
|
|
79
|
-
},
|
|
80
|
-
"google/gemini-2.0-flash-exp": {
|
|
81
|
-
vision: true,
|
|
82
|
-
tools: true,
|
|
83
|
-
jsonMode: true,
|
|
84
|
-
maxTokens: 1e6
|
|
85
|
-
},
|
|
86
|
-
// Meta Llama
|
|
87
|
-
"meta-llama/llama-3.1-405b-instruct": {
|
|
88
|
-
vision: false,
|
|
89
|
-
tools: true,
|
|
90
|
-
jsonMode: true,
|
|
91
|
-
maxTokens: 131072
|
|
92
|
-
},
|
|
93
|
-
"meta-llama/llama-3.1-70b-instruct": {
|
|
94
|
-
vision: false,
|
|
95
|
-
tools: true,
|
|
96
|
-
jsonMode: true,
|
|
97
|
-
maxTokens: 131072
|
|
98
|
-
},
|
|
99
|
-
"meta-llama/llama-3.1-8b-instruct": {
|
|
100
|
-
vision: false,
|
|
101
|
-
tools: true,
|
|
102
|
-
jsonMode: true,
|
|
103
|
-
maxTokens: 131072
|
|
104
|
-
},
|
|
105
|
-
"meta-llama/llama-3.2-90b-vision-instruct": {
|
|
106
|
-
vision: true,
|
|
107
|
-
tools: true,
|
|
108
|
-
jsonMode: true,
|
|
109
|
-
maxTokens: 131072
|
|
110
|
-
},
|
|
111
|
-
// Mistral
|
|
112
|
-
"mistralai/mistral-large": {
|
|
113
|
-
vision: false,
|
|
114
|
-
tools: true,
|
|
115
|
-
jsonMode: true,
|
|
116
|
-
maxTokens: 128e3
|
|
117
|
-
},
|
|
118
|
-
"mistralai/mixtral-8x7b-instruct": {
|
|
119
|
-
vision: false,
|
|
120
|
-
tools: true,
|
|
121
|
-
jsonMode: true,
|
|
122
|
-
maxTokens: 32768
|
|
123
|
-
},
|
|
124
|
-
"mistralai/mistral-nemo": {
|
|
125
|
-
vision: false,
|
|
126
|
-
tools: true,
|
|
127
|
-
jsonMode: true,
|
|
128
|
-
maxTokens: 128e3
|
|
129
|
-
},
|
|
130
|
-
// DeepSeek
|
|
131
|
-
"deepseek/deepseek-chat": {
|
|
132
|
-
vision: false,
|
|
133
|
-
tools: true,
|
|
134
|
-
jsonMode: true,
|
|
135
|
-
maxTokens: 64e3
|
|
136
|
-
},
|
|
137
|
-
"deepseek/deepseek-coder": {
|
|
138
|
-
vision: false,
|
|
139
|
-
tools: true,
|
|
140
|
-
jsonMode: true,
|
|
141
|
-
maxTokens: 64e3
|
|
142
|
-
},
|
|
143
|
-
// Qwen
|
|
144
|
-
"qwen/qwen-2.5-72b-instruct": {
|
|
145
|
-
vision: false,
|
|
146
|
-
tools: true,
|
|
147
|
-
jsonMode: true,
|
|
148
|
-
maxTokens: 131072
|
|
149
|
-
},
|
|
150
|
-
"qwen/qwen-2-vl-72b-instruct": {
|
|
151
|
-
vision: true,
|
|
152
|
-
tools: true,
|
|
153
|
-
jsonMode: true,
|
|
154
|
-
maxTokens: 32768
|
|
155
|
-
},
|
|
156
|
-
// OpenRouter Auto (magic model)
|
|
157
|
-
"openrouter/auto": {
|
|
158
|
-
vision: true,
|
|
159
|
-
tools: true,
|
|
160
|
-
jsonMode: true,
|
|
161
|
-
maxTokens: 128e3
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
4
|
var DEFAULT_MODEL_CONFIG = {
|
|
165
5
|
vision: true,
|
|
166
6
|
tools: true,
|
|
@@ -189,7 +29,7 @@ function openrouter(modelId, options = {}) {
|
|
|
189
29
|
}
|
|
190
30
|
return client;
|
|
191
31
|
}
|
|
192
|
-
const modelConfig =
|
|
32
|
+
const modelConfig = DEFAULT_MODEL_CONFIG;
|
|
193
33
|
return {
|
|
194
34
|
provider: "openrouter",
|
|
195
35
|
modelId,
|
|
@@ -388,6 +228,29 @@ function formatMessagesForOpenRouter(messages) {
|
|
|
388
228
|
}
|
|
389
229
|
});
|
|
390
230
|
}
|
|
231
|
+
async function fetchOpenRouterModels(apiKey) {
|
|
232
|
+
const headers = {
|
|
233
|
+
"Content-Type": "application/json"
|
|
234
|
+
};
|
|
235
|
+
if (apiKey) {
|
|
236
|
+
headers["Authorization"] = `Bearer ${apiKey}`;
|
|
237
|
+
}
|
|
238
|
+
const response = await fetch("https://openrouter.ai/api/v1/models", {
|
|
239
|
+
headers
|
|
240
|
+
});
|
|
241
|
+
if (!response.ok) {
|
|
242
|
+
throw new Error(`Failed to fetch models: ${response.statusText}`);
|
|
243
|
+
}
|
|
244
|
+
const data = await response.json();
|
|
245
|
+
return data.data || [];
|
|
246
|
+
}
|
|
247
|
+
async function searchOpenRouterModels(query, apiKey) {
|
|
248
|
+
const models = await fetchOpenRouterModels(apiKey);
|
|
249
|
+
const lowerQuery = query.toLowerCase();
|
|
250
|
+
return models.filter(
|
|
251
|
+
(model) => model.id.toLowerCase().includes(lowerQuery) || model.name.toLowerCase().includes(lowerQuery)
|
|
252
|
+
);
|
|
253
|
+
}
|
|
391
254
|
|
|
392
255
|
// src/core/utils.ts
|
|
393
256
|
function generateId(prefix = "id") {
|
|
@@ -586,29 +449,60 @@ var OpenAIAdapter = class {
|
|
|
586
449
|
request.systemPrompt
|
|
587
450
|
);
|
|
588
451
|
}
|
|
589
|
-
const tools = request.actions?.length ? formatTools(request.actions) :
|
|
452
|
+
const tools = request.actions?.length ? formatTools(request.actions) : [];
|
|
453
|
+
const webSearchConfig = request.webSearch ?? this.config.webSearch;
|
|
454
|
+
if (webSearchConfig) {
|
|
455
|
+
const webSearchTool = {
|
|
456
|
+
type: "web_search_preview"
|
|
457
|
+
};
|
|
458
|
+
const wsConfig = typeof webSearchConfig === "object" ? webSearchConfig : {};
|
|
459
|
+
if (wsConfig.userLocation) {
|
|
460
|
+
webSearchTool.search_context_size = "medium";
|
|
461
|
+
}
|
|
462
|
+
tools.push(webSearchTool);
|
|
463
|
+
}
|
|
590
464
|
const messageId = generateMessageId();
|
|
591
465
|
yield { type: "message:start", id: messageId };
|
|
592
466
|
try {
|
|
593
467
|
const stream = await client.chat.completions.create({
|
|
594
468
|
model: request.config?.model || this.model,
|
|
595
469
|
messages,
|
|
596
|
-
tools,
|
|
470
|
+
tools: tools.length > 0 ? tools : void 0,
|
|
597
471
|
temperature: request.config?.temperature ?? this.config.temperature,
|
|
598
472
|
max_tokens: request.config?.maxTokens ?? this.config.maxTokens,
|
|
599
473
|
stream: true,
|
|
600
474
|
stream_options: { include_usage: true }
|
|
601
475
|
});
|
|
602
476
|
let currentToolCall = null;
|
|
477
|
+
const collectedCitations = [];
|
|
478
|
+
let citationIndex = 0;
|
|
603
479
|
let usage;
|
|
604
480
|
for await (const chunk of stream) {
|
|
605
481
|
if (request.signal?.aborted) {
|
|
606
482
|
break;
|
|
607
483
|
}
|
|
608
484
|
const delta = chunk.choices[0]?.delta;
|
|
485
|
+
const choice = chunk.choices[0];
|
|
609
486
|
if (delta?.content) {
|
|
610
487
|
yield { type: "message:delta", content: delta.content };
|
|
611
488
|
}
|
|
489
|
+
const annotations = delta?.annotations;
|
|
490
|
+
if (annotations && annotations.length > 0) {
|
|
491
|
+
for (const annotation of annotations) {
|
|
492
|
+
if (annotation.type === "url_citation" && annotation.url_citation?.url) {
|
|
493
|
+
citationIndex++;
|
|
494
|
+
const url = annotation.url_citation.url;
|
|
495
|
+
const domain = extractDomain(url);
|
|
496
|
+
collectedCitations.push({
|
|
497
|
+
index: citationIndex,
|
|
498
|
+
url,
|
|
499
|
+
title: annotation.url_citation.title || domain,
|
|
500
|
+
domain,
|
|
501
|
+
favicon: domain ? `https://www.google.com/s2/favicons?domain=${domain}&sz=32` : void 0
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
612
506
|
if (delta?.tool_calls) {
|
|
613
507
|
for (const toolCall of delta.tool_calls) {
|
|
614
508
|
if (toolCall.id) {
|
|
@@ -641,7 +535,7 @@ var OpenAIAdapter = class {
|
|
|
641
535
|
total_tokens: chunk.usage.total_tokens
|
|
642
536
|
};
|
|
643
537
|
}
|
|
644
|
-
if (
|
|
538
|
+
if (choice?.finish_reason) {
|
|
645
539
|
if (currentToolCall) {
|
|
646
540
|
yield {
|
|
647
541
|
type: "action:args",
|
|
@@ -651,6 +545,10 @@ var OpenAIAdapter = class {
|
|
|
651
545
|
}
|
|
652
546
|
}
|
|
653
547
|
}
|
|
548
|
+
if (collectedCitations.length > 0) {
|
|
549
|
+
const uniqueCitations = deduplicateCitations(collectedCitations);
|
|
550
|
+
yield { type: "citation", citations: uniqueCitations };
|
|
551
|
+
}
|
|
654
552
|
yield { type: "message:end" };
|
|
655
553
|
yield { type: "done", usage };
|
|
656
554
|
} catch (error) {
|
|
@@ -662,6 +560,25 @@ var OpenAIAdapter = class {
|
|
|
662
560
|
}
|
|
663
561
|
}
|
|
664
562
|
};
|
|
563
|
+
function extractDomain(url) {
|
|
564
|
+
try {
|
|
565
|
+
const parsed = new URL(url);
|
|
566
|
+
return parsed.hostname;
|
|
567
|
+
} catch {
|
|
568
|
+
return "";
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function deduplicateCitations(citations) {
|
|
572
|
+
const seen = /* @__PURE__ */ new Map();
|
|
573
|
+
let index = 0;
|
|
574
|
+
for (const citation of citations) {
|
|
575
|
+
if (!seen.has(citation.url)) {
|
|
576
|
+
index++;
|
|
577
|
+
seen.set(citation.url, { ...citation, index });
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return Array.from(seen.values());
|
|
581
|
+
}
|
|
665
582
|
function createOpenAIAdapter(config) {
|
|
666
583
|
return new OpenAIAdapter(config);
|
|
667
584
|
}
|
|
@@ -683,111 +600,6 @@ function createCallableProvider(providerFn, properties) {
|
|
|
683
600
|
}
|
|
684
601
|
|
|
685
602
|
// src/providers/openrouter/index.ts
|
|
686
|
-
var OPENROUTER_MODELS2 = {
|
|
687
|
-
// OpenAI
|
|
688
|
-
"openai/gpt-4o": {
|
|
689
|
-
vision: true,
|
|
690
|
-
tools: true,
|
|
691
|
-
jsonMode: true,
|
|
692
|
-
maxTokens: 128e3
|
|
693
|
-
},
|
|
694
|
-
"openai/gpt-4o-mini": {
|
|
695
|
-
vision: true,
|
|
696
|
-
tools: true,
|
|
697
|
-
jsonMode: true,
|
|
698
|
-
maxTokens: 128e3
|
|
699
|
-
},
|
|
700
|
-
"openai/gpt-4-turbo": {
|
|
701
|
-
vision: true,
|
|
702
|
-
tools: true,
|
|
703
|
-
jsonMode: true,
|
|
704
|
-
maxTokens: 128e3
|
|
705
|
-
},
|
|
706
|
-
"openai/o1": {
|
|
707
|
-
vision: true,
|
|
708
|
-
tools: false,
|
|
709
|
-
jsonMode: false,
|
|
710
|
-
maxTokens: 128e3
|
|
711
|
-
},
|
|
712
|
-
// Anthropic
|
|
713
|
-
"anthropic/claude-3.5-sonnet": {
|
|
714
|
-
vision: true,
|
|
715
|
-
tools: true,
|
|
716
|
-
jsonMode: true,
|
|
717
|
-
maxTokens: 2e5
|
|
718
|
-
},
|
|
719
|
-
"anthropic/claude-3.5-sonnet-20241022": {
|
|
720
|
-
vision: true,
|
|
721
|
-
tools: true,
|
|
722
|
-
jsonMode: true,
|
|
723
|
-
maxTokens: 2e5
|
|
724
|
-
},
|
|
725
|
-
"anthropic/claude-3-opus": {
|
|
726
|
-
vision: true,
|
|
727
|
-
tools: true,
|
|
728
|
-
jsonMode: true,
|
|
729
|
-
maxTokens: 2e5
|
|
730
|
-
},
|
|
731
|
-
"anthropic/claude-3-haiku": {
|
|
732
|
-
vision: true,
|
|
733
|
-
tools: true,
|
|
734
|
-
jsonMode: true,
|
|
735
|
-
maxTokens: 2e5
|
|
736
|
-
},
|
|
737
|
-
// Google
|
|
738
|
-
"google/gemini-pro-1.5": {
|
|
739
|
-
vision: true,
|
|
740
|
-
tools: true,
|
|
741
|
-
jsonMode: true,
|
|
742
|
-
maxTokens: 1e6
|
|
743
|
-
},
|
|
744
|
-
"google/gemini-flash-1.5": {
|
|
745
|
-
vision: true,
|
|
746
|
-
tools: true,
|
|
747
|
-
jsonMode: true,
|
|
748
|
-
maxTokens: 1e6
|
|
749
|
-
},
|
|
750
|
-
// Meta Llama
|
|
751
|
-
"meta-llama/llama-3.1-405b-instruct": {
|
|
752
|
-
vision: false,
|
|
753
|
-
tools: true,
|
|
754
|
-
jsonMode: true,
|
|
755
|
-
maxTokens: 131072
|
|
756
|
-
},
|
|
757
|
-
"meta-llama/llama-3.1-70b-instruct": {
|
|
758
|
-
vision: false,
|
|
759
|
-
tools: true,
|
|
760
|
-
jsonMode: true,
|
|
761
|
-
maxTokens: 131072
|
|
762
|
-
},
|
|
763
|
-
// Mistral
|
|
764
|
-
"mistralai/mistral-large": {
|
|
765
|
-
vision: false,
|
|
766
|
-
tools: true,
|
|
767
|
-
jsonMode: true,
|
|
768
|
-
maxTokens: 128e3
|
|
769
|
-
},
|
|
770
|
-
"mistralai/mixtral-8x7b-instruct": {
|
|
771
|
-
vision: false,
|
|
772
|
-
tools: true,
|
|
773
|
-
jsonMode: true,
|
|
774
|
-
maxTokens: 32768
|
|
775
|
-
},
|
|
776
|
-
// DeepSeek
|
|
777
|
-
"deepseek/deepseek-chat": {
|
|
778
|
-
vision: false,
|
|
779
|
-
tools: true,
|
|
780
|
-
jsonMode: true,
|
|
781
|
-
maxTokens: 64e3
|
|
782
|
-
},
|
|
783
|
-
// OpenRouter Auto (magic model - picks best for your prompt)
|
|
784
|
-
"openrouter/auto": {
|
|
785
|
-
vision: true,
|
|
786
|
-
tools: true,
|
|
787
|
-
jsonMode: true,
|
|
788
|
-
maxTokens: 128e3
|
|
789
|
-
}
|
|
790
|
-
};
|
|
791
603
|
var DEFAULT_CAPABILITIES = {
|
|
792
604
|
vision: true,
|
|
793
605
|
tools: true,
|
|
@@ -805,24 +617,24 @@ function createOpenRouter(config = {}) {
|
|
|
805
617
|
});
|
|
806
618
|
};
|
|
807
619
|
const getCapabilities = (modelId) => {
|
|
808
|
-
const model = OPENROUTER_MODELS2[modelId] ?? DEFAULT_CAPABILITIES;
|
|
809
620
|
return {
|
|
810
|
-
supportsVision:
|
|
811
|
-
supportsTools:
|
|
621
|
+
supportsVision: DEFAULT_CAPABILITIES.vision,
|
|
622
|
+
supportsTools: DEFAULT_CAPABILITIES.tools,
|
|
812
623
|
supportsThinking: false,
|
|
813
624
|
supportsStreaming: true,
|
|
814
625
|
supportsPDF: false,
|
|
815
626
|
supportsAudio: false,
|
|
816
627
|
supportsVideo: false,
|
|
817
|
-
maxTokens:
|
|
818
|
-
supportedImageTypes:
|
|
819
|
-
supportsJsonMode:
|
|
628
|
+
maxTokens: DEFAULT_CAPABILITIES.maxTokens,
|
|
629
|
+
supportedImageTypes: ["image/png", "image/jpeg", "image/gif", "image/webp"] ,
|
|
630
|
+
supportsJsonMode: DEFAULT_CAPABILITIES.jsonMode,
|
|
820
631
|
supportsSystemMessages: true
|
|
821
632
|
};
|
|
822
633
|
};
|
|
823
634
|
return createCallableProvider(providerFn, {
|
|
824
635
|
name: "openrouter",
|
|
825
|
-
supportedModels:
|
|
636
|
+
supportedModels: [],
|
|
637
|
+
// Use fetchOpenRouterModels() to get live model list
|
|
826
638
|
getCapabilities
|
|
827
639
|
});
|
|
828
640
|
}
|
|
@@ -831,6 +643,8 @@ var createOpenRouterProvider = createOpenRouter;
|
|
|
831
643
|
exports.createOpenRouter = createOpenRouter;
|
|
832
644
|
exports.createOpenRouterModel = openrouter;
|
|
833
645
|
exports.createOpenRouterProvider = createOpenRouterProvider;
|
|
646
|
+
exports.fetchOpenRouterModels = fetchOpenRouterModels;
|
|
834
647
|
exports.openrouter = openrouter;
|
|
648
|
+
exports.searchOpenRouterModels = searchOpenRouterModels;
|
|
835
649
|
//# sourceMappingURL=index.js.map
|
|
836
650
|
//# sourceMappingURL=index.js.map
|