镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 06:26:47 +00:00
add o3 and o4 models
这个提交包含在:
@@ -79,6 +79,14 @@ def what_keys(keys):
|
||||
|
||||
return f"检测到: OpenAI Key {avail_key_list['OpenAI Key']} 个, Azure Key {avail_key_list['Azure Key']} 个, API2D Key {avail_key_list['API2D Key']} 个"
|
||||
|
||||
def is_o_family_for_openai(llm_model):
|
||||
if not llm_model.startswith('o'):
|
||||
return False
|
||||
if llm_model in ['o1', 'o2', 'o3', 'o4', 'o5', 'o6', 'o7', 'o8']:
|
||||
return True
|
||||
if llm_model[:3] in ['o1-', 'o2-', 'o3-', 'o4-', 'o5-', 'o6-', 'o7-', 'o8-']:
|
||||
return True
|
||||
return False
|
||||
|
||||
def select_api_key(keys, llm_model):
|
||||
import random
|
||||
@@ -86,7 +94,7 @@ def select_api_key(keys, llm_model):
|
||||
key_list = keys.split(',')
|
||||
|
||||
if llm_model.startswith('gpt-') or llm_model.startswith('chatgpt-') or \
|
||||
llm_model.startswith('one-api-') or llm_model == 'o1' or llm_model.startswith('o1-'):
|
||||
llm_model.startswith('one-api-') or is_o_family_for_openai(llm_model):
|
||||
for k in key_list:
|
||||
if is_openai_api_key(k): avail_key_list.append(k)
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户