-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.mjs
More file actions
26 lines (21 loc) · 768 Bytes
/
Copy pathrun.mjs
File metadata and controls
26 lines (21 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { loadConfig } from '../../dist/config/index.js';
import { resolve } from '../../dist/resolver/index.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
if (!process.env.OPENAI_API_KEY) {
process.env.OPENAI_API_KEY = 'sk-demo-openai';
}
if (!process.env.OPENROUTER_API_KEY) {
process.env.OPENROUTER_API_KEY = 'sk-demo-openrouter';
}
const configPath = join(__dirname, 'modelconfig.json');
const config = loadConfig(configPath);
const result = resolve(config, {
model: 'smart',
require: ['vision', 'json_output'],
env: 'dev'
});
console.log('[ModelConfig basic example]');
console.log(JSON.stringify(result, null, 2));