mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-29 23:12:38 +08:00
fix(InputbarTools): allow url context for gemini endpoint type model (#10926)
fix(InputbarTools): allow url context for gemini endpoint type Add condition to check for gemini endpoint type when determining URL context support
This commit is contained in:
parent
4dfb73c982
commit
0081a0740f
@ -383,7 +383,9 @@ const InputbarTools = ({
|
||||
key: 'url_context',
|
||||
label: t('chat.input.url_context'),
|
||||
component: <UrlContextButton ref={urlContextButtonRef} assistantId={assistant.id} />,
|
||||
condition: isGeminiModel(model) && isSupportUrlContextProvider(getProviderByModel(model))
|
||||
condition:
|
||||
isGeminiModel(model) &&
|
||||
(isSupportUrlContextProvider(getProviderByModel(model)) || model.endpoint_type === 'gemini')
|
||||
},
|
||||
{
|
||||
key: 'knowledge_base',
|
||||
|
||||
@ -133,6 +133,8 @@ export function getAssistantProvider(assistant: Assistant): Provider {
|
||||
return provider || getDefaultProvider()
|
||||
}
|
||||
|
||||
// FIXME: This function fails in silence.
|
||||
// TODO: Refactor it to make it return exactly valid value or null, and update all usage.
|
||||
export function getProviderByModel(model?: Model): Provider {
|
||||
const providers = getStoreProviders()
|
||||
const provider = providers.find((p) => p.id === model?.provider)
|
||||
@ -145,6 +147,7 @@ export function getProviderByModel(model?: Model): Provider {
|
||||
return provider
|
||||
}
|
||||
|
||||
// FIXME: This function may return undefined but as Provider
|
||||
export function getProviderByModelId(modelId?: string) {
|
||||
const providers = getStoreProviders()
|
||||
const _modelId = modelId || getDefaultModel().id
|
||||
|
||||
Loading…
Reference in New Issue
Block a user