@saltcorn/large-language-model 1.0.7 → 1.0.8

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/generate.js CHANGED
@@ -442,7 +442,10 @@ const getAiSdkModel = ({ config, alt_config, userCfg }, isEmbedding) => {
442
442
  switch (use_provider) {
443
443
  case "OpenAI":
444
444
  const use_api_key =
445
- userCfg.api_key || userCfg.apiKey || use_config.api_key;
445
+ userCfg.api_key ||
446
+ userCfg.apiKey ||
447
+ use_config.api_key ||
448
+ use_config.apiKey;
446
449
  const openai = createOpenAI({ apiKey: use_api_key });
447
450
  return isEmbedding
448
451
  ? openai.textEmbeddingModel(model_name)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/large-language-model",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Large language models and functionality for Saltcorn",
5
5
  "main": "index.js",
6
6
  "dependencies": {
package/tests/llm.test.js CHANGED
@@ -17,7 +17,7 @@ beforeAll(async () => {
17
17
  // run with:
18
18
  // saltcorn dev:plugin-test -d ~/large-language-model/
19
19
 
20
- jest.setTimeout(30000);
20
+ jest.setTimeout(40000);
21
21
 
22
22
  for (const nameconfig of require("./configs")) {
23
23
  const { name, ...config } = nameconfig;