@saltcorn/large-language-model 0.8.8 → 0.8.9

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/constants.js CHANGED
@@ -14,6 +14,9 @@ const OPENAI_MODELS = [
14
14
  "o3",
15
15
  "o3-mini",
16
16
  "o4-mini",
17
+ "gtp-5",
18
+ "gtp-5-nano",
19
+ "gtp-5-mini",
17
20
  ];
18
21
 
19
22
  // https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored
package/generate.js CHANGED
@@ -182,9 +182,10 @@ const getCompletionOpenAICompatible = async (
182
182
  };
183
183
  if (bearer) headers.Authorization = "Bearer " + bearer;
184
184
  if (apiKey) headers["api-key"] = apiKey;
185
+ const use_model = rest.model || model;
185
186
  const body = {
186
187
  //prompt: "How are you?",
187
- model: rest.model || model,
188
+ model: use_model,
188
189
  ...rest,
189
190
  };
190
191
  if (rest.temperature || temperature) {
@@ -193,7 +194,18 @@ const getCompletionOpenAICompatible = async (
193
194
  } else if (rest.temperature === null) {
194
195
  delete body.temperature;
195
196
  } else if (typeof temperature === "undefined") {
196
- body.temperature = 0.7;
197
+ if (
198
+ ![
199
+ "o1",
200
+ "o3",
201
+ "o3-mini",
202
+ "o4-mini",
203
+ "gtp-5",
204
+ "gtp-5-nano",
205
+ "gtp-5-mini",
206
+ ].includes(use_model)
207
+ )
208
+ body.temperature = 0.7;
197
209
  }
198
210
 
199
211
  if (responses_api) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/large-language-model",
3
- "version": "0.8.8",
3
+ "version": "0.8.9",
4
4
  "description": "Large language models and functionality for Saltcorn",
5
5
  "main": "index.js",
6
6
  "dependencies": {