add support for gpt 5.1 (#4197)
This commit is contained in:
@@ -281,6 +281,13 @@ class Settings(BaseSettings):
|
|||||||
AZURE_GPT5_NANO_API_BASE: str | None = None
|
AZURE_GPT5_NANO_API_BASE: str | None = None
|
||||||
AZURE_GPT5_NANO_API_VERSION: str = "2025-04-01-preview"
|
AZURE_GPT5_NANO_API_VERSION: str = "2025-04-01-preview"
|
||||||
|
|
||||||
|
# AZURE gpt-5.1
|
||||||
|
ENABLE_AZURE_GPT5_1: bool = False
|
||||||
|
AZURE_GPT5_1_DEPLOYMENT: str = "gpt-5.1"
|
||||||
|
AZURE_GPT5_1_API_KEY: str | None = None
|
||||||
|
AZURE_GPT5_1_API_BASE: str | None = None
|
||||||
|
AZURE_GPT5_1_API_VERSION: str = "2025-04-01-preview"
|
||||||
|
|
||||||
# GEMINI
|
# GEMINI
|
||||||
GEMINI_API_KEY: str | None = None
|
GEMINI_API_KEY: str | None = None
|
||||||
GEMINI_INCLUDE_THOUGHT: bool = False
|
GEMINI_INCLUDE_THOUGHT: bool = False
|
||||||
|
|||||||
@@ -108,6 +108,18 @@ if settings.ENABLE_OPENAI:
|
|||||||
reasoning_effort=settings.GPT5_REASONING_EFFORT,
|
reasoning_effort=settings.GPT5_REASONING_EFFORT,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
LLMConfigRegistry.register_config(
|
||||||
|
"OPENAI_GPT5_1",
|
||||||
|
LLMConfig(
|
||||||
|
"gpt-5.1",
|
||||||
|
["OPENAI_API_KEY"],
|
||||||
|
supports_vision=True,
|
||||||
|
add_assistant_prefix=False,
|
||||||
|
max_completion_tokens=128000,
|
||||||
|
temperature=1, # GPT-5 only supports temperature=1
|
||||||
|
reasoning_effort=settings.GPT5_REASONING_EFFORT,
|
||||||
|
),
|
||||||
|
)
|
||||||
LLMConfigRegistry.register_config(
|
LLMConfigRegistry.register_config(
|
||||||
"OPENAI_GPT4_TURBO",
|
"OPENAI_GPT4_TURBO",
|
||||||
LLMConfig(
|
LLMConfig(
|
||||||
@@ -661,6 +673,31 @@ if settings.ENABLE_AZURE_GPT5_NANO:
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if settings.ENABLE_AZURE_GPT5_1:
|
||||||
|
LLMConfigRegistry.register_config(
|
||||||
|
"AZURE_OPENAI_GPT5_1",
|
||||||
|
LLMConfig(
|
||||||
|
f"azure/{settings.AZURE_GPT5_1_DEPLOYMENT}",
|
||||||
|
[
|
||||||
|
"AZURE_GPT5_1_DEPLOYMENT",
|
||||||
|
"AZURE_GPT5_1_API_KEY",
|
||||||
|
"AZURE_GPT5_1_API_BASE",
|
||||||
|
"AZURE_GPT5_1_API_VERSION",
|
||||||
|
],
|
||||||
|
litellm_params=LiteLLMParams(
|
||||||
|
api_base=settings.AZURE_GPT5_1_API_BASE,
|
||||||
|
api_key=settings.AZURE_GPT5_1_API_KEY,
|
||||||
|
api_version=settings.AZURE_GPT5_1_API_VERSION,
|
||||||
|
model_info={"model_name": "azure/gpt-5.1"},
|
||||||
|
),
|
||||||
|
supports_vision=True,
|
||||||
|
add_assistant_prefix=False,
|
||||||
|
max_completion_tokens=128000,
|
||||||
|
temperature=1, # GPT-5 only supports temperature=1
|
||||||
|
reasoning_effort=settings.GPT5_REASONING_EFFORT,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
if settings.ENABLE_AZURE_O4_MINI:
|
if settings.ENABLE_AZURE_O4_MINI:
|
||||||
LLMConfigRegistry.register_config(
|
LLMConfigRegistry.register_config(
|
||||||
"AZURE_OPENAI_O4_MINI",
|
"AZURE_OPENAI_O4_MINI",
|
||||||
|
|||||||
Reference in New Issue
Block a user