tweak: adjust agent variant logic to not require exact match on model, and instead check if the variant is available for model (#12838)
This commit is contained in:
@@ -843,14 +843,11 @@ export namespace SessionPrompt {
|
|||||||
const agent = await Agent.get(input.agent ?? (await Agent.defaultAgent()))
|
const agent = await Agent.get(input.agent ?? (await Agent.defaultAgent()))
|
||||||
|
|
||||||
const model = input.model ?? agent.model ?? (await lastModel(input.sessionID))
|
const model = input.model ?? agent.model ?? (await lastModel(input.sessionID))
|
||||||
const variant =
|
const full =
|
||||||
input.variant ??
|
!input.variant && agent.variant
|
||||||
(agent.variant &&
|
? await Provider.getModel(model.providerID, model.modelID).catch(() => undefined)
|
||||||
agent.model &&
|
: undefined
|
||||||
model.providerID === agent.model.providerID &&
|
const variant = input.variant ?? (agent.variant && full?.variants?.[agent.variant] ? agent.variant : undefined)
|
||||||
model.modelID === agent.model.modelID
|
|
||||||
? agent.variant
|
|
||||||
: undefined)
|
|
||||||
|
|
||||||
const info: MessageV2.Info = {
|
const info: MessageV2.Info = {
|
||||||
id: input.messageID ?? Identifier.ascending("message"),
|
id: input.messageID ?? Identifier.ascending("message"),
|
||||||
|
|||||||
Reference in New Issue
Block a user