Skip to content

Commit cc26c3f

Browse files
committed
fix: guard against nil tool_definition in buildTranscript
Assisted-By: docker-agent
1 parent d4e9537 commit cc26c3f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pkg/evaluation/eval.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,10 @@ func buildTranscript(events []map[string]any) string {
577577
case "tool_call_response":
578578
// The ToolCallResponseEvent has tool_definition at the top level, not
579579
// nested under "tool_call".
580-
td, _ := event["tool_definition"].(map[string]any)
581-
name, _ := td["name"].(string)
580+
var name string
581+
if td, ok := event["tool_definition"].(map[string]any); ok {
582+
name, _ = td["name"].(string)
583+
}
582584
response, _ := event["response"].(string)
583585
if len(response) > 500 {
584586
response = response[:500] + "...(truncated)"

0 commit comments

Comments
 (0)