fix: filter GPT-5.2 Pro from chat (Responses API only, not chat)

GPT-5.2 Pro and its dated variant only support the Responses API,
not Chat Completions. OCI GenAI uses chat/completions internally,
causing a 400 error. Also trim debug log to a shorter format.
This commit is contained in:
nogueiraguh
2026-03-04 07:54:56 -03:00
parent 84f35a50fe
commit 904d5c4cd7
2 changed files with 4 additions and 1 deletions

View File

@@ -919,6 +919,7 @@ def _call_genai(gc: dict, message: str, history: list = None) -> str:
region = gc.get("genai_region", "")
ocids = model_info.get("ocids", {})
model_ref = ocids.get(region) or gc["model_id"]
log.info(f"GenAI call: model_id={gc.get('model_id')}, model_ref={model_ref[:60]}...")
if gc.get("serving_type") == "DEDICATED" and gc.get("dedicated_endpoint_id"):
chat_detail.serving_mode = oci.generative_ai_inference.models.DedicatedServingMode(
endpoint_id=gc["dedicated_endpoint_id"]

View File

@@ -278,9 +278,11 @@ function rChat(){
const ms=S.msgs.length===0?'<div class="emp"><div class="eic">🤖</div><p>Inicie uma conversa com o agente.</p><p style="font-size:.74rem;margin-top:.35rem">Selecione um modelo ou use o agente local.</p></div>'
:S.msgs.map(m=>`<div class="cm cm-${m.r}"><div class="cb">${fm(m.c)}</div></div>`).join('');
// Build custom dropdown items
// Skip non-chat models: Codex (completions only), Image, Audio, Guard, ProtectAI, GPT-oss, Pro (Responses API only)
const skip=new Set(['openai.gpt-image-1','openai.gpt-image-1.5','openai.gpt-audio','meta.llama-guard-4-12b','protectai.deberta-v3-base-prompt-injection-v2',
'openai.gpt-5.3-codex','openai.gpt-5.2-codex','openai.gpt-5.1-codex','openai.gpt-5.1-codex-max','openai.gpt-5.1-codex-mini','openai.gpt-5-codex',
'openai.gpt-oss-120b','openai.gpt-oss-20b']);
'openai.gpt-oss-120b','openai.gpt-oss-20b',
'openai.gpt-5.2-pro','openai.gpt-5.2-pro-2025-12-11']);
const provs={};for(const[mid,info]of Object.entries(S.models)){if(skip.has(mid))continue;const p=info.provider||'other';if(!provs[p])provs[p]=[];provs[p].push({id:mid,name:info.name})}
const provOrder=['openai','google','meta','cohere','xai'];
let ddItems=`<div class="itm${!S.chatModel?' sel':''}" onclick="pickModel('')">Agente Local (sem IA)</div>`;