perf: eliminate string(paramsJSON) conversion in codex CLI provider
Use sb.Write(paramsJSON) to write []byte directly to Builder instead of converting to string first, matching the claude CLI provider optimization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
005254c39d
commit
4507ace9e3
1 changed files with 3 additions and 1 deletions
|
|
@ -152,7 +152,9 @@ func (p *CodexCliProvider) buildToolsPrompt(tools []ToolDefinition) string {
|
|||
}
|
||||
if len(tool.Function.Parameters) > 0 {
|
||||
paramsJSON, _ := json.Marshal(tool.Function.Parameters)
|
||||
sb.WriteString(fmt.Sprintf("Parameters:\n```json\n%s\n```\n", string(paramsJSON)))
|
||||
sb.WriteString("Parameters:\n```json\n")
|
||||
sb.Write(paramsJSON)
|
||||
sb.WriteString("\n```\n")
|
||||
}
|
||||
sb.WriteString("\n")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue