mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 04:10:51 +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 {
|
||||
models := []string{
|
||||
"gpt-5",
|
||||
"gpt-5-mini",
|
||||
"gpt-5-nano",
|
||||
"gpt-5-minimal",
|
||||
"gpt-5-low",
|
||||
"gpt-5-medium",
|
||||
"gpt-5-high",
|
||||
"codex-mini-latest",
|
||||
}
|
||||
@@ -344,14 +345,14 @@ func (c *CodexClient) APIRequest(ctx context.Context, modelName, endpoint string
|
||||
// Stream must be set to 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")
|
||||
switch modelName {
|
||||
case "gpt-5-nano":
|
||||
case "gpt-5-minimal":
|
||||
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "minimal")
|
||||
case "gpt-5-mini":
|
||||
case "gpt-5-low":
|
||||
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "low")
|
||||
case "gpt-5":
|
||||
case "gpt-5-medium":
|
||||
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "medium")
|
||||
case "gpt-5-high":
|
||||
jsonBody, _ = sjson.SetBytes(jsonBody, "reasoning.effort", "high")
|
||||
|
||||
Reference in New Issue
Block a user