mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
feat(codex): add gpt-5.2 codex prompt handling
This change introduces specific logic to load and use instructions for the 'gpt-5.2-codex' model variant by recognizing the 'gpt-5.2-codex_prompt.md' filename. This ensures the correct prompts are used when the '5.2-codex' model is identified, complementing the recent addition of its definition.
This commit is contained in:
@@ -20,6 +20,7 @@ func CodexInstructionsForModel(modelName, systemInstructions string) (bool, stri
|
|||||||
lastCodexMaxPrompt := ""
|
lastCodexMaxPrompt := ""
|
||||||
last51Prompt := ""
|
last51Prompt := ""
|
||||||
last52Prompt := ""
|
last52Prompt := ""
|
||||||
|
last52CodexPrompt := ""
|
||||||
// lastReviewPrompt := ""
|
// lastReviewPrompt := ""
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
content, _ := codexInstructionsDir.ReadFile("codex_instructions/" + entry.Name())
|
content, _ := codexInstructionsDir.ReadFile("codex_instructions/" + entry.Name())
|
||||||
@@ -36,12 +37,16 @@ func CodexInstructionsForModel(modelName, systemInstructions string) (bool, stri
|
|||||||
last51Prompt = string(content)
|
last51Prompt = string(content)
|
||||||
} else if strings.HasPrefix(entry.Name(), "gpt_5_2_prompt.md") {
|
} else if strings.HasPrefix(entry.Name(), "gpt_5_2_prompt.md") {
|
||||||
last52Prompt = string(content)
|
last52Prompt = string(content)
|
||||||
|
} else if strings.HasPrefix(entry.Name(), "gpt-5.2-codex_prompt.md") {
|
||||||
|
last52CodexPrompt = string(content)
|
||||||
} else if strings.HasPrefix(entry.Name(), "review_prompt.md") {
|
} else if strings.HasPrefix(entry.Name(), "review_prompt.md") {
|
||||||
// lastReviewPrompt = string(content)
|
// lastReviewPrompt = string(content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if strings.Contains(modelName, "codex-max") {
|
if strings.Contains(modelName, "codex-max") {
|
||||||
return false, lastCodexMaxPrompt
|
return false, lastCodexMaxPrompt
|
||||||
|
} else if strings.Contains(modelName, "5.2-codex") {
|
||||||
|
return false, last52CodexPrompt
|
||||||
} else if strings.Contains(modelName, "codex") {
|
} else if strings.Contains(modelName, "codex") {
|
||||||
return false, lastCodexPrompt
|
return false, lastCodexPrompt
|
||||||
} else if strings.Contains(modelName, "5.1") {
|
} else if strings.Contains(modelName, "5.1") {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user