终端函数调用
- Base URL:
https://stardust.ticos.cn - Endpoint:
POST /terminal/function
认证与请求头
Section titled “认证与请求头”Content-Type: application/jsonAuthorization: Bearer {terminal_secret}
function_name(必填):函数名称arguments(可选):函数参数对象request_id(可选):请求追踪 IDresponse_item_id(可选):响应项 IDfunction_id(可选):函数 ID
{ "function_name": "control_robot_motion", "arguments": { "action": "move_forward", "distance": 1.5, "speed": 0.5 }, "request_id": "req_12345", "response_item_id": "resp_67890", "function_id": "func_abcde"}Curl 示例
Section titled “Curl 示例”curl --location 'https://stardust.ticos.cn/terminal/function' \--header 'Authorization: Bearer ts_xxx_terminal_secret' \--header 'Content-Type: application/json' \--data-raw '{ "function_name": "play_audio", "arguments": { "audio_url": "https://example.com/audio.wav", "volume": 80 }}'200 OK:成功400 Bad Request:参数错误或设备不在线401 Unauthorized:鉴权失败500 Internal Server Error:服务器错误