@axiom-lattice/core 2.1.7 → 2.1.9

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/index.mjs CHANGED
@@ -200,7 +200,7 @@ var ModelLattice = class extends BaseChatModel {
200
200
  initChatModel(config) {
201
201
  if (config.provider === "azure") {
202
202
  return new AzureChatOpenAI({
203
- azureOpenAIApiKey: process.env.AZURE_OPENAI_API_KEY,
203
+ azureOpenAIApiKey: config.apiKey || process.env.AZURE_OPENAI_API_KEY,
204
204
  azureOpenAIApiInstanceName: "convertlab-westus",
205
205
  azureOpenAIApiDeploymentName: config.model,
206
206
  azureOpenAIApiVersion: "2024-02-01",
@@ -217,7 +217,7 @@ var ModelLattice = class extends BaseChatModel {
217
217
  maxTokens: config.maxTokens,
218
218
  timeout: config.timeout,
219
219
  maxRetries: config.maxRetries || 2,
220
- apiKey: process.env[config.apiKeyEnvName || "DEEPSEEK_API_KEY"],
220
+ apiKey: config.apiKey || process.env[config.apiKeyEnvName || "DEEPSEEK_API_KEY"],
221
221
  streaming: config.streaming
222
222
  });
223
223
  } else if (config.provider === "siliconcloud") {
@@ -227,7 +227,7 @@ var ModelLattice = class extends BaseChatModel {
227
227
  maxTokens: config.maxTokens,
228
228
  timeout: config.timeout,
229
229
  maxRetries: config.maxRetries || 2,
230
- apiKey: process.env[config.apiKeyEnvName || "SILICONCLOUD_API_KEY"],
230
+ apiKey: config.apiKey || process.env[config.apiKeyEnvName || "SILICONCLOUD_API_KEY"],
231
231
  configuration: {
232
232
  baseURL: "https://api.siliconflow.cn/v1"
233
233
  },
@@ -240,7 +240,7 @@ var ModelLattice = class extends BaseChatModel {
240
240
  maxTokens: config.maxTokens,
241
241
  timeout: config.timeout,
242
242
  maxRetries: config.maxRetries || 2,
243
- apiKey: process.env[config.apiKeyEnvName || "VOLCENGINE_API_KEY"],
243
+ apiKey: config.apiKey || process.env[config.apiKeyEnvName || "VOLCENGINE_API_KEY"],
244
244
  configuration: {
245
245
  baseURL: "https://ark.cn-beijing.volces.com/api/v3"
246
246
  },
@@ -254,7 +254,7 @@ var ModelLattice = class extends BaseChatModel {
254
254
  timeout: config.timeout,
255
255
  maxRetries: config.maxRetries || 2,
256
256
  streaming: config.streaming,
257
- apiKey: process.env[config.apiKeyEnvName || "OPENAI_API_KEY"],
257
+ apiKey: config.apiKey || process.env[config.apiKeyEnvName || "OPENAI_API_KEY"],
258
258
  configuration: {
259
259
  baseURL: config.baseURL
260
260
  }
@@ -560,7 +560,7 @@ registerToolLattice(
560
560
  {
561
561
  name: "internet_search",
562
562
  description: "Run a web search",
563
- needUserApprove: true,
563
+ needUserApprove: false,
564
564
  schema: z2.object({
565
565
  query: z2.string().describe("The search query"),
566
566
  maxResults: z2.number().optional().default(5).describe("Maximum number of results to return"),