mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-05 17:05:32 +08:00
26 lines
412 B
Go
26 lines
412 B
Go
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)
|
|
}
|