MCPcopy Create free account
hub / github.com/53AI/53AIHub / parseIntValue

Function parseIntValue

api/service/tools/executor.go:1448–1467  ·  view source on GitHub ↗
(value interface{}, defaultValue int)

Source from the content-addressed store, hash-verified

1446}
1447
1448func parseIntValue(value interface{}, defaultValue int) int {
1449 switch v := value.(type) {
1450 case int:
1451 return v
1452 case int32:
1453 return int(v)
1454 case int64:
1455 return int(v)
1456 case float32:
1457 return int(v)
1458 case float64:
1459 return int(v)
1460 case string:
1461 parsed, err := strconv.Atoi(strings.TrimSpace(v))
1462 if err == nil {
1463 return parsed
1464 }
1465 }
1466 return defaultValue
1467}
1468
1469func paginateReadFileContent(content string, args map[string]interface{}) string {
1470 const readFileMaxChars = 50000

Callers 8

executeRunShellFunction · 0.85
executeReadFileFunction · 0.85
executeListFilesFunction · 0.85
paginateReadFileContentFunction · 0.85
executeWebFetchFunction · 0.85

Calls 1

intFunction · 0.85

Tested by

no test coverage detected