mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
Introduce comprehensive agent instruction documentation (`gpt_5_1_prompt.md`) for Codex CLI. Specify agent behavior, personality, planning requirements, task execution, sandboxing rules, and validation processes to standardize interactions and improve usability.
46 lines
1.4 KiB
Go
46 lines
1.4 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 := ""
|
|
last51Prompt := ""
|
|
// 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(), "gpt_5_1_prompt.md") {
|
|
last51Prompt = string(content)
|
|
} else if strings.HasPrefix(entry.Name(), "review_prompt.md") {
|
|
// lastReviewPrompt = string(content)
|
|
}
|
|
}
|
|
|
|
if strings.Contains(modelName, "codex") {
|
|
return false, lastCodexPrompt
|
|
} else if strings.Contains(modelName, "5.1") {
|
|
return false, last51Prompt
|
|
} else {
|
|
return false, lastPrompt
|
|
}
|
|
}
|