@outputai/cli 0.1.6-next.52f426b.0 → 0.1.6
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.
|
@@ -10,10 +10,10 @@ import { formatOutput } from '#utils/output_formatter.js';
|
|
|
10
10
|
export default class WorkflowCost extends Command {
|
|
11
11
|
static description = 'Calculate the cost of a workflow execution';
|
|
12
12
|
static examples = [
|
|
13
|
-
'<%= config.bin %> <%= command.id %>
|
|
14
|
-
'<%= config.bin %> <%= command.id %>
|
|
15
|
-
'<%= config.bin %> <%= command.id %>
|
|
16
|
-
'<%= config.bin %> <%= command.id %>
|
|
13
|
+
'<%= config.bin %> <%= command.id %> my_workflow_id',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> my_workflow_id --verbose',
|
|
15
|
+
'<%= config.bin %> <%= command.id %> my_workflow_id path/to/trace.json',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> my_workflow_id --format json'
|
|
17
17
|
];
|
|
18
18
|
static args = {
|
|
19
19
|
workflowId: Args.string({
|
|
@@ -27,12 +27,16 @@ function loadYaml(filePath) {
|
|
|
27
27
|
export function loadPricingConfig(configPath) {
|
|
28
28
|
const bundledPath = new URL('../assets/config/costs.yml', import.meta.url).pathname;
|
|
29
29
|
const bundled = loadYaml(configPath ?? bundledPath);
|
|
30
|
+
if (!bundled) {
|
|
31
|
+
console.warn('Warning: bundled pricing config is empty or missing. Add a config/costs.yml to your project to define model pricing.');
|
|
32
|
+
return { models: {}, services: {} };
|
|
33
|
+
}
|
|
30
34
|
const projectPath = join(process.cwd(), 'config', 'costs.yml');
|
|
31
35
|
if (!configPath && existsSync(projectPath)) {
|
|
32
36
|
const project = loadYaml(projectPath);
|
|
33
37
|
return {
|
|
34
|
-
models: { ...bundled.models, ...project
|
|
35
|
-
services: { ...bundled.services, ...project
|
|
38
|
+
models: { ...bundled.models, ...(project?.models ?? {}) },
|
|
39
|
+
services: { ...bundled.services, ...(project?.services ?? {}) }
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
return bundled;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outputai/cli",
|
|
3
|
-
"version": "0.1.6
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "CLI for Output.ai workflow generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"log-update": "7.2.0",
|
|
34
34
|
"semver": "7.7.4",
|
|
35
35
|
"yaml": "^2.7.1",
|
|
36
|
-
"@outputai/credentials": "0.1.6
|
|
37
|
-
"@outputai/evals": "0.1.6
|
|
38
|
-
"@outputai/llm": "0.1.6
|
|
36
|
+
"@outputai/credentials": "0.1.6",
|
|
37
|
+
"@outputai/evals": "0.1.6",
|
|
38
|
+
"@outputai/llm": "0.1.6"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/cli-progress": "3.11.6",
|