@agi-cli/sdk 0.1.100 → 0.1.101
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/package.json
CHANGED
|
@@ -7,7 +7,16 @@ import type {
|
|
|
7
7
|
type CatalogMap = Partial<Record<ProviderId, ProviderCatalogEntry>>;
|
|
8
8
|
|
|
9
9
|
const SOLFORGE_ID: ProviderId = 'solforge';
|
|
10
|
-
const
|
|
10
|
+
const SOLFORGE_SOURCES: Array<{ id: ProviderId; npm: string }> = [
|
|
11
|
+
{
|
|
12
|
+
id: 'openai',
|
|
13
|
+
npm: '@ai-sdk/openai',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 'anthropic',
|
|
17
|
+
npm: '@ai-sdk/anthropic',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
11
20
|
|
|
12
21
|
function cloneModel(model: ModelInfo): ModelInfo {
|
|
13
22
|
return {
|
|
@@ -29,13 +38,14 @@ function cloneModel(model: ModelInfo): ModelInfo {
|
|
|
29
38
|
}
|
|
30
39
|
|
|
31
40
|
function buildSolforgeEntry(base: CatalogMap): ProviderCatalogEntry | null {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
.
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
const solforgeModels = SOLFORGE_SOURCES.flatMap(({ id, npm }) => {
|
|
42
|
+
const sourceModels = base[id]?.models ?? [];
|
|
43
|
+
return sourceModels.map((model) => {
|
|
44
|
+
const cloned = cloneModel(model);
|
|
45
|
+
cloned.provider = { ...(cloned.provider ?? {}), npm };
|
|
46
|
+
return cloned;
|
|
47
|
+
});
|
|
48
|
+
});
|
|
39
49
|
|
|
40
50
|
if (!solforgeModels.length) return null;
|
|
41
51
|
|