File size: 412 Bytes
8d3471e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package claude

import (
	"fmt"
	"strings"
)

type claudeToolCallState struct {
	nameByID       map[string]string
	lastIDByName   map[string]string
	callIDSequence int
}

func (s *claudeToolCallState) nextID() string {
	s.callIDSequence++
	return fmt.Sprintf("call_claude_%d", s.callIDSequence)
}

func safeStringValue(v any) string {
	s, ok := v.(string)
	if !ok {
		return ""
	}
	return strings.TrimSpace(s)
}