## Device Control

In agent conversation applications developed based on the **AI Agent SDK**, you can implement control of devices if your product supports AI control.

For more detailed information, please visit [Controlling Devices](https://developer.tuya.com/en/miniapp-codelabs/codelabs/t-agent-sdk-guide/index.html#6).

### Effect Demonstration

<img src="https://developer.tuya.com/en/miniapp-codelabs/codelabs/t-agent-sdk-guide/img/6dfe31f89a0ec53.jpg" width="300" alt="Device Control" />

### Interaction Flow
```mermaid
sequenceDiagram
    participant User
    participant AIAgent
    participant DeviceControlTool
    participant SmartDevice

    User->>AIAgent: Send control instruction (e.g., "Turn on the living room light")
    AIAgent->>AIAgent: Determine user intent
    AIAgent->>DeviceControlTool: Call device control tool
    DeviceControlTool->>SmartDevice: Issue DP command
    SmartDevice-->>DeviceControlTool: Return control result
    DeviceControlTool-->>AIAgent: Return control result
    AIAgent-->>User: Feedback control result (e.g., "I've turned on the living room light for you")
```
