From 17df7ceebc6b92e93bcd73817a854697e9715352 Mon Sep 17 00:00:00 2001 From: Billy Bao Date: Fri, 12 Dec 2025 16:40:53 +0800 Subject: [PATCH] add gpt 5.2 / pro --- conf/llm_factories.json | 14 ++++++++++++++ rag/llm/__init__.py | 4 ++++ rag/llm/chat_model.py | 13 +++++++------ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/conf/llm_factories.json b/conf/llm_factories.json index d363e7f06..4474cc71e 100644 --- a/conf/llm_factories.json +++ b/conf/llm_factories.json @@ -7,6 +7,20 @@ "status": "1", "rank": "999", "llm": [ + { + "llm_name": "gpt-5.2-pro", + "tags": "LLM,CHAT,400k,IMAGE2TEXT", + "max_tokens": 400000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "gpt-5.2", + "tags": "LLM,CHAT,400k,IMAGE2TEXT", + "max_tokens": 400000, + "model_type": "chat", + "is_tools": true + }, { "llm_name": "gpt-5.1", "tags": "LLM,CHAT,400k,IMAGE2TEXT", diff --git a/rag/llm/__init__.py b/rag/llm/__init__.py index 4a697be19..1e80846a8 100644 --- a/rag/llm/__init__.py +++ b/rag/llm/__init__.py @@ -54,6 +54,7 @@ class SupportedLiteLLMProvider(StrEnum): MiniMax = "MiniMax" DeerAPI = "DeerAPI" GPUStack = "GPUStack" + OpenAI = "OpenAI" FACTORY_DEFAULT_BASE_URL = { @@ -78,6 +79,7 @@ FACTORY_DEFAULT_BASE_URL = { SupportedLiteLLMProvider.ZHIPU_AI: "https://open.bigmodel.cn/api/paas/v4", SupportedLiteLLMProvider.MiniMax: "https://api.minimaxi.com/v1", SupportedLiteLLMProvider.DeerAPI: "https://api.deerapi.com/v1", + SupportedLiteLLMProvider.OpenAI: "https://api.openai.com/v1", } @@ -113,6 +115,8 @@ LITELLM_PROVIDER_PREFIX = { SupportedLiteLLMProvider.MiniMax: "openai/", SupportedLiteLLMProvider.DeerAPI: "openai/", SupportedLiteLLMProvider.GPUStack: "openai/", + SupportedLiteLLMProvider.OpenAI: "openai/", + } ChatModel = globals().get("ChatModel", {}) diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 648bbe8ce..a900ccb8d 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -487,13 +487,13 @@ class Base(ABC): assert False, "Shouldn't be here." -class GptTurbo(Base): - _FACTORY_NAME = "OpenAI" +# class GptTurbo(Base): +# _FACTORY_NAME = "OpenAI" - def __init__(self, key, model_name="gpt-3.5-turbo", base_url="https://api.openai.com/v1", **kwargs): - if not base_url: - base_url = "https://api.openai.com/v1" - super().__init__(key, model_name, base_url, **kwargs) +# def __init__(self, key, model_name="gpt-3.5-turbo", base_url="https://api.openai.com/v1", **kwargs): +# if not base_url: +# base_url = "https://api.openai.com/v1" +# super().__init__(key, model_name, base_url, **kwargs) class XinferenceChat(Base): @@ -1227,6 +1227,7 @@ class LiteLLMBase(ABC): "MiniMax", "DeerAPI", "GPUStack", + "OpenAI", ] def __init__(self, key, model_name, base_url=None, **kwargs):