mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
refactor(translator): remove unused log dependency and comment out debug logging
docs: add GPT-5 Codex guidelines for CLI usage - Added detailed guidelines for GPT-5 Codex in Codex CLI. - Expanded instructions on sandboxing, approvals, editing constraints, and style requirements. - Included presentation and response formatting best practices. fix(codex_instructions): update comparison logic to use prefix matching - Changed system instructions comparison to use `strings.HasPrefix` for improved flexibility.
This commit is contained in:
@@ -20,7 +20,7 @@ func CodexInstructionsForModel(modelName, systemInstructions string) (bool, stri
|
|||||||
// lastReviewPrompt := ""
|
// lastReviewPrompt := ""
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
content, _ := codexInstructionsDir.ReadFile("codex_instructions/" + entry.Name())
|
content, _ := codexInstructionsDir.ReadFile("codex_instructions/" + entry.Name())
|
||||||
if systemInstructions == string(content) {
|
if strings.HasPrefix(systemInstructions, string(content)) {
|
||||||
return true, ""
|
return true, ""
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(entry.Name(), "gpt_5_codex_prompt.md") {
|
if strings.HasPrefix(entry.Name(), "gpt_5_codex_prompt.md") {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/router-for-me/CLIProxyAPI/v6/internal/misc"
|
"github.com/router-for-me/CLIProxyAPI/v6/internal/misc"
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"github.com/tidwall/gjson"
|
"github.com/tidwall/gjson"
|
||||||
"github.com/tidwall/sjson"
|
"github.com/tidwall/sjson"
|
||||||
)
|
)
|
||||||
@@ -74,7 +73,7 @@ func ConvertOpenAIResponsesRequestToCodex(modelName string, inputRawJSON []byte,
|
|||||||
if hasOfficialInstructions {
|
if hasOfficialInstructions {
|
||||||
return rawJSON
|
return rawJSON
|
||||||
}
|
}
|
||||||
log.Debugf("instructions not matched, %s\n", originalInstructions)
|
// log.Debugf("instructions not matched, %s\n", originalInstructions)
|
||||||
|
|
||||||
if len(inputResults) > 0 {
|
if len(inputResults) > 0 {
|
||||||
newInput := "[]"
|
newInput := "[]"
|
||||||
|
|||||||
Reference in New Issue
Block a user