This commit is contained in:
Webifi 2023-06-07 13:26:50 -05:00
parent 01fe033583
commit d768f4b355
1 changed files with 5 additions and 4 deletions

View File

@ -341,14 +341,15 @@
// Provide the settings by mapping the settingsMap to key/value pairs
...getRequestSettingList().reduce((acc, setting) => {
const key = setting.key
let value = getChatSettingValueNullDefault(chatId, setting)
if (typeof setting.apiTransform === 'function') {
value = setting.apiTransform(chatId, setting, value)
}
if (opts.summaryRequest && opts.maxTokens) {
// requesting summary. do overrides
if (setting.key === 'max_tokens') value = opts.maxTokens // only as large as we need for summary
if (setting.key === 'n') value = 1 // never more than one completion for summary
if (key === 'max_tokens') value = opts.maxTokens // only as large as we need for summary
if (key === 'n') value = 1 // never more than one completion for summary
}
if (opts.streaming) {
/*
@ -356,9 +357,9 @@
Doesn't seem like there's any way to separate the jumbled mess of deltas for the
different completions.
*/
if (setting.key === 'n') value = 1
if (key === 'n') value = 1
}
if (value !== null) acc[setting.key] = value
if (value !== null) acc[key] = value
return acc
}, {})
}