modelmix 4.4.8 → 4.4.11
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/README.md +1 -1
- package/demo/custom.js +1 -1
- package/demo/demo.js +1 -3
- package/demo/fallback.js +4 -3
- package/demo/parallel.js +3 -2
- package/demo/stream.js +1 -1
- package/demo/together.js +2 -1
- package/package.json +5 -6
- package/test/setup.js +3 -0
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ For environment variables, use `dotenv` or Node's built-in `process.loadEnvFile(
|
|
|
42
42
|
3. **Create and configure your models**:
|
|
43
43
|
|
|
44
44
|
```javascript
|
|
45
|
-
|
|
45
|
+
process.loadEnvFile();
|
|
46
46
|
import { ModelMix } from 'modelmix';
|
|
47
47
|
|
|
48
48
|
// Get structured JSON responses
|
package/demo/custom.js
CHANGED
package/demo/demo.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
process.loadEnvFile();
|
|
2
2
|
import { ModelMix } from '../index.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
const mmix = new ModelMix({
|
|
6
5
|
options: {
|
|
7
6
|
temperature: 0.5,
|
|
@@ -14,7 +13,6 @@ const mmix = new ModelMix({
|
|
|
14
13
|
}
|
|
15
14
|
});
|
|
16
15
|
|
|
17
|
-
|
|
18
16
|
const pplxSettings = {
|
|
19
17
|
config: {
|
|
20
18
|
apiKey: process.env.PPLX_API_KEY,
|
package/demo/fallback.js
CHANGED
package/demo/parallel.js
CHANGED
package/demo/stream.js
CHANGED
package/demo/together.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modelmix",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.11",
|
|
4
4
|
"description": "🧬 Reliable interface with automatic fallback for AI LLMs.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -56,21 +56,20 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"chai": "^5.2.1",
|
|
59
|
-
"dotenv": "^17.2.1",
|
|
60
59
|
"mocha": "^11.3.0",
|
|
61
60
|
"nock": "^14.0.9",
|
|
62
61
|
"sinon": "^21.0.0"
|
|
63
62
|
},
|
|
64
63
|
"scripts": {
|
|
65
|
-
"test": "mocha test/**/*.js --timeout 10000 --require
|
|
64
|
+
"test": "mocha test/**/*.js --timeout 10000 --require test/setup.js",
|
|
66
65
|
"test:watch": "mocha test/**/*.js --watch --timeout 10000 --require test/setup.js",
|
|
67
66
|
"test:json": "mocha test/json.test.js --timeout 10000 --require test/setup.js",
|
|
68
67
|
"test:fallback": "mocha test/fallback.test.js --timeout 10000 --require test/setup.js",
|
|
69
68
|
"test:templates": "mocha test/templates.test.js --timeout 10000 --require test/setup.js",
|
|
70
69
|
"test:images": "mocha test/images.test.js --timeout 10000 --require test/setup.js",
|
|
71
70
|
"test:bottleneck": "mocha test/bottleneck.test.js --timeout 10000 --require test/setup.js",
|
|
72
|
-
"test:live": "mocha test/live.test.js --timeout 10000 --require
|
|
73
|
-
"test:live.mcp": "mocha test/live.mcp.js --timeout 60000 --require
|
|
74
|
-
"test:tokens": "mocha test/tokens.test.js --timeout 10000 --require
|
|
71
|
+
"test:live": "mocha test/live.test.js --timeout 10000 --require test/setup.js",
|
|
72
|
+
"test:live.mcp": "mocha test/live.mcp.js --timeout 60000 --require test/setup.js",
|
|
73
|
+
"test:tokens": "mocha test/tokens.test.js --timeout 10000 --require test/setup.js"
|
|
75
74
|
}
|
|
76
75
|
}
|
package/test/setup.js
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* It runs before each test suite and sets up the testing environment.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// Load .env file if present (native Node.js, no dotenv dependency required)
|
|
9
|
+
try { process.loadEnvFile(); } catch {}
|
|
10
|
+
|
|
8
11
|
// Set dummy environment variables for testing to prevent library errors
|
|
9
12
|
|
|
10
13
|
const chai = require('chai');
|