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:
Luis Pater
2025-09-19 08:47:54 +08:00
parent df66046b14
commit 869a3dfbb4
8 changed files with 21 additions and 10 deletions

View File

@@ -97,7 +97,7 @@ func ConvertOpenAIRequestToCodex(modelName string, inputRawJSON []byte, stream b
// Extract system instructions from first system message (string or text object)
messages := gjson.GetBytes(rawJSON, "messages")
instructions := misc.CodexInstructions
instructions := misc.CodexInstructions(modelName)
out, _ = sjson.SetRaw(out, "instructions", instructions)
// if messages.IsArray() {
// arr := messages.Array()