@blaxel/llamaindex 0.2.10 → 0.2.11-dev.88
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/model.js +27 -7
- package/package.json +4 -3
package/dist/model.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.blModel = void 0;
|
|
4
4
|
const core_1 = require("@blaxel/core");
|
|
5
5
|
const anthropic_1 = require("@llamaindex/anthropic");
|
|
6
|
-
const
|
|
6
|
+
const google_1 = require("@llamaindex/google");
|
|
7
7
|
const openai_1 = require("@llamaindex/openai");
|
|
8
8
|
const blModel = async (model, options) => {
|
|
9
9
|
const url = `${core_1.settings.runUrl}/${core_1.settings.workspace}/models/${model}`;
|
|
@@ -15,17 +15,12 @@ const blModel = async (model, options) => {
|
|
|
15
15
|
const type = modelData?.spec?.runtime?.type || "openai";
|
|
16
16
|
try {
|
|
17
17
|
if (type === "mistral") {
|
|
18
|
-
|
|
19
|
-
// @ts-expect-error - We have dynamic model name, we don't want to check it here
|
|
18
|
+
return (0, openai_1.openai)({
|
|
20
19
|
model: modelData?.spec?.runtime?.model,
|
|
21
20
|
apiKey: core_1.settings.token,
|
|
22
21
|
baseURL: `${url}/v1`,
|
|
23
22
|
...options,
|
|
24
23
|
});
|
|
25
|
-
return {
|
|
26
|
-
...llm,
|
|
27
|
-
supportToolCall: true,
|
|
28
|
-
};
|
|
29
24
|
}
|
|
30
25
|
if (type === "anthropic") {
|
|
31
26
|
const llm = (0, anthropic_1.anthropic)({
|
|
@@ -41,6 +36,31 @@ const blModel = async (model, options) => {
|
|
|
41
36
|
supportToolCall: true,
|
|
42
37
|
};
|
|
43
38
|
}
|
|
39
|
+
if (type === "cohere") {
|
|
40
|
+
const llm = (0, openai_1.openai)({
|
|
41
|
+
model: modelData?.spec?.runtime?.model,
|
|
42
|
+
apiKey: core_1.settings.token,
|
|
43
|
+
baseURL: `${url}/compatibility/v1`,
|
|
44
|
+
...options,
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
...llm,
|
|
48
|
+
supportToolCall: true,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (type === "gemini") {
|
|
52
|
+
process.env.GOOGLE_API_KEY = process.env.GOOGLE_API_KEY || "THIS_IS_A_DUMMY_KEY_FOR_LLAMAINDEX";
|
|
53
|
+
const llm = new google_1.Gemini({
|
|
54
|
+
apiKey: core_1.settings.token,
|
|
55
|
+
model: modelData?.spec?.runtime?.model,
|
|
56
|
+
requestOptions: {
|
|
57
|
+
baseUrl: url,
|
|
58
|
+
customHeaders: core_1.settings.headers,
|
|
59
|
+
},
|
|
60
|
+
...options,
|
|
61
|
+
});
|
|
62
|
+
return llm;
|
|
63
|
+
}
|
|
44
64
|
return (0, openai_1.openai)({
|
|
45
65
|
model: modelData?.spec?.runtime?.model,
|
|
46
66
|
apiKey: core_1.settings.token,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaxel/llamaindex",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11-dev.88",
|
|
4
4
|
"description": "Blaxel SDK for TypeScript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Blaxel, INC (https://blaxel.ai)",
|
|
@@ -54,13 +54,14 @@
|
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@llamaindex/anthropic": "^0.3.4",
|
|
57
|
-
"@llamaindex/core": "0.6.
|
|
57
|
+
"@llamaindex/core": "0.6.6",
|
|
58
|
+
"@llamaindex/google": "^0.3.2",
|
|
58
59
|
"@llamaindex/mistral": "^0.1.3",
|
|
59
60
|
"@llamaindex/openai": "^0.3.5",
|
|
60
61
|
"@opentelemetry/instrumentation": "^0.200.0",
|
|
61
62
|
"@traceloop/instrumentation-llamaindex": "^0.13.0",
|
|
62
63
|
"llamaindex": "^0.10.3",
|
|
63
|
-
"@blaxel/core": "0.2.
|
|
64
|
+
"@blaxel/core": "0.2.11-dev.88"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@eslint/js": "^9.26.0",
|