mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 20:30:51 +08:00
feat: implement model-specific Codex instructions for GPT-5
- Added `CodexInstructions(modelName string)` function to dynamically select instructions based on the model (e.g., GPT-5 Codex). - Introduced `gpt_5_instructions.txt` and `gpt_5_codex_instructions.txt` for respective model configurations. - Updated translators to pass `modelName` and use the new instruction logic.
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/tidwall/sjson"
|
||||
)
|
||||
|
||||
func ConvertOpenAIResponsesRequestToCodex(_ string, inputRawJSON []byte, _ bool) []byte {
|
||||
func ConvertOpenAIResponsesRequestToCodex(modelName string, inputRawJSON []byte, _ bool) []byte {
|
||||
rawJSON := bytes.Clone(inputRawJSON)
|
||||
|
||||
rawJSON, _ = sjson.SetBytes(rawJSON, "stream", true)
|
||||
@@ -16,7 +16,7 @@ func ConvertOpenAIResponsesRequestToCodex(_ string, inputRawJSON []byte, _ bool)
|
||||
rawJSON, _ = sjson.SetBytes(rawJSON, "parallel_tool_calls", true)
|
||||
rawJSON, _ = sjson.SetBytes(rawJSON, "include", []string{"reasoning.encrypted_content"})
|
||||
|
||||
instructions := misc.CodexInstructions
|
||||
instructions := misc.CodexInstructions(modelName)
|
||||
|
||||
originalInstructions := ""
|
||||
originalInstructionsResult := gjson.GetBytes(rawJSON, "instructions")
|
||||
|
||||
Reference in New Issue
Block a user