enh: model capabilities

This commit is contained in:
Timothy Jaeryang Baek
2025-05-17 00:59:00 +04:00
parent 7df6d7f325
commit b14398481d
3 changed files with 62 additions and 15 deletions

View File

@@ -7,15 +7,39 @@
const i18n = getContext('i18n');
const capabilityLabels = {
vision: $i18n.t('Model accepts image inputs'),
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')
vision: {
label: $i18n.t('Vision'),
description: $i18n.t('Model accepts image inputs')
},
web_search: {
label: $i18n.t('Web Search'),
description: $i18n.t('Model can search the web for information')
},
image_generation: {
label: $i18n.t('Image Generation'),
description: $i18n.t('Model can generate images based on text prompts')
},
code_interpreter: {
label: $i18n.t('Code Interpreter'),
description: $i18n.t('Model can execute code and perform calculations')
},
usage: {
label: $i18n.t('Usage'),
description: $i18n.t(
'Sends `stream_options: { include_usage: true }` in the request.\nSupported providers will return token usage information in the response when set.'
)
},
citations: {
label: $i18n.t('Citations'),
description: $i18n.t('Displays citations in the response')
}
};
export let capabilities: {
vision?: boolean;
web_search?: boolean;
image_generation?: boolean;
code_interpreter?: boolean;
usage?: boolean;
citations?: boolean;
} = {};
@@ -36,8 +60,8 @@
/>
<div class=" py-0.5 text-sm capitalize">
<Tooltip content={marked.parse(capabilityLabels[capability])}>
{$i18n.t(capability)}
<Tooltip content={marked.parse(capabilityLabels[capability].description)}>
{$i18n.t(capabilityLabels[capability].label)}
</Tooltip>
</div>
</div>

View File

@@ -77,9 +77,11 @@
};
let capabilities = {
vision: true,
web_search: true,
image_generation: true,
code_interpreter: true,
citations: true,
usage: undefined,
reasoning: false
usage: undefined
};
let knowledge = [];