@blaxel/llamaindex 0.2.59-preview.41 → 0.2.59-preview.43

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/cjs/model.js CHANGED
@@ -16,7 +16,7 @@ class BlaxelLLM {
16
16
  this.model = model;
17
17
  this.modelData = modelData;
18
18
  this.options = options;
19
- this.type = modelData?.spec?.runtime?.type || "openai";
19
+ this.type = modelData?.spec.runtime?.type || "openai";
20
20
  }
21
21
  get supportToolCall() {
22
22
  return true;
@@ -46,7 +46,7 @@ class BlaxelLLM {
46
46
  catch {
47
47
  // If metadata access fails (e.g., Gemini), use default metadata
48
48
  this._metadata = {
49
- model: this.modelData?.spec?.runtime?.model || this.model,
49
+ model: this.modelData?.spec.runtime?.model || this.model,
50
50
  temperature: this.options?.temperature ?? 0,
51
51
  topP: this.options?.topP ?? 1,
52
52
  maxTokens: this.options?.maxTokens ?? undefined,
@@ -96,7 +96,7 @@ class BlaxelLLM {
96
96
  };
97
97
  if (this.type === "mistral") {
98
98
  return (0, openai_1.openai)({
99
- model: this.modelData?.spec?.runtime?.model,
99
+ model: this.modelData?.spec.runtime?.model,
100
100
  apiKey: currentToken,
101
101
  baseURL: `${url}/v1`,
102
102
  additionalSessionOptions: {
@@ -112,7 +112,7 @@ class BlaxelLLM {
112
112
  // Get fresh headers right before creating the session
113
113
  const anthropicHeaders = { ...core_1.settings.headers };
114
114
  const llm = (0, anthropic_1.anthropic)({
115
- model: this.modelData?.spec?.runtime?.model,
115
+ model: this.modelData?.spec.runtime?.model,
116
116
  session: new anthropic_1.AnthropicSession({
117
117
  baseURL: url,
118
118
  defaultHeaders: anthropicHeaders,
@@ -173,7 +173,7 @@ class BlaxelLLM {
173
173
  }
174
174
  if (this.type === "cohere") {
175
175
  const llm = (0, openai_1.openai)({
176
- model: this.modelData?.spec?.runtime?.model,
176
+ model: this.modelData?.spec.runtime?.model,
177
177
  apiKey: currentToken,
178
178
  baseURL: `${url}/compatibility/v1`, // OpenAI compatibility endpoint
179
179
  additionalSessionOptions: {
@@ -190,7 +190,7 @@ class BlaxelLLM {
190
190
  process.env.GOOGLE_API_KEY = process.env.GOOGLE_API_KEY || "THIS_IS_A_DUMMY_KEY_FOR_LLAMAINDEX";
191
191
  const llm = new google_1.Gemini({
192
192
  apiKey: core_1.settings.token,
193
- model: this.modelData?.spec?.runtime?.model,
193
+ model: this.modelData?.spec.runtime?.model,
194
194
  httpOptions: {
195
195
  baseUrl: url,
196
196
  headers: core_1.settings.headers,
@@ -200,7 +200,7 @@ class BlaxelLLM {
200
200
  return llm;
201
201
  }
202
202
  return (0, openai_1.openai)({
203
- model: this.modelData?.spec?.runtime?.model,
203
+ model: this.modelData?.spec.runtime?.model,
204
204
  apiKey: currentToken,
205
205
  baseURL: `${url}/v1`,
206
206
  additionalSessionOptions: {