Skip to content

Commit

Permalink
fix: Lite series models disable plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Amery2010 committed Feb 21, 2025
1 parent 698d180 commit 8cc3a67
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ export default function Home() {
return OldVisionModel.includes(model)
}, [model])
const isThinkingModel = useMemo(() => {
return model.includes('-thinking')
return model.includes('thinking')
}, [model])
const isLiteModel = useMemo(() => {
return model.includes('lite')
}, [model])
const supportAttachment = useMemo(() => {
return !OldTextModel.includes(model)
Expand Down Expand Up @@ -187,7 +190,7 @@ export default function Home() {
if (talkMode === 'voice') {
config.systemInstruction = `${getVoiceModelPrompt()}\n\n${systemInstruction}`
}
if (tools.length > 0 && !isThinkingModel) config.tools = [{ functionDeclarations: tools }]
if (tools.length > 0 && !isThinkingModel && !isLiteModel) config.tools = [{ functionDeclarations: tools }]
if (apiKey !== '') {
config.baseUrl = apiProxy || GEMINI_API_BASE_URL
} else {
Expand Down Expand Up @@ -283,7 +286,7 @@ export default function Home() {
}
}
},
[systemInstruction, isThinkingModel, talkMode],
[systemInstruction, isThinkingModel, isLiteModel, talkMode],
)

const summarize = useCallback(
Expand Down Expand Up @@ -864,12 +867,12 @@ export default function Home() {
}, [])

useEffect(() => {
if (isOldVisionModel || isThinkingModel) {
if (isOldVisionModel || isThinkingModel || isLiteModel) {
setEnablePlugin(false)
} else {
setEnablePlugin(true)
}
}, [isOldVisionModel, isThinkingModel])
}, [isOldVisionModel, isThinkingModel, isLiteModel])

useLayoutEffect(() => {
const setting = useSettingStore.getState()
Expand Down

0 comments on commit 8cc3a67

Please sign in to comment.