Merge pull request #3121 from chengzhichao-xydt/codex/openai-stream-logger
refactor(openai_compat): replace log.Printf with structured logger
This commit is contained in:
commit
73738f1cd3
1 changed files with 4 additions and 2 deletions
|
|
@ -7,7 +7,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"maps"
|
"maps"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
@ -769,7 +768,10 @@ func parseStreamResponse(
|
||||||
raw := acc.argsJSON.String()
|
raw := acc.argsJSON.String()
|
||||||
if raw != "" {
|
if raw != "" {
|
||||||
if err := json.Unmarshal([]byte(raw), &args); err != nil {
|
if err := json.Unmarshal([]byte(raw), &args); err != nil {
|
||||||
log.Printf("openai_compat stream: failed to decode tool call arguments for %q: %v", acc.name, err)
|
logger.WarnCF("openai_compat", "stream: failed to decode tool call arguments", map[string]any{
|
||||||
|
"tool": acc.name,
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
args["raw"] = raw
|
args["raw"] = raw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue