package tools import ( "context" "github.com/yourname/cyrene-ai/tool-engine/internal/model" ) // Tool 工具接口 type Tool interface { Definition() model.ToolDefinition Execute(ctx context.Context, arguments map[string]interface{}) (*model.ToolResult, error) } // IoTClientFactory 用于创建 IoT 客户端的工厂函数类型 type IoTClientFactory func() IoTClientInterface // IoTClientInterface IoT 客户端接口(解耦对 ai-core 的依赖) type IoTClientInterface interface { GetAllDevices() ([]IoTDevice, error) GetDevice(id string) (*IoTDevice, error) ToggleDevice(id string) error SetDeviceProperty(id string, field string, value interface{}) error } // IoTDevice IoT 设备结构体 type IoTDevice struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Status string `json:"status"` Brightness int `json:"brightness,omitempty"` Color string `json:"color,omitempty"` Temperature float64 `json:"temperature,omitempty"` Mode string `json:"mode,omitempty"` Position int `json:"position,omitempty"` Value float64 `json:"value,omitempty"` Unit string `json:"unit,omitempty"` Battery int `json:"battery,omitempty"` LastUpdated string `json:"last_updated"` }