mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-08-21 02:17:21 +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{}
|
required := []string{}
|
||||||
|
|
||||||
for _, param := range toolConfig.Parameters {
|
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)
|
openAIType := e.convertToOpenAIType(param.Type)
|
||||||
|
|
||||||
prop := map[string]interface{}{
|
prop := map[string]interface{}{
|
||||||
@@ -1255,6 +1263,10 @@ func (e *Executor) buildInputSchema(toolConfig *config.ToolConfig) map[string]in
|
|||||||
|
|
||||||
// convertToOpenAIType 将配置中的类型转换为OpenAI/JSON Schema标准类型
|
// convertToOpenAIType 将配置中的类型转换为OpenAI/JSON Schema标准类型
|
||||||
func (e *Executor) convertToOpenAIType(configType string) string {
|
func (e *Executor) convertToOpenAIType(configType string) string {
|
||||||
|
// 空或 null 类型统一视为 string,避免非法 schema 导致工具调用失败
|
||||||
|
if strings.TrimSpace(configType) == "" {
|
||||||
|
return "string"
|
||||||
|
}
|
||||||
switch configType {
|
switch configType {
|
||||||
case "bool":
|
case "bool":
|
||||||
return "boolean"
|
return "boolean"
|
||||||
|
|||||||
+2
-5
@@ -1,11 +1,8 @@
|
|||||||
# Python HTTP helpers leveraged by tools like api-fuzzer, dnslog, http-intruder, http-framework-test
|
# Python HTTP helpers leveraged by tools like api-fuzzer, dnslog, http-intruder, http-framework-test
|
||||||
requests>=2.32.3
|
requests>=2.32.3
|
||||||
|
|
||||||
# dirsearch (Kali/system dirsearch) 依赖:
|
# dirsearch:用 python3 -m dirsearch 时由本依赖提供(含 defusedxml 等)
|
||||||
defusedxml>=0.7.0
|
dirsearch>=0.4.3
|
||||||
httpx>=0.27.0
|
|
||||||
charset-normalizer>=3.3.2
|
|
||||||
chardet>=5.2.0
|
|
||||||
|
|
||||||
# Python exploitation / analysis frameworks referenced by tool recipes
|
# Python exploitation / analysis frameworks referenced by tool recipes
|
||||||
# angr>=9.2.96
|
# angr>=9.2.96
|
||||||
|
|||||||
Reference in New Issue
Block a user