From 57cce3aa64deda4fdf1e2a51feb9da7e1561f8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E7=BF=8C=E7=90=AA?= Date: Thu, 19 Dec 2024 17:37:35 +0800 Subject: [PATCH] Add o1 and o1-2024-12-17 model support --- config.py | 5 +++-- request_llms/bridge_all.py | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 6353cb8a..f4f61da8 100644 --- a/config.py +++ b/config.py @@ -8,7 +8,7 @@ """ # [step 1]>> API_KEY = "sk-123456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx123456789"。极少数情况下,还需要填写组织(格式如org-123456789abcdefghijklmno的),请向下翻,找 API_ORG 设置项 -API_KEY = "此处填API密钥" # 可同时填写多个API-KEY,用英文逗号分割,例如API_KEY = "sk-openaikey1,sk-openaikey2,fkxxxx-api2dkey3,azure-apikey4" +API_KEY = "在此处填写APIKEY" # 可同时填写多个API-KEY,用英文逗号分割,例如API_KEY = "sk-openaikey1,sk-openaikey2,fkxxxx-api2dkey3,azure-apikey4" # [step 2]>> 改为True应用代理,如果直接在海外服务器部署,此处不修改;如果使用本地或无地域限制的大模型时,此处也不需要修改 @@ -32,7 +32,8 @@ else: # [step 3]>> 模型选择是 (注意: LLM_MODEL是默认选中的模型, 它*必须*被包含在AVAIL_LLM_MODELS列表中 ) LLM_MODEL = "gpt-3.5-turbo-16k" # 可选 ↓↓↓ -AVAIL_LLM_MODELS = ["gpt-4-1106-preview", "gpt-4-turbo-preview", "gpt-4-vision-preview", +AVAIL_LLM_MODELS = ["o1-mini", "o1-mini-2024-09-12", "o1", "o1-2024-12-17", "o1-preview", "o1-preview-2024-09-12", + "gpt-4-1106-preview", "gpt-4-turbo-preview", "gpt-4-vision-preview", "gpt-4o", "gpt-4o-mini", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-16k", "gpt-3.5-turbo", "azure-gpt-3.5", "gpt-4", "gpt-4-32k", "azure-gpt-4", "glm-4", "glm-4v", "glm-3-turbo", diff --git a/request_llms/bridge_all.py b/request_llms/bridge_all.py index 1aef7089..20d7798b 100644 --- a/request_llms/bridge_all.py +++ b/request_llms/bridge_all.py @@ -274,6 +274,7 @@ model_info = { "openai_disable_system_prompt": True, "openai_disable_stream": True, }, + "o1-mini": { "fn_with_ui": chatgpt_ui, "fn_without_ui": chatgpt_noui, @@ -285,6 +286,28 @@ model_info = { "openai_disable_stream": True, }, + "o1-2024-12-17": { + "fn_with_ui": chatgpt_ui, + "fn_without_ui": chatgpt_noui, + "endpoint": openai_endpoint, + "max_token": 200000, + "tokenizer": tokenizer_gpt4, + "token_cnt": get_token_num_gpt4, + "openai_disable_system_prompt": True, + "openai_disable_stream": True, + }, + + "o1": { + "fn_with_ui": chatgpt_ui, + "fn_without_ui": chatgpt_noui, + "endpoint": openai_endpoint, + "max_token": 200000, + "tokenizer": tokenizer_gpt4, + "token_cnt": get_token_num_gpt4, + "openai_disable_system_prompt": True, + "openai_disable_stream": True, + }, + "gpt-4-turbo": { "fn_with_ui": chatgpt_ui, "fn_without_ui": chatgpt_noui,