mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
Add support for new GPT-5 model variants
- Renamed existing GPT-5 variants for consistency (`nano` → `minimal`, `mini` → `low`, etc.). - Added metadata definitions for new variants: `gpt-5-minimal`, `gpt-5-low`, `gpt-5-medium`, and updated logic to reflect variant-specific reasoning efforts.
This commit is contained in:
@@ -93,8 +93,9 @@ func (c *CodexClient) Provider() string {
|
|||||||
func (c *CodexClient) CanProvideModel(modelName string) bool {
|
func (c *CodexClient) CanProvideModel(modelName string) bool {
|
||||||
models := []string{
|
models := []string{
|
||||||
"gpt-5",
|
"gpt-5",
|
||||||
"gpt-5-mini",
|
"gpt-5-minimal",
|
||||||
"gpt-5-nano",
|
"gpt-5-low",
|
||||||
|
"gpt-5-medium",
|
||||||
"gpt-5-high",
|
"gpt-5-high",
|
||||||
"codex-mini-latest",
|
"codex-mini-latest",
|
||||||
}
|
}
|
||||||
@@ -344,14 +345,14 @@ func (c *CodexClient) APIRequest(ctx context.Context, modelName, endpoint string
|
|||||||
// Stream must be set to true
|
// Stream must be set to true
|
||||||
jsonBody, _ = sjson.SetBytes(jsonBody, "stream", true)
|
jsonBody, _ = sjson.SetBytes(jsonBody, "stream", true)
|
||||||
|
|
||||||
if util.InArray([]string{"gpt-5-nano", "gpt-5-mini", "gpt-5", "gpt-5-high"}, modelName) {
|
if util.InArray([]string{"gpt-5-minimal", "gpt-5-low", "gpt-5-medium", "gpt-5-high"}, modelName) {
|
||||||
jsonBody, _ = sjson.SetBytes(jsonBody, "model", "gpt-5")
|
jsonBody, _ = sjson.SetBytes(jsonBody, "model", "gpt-5")
|
||||||
switch modelName {
|
switch modelName {
|
||||||
case "gpt-5-nano":
|
case "gpt-5-minimal":
|
||||||
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "minimal")
|
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "minimal")
|
||||||
case "gpt-5-mini":
|
case "gpt-5-low":
|
||||||
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "low")
|
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "low")
|
||||||
case "gpt-5":
|
case "gpt-5-medium":
|
||||||
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "medium")
|
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "medium")
|
||||||
case "gpt-5-high":
|
case "gpt-5-high":
|
||||||
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "high")
|
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "high")
|
||||||
|
|||||||
@@ -149,6 +149,58 @@ func GetOpenAIModels() []*ModelInfo {
|
|||||||
MaxCompletionTokens: 128000,
|
MaxCompletionTokens: 128000,
|
||||||
SupportedParameters: []string{"tools"},
|
SupportedParameters: []string{"tools"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ID: "gpt-5-minimal",
|
||||||
|
Object: "model",
|
||||||
|
Created: time.Now().Unix(),
|
||||||
|
OwnedBy: "openai",
|
||||||
|
Type: "openai",
|
||||||
|
Version: "gpt-5-2025-08-07",
|
||||||
|
DisplayName: "GPT 5 Minimal",
|
||||||
|
Description: "Stable version of GPT 5, The best model for coding and agentic tasks across domains.",
|
||||||
|
ContextLength: 400000,
|
||||||
|
MaxCompletionTokens: 128000,
|
||||||
|
SupportedParameters: []string{"tools"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ID: "gpt-5-low",
|
||||||
|
Object: "model",
|
||||||
|
Created: time.Now().Unix(),
|
||||||
|
OwnedBy: "openai",
|
||||||
|
Type: "openai",
|
||||||
|
Version: "gpt-5-2025-08-07",
|
||||||
|
DisplayName: "GPT 5 Low",
|
||||||
|
Description: "Stable version of GPT 5, The best model for coding and agentic tasks across domains.",
|
||||||
|
ContextLength: 400000,
|
||||||
|
MaxCompletionTokens: 128000,
|
||||||
|
SupportedParameters: []string{"tools"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ID: "gpt-5-medium",
|
||||||
|
Object: "model",
|
||||||
|
Created: time.Now().Unix(),
|
||||||
|
OwnedBy: "openai",
|
||||||
|
Type: "openai",
|
||||||
|
Version: "gpt-5-2025-08-07",
|
||||||
|
DisplayName: "GPT 5 Medium",
|
||||||
|
Description: "Stable version of GPT 5, The best model for coding and agentic tasks across domains.",
|
||||||
|
ContextLength: 400000,
|
||||||
|
MaxCompletionTokens: 128000,
|
||||||
|
SupportedParameters: []string{"tools"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ID: "gpt-5-high",
|
||||||
|
Object: "model",
|
||||||
|
Created: time.Now().Unix(),
|
||||||
|
OwnedBy: "openai",
|
||||||
|
Type: "openai",
|
||||||
|
Version: "gpt-5-2025-08-07",
|
||||||
|
DisplayName: "GPT 5 High",
|
||||||
|
Description: "Stable version of GPT 5, The best model for coding and agentic tasks across domains.",
|
||||||
|
ContextLength: 400000,
|
||||||
|
MaxCompletionTokens: 128000,
|
||||||
|
SupportedParameters: []string{"tools"},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ID: "codex-mini-latest",
|
ID: "codex-mini-latest",
|
||||||
Object: "model",
|
Object: "model",
|
||||||
|
|||||||
Reference in New Issue
Block a user