mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
fix: better agents
This commit is contained in:
parent
16bdb0707f
commit
0f62ba8dd5
@ -35,9 +35,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
||||
}
|
||||
|
||||
const tfFallbackModel = createMemo(() => {
|
||||
const m = { providerID: "toothfairyai", modelID: "mystica-15" }
|
||||
if (isModelValid(m)) return m
|
||||
return undefined
|
||||
return { providerID: "toothfairyai", modelID: "mystica-15" }
|
||||
})
|
||||
|
||||
const agent = iife(() => {
|
||||
@ -393,15 +391,24 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
||||
createEffect(() => {
|
||||
const value = agent.current()
|
||||
const isTFAgent = !!value.options?.tf_agent_id
|
||||
if (value.model) {
|
||||
|
||||
if (isTFAgent) {
|
||||
// For TF agents, always ensure a valid model is set
|
||||
if (value.model && isModelValid(value.model)) {
|
||||
model.set({
|
||||
providerID: value.model.providerID,
|
||||
modelID: value.model.modelID,
|
||||
})
|
||||
} else {
|
||||
// Fallback to toothfairyai/mystica-15 for TF agents
|
||||
model.setDefault({ providerID: "toothfairyai", modelID: "mystica-15" })
|
||||
}
|
||||
} else if (value.model) {
|
||||
if (isModelValid(value.model)) {
|
||||
model.set({
|
||||
providerID: value.model.providerID,
|
||||
modelID: value.model.modelID,
|
||||
})
|
||||
} else if (isTFAgent) {
|
||||
// For TF agents with invalid model, force default to toothfairyai/mystica-15
|
||||
model.setDefault({ providerID: "toothfairyai", modelID: "mystica-15" })
|
||||
} else {
|
||||
toast.show({
|
||||
variant: "warning",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user