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"]