Kigo安全服务接口
  1. 构建
Kigo安全服务接口
  • KToolkits文档中心
    • 入门
      • 欢迎使用KToolkits
      • 云服务
    • 手册
      • 工具库(规划中)
      • 工具
        • Nmap
        • Subfinder
        • 社交查询
        • PDF文档生成
        • 渗透报告
        • 图片文件生成
      • 构建
        • 工具箱
        • 智能体工具
  1. 构建

工具箱

我们在工具箱中为你提供了各种类型的工具,你可以为你的AI应用快速构建属于你自己的AI工具箱。

工具使用#

1.
使用Nmap网络端口扫描工具
import ktoolkits

ktoolkits.api_key="XXXX"

#当工具有多个参数时,可以使用参数字典为输入tool_input={"scan_target":"baidu.com"}
output = ktoolkits.Runner.call(
	tool_name="nmap",
	tool_input="www.baidu.com",
)
2.
在AutoGen中使用KTool快速构建智能体
import autogen
import ktoolkits

user_proxy = autogen.UserProxyAgent(

	name="用户代理",
	
	#human_input_mode="NEVER",
	
	is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
	
	code_execution_config={
	
	"last_n_messages": 10,
	
	"work_dir": "code",
	
	"use_docker": False,

	}

)


tasks=[

"""请对www.baidu.com进行端口扫描""",

]

assistant = autogen.AssistantAgent(

name="渗透测试专家",

llm_config=llm_config

)

tool = ktool.FunctionCall.create_tool(tool_name="nmap")

register_function(

	f=tool.get("tool_func"),
	
	caller=assistant,
	
	executor=user_proxy,
	
	description=tool.get("tool_desc"),

)

user_proxy.initiate_chat(assistant,message=tasks[0])
上一页
图片文件生成
下一页
智能体工具
Built with