mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-09 02:09:12 +00:00
feat: add variants toggle (#6325)
Co-authored-by: Github Action <action@github.com>
This commit is contained in:
@@ -74,6 +74,14 @@ export namespace LLM {
|
||||
}
|
||||
|
||||
const provider = await Provider.getProvider(input.model.providerID)
|
||||
const variant = input.model.variants && input.user.variant ? input.model.variants[input.user.variant] : undefined
|
||||
const options = pipe(
|
||||
ProviderTransform.options(input.model, input.sessionID, provider.options),
|
||||
mergeDeep(input.small ? ProviderTransform.smallOptions(input.model) : {}),
|
||||
mergeDeep(input.model.options),
|
||||
mergeDeep(input.agent.options),
|
||||
mergeDeep(variant && !variant.disabled ? variant : {}),
|
||||
)
|
||||
|
||||
const params = await Plugin.trigger(
|
||||
"chat.params",
|
||||
@@ -90,13 +98,7 @@ export namespace LLM {
|
||||
: undefined,
|
||||
topP: input.agent.topP ?? ProviderTransform.topP(input.model),
|
||||
topK: ProviderTransform.topK(input.model),
|
||||
options: pipe(
|
||||
{},
|
||||
mergeDeep(ProviderTransform.options(input.model, input.sessionID, provider.options)),
|
||||
input.small ? mergeDeep(ProviderTransform.smallOptions(input.model)) : mergeDeep({}),
|
||||
mergeDeep(input.model.options),
|
||||
mergeDeep(input.agent.options),
|
||||
),
|
||||
options,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user