cloving 0.3.0 → 0.3.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.
@@ -66,23 +66,25 @@ const config = async () => {
66
66
  message: `Do you trust ${selectedModel} with sensitive information?`,
67
67
  default: false,
68
68
  });
69
- const temperature = await (0, prompts_1.number)({
69
+ const temperature = await (0, prompts_1.input)({
70
70
  message: `Enter the temperature for ${selectedModel} (0.0 - 1.0): [0.2]`,
71
- default: 0.2,
71
+ default: '0.2',
72
72
  validate: (value) => {
73
- if (value && (isNaN(value) || value < 0 || value > 1)) {
73
+ const num = parseFloat(value);
74
+ if (isNaN(num) || num < 0 || num > 1) {
74
75
  return 'Please enter a valid number between 0.0 and 1.0.';
75
76
  }
76
77
  return true;
77
78
  },
78
- }) || 0.2;
79
+ });
80
+ const parsedTemperature = parseFloat(temperature);
79
81
  const modelConfig = {
80
82
  apiKey,
81
83
  primary,
82
84
  priority: parseInt(priority, 10),
83
85
  silent: !review,
84
86
  trust,
85
- temperature,
87
+ temperature: parsedTemperature,
86
88
  };
87
89
  currentConfig.models[provider][model] = modelConfig;
88
90
  if (primary) {
@@ -22,6 +22,15 @@ const getConfig = (options) => {
22
22
  if (options.silent) {
23
23
  config.globalSilent = true;
24
24
  }
25
+ // Parse temperature to float if it exists in the config
26
+ for (const provider in config.models) {
27
+ for (const model in config.models[provider]) {
28
+ if (config.models[provider][model].temperature !== undefined) {
29
+ const temp = config.models[provider][model].temperature;
30
+ config.models[provider][model].temperature = typeof temp === 'string' ? parseFloat(temp) : temp;
31
+ }
32
+ }
33
+ }
25
34
  return config;
26
35
  }
27
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloving",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "packageManager": "yarn@1.22.22",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",