mirror of
https://github.com/open-webui/open-webui
synced 2025-04-02 12:09:06 +00:00
Merge 713573630c
into e0ec2cdeb0
This commit is contained in:
commit
38a03c3d98
@ -109,6 +109,24 @@
|
||||
(model) => $models.find((m) => m.id === model)?.info?.meta?.capabilities?.vision ?? true
|
||||
);
|
||||
|
||||
$: areSelectedModelsWebSearchCapable = selectedModelIds.every(
|
||||
(id) =>
|
||||
$models.find((m) => m.id === id)?.info?.meta?.capabilities?.websearch ?? false
|
||||
);
|
||||
$: console.log('areSelectedModelsWebSearchCapable: ', areSelectedModelsWebSearchCapable);
|
||||
|
||||
$: areSelectedModelsCodeExecutionCapable = selectedModelIds.every(
|
||||
(id) =>
|
||||
$models.find((m) => m.id === id)?.info?.meta?.capabilities?.codeexecution ?? false
|
||||
);
|
||||
$: console.log('areSelectedModelsCodeExecutionCapable: ', areSelectedModelsCodeExecutionCapable);
|
||||
|
||||
$: areSelectedModelsImageGenerationCapable = selectedModelIds.every(
|
||||
(id) =>
|
||||
$models.find((m) => m.id === id)?.info?.meta?.capabilities?.imagegeneration ?? false
|
||||
);
|
||||
$: console.log('areSelectedModelsImageGenerationCapable: ', areSelectedModelsImageGenerationCapable);
|
||||
|
||||
const scrollToBottom = () => {
|
||||
const element = document.getElementById('messages-container');
|
||||
element.scrollTo({
|
||||
@ -1128,7 +1146,7 @@
|
||||
|
||||
<div class="flex gap-0.5 items-center overflow-x-auto scrollbar-none flex-1">
|
||||
{#if $_user}
|
||||
{#if $config?.features?.enable_web_search && ($_user.role === 'admin' || $_user?.permissions?.features?.web_search)}
|
||||
{#if $config?.features?.enable_web_search && ($_user.role === 'admin' || $_user?.permissions?.features?.web_search) && areSelectedModelsWebSearchCapable}
|
||||
<Tooltip content={$i18n.t('Search the internet')} placement="top">
|
||||
<button
|
||||
on:click|preventDefault={() => (webSearchEnabled = !webSearchEnabled)}
|
||||
@ -1147,7 +1165,7 @@
|
||||
</Tooltip>
|
||||
{/if}
|
||||
|
||||
{#if $config?.features?.enable_image_generation && ($_user.role === 'admin' || $_user?.permissions?.features?.image_generation)}
|
||||
{#if $config?.features?.enable_image_generation && ($_user.role === 'admin' || $_user?.permissions?.features?.image_generation) && areSelectedModelsImageGenerationCapable}
|
||||
<Tooltip content={$i18n.t('Generate an image')} placement="top">
|
||||
<button
|
||||
on:click|preventDefault={() =>
|
||||
@ -1166,7 +1184,7 @@
|
||||
</Tooltip>
|
||||
{/if}
|
||||
|
||||
{#if $config?.features?.enable_code_interpreter && ($_user.role === 'admin' || $_user?.permissions?.features?.code_interpreter)}
|
||||
{#if $config?.features?.enable_code_interpreter && ($_user.role === 'admin' || $_user?.permissions?.features?.code_interpreter) && areSelectedModelsCodeExecutionCapable}
|
||||
<Tooltip content={$i18n.t('Execute code for analysis')} placement="top">
|
||||
<button
|
||||
on:click|preventDefault={() =>
|
||||
|
@ -11,13 +11,28 @@
|
||||
usage: $i18n.t(
|
||||
'Sends `stream_options: { include_usage: true }` in the request.\nSupported providers will return token usage information in the response when set.'
|
||||
),
|
||||
citations: $i18n.t('Displays citations in the response')
|
||||
citations: $i18n.t('Displays citations in the response'),
|
||||
websearch: $i18n.t('Enables web search capability for this model. (if active in Admin Settings)'),
|
||||
codeexecution: $i18n.t('Enables codeInterpreter capability for this model. (if active in Admin Settings)'),
|
||||
imagegeneration: $i18n.t('Enables image generation capability for this model. (if active in Admin Settings)'),
|
||||
};
|
||||
|
||||
const displayNames = {
|
||||
vision: $i18n.t('Vision'),
|
||||
usage: $i18n.t('Usage'),
|
||||
citations: $i18n.t('Citations'),
|
||||
websearch: $i18n.t('Web Search'),
|
||||
codeexecution: $i18n.t('Code Execution'),
|
||||
imagegeneration: $i18n.t('Image Generation')
|
||||
};
|
||||
|
||||
export let capabilities: {
|
||||
vision?: boolean;
|
||||
usage?: boolean;
|
||||
citations?: boolean;
|
||||
websearch?: boolean;
|
||||
codeexecution?: boolean;
|
||||
imagegeneration?: boolean;
|
||||
} = {};
|
||||
</script>
|
||||
|
||||
@ -37,7 +52,7 @@
|
||||
|
||||
<div class=" py-0.5 text-sm capitalize">
|
||||
<Tooltip content={marked.parse(helpText[capability])}>
|
||||
{$i18n.t(capability)}
|
||||
{displayNames[capability]}
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -77,7 +77,10 @@
|
||||
let capabilities = {
|
||||
vision: true,
|
||||
usage: undefined,
|
||||
citations: true
|
||||
citations: true,
|
||||
websearch: true,
|
||||
codeexecution: true,
|
||||
imagegeneration: true,
|
||||
};
|
||||
|
||||
let knowledge = [];
|
||||
|
Loading…
Reference in New Issue
Block a user