diff --git a/frontend/index.html b/frontend/index.html index 3f3d338..489cefa 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -375,12 +375,12 @@ async function dOci(id){if(!confirm('Excluir credencial?'))return;await $api('/o /* ── GenAI Config ── */ function rGenAI(){const eg=S.editing?.type==='genai'?S.genaiCfg.find(g=>g.id===S.editing.id):null; - const mOpts=Object.entries(S.models).map(([k,v])=>``).join(''); + const mOpts=''+Object.entries(S.models).map(([k,v])=>``).join(''); const rOpts=S.regions.map(r=>``).join(''); return`
🧠 Modelos Configurados
${S.genaiCfg.map(g=>{const mi=S.models[g.model_id]||{};return` - +`}).join('')}
ConfigModeloRegiãoTempTokensAções
${g.name||'—'}${g.is_default?' ⭐':''}${mi.name||g.model_id}
${mi.provider||'?'}
${mi.name||(g.model_ocid?'OCID Personalizado':g.model_id)}
${mi.provider||(g.model_ocid?'custom':'?')}
${g.genai_region} ${g.temperature}${g.max_tokens}
@@ -393,7 +393,7 @@ ${S.ociCfg.map(c=>`
-
Somente se diferente do catálogo
+
Cole o OCID do modelo do portal OCI. Se preenchido, será usado no lugar do modelo selecionado acima.
Parâmetros
@@ -404,10 +404,13 @@ ${S.ociCfg.map(c=>`
`+rConfigLogs('genai')} async function sGenai(){const btn=document.getElementById('gbtn');btn.disabled=true;btn.textContent='Salvando...';sm('gm',' Salvando modelo...','i'); - const isEdit=S.editing?.type==='genai';const body={ + const isEdit=S.editing?.type==='genai'; + const selModel=document.getElementById('gmod').value;const ocid=document.getElementById('gocid').value||null; + if(selModel==='_custom'&&!ocid){sm('gm','Informe o Model OCID para usar modelo personalizado.','e');btn.disabled=false;btn.textContent=isEdit?'Salvar Alterações':'Salvar Modelo';return} + const body={ name:document.getElementById('gname').value||'default', - oci_config_id:document.getElementById('goci').value,model_id:document.getElementById('gmod').value, - model_ocid:document.getElementById('gocid').value||null, + oci_config_id:document.getElementById('goci').value,model_id:selModel==='_custom'?'custom':selModel, + model_ocid:ocid, compartment_id:document.getElementById('gcmp').value,genai_region:document.getElementById('greg').value, endpoint:null,serving_type:'ON_DEMAND',dedicated_endpoint_id:null, temperature:parseFloat(document.getElementById('gtemp').value),max_tokens:parseInt(document.getElementById('gmt').value),