namirasoft-inference 1.5.11 → 1.5.13
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/NamirasoftInferenceServer.js +1 -1
- package/dist/NamirasoftInferenceServerUsage.d.ts +1 -1
- package/dist/NamirasoftInferenceServerUsage.js +2 -2
- package/dist/NamirasoftInferenceServerUsage.js.map +1 -1
- package/dist/command/ModelCreateCommand.js +192 -165
- package/dist/command/ModelCreateCommand.js.map +1 -1
- package/dist/command/ModelUpdateCommand.js +192 -165
- package/dist/command/ModelUpdateCommand.js.map +1 -1
- package/dist/command/UsageCommand.js +16 -16
- package/dist/command/UsageDashboardCommand.d.ts +5 -5
- package/dist/command/UsageDashboardCommand.js +37 -37
- package/dist/command/UsageSummaryCommand.js +37 -37
- package/dist/command/UsageSummaryCommand.js.map +1 -1
- package/dist/enum/InferencerType.d.ts +6 -6
- package/dist/enum/InferencerType.js +10 -10
- package/dist/enum/UsageBucketType.d.ts +4 -4
- package/dist/enum/UsageBucketType.js +8 -8
- package/dist/index.d.ts +141 -141
- package/dist/index.js +157 -157
- package/dist/meta/ModelMetaTable.d.ts +66 -63
- package/dist/meta/ModelMetaTable.js +88 -85
- package/dist/meta/ModelMetaTable.js.map +1 -1
- package/dist/row/ModelInputRow.d.ts +24 -21
- package/dist/row/ModelRow.d.ts +61 -58
- package/dist/row/UsageDashboardBucketRow.d.ts +10 -10
- package/dist/row/UsageDashboardBucketRow.js +2 -2
- package/dist/row/UsageDashboardResponseRow.d.ts +8 -8
- package/dist/row/UsageDashboardResponseRow.js +2 -2
- package/package.json +1 -1
- package/src/NamirasoftInferenceServer.ts +1 -1
- package/src/NamirasoftInferenceServerUsage.ts +2 -2
- package/src/command/ModelCreateCommand.ts +27 -0
- package/src/command/ModelUpdateCommand.ts +27 -0
- package/src/command/UsageSummaryCommand.ts +2 -2
- package/src/enum/UsageBucketType.ts +2 -2
- package/src/meta/ModelMetaTable.ts +6 -0
- package/src/row/ModelInputRow.ts +3 -0
- package/src/row/ModelRow.ts +3 -0
|
@@ -1,166 +1,193 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ModelUpdateCommand = void 0;
|
|
13
|
-
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
-
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
-
const NamirasoftInferenceServer_1 = require("../NamirasoftInferenceServer");
|
|
16
|
-
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
-
class ModelUpdateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
-
constructor(argv) {
|
|
19
|
-
super(argv, ["id"], [
|
|
20
|
-
{
|
|
21
|
-
name: "workspace_id",
|
|
22
|
-
short: "",
|
|
23
|
-
description: "Provides the value of 'workspace_id' in body",
|
|
24
|
-
optional: true,
|
|
25
|
-
args: ["workspace_id"],
|
|
26
|
-
defaults: [""]
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "name",
|
|
30
|
-
short: "",
|
|
31
|
-
description: "Provides the value of 'name' in body",
|
|
32
|
-
optional: false,
|
|
33
|
-
args: ["name"],
|
|
34
|
-
defaults: [""]
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: "model_company",
|
|
38
|
-
short: "",
|
|
39
|
-
description: "Provides the value of 'model_company' in body",
|
|
40
|
-
optional: false,
|
|
41
|
-
args: ["model_company"],
|
|
42
|
-
defaults: [""]
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: "model_name",
|
|
46
|
-
short: "",
|
|
47
|
-
description: "Provides the value of 'model_name' in body",
|
|
48
|
-
optional: false,
|
|
49
|
-
args: ["model_name"],
|
|
50
|
-
defaults: [""]
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "settings",
|
|
54
|
-
short: "",
|
|
55
|
-
description: "Provides the value of 'settings' in body",
|
|
56
|
-
optional: true,
|
|
57
|
-
args: ["settings"],
|
|
58
|
-
defaults: [""]
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: "model_api_key_credential_id",
|
|
62
|
-
short: "",
|
|
63
|
-
description: "Provides the value of 'model_api_key_credential_id' in body",
|
|
64
|
-
optional: true,
|
|
65
|
-
args: ["model_api_key_credential_id"],
|
|
66
|
-
defaults: [""]
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: "cost_limit_per_month",
|
|
70
|
-
short: "",
|
|
71
|
-
description: "Provides the value of 'cost_limit_per_month' in body",
|
|
72
|
-
optional: true,
|
|
73
|
-
args: ["cost_limit_per_month"],
|
|
74
|
-
defaults: [""]
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "cost_limit_per_week",
|
|
78
|
-
short: "",
|
|
79
|
-
description: "Provides the value of 'cost_limit_per_week' in body",
|
|
80
|
-
optional: true,
|
|
81
|
-
args: ["cost_limit_per_week"],
|
|
82
|
-
defaults: [""]
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: "cost_limit_per_day",
|
|
86
|
-
short: "",
|
|
87
|
-
description: "Provides the value of 'cost_limit_per_day' in body",
|
|
88
|
-
optional: true,
|
|
89
|
-
args: ["cost_limit_per_day"],
|
|
90
|
-
defaults: [""]
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: "cost_limit_per_chat",
|
|
94
|
-
short: "",
|
|
95
|
-
description: "Provides the value of 'cost_limit_per_chat' in body",
|
|
96
|
-
optional: true,
|
|
97
|
-
args: ["cost_limit_per_chat"],
|
|
98
|
-
defaults: [""]
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: "cost_limit_per_run",
|
|
102
|
-
short: "",
|
|
103
|
-
description: "Provides the value of 'cost_limit_per_run' in body",
|
|
104
|
-
optional: true,
|
|
105
|
-
args: ["cost_limit_per_run"],
|
|
106
|
-
defaults: [""]
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: "
|
|
110
|
-
short: "",
|
|
111
|
-
description: "Provides the value of '
|
|
112
|
-
optional: false,
|
|
113
|
-
args: ["
|
|
114
|
-
defaults: [""]
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: "
|
|
118
|
-
short: "",
|
|
119
|
-
description: "Provides the value of '
|
|
120
|
-
optional: false,
|
|
121
|
-
args: ["
|
|
122
|
-
defaults: [""]
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: "
|
|
126
|
-
short: "",
|
|
127
|
-
description: "Provides the value of '
|
|
128
|
-
optional: false,
|
|
129
|
-
args: ["
|
|
130
|
-
defaults: [""]
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
this.app.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ModelUpdateCommand = void 0;
|
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
+
const NamirasoftInferenceServer_1 = require("../NamirasoftInferenceServer");
|
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
+
class ModelUpdateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, ["id"], [
|
|
20
|
+
{
|
|
21
|
+
name: "workspace_id",
|
|
22
|
+
short: "",
|
|
23
|
+
description: "Provides the value of 'workspace_id' in body",
|
|
24
|
+
optional: true,
|
|
25
|
+
args: ["workspace_id"],
|
|
26
|
+
defaults: [""]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "name",
|
|
30
|
+
short: "",
|
|
31
|
+
description: "Provides the value of 'name' in body",
|
|
32
|
+
optional: false,
|
|
33
|
+
args: ["name"],
|
|
34
|
+
defaults: [""]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "model_company",
|
|
38
|
+
short: "",
|
|
39
|
+
description: "Provides the value of 'model_company' in body",
|
|
40
|
+
optional: false,
|
|
41
|
+
args: ["model_company"],
|
|
42
|
+
defaults: [""]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "model_name",
|
|
46
|
+
short: "",
|
|
47
|
+
description: "Provides the value of 'model_name' in body",
|
|
48
|
+
optional: false,
|
|
49
|
+
args: ["model_name"],
|
|
50
|
+
defaults: [""]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "settings",
|
|
54
|
+
short: "",
|
|
55
|
+
description: "Provides the value of 'settings' in body",
|
|
56
|
+
optional: true,
|
|
57
|
+
args: ["settings"],
|
|
58
|
+
defaults: [""]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "model_api_key_credential_id",
|
|
62
|
+
short: "",
|
|
63
|
+
description: "Provides the value of 'model_api_key_credential_id' in body",
|
|
64
|
+
optional: true,
|
|
65
|
+
args: ["model_api_key_credential_id"],
|
|
66
|
+
defaults: [""]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "cost_limit_per_month",
|
|
70
|
+
short: "",
|
|
71
|
+
description: "Provides the value of 'cost_limit_per_month' in body",
|
|
72
|
+
optional: true,
|
|
73
|
+
args: ["cost_limit_per_month"],
|
|
74
|
+
defaults: [""]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "cost_limit_per_week",
|
|
78
|
+
short: "",
|
|
79
|
+
description: "Provides the value of 'cost_limit_per_week' in body",
|
|
80
|
+
optional: true,
|
|
81
|
+
args: ["cost_limit_per_week"],
|
|
82
|
+
defaults: [""]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "cost_limit_per_day",
|
|
86
|
+
short: "",
|
|
87
|
+
description: "Provides the value of 'cost_limit_per_day' in body",
|
|
88
|
+
optional: true,
|
|
89
|
+
args: ["cost_limit_per_day"],
|
|
90
|
+
defaults: [""]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "cost_limit_per_chat",
|
|
94
|
+
short: "",
|
|
95
|
+
description: "Provides the value of 'cost_limit_per_chat' in body",
|
|
96
|
+
optional: true,
|
|
97
|
+
args: ["cost_limit_per_chat"],
|
|
98
|
+
defaults: [""]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "cost_limit_per_run",
|
|
102
|
+
short: "",
|
|
103
|
+
description: "Provides the value of 'cost_limit_per_run' in body",
|
|
104
|
+
optional: true,
|
|
105
|
+
args: ["cost_limit_per_run"],
|
|
106
|
+
defaults: [""]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "json_force",
|
|
110
|
+
short: "",
|
|
111
|
+
description: "Provides the value of 'json_force' in body",
|
|
112
|
+
optional: false,
|
|
113
|
+
args: ["json_force"],
|
|
114
|
+
defaults: [""]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "json_system_prompt",
|
|
118
|
+
short: "",
|
|
119
|
+
description: "Provides the value of 'json_system_prompt' in body",
|
|
120
|
+
optional: false,
|
|
121
|
+
args: ["json_system_prompt"],
|
|
122
|
+
defaults: [""]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "json_correction",
|
|
126
|
+
short: "",
|
|
127
|
+
description: "Provides the value of 'json_correction' in body",
|
|
128
|
+
optional: false,
|
|
129
|
+
args: ["json_correction"],
|
|
130
|
+
defaults: [""]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "model_category",
|
|
134
|
+
short: "",
|
|
135
|
+
description: "Provides the value of 'model_category' in body",
|
|
136
|
+
optional: false,
|
|
137
|
+
args: ["model_category"],
|
|
138
|
+
defaults: [""]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "model_field",
|
|
142
|
+
short: "",
|
|
143
|
+
description: "Provides the value of 'model_field' in body",
|
|
144
|
+
optional: false,
|
|
145
|
+
args: ["model_field"],
|
|
146
|
+
defaults: [""]
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "model_tag",
|
|
150
|
+
short: "",
|
|
151
|
+
description: "Provides the value of 'model_tag' in body",
|
|
152
|
+
optional: false,
|
|
153
|
+
args: ["model_tag"],
|
|
154
|
+
defaults: [""]
|
|
155
|
+
}
|
|
156
|
+
]);
|
|
157
|
+
}
|
|
158
|
+
exec() {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
let token = this.app.storage.getNSAToken();
|
|
161
|
+
if (token == null)
|
|
162
|
+
throw new Error("Token is not available. Please login first using:\nns-inference ns-account config \nor \nns-inference ns-account login.");
|
|
163
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
|
164
|
+
let token_manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
165
|
+
token_manager.setValue(token, false);
|
|
166
|
+
let url = this.app.storage.getItem("ns-inference-server-url");
|
|
167
|
+
let server = new NamirasoftInferenceServer_1.NamirasoftInferenceServer(url, token_manager, e => this.app.logger.error(e.message));
|
|
168
|
+
let ans = yield server.model.Update(this.arg_values[0], {
|
|
169
|
+
workspace_id: this.option_values.workspace_id,
|
|
170
|
+
name: this.option_values.name,
|
|
171
|
+
model_company: this.option_values.model_company,
|
|
172
|
+
model_name: this.option_values.model_name,
|
|
173
|
+
settings: this.option_values.settings,
|
|
174
|
+
model_api_key_credential_id: this.option_values.model_api_key_credential_id,
|
|
175
|
+
cost_limit_per_month: this.option_values.cost_limit_per_month,
|
|
176
|
+
cost_limit_per_week: this.option_values.cost_limit_per_week,
|
|
177
|
+
cost_limit_per_day: this.option_values.cost_limit_per_day,
|
|
178
|
+
cost_limit_per_chat: this.option_values.cost_limit_per_chat,
|
|
179
|
+
cost_limit_per_run: this.option_values.cost_limit_per_run,
|
|
180
|
+
json_force: this.option_values.json_force,
|
|
181
|
+
json_system_prompt: this.option_values.json_system_prompt,
|
|
182
|
+
json_correction: this.option_values.json_correction,
|
|
183
|
+
model_category: this.option_values.model_category,
|
|
184
|
+
model_field: this.option_values.model_field,
|
|
185
|
+
model_tag: this.option_values.model_tag
|
|
186
|
+
});
|
|
187
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
exports.ModelUpdateCommand = ModelUpdateCommand;
|
|
192
|
+
;
|
|
166
193
|
//# sourceMappingURL=ModelUpdateCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelUpdateCommand.js","sourceRoot":"","sources":["../../src/command/ModelUpdateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,4EAAyE;AACzE,2DAAkD;AAElD,MAAa,kBAAmB,SAAQ,sCAAgB;IAEpD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE;YAChB;gBACI,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,CAAC,cAAc,CAAC;gBACtB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,sCAAsC;gBACnD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,MAAM,CAAC;gBACd,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,eAAe,CAAC;gBACvB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,YAAY,CAAC;gBACpB,QAAQ,EAAE,CAAC,EAAE,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AAI,CAAC,aAAa,CAAC,eAAe;gBACnD,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc;gBACjD,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS;aAC1C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AA9KD,gDA8KC;AAAA,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UsageCommand = void 0;
|
|
4
|
-
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
5
|
-
const UsageDashboardCommand_1 = require("./UsageDashboardCommand");
|
|
6
|
-
const UsageSummaryCommand_1 = require("./UsageSummaryCommand");
|
|
7
|
-
class UsageCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
|
8
|
-
constructor(argv) {
|
|
9
|
-
super(argv, {
|
|
10
|
-
"summary": UsageSummaryCommand_1.UsageSummaryCommand,
|
|
11
|
-
"dashboard": UsageDashboardCommand_1.UsageDashboardCommand,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.UsageCommand = UsageCommand;
|
|
16
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UsageCommand = void 0;
|
|
4
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
5
|
+
const UsageDashboardCommand_1 = require("./UsageDashboardCommand");
|
|
6
|
+
const UsageSummaryCommand_1 = require("./UsageSummaryCommand");
|
|
7
|
+
class UsageCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
|
8
|
+
constructor(argv) {
|
|
9
|
+
super(argv, {
|
|
10
|
+
"summary": UsageSummaryCommand_1.UsageSummaryCommand,
|
|
11
|
+
"dashboard": UsageDashboardCommand_1.UsageDashboardCommand,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.UsageCommand = UsageCommand;
|
|
16
|
+
;
|
|
17
17
|
//# sourceMappingURL=UsageCommand.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
2
|
-
export declare class UsageDashboardCommand extends BaseFinalCommand {
|
|
3
|
-
constructor(argv: string[]);
|
|
4
|
-
exec(): Promise<void>;
|
|
5
|
-
}
|
|
1
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
2
|
+
export declare class UsageDashboardCommand extends BaseFinalCommand {
|
|
3
|
+
constructor(argv: string[]);
|
|
4
|
+
exec(): Promise<void>;
|
|
5
|
+
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UsageDashboardCommand = void 0;
|
|
13
|
-
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
-
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
-
const NamirasoftInferenceServer_1 = require("../NamirasoftInferenceServer");
|
|
16
|
-
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
-
class UsageDashboardCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
-
constructor(argv) {
|
|
19
|
-
super(argv, ["inferencer_type", "inferencer_id", "winner_final", "started_at", "ended_at", "bucket"], []);
|
|
20
|
-
}
|
|
21
|
-
exec() {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
let token = this.app.storage.getNSAToken();
|
|
24
|
-
if (token == null)
|
|
25
|
-
throw new Error("Token is not available. Please login first using:\nns-inference ns-account config \nor \nns-inference ns-account login.");
|
|
26
|
-
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
|
27
|
-
let token_manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
28
|
-
token_manager.setValue(token, false);
|
|
29
|
-
let url = this.app.storage.getItem("ns-inference-server-url");
|
|
30
|
-
let server = new NamirasoftInferenceServer_1.NamirasoftInferenceServer(url, token_manager, e => this.app.logger.error(e.message));
|
|
31
|
-
let ans = yield server.usage.Dashboard(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3], this.arg_values[4], this.arg_values[5]);
|
|
32
|
-
this.app.logger.success(JSON.stringify(ans));
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.UsageDashboardCommand = UsageDashboardCommand;
|
|
37
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UsageDashboardCommand = void 0;
|
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
+
const NamirasoftInferenceServer_1 = require("../NamirasoftInferenceServer");
|
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
+
class UsageDashboardCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, ["inferencer_type", "inferencer_id", "winner_final", "started_at", "ended_at", "bucket"], []);
|
|
20
|
+
}
|
|
21
|
+
exec() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
let token = this.app.storage.getNSAToken();
|
|
24
|
+
if (token == null)
|
|
25
|
+
throw new Error("Token is not available. Please login first using:\nns-inference ns-account config \nor \nns-inference ns-account login.");
|
|
26
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
|
27
|
+
let token_manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
28
|
+
token_manager.setValue(token, false);
|
|
29
|
+
let url = this.app.storage.getItem("ns-inference-server-url");
|
|
30
|
+
let server = new NamirasoftInferenceServer_1.NamirasoftInferenceServer(url, token_manager, e => this.app.logger.error(e.message));
|
|
31
|
+
let ans = yield server.usage.Dashboard(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3], this.arg_values[4], this.arg_values[5]);
|
|
32
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.UsageDashboardCommand = UsageDashboardCommand;
|
|
37
|
+
;
|
|
38
38
|
//# sourceMappingURL=UsageDashboardCommand.js.map
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UsageSummaryCommand = void 0;
|
|
13
|
-
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
-
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
-
const NamirasoftInferenceServer_1 = require("../NamirasoftInferenceServer");
|
|
16
|
-
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
-
class UsageSummaryCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
-
constructor(argv) {
|
|
19
|
-
super(argv, ["
|
|
20
|
-
}
|
|
21
|
-
exec() {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
let token = this.app.storage.getNSAToken();
|
|
24
|
-
if (token == null)
|
|
25
|
-
throw new Error("Token is not available. Please login first using:\nns-inference ns-account config \nor \nns-inference ns-account login.");
|
|
26
|
-
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
|
27
|
-
let token_manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
28
|
-
token_manager.setValue(token, false);
|
|
29
|
-
let url = this.app.storage.getItem("ns-inference-server-url");
|
|
30
|
-
let server = new NamirasoftInferenceServer_1.NamirasoftInferenceServer(url, token_manager, e => this.app.logger.error(e.message));
|
|
31
|
-
let ans = yield server.usage.Summary(this.arg_values[0], this.arg_values[1], this.arg_values[2]);
|
|
32
|
-
this.app.logger.success(JSON.stringify(ans));
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.UsageSummaryCommand = UsageSummaryCommand;
|
|
37
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UsageSummaryCommand = void 0;
|
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
+
const NamirasoftInferenceServer_1 = require("../NamirasoftInferenceServer");
|
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
+
class UsageSummaryCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, ["inferencer_type", "inferencer_id", "started_at", "ended_at"], []);
|
|
20
|
+
}
|
|
21
|
+
exec() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
let token = this.app.storage.getNSAToken();
|
|
24
|
+
if (token == null)
|
|
25
|
+
throw new Error("Token is not available. Please login first using:\nns-inference ns-account config \nor \nns-inference ns-account login.");
|
|
26
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
|
27
|
+
let token_manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
28
|
+
token_manager.setValue(token, false);
|
|
29
|
+
let url = this.app.storage.getItem("ns-inference-server-url");
|
|
30
|
+
let server = new NamirasoftInferenceServer_1.NamirasoftInferenceServer(url, token_manager, e => this.app.logger.error(e.message));
|
|
31
|
+
let ans = yield server.usage.Summary(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3]);
|
|
32
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.UsageSummaryCommand = UsageSummaryCommand;
|
|
37
|
+
;
|
|
38
38
|
//# sourceMappingURL=UsageSummaryCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsageSummaryCommand.js","sourceRoot":"","sources":["../../src/command/UsageSummaryCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,4EAAyE;AACzE,2DAAkD;AAElD,MAAa,mBAAoB,SAAQ,sCAAgB;IAErD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"UsageSummaryCommand.js","sourceRoot":"","sources":["../../src/command/UsageSummaryCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,4EAAyE;AACzE,2DAAkD;AAElD,MAAa,mBAAoB,SAAQ,sCAAgB;IAErD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;IACpF,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,yHAAyH,CAAC,CAAC;YAC/I,IAAI,OAAO,GAAG,IAAI,yCAAuB,EAAE,CAAC;YAC5C,IAAI,aAAa,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACzD,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACrC,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;YAC9D,IAAI,MAAM,GAAG,IAAI,qDAAyB,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACtG,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YACrH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAnBD,kDAmBC;AAAA,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare enum InferencerType {
|
|
2
|
-
MODEL = "MODEL",
|
|
3
|
-
LOAD_BALANCER = "LOAD_BALANCER",
|
|
4
|
-
FAILOVER = "FAILOVER",
|
|
5
|
-
RACE = "RACE"
|
|
6
|
-
}
|
|
1
|
+
export declare enum InferencerType {
|
|
2
|
+
MODEL = "MODEL",
|
|
3
|
+
LOAD_BALANCER = "LOAD_BALANCER",
|
|
4
|
+
FAILOVER = "FAILOVER",
|
|
5
|
+
RACE = "RACE"
|
|
6
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InferencerType = void 0;
|
|
4
|
-
var InferencerType;
|
|
5
|
-
(function (InferencerType) {
|
|
6
|
-
InferencerType["MODEL"] = "MODEL";
|
|
7
|
-
InferencerType["LOAD_BALANCER"] = "LOAD_BALANCER";
|
|
8
|
-
InferencerType["FAILOVER"] = "FAILOVER";
|
|
9
|
-
InferencerType["RACE"] = "RACE";
|
|
10
|
-
})(InferencerType || (exports.InferencerType = InferencerType = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InferencerType = void 0;
|
|
4
|
+
var InferencerType;
|
|
5
|
+
(function (InferencerType) {
|
|
6
|
+
InferencerType["MODEL"] = "MODEL";
|
|
7
|
+
InferencerType["LOAD_BALANCER"] = "LOAD_BALANCER";
|
|
8
|
+
InferencerType["FAILOVER"] = "FAILOVER";
|
|
9
|
+
InferencerType["RACE"] = "RACE";
|
|
10
|
+
})(InferencerType || (exports.InferencerType = InferencerType = {}));
|
|
11
11
|
//# sourceMappingURL=InferencerType.js.map
|