backend-manager 5.0.125 → 5.0.127

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": "5.0.125",
3
+ "version": "5.0.127",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -21,6 +21,7 @@ const MODEL_TABLE = {
21
21
  provider: 'openai',
22
22
  features: {
23
23
  json: true,
24
+ temperature: false,
24
25
  },
25
26
  },
26
27
  'gpt-5.2': {
@@ -29,6 +30,7 @@ const MODEL_TABLE = {
29
30
  provider: 'openai',
30
31
  features: {
31
32
  json: true,
33
+ temperature: false,
32
34
  },
33
35
  },
34
36
  'gpt-5.1': {
@@ -37,6 +39,7 @@ const MODEL_TABLE = {
37
39
  provider: 'openai',
38
40
  features: {
39
41
  json: true,
42
+ temperature: false,
40
43
  },
41
44
  },
42
45
  'gpt-5': {
@@ -45,6 +48,7 @@ const MODEL_TABLE = {
45
48
  provider: 'openai',
46
49
  features: {
47
50
  json: true,
51
+ temperature: false,
48
52
  },
49
53
  },
50
54
  'gpt-5-mini': {
@@ -53,6 +57,7 @@ const MODEL_TABLE = {
53
57
  provider: 'openai',
54
58
  features: {
55
59
  json: true,
60
+ temperature: false,
56
61
  },
57
62
  },
58
63
  'gpt-5-nano': {
@@ -61,6 +66,7 @@ const MODEL_TABLE = {
61
66
  provider: 'openai',
62
67
  features: {
63
68
  json: true,
69
+ temperature: false,
64
70
  },
65
71
  },
66
72
  // GPT-4.5
@@ -793,16 +799,22 @@ function makeRequest(mode, options, self, prompt, message, user, _log) {
793
799
  const history = formatHistory(options, prompt, message, _log);
794
800
 
795
801
  // Set request
802
+ const modelConfig = getModelConfig(options.model);
803
+
796
804
  request.url = 'https://api.openai.com/v1/responses';
797
805
  request.body = {
798
806
  model: options.model,
799
807
  input: history,
800
808
  user: user,
801
- temperature: options.temperature,
802
809
  max_output_tokens: options.maxTokens,
803
810
  text: resolveFormatting(options),
804
811
  reasoning: resolveReasoning(options),
805
812
  }
813
+
814
+ // Only include temperature if the model supports it
815
+ if (modelConfig.features?.temperature !== false) {
816
+ request.body.temperature = options.temperature;
817
+ }
806
818
  }
807
819
 
808
820
  // Request
@@ -93,6 +93,7 @@ describe(`${package.name}`, () => {
93
93
  requests: {
94
94
  total: -1,
95
95
  monthly: -1,
96
+ daily: -1,
96
97
  last: {
97
98
  id: 'decrement',
98
99
  timestamp: '2024-01-01T01:00:00.000Z',
@@ -72,7 +72,8 @@ module.exports = {
72
72
  assert.ok(user.api.privateKey.length > 0, 'api.privateKey should not be empty');
73
73
 
74
74
  // Usage
75
- assert.equal(user.usage.requests.period, 0, 'usage.requests.period should be 0');
75
+ assert.equal(user.usage.requests.monthly, 0, 'usage.requests.monthly should be 0');
76
+ assert.equal(user.usage.requests.daily, 0, 'usage.requests.daily should be 0');
76
77
  assert.equal(user.usage.requests.total, 0, 'usage.requests.total should be 0');
77
78
  assert.equal(user.usage.requests.last.id, null, 'usage.requests.last.id should be null');
78
79
 
@@ -204,24 +205,24 @@ module.exports = {
204
205
  async run({ assert }) {
205
206
  const user = createUser({
206
207
  usage: {
207
- requests: { period: 10, total: 100, last: { id: 'r1', timestamp: '2025-01-01T00:00:00.000Z', timestampUNIX: 1735689600 } },
208
- emails: { period: 5, total: 50, last: { id: 'e1', timestamp: '2025-01-02T00:00:00.000Z', timestampUNIX: 1735776000 } },
209
- sends: { period: 3, total: 30 },
208
+ requests: { monthly: 10, total: 100, last: { id: 'r1', timestamp: '2025-01-01T00:00:00.000Z', timestampUNIX: 1735689600 } },
209
+ emails: { monthly: 5, total: 50, last: { id: 'e1', timestamp: '2025-01-02T00:00:00.000Z', timestampUNIX: 1735776000 } },
210
+ sends: { monthly: 3, total: 30 },
210
211
  },
211
212
  });
212
213
 
213
214
  // Defined key (requests)
214
- assert.equal(user.usage.requests.period, 10, 'requests.period preserved');
215
+ assert.equal(user.usage.requests.monthly, 10, 'requests.monthly preserved');
215
216
  assert.equal(user.usage.requests.total, 100, 'requests.total preserved');
216
217
  assert.equal(user.usage.requests.last.id, 'r1', 'requests.last.id preserved');
217
218
 
218
219
  // Dynamic key (emails) — full data
219
- assert.equal(user.usage.emails.period, 5, 'emails.period preserved');
220
+ assert.equal(user.usage.emails.monthly, 5, 'emails.monthly preserved');
220
221
  assert.equal(user.usage.emails.total, 50, 'emails.total preserved');
221
222
  assert.equal(user.usage.emails.last.id, 'e1', 'emails.last.id preserved');
222
223
 
223
224
  // Dynamic key (sends) — partial data, template fills in missing
224
- assert.equal(user.usage.sends.period, 3, 'sends.period preserved');
225
+ assert.equal(user.usage.sends.monthly, 3, 'sends.monthly preserved');
225
226
  assert.equal(user.usage.sends.total, 30, 'sends.total preserved');
226
227
  assert.equal(user.usage.sends.last.id, null, 'sends.last.id defaulted to null');
227
228
  assert.ok(user.usage.sends.last.timestamp, 'sends.last.timestamp defaulted');
@@ -484,8 +485,8 @@ module.exports = {
484
485
  },
485
486
  },
486
487
  usage: {
487
- requests: { period: 100, total: 5000, last: { id: 'req-z', timestamp: '2025-12-01T00:00:00.000Z', timestampUNIX: 1764633600 } },
488
- emails: { period: 42, total: 2100, last: { id: 'em-z', timestamp: '2025-12-01T00:00:00.000Z', timestampUNIX: 1764633600 } },
488
+ requests: { monthly: 100, total: 5000, last: { id: 'req-z', timestamp: '2025-12-01T00:00:00.000Z', timestampUNIX: 1764633600 } },
489
+ emails: { monthly: 42, total: 2100, last: { id: 'em-z', timestamp: '2025-12-01T00:00:00.000Z', timestampUNIX: 1764633600 } },
489
490
  },
490
491
  personal: {
491
492
  name: { first: 'Ian', last: 'Wiedenman' },
@@ -508,7 +509,7 @@ module.exports = {
508
509
  assert.equal(user.api.clientId, 'uuid-123', 'api clientId preserved');
509
510
  assert.equal(user.oauth2.google.token.access_token, 'ya29.real', 'oauth2 token preserved');
510
511
  assert.equal(user.oauth2.google.identity.email, 'ian@gmail.com', 'oauth2 identity preserved');
511
- assert.equal(user.usage.emails.period, 42, 'usage emails preserved');
512
+ assert.equal(user.usage.emails.monthly, 42, 'usage emails preserved');
512
513
  assert.equal(user.personal.name.first, 'Ian', 'name preserved');
513
514
  assert.equal(user.personal.company.name, 'ITW Creative Works', 'company preserved');
514
515
  assert.equal(user.personal.birthday.timestampUNIX, 642988800, 'birthday preserved');