@saltcorn/large-language-model 0.8.8 → 0.8.10
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 +3 -0
- package/generate.js +14 -2
- package/package.json +1 -1
package/constants.js
CHANGED
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:
|
|
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
|
-
|
|
197
|
+
if (
|
|
198
|
+
![
|
|
199
|
+
"o1",
|
|
200
|
+
"o3",
|
|
201
|
+
"o3-mini",
|
|
202
|
+
"o4-mini",
|
|
203
|
+
"gpt-5",
|
|
204
|
+
"gpt-5-nano",
|
|
205
|
+
"gpt-5-mini",
|
|
206
|
+
].includes(use_model)
|
|
207
|
+
)
|
|
208
|
+
body.temperature = 0.7;
|
|
197
209
|
}
|
|
198
210
|
|
|
199
211
|
if (responses_api) {
|