feat: remove unused helper functions for string and int64 value extraction
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package tools
|
package tools
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"cs-agent/internal/ai/runtime/registry"
|
"cs-agent/internal/ai/runtime/registry"
|
||||||
@@ -35,36 +34,6 @@ func ParseConfirmationDecision(value string) Decision {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStringValue(data map[string]any, key string) string {
|
|
||||||
value, ok := data[key]
|
|
||||||
if !ok || value == nil {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
switch v := value.(type) {
|
|
||||||
case string:
|
|
||||||
return v
|
|
||||||
default:
|
|
||||||
return fmt.Sprintf("%v", v)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getInt64Value(data map[string]any, key string) int64 {
|
|
||||||
value, ok := data[key]
|
|
||||||
if !ok || value == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
switch v := value.(type) {
|
|
||||||
case float64:
|
|
||||||
return int64(v)
|
|
||||||
case int64:
|
|
||||||
return v
|
|
||||||
case int:
|
|
||||||
return int64(v)
|
|
||||||
default:
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewRuntimeStaticTool(toolCode string) registry.Tool {
|
func NewRuntimeStaticTool(toolCode string) registry.Tool {
|
||||||
switch toolx.NormalizeToolCodeAlias(strings.TrimSpace(toolCode)) {
|
switch toolx.NormalizeToolCodeAlias(strings.TrimSpace(toolCode)) {
|
||||||
case toolx.GraphTriageServiceRequest.Code:
|
case toolx.GraphTriageServiceRequest.Code:
|
||||||
|
|||||||
Reference in New Issue
Block a user