mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-03-31 16:20:28 +02:00
Add files via upload
This commit is contained in:
@@ -1213,7 +1213,15 @@ func (e *Executor) buildInputSchema(toolConfig *config.ToolConfig) map[string]in
|
||||
required := []string{}
|
||||
|
||||
for _, param := range toolConfig.Parameters {
|
||||
// 转换类型为OpenAI/JSON Schema标准类型
|
||||
// 跳过 name 为空的参数(避免 YAML 中 name: null 或空导致非法 schema)
|
||||
if strings.TrimSpace(param.Name) == "" {
|
||||
e.logger.Debug("跳过无名称的参数",
|
||||
zap.String("tool", toolConfig.Name),
|
||||
zap.String("type", param.Type),
|
||||
)
|
||||
continue
|
||||
}
|
||||
// 转换类型为OpenAI/JSON Schema标准类型(空类型默认为 string)
|
||||
openAIType := e.convertToOpenAIType(param.Type)
|
||||
|
||||
prop := map[string]interface{}{
|
||||
@@ -1255,6 +1263,10 @@ func (e *Executor) buildInputSchema(toolConfig *config.ToolConfig) map[string]in
|
||||
|
||||
// convertToOpenAIType 将配置中的类型转换为OpenAI/JSON Schema标准类型
|
||||
func (e *Executor) convertToOpenAIType(configType string) string {
|
||||
// 空或 null 类型统一视为 string,避免非法 schema 导致工具调用失败
|
||||
if strings.TrimSpace(configType) == "" {
|
||||
return "string"
|
||||
}
|
||||
switch configType {
|
||||
case "bool":
|
||||
return "boolean"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
# Python HTTP helpers leveraged by tools like api-fuzzer, dnslog, http-intruder, http-framework-test
|
||||
requests>=2.32.3
|
||||
|
||||
# dirsearch (Kali/system dirsearch) 依赖:
|
||||
defusedxml>=0.7.0
|
||||
httpx>=0.27.0
|
||||
charset-normalizer>=3.3.2
|
||||
chardet>=5.2.0
|
||||
# dirsearch:用 python3 -m dirsearch 时由本依赖提供(含 defusedxml 等)
|
||||
dirsearch>=0.4.3
|
||||
|
||||
# Python exploitation / analysis frameworks referenced by tool recipes
|
||||
# angr>=9.2.96
|
||||
|
||||
Reference in New Issue
Block a user