mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 13:00:52 +08:00
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.
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
// Package misc provides miscellaneous utility functions and embedded data for the CLI Proxy API.
|
|
// This package contains general-purpose helpers and embedded resources that do not fit into
|
|
// more specific domain packages. It includes embedded instructional text for Codex-related operations.
|
|
package misc
|
|
|
|
import (
|
|
"embed"
|
|
_ "embed"
|
|
"strings"
|
|
)
|
|
|
|
//go:embed codex_instructions
|
|
var codexInstructionsDir embed.FS
|
|
|
|
func CodexInstructionsForModel(modelName, systemInstructions string) (bool, string) {
|
|
entries, _ := codexInstructionsDir.ReadDir("codex_instructions")
|
|
|
|
lastPrompt := ""
|
|
lastCodexPrompt := ""
|
|
// lastReviewPrompt := ""
|
|
for _, entry := range entries {
|
|
content, _ := codexInstructionsDir.ReadFile("codex_instructions/" + entry.Name())
|
|
if strings.HasPrefix(systemInstructions, string(content)) {
|
|
return true, ""
|
|
}
|
|
if strings.HasPrefix(entry.Name(), "gpt_5_codex_prompt.md") {
|
|
lastCodexPrompt = string(content)
|
|
} else if strings.HasPrefix(entry.Name(), "prompt.md") {
|
|
lastPrompt = string(content)
|
|
} else if strings.HasPrefix(entry.Name(), "review_prompt.md") {
|
|
// lastReviewPrompt = string(content)
|
|
}
|
|
}
|
|
|
|
if strings.Contains(modelName, "codex") {
|
|
return false, lastCodexPrompt
|
|
} else {
|
|
return false, lastPrompt
|
|
}
|
|
}
|