feat: add gpt-5.2 support (#6698)
This commit is contained in:
@@ -246,6 +246,11 @@ LLM_MAX_TOKENS = {
|
||||
"gpt-5.1-codex": 272000,
|
||||
"gpt-5.1-codex-mini": 272000,
|
||||
"gpt-5.1-codex-max": 272000,
|
||||
# gpt-5.2
|
||||
"gpt-5.2": 272000,
|
||||
"gpt-5.2-2025-12-11": 272000,
|
||||
"gpt-5.2-pro": 272000,
|
||||
"gpt-5.2-pro-2025-12-11": 272000,
|
||||
# reasoners
|
||||
"o1": 200000,
|
||||
# "o1-pro": 200000, # responses API only
|
||||
|
||||
@@ -83,9 +83,9 @@ def does_not_support_minimal_reasoning(model: str) -> bool:
|
||||
def supports_none_reasoning_effort(model: str) -> bool:
|
||||
"""Check if the model supports 'none' reasoning effort.
|
||||
|
||||
Currently, only GPT-5.1 models support the 'none' reasoning effort level.
|
||||
Currently, GPT-5.1 and GPT-5.2 models support the 'none' reasoning effort level.
|
||||
"""
|
||||
return model.startswith("gpt-5.1")
|
||||
return model.startswith("gpt-5.1") or model.startswith("gpt-5.2")
|
||||
|
||||
|
||||
def is_openai_5_model(model: str) -> bool:
|
||||
|
||||
@@ -269,6 +269,17 @@ class LLMConfig(BaseModel):
|
||||
verbosity="medium",
|
||||
max_tokens=16384,
|
||||
)
|
||||
elif model_name == "gpt-5.2":
|
||||
return cls(
|
||||
model="gpt-5.2",
|
||||
model_endpoint_type="openai",
|
||||
model_endpoint="https://api.openai.com/v1",
|
||||
model_wrapper=None,
|
||||
context_window=272000,
|
||||
reasoning_effort="none", # Default to "none" for GPT-5.2
|
||||
verbosity="medium",
|
||||
max_tokens=16384,
|
||||
)
|
||||
elif model_name == "letta":
|
||||
return cls(
|
||||
model="memgpt-openai",
|
||||
|
||||
8
tests/configs/llm_model_configs/openai-gpt-5.2.json
Normal file
8
tests/configs/llm_model_configs/openai-gpt-5.2.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"context_window": 32000,
|
||||
"model": "gpt-5.2",
|
||||
"model_endpoint_type": "openai",
|
||||
"model_endpoint": "https://api.openai.com/v1",
|
||||
"model_wrapper": null,
|
||||
"reasoning_effort": "low"
|
||||
}
|
||||
Reference in New Issue
Block a user