backend-manager 4.0.2 → 4.0.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -212,6 +212,12 @@ BackendAssistant.prototype.init = function (ref, options) {
212
212
  self.constant.pastTime.timestamp = '1999-01-01T00:00:00Z';
213
213
  self.constant.pastTime.timestampUNIX = 915148800;
214
214
 
215
+ // Schema
216
+ self.schema = {
217
+ dir: '',
218
+ name: '',
219
+ }
220
+
215
221
  // Log options
216
222
  if (
217
223
  (self.isDevelopment())
@@ -97,11 +97,11 @@ Middleware.prototype.run = function (libPath, options) {
97
97
 
98
98
  // Resolve settings
99
99
  if (options.setupSettings) {
100
- // assistant.log(`Middleware.process(): Resolving settings with schema ${options.schema}...`);
101
-
102
100
  // Resolve settings
103
101
  try {
104
- // assistant.settings = Manager.Settings().resolve(assistant, options.schema, data);
102
+ // Attach schema to assistant
103
+ assistant.schema.dir = schemasDir;
104
+ assistant.schema.name = options.schema;
105
105
  assistant.settings = Manager.Settings().resolve(assistant, undefined, data, {dir: schemasDir, schema: options.schema});
106
106
  } catch (e) {
107
107
  return assistant.respond(new Error(`Unable to resolve schema ${options.schema}: ${e.message}`), {code: 500, sentry: true});
@@ -7,14 +7,22 @@ const JSON5 = require('json5');
7
7
  // Constants
8
8
  const DEFAULT_MODEL = 'gpt-4o';
9
9
  const TOKEN_COST_TABLE = {
10
- // Jul 18th, 2024
10
+ // Sept 21st, 2024
11
+ 'gpt-4o': {
12
+ input: 0.00500,
13
+ output: 0.01500,
14
+ },
11
15
  'gpt-4o-mini': {
12
16
  input: 0.000150,
13
17
  output: 0.000600,
14
18
  },
15
- 'gpt-4o': {
16
- input: 0.00500,
17
- output: 0.01500,
19
+ 'o1-preview': {
20
+ input: 0.01500,
21
+ output: 0.06000,
22
+ },
23
+ 'o1-mini': {
24
+ input: 0.00300,
25
+ output: 0.01200,
18
26
  },
19
27
  'gpt-4-turbo': {
20
28
  input: 0.01000,
@@ -29,6 +37,28 @@ const TOKEN_COST_TABLE = {
29
37
  output: 0.00150,
30
38
  },
31
39
 
40
+ // // Jul 18th, 2024
41
+ // 'gpt-4o': {
42
+ // input: 0.00500,
43
+ // output: 0.01500,
44
+ // },
45
+ // 'gpt-4o-mini': {
46
+ // input: 0.000150,
47
+ // output: 0.000600,
48
+ // },
49
+ // 'gpt-4-turbo': {
50
+ // input: 0.01000,
51
+ // output: 0.03000,
52
+ // },
53
+ // 'gpt-4': {
54
+ // input: 0.03000,
55
+ // output: 0.06000,
56
+ // },
57
+ // 'gpt-3.5-turbo': {
58
+ // input: 0.00050,
59
+ // output: 0.00150,
60
+ // },
61
+
32
62
  // // May 13th, 2024
33
63
  // 'gpt-4o': {
34
64
  // input: 0.0050,