@blaxel/llamaindex 0.2.10 → 0.2.11-dev.89

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 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 mistral_1 = require("@llamaindex/mistral");
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
- const llm = (0, mistral_1.mistral)({
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/dist/tools.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const blTool: (name: string) => Promise<import("llamaindex").FunctionTool<unknown, import("llamaindex").JSONValue | Promise<import("llamaindex").JSONValue>, object>[]>;
2
- export declare const blTools: (names: string[]) => Promise<import("llamaindex").FunctionTool<unknown, import("llamaindex").JSONValue | Promise<import("llamaindex").JSONValue>, object>[]>;
1
+ export declare const blTool: (name: string, ms?: number) => Promise<import("llamaindex").FunctionTool<unknown, import("llamaindex").JSONValue | Promise<import("llamaindex").JSONValue>, object>[]>;
2
+ export declare const blTools: (names: string[], ms?: number) => Promise<import("llamaindex").FunctionTool<unknown, import("llamaindex").JSONValue | Promise<import("llamaindex").JSONValue>, object>[]>;
package/dist/tools.js CHANGED
@@ -4,9 +4,9 @@ exports.blTools = exports.blTool = void 0;
4
4
  // @ts-ignore - Required for build time due to missing types in 'llamaindex'
5
5
  const core_1 = require("@blaxel/core");
6
6
  const llamaindex_1 = require("llamaindex");
7
- const blTool = async (name) => {
7
+ const blTool = async (name, ms) => {
8
8
  try {
9
- const blaxelTool = await (0, core_1.getTool)(name);
9
+ const blaxelTool = await (0, core_1.getTool)(name, ms);
10
10
  const tools = blaxelTool.map((t) => {
11
11
  // @ts-ignore - Required for build time due to missing types in 'llamaindex'
12
12
  return (0, llamaindex_1.tool)(t.call.bind(t), {
@@ -23,8 +23,8 @@ const blTool = async (name) => {
23
23
  }
24
24
  };
25
25
  exports.blTool = blTool;
26
- const blTools = async (names) => {
27
- const toolArrays = await Promise.all(names.map(exports.blTool));
26
+ const blTools = async (names, ms) => {
27
+ const toolArrays = await Promise.all(names.map((n) => (0, exports.blTool)(n, ms)));
28
28
  return toolArrays.flat();
29
29
  };
30
30
  exports.blTools = blTools;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/llamaindex",
3
- "version": "0.2.10",
3
+ "version": "0.2.11-dev.89",
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.2",
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.10"
64
+ "@blaxel/core": "0.2.11-dev.89"
64
65
  },
65
66
  "devDependencies": {
66
67
  "@eslint/js": "^9.26.0",