backend-manager 5.0.0 → 5.0.1
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/package.json
CHANGED
package/src/manager/index.js
CHANGED
|
@@ -290,7 +290,7 @@ Manager.prototype.init = function (exporter, options) {
|
|
|
290
290
|
self.storage();
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
// Fetch stats
|
|
293
|
+
// Fetch stats
|
|
294
294
|
if (self.assistant.isDevelopment() && options.fetchStats) {
|
|
295
295
|
setTimeout(function () {
|
|
296
296
|
self.assistant.log('Fetching meta/stats...');
|
|
@@ -10,6 +10,7 @@ const mimeTypes = require('mime-types');
|
|
|
10
10
|
const DEFAULT_MODEL = 'gpt-4o';
|
|
11
11
|
const MODERATION_MODEL = 'omni-moderation-latest';
|
|
12
12
|
|
|
13
|
+
// OpenAI model pricing table
|
|
13
14
|
// https://platform.openai.com/docs/pricing
|
|
14
15
|
const MODEL_TABLE = {
|
|
15
16
|
// Jul 11, 2025
|
|
@@ -85,6 +86,14 @@ const MODEL_TABLE = {
|
|
|
85
86
|
json: true,
|
|
86
87
|
},
|
|
87
88
|
},
|
|
89
|
+
'o4-mini': {
|
|
90
|
+
input: 1.10,
|
|
91
|
+
output: 4.40,
|
|
92
|
+
provider: 'openai',
|
|
93
|
+
features: {
|
|
94
|
+
json: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
88
97
|
'o1-preview': {
|
|
89
98
|
input: 15.00,
|
|
90
99
|
output: 60.00,
|
|
@@ -195,6 +204,9 @@ OpenAI.prototype.request = function (options) {
|
|
|
195
204
|
// Format schema
|
|
196
205
|
options.schema = options.schema || undefined;
|
|
197
206
|
|
|
207
|
+
// Reasons
|
|
208
|
+
options.reasoning = options.reasoning || undefined;
|
|
209
|
+
|
|
198
210
|
// Format prompt
|
|
199
211
|
options.prompt = options.prompt || {};
|
|
200
212
|
options.prompt.path = options.prompt.path || '';
|
|
@@ -592,8 +604,11 @@ function attemptRequest(options, self, prompt, message, user, moderation, attemp
|
|
|
592
604
|
// metadata: {}
|
|
593
605
|
// }
|
|
594
606
|
|
|
607
|
+
// Get output
|
|
608
|
+
const output = r.output;
|
|
609
|
+
|
|
595
610
|
// Ensure content is set
|
|
596
|
-
const content =
|
|
611
|
+
const content = output.find((o) => o.type === 'message')?.content || [];
|
|
597
612
|
|
|
598
613
|
// Trim and combine all output text
|
|
599
614
|
const outputText = content
|
|
@@ -708,6 +723,7 @@ function makeRequest(mode, options, self, prompt, message, user, _log) {
|
|
|
708
723
|
temperature: options.temperature,
|
|
709
724
|
max_output_tokens: options.maxTokens,
|
|
710
725
|
text: resolveFormatting(options),
|
|
726
|
+
reasoning: resolveReasoning(options),
|
|
711
727
|
}
|
|
712
728
|
}
|
|
713
729
|
|
|
@@ -768,4 +784,17 @@ function resolveFormatting(options) {
|
|
|
768
784
|
return undefined;
|
|
769
785
|
}
|
|
770
786
|
|
|
787
|
+
function resolveReasoning(options) {
|
|
788
|
+
// If reasoning is set, return reasoning format
|
|
789
|
+
if (options.reasoning) {
|
|
790
|
+
return {
|
|
791
|
+
effort: options.reasoning.effort || 'medium',
|
|
792
|
+
// summary: options.reasoning.summary || 'concise',
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
// Other, return undefined
|
|
797
|
+
return undefined;
|
|
798
|
+
}
|
|
799
|
+
|
|
771
800
|
module.exports = OpenAI;
|