mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-09 10:39:11 +02:00
feat(models): define capability schema and readers (#2739)
* feat(models): define capability schema and readers * fix(models): harden Google catalog probing Restrict native catalog probing to the Gemini host, keep provider keys out of request URLs, filter non-chat model resources, and preserve the manual refresh default in the built-in Google add flow.
This commit is contained in:
parent
b4e5ad088a
commit
b9cafd67a1
17 changed files with 3861 additions and 4 deletions
|
|
@ -934,6 +934,13 @@ function initEndpointForm() {
|
|||
function _apiEndpointKind() {
|
||||
return (kindSel && kindSel.value) ? kindSel.value : 'api';
|
||||
}
|
||||
function _modelRefreshModeForApiEndpoint(url, endpointKind) {
|
||||
if (endpointKind === 'proxy') return 'manual';
|
||||
try {
|
||||
if ((new URL(url)).hostname.toLowerCase() === 'generativelanguage.googleapis.com') return '';
|
||||
} catch (_) {}
|
||||
return 'auto';
|
||||
}
|
||||
function _normalizeBaseUrl(raw) {
|
||||
let u = raw.trim();
|
||||
// Fix common protocol typos
|
||||
|
|
@ -1081,7 +1088,8 @@ function initEndpointForm() {
|
|||
fd.append('base_url', url);
|
||||
const endpointKind = _apiEndpointKind();
|
||||
fd.append('endpoint_kind', endpointKind);
|
||||
fd.append('model_refresh_mode', endpointKind === 'proxy' ? 'manual' : 'auto');
|
||||
const refreshMode = _modelRefreshModeForApiEndpoint(url, endpointKind);
|
||||
if (refreshMode) fd.append('model_refresh_mode', refreshMode);
|
||||
fd.append('model_refresh_timeout', '30');
|
||||
if (apiKey) fd.append('api_key', apiKey);
|
||||
if (provider.value && provider.selectedOptions && provider.selectedOptions[0]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue