mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 12:20:52 +08:00
Fixed #91
refactor(translator): streamline Codex response handling and remove redundant code - Updated `ConvertCodexResponseToOpenAIResponses` logic for clarity and consistency. - Simplified `ConvertCodexResponseToOpenAIResponsesNonStream` by removing unnecessary buffer setup and scanner logic. - Switched to using `sjson.SetRaw` for improved processing of raw input strings.
This commit is contained in:
@@ -40,7 +40,7 @@ func ConvertOpenAIResponsesRequestToCodex(modelName string, inputRawJSON []byte,
|
||||
inputResults = inputResult.Array()
|
||||
} else if inputResult.Type == gjson.String {
|
||||
newInput := `[{"type":"message","role":"user","content":[{"type":"input_text","text":""}]}]`
|
||||
newInput, _ = sjson.Set(newInput, "0.content.0.text", inputResult.String())
|
||||
newInput, _ = sjson.SetRaw(newInput, "0.content.0.text", inputResult.Raw)
|
||||
inputResults = gjson.Parse(newInput).Array()
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user