|
SDK สำหรับ TESAIoT Dev Kit
คู่มืออ้างอิง API และ Tutorial (MTB & µPython)
|
Functions | |
| void | nus_agent_reset (void) |
| ล้าง id ของ ask ที่ค้างอยู่และ accumulator ไม่ต้อง init ไม่มีการจับ lock ไม่มีค่าคืน | |
| void | nus_agent_note_ask (const char *id) |
| บันทึก id ของ ask ที่ค้างอยู่ id ที่เป็น NULL หรือว่างเปล่าจะรีเซ็ต agent ไม่มีผู้เรียกที่ใดเลย | |
| int | nus_agent_handle_token (const char *json, const jsmntok_t *toks, int n_toks) |
| ต่อ "delta" เข้ากับ accumulator คืน -1 เมื่อ id ไม่ตรง (ถูกทิ้งไปเงียบ ๆ) | |
| int | nus_agent_handle_done (const char *json, const jsmntok_t *toks, int n_toks) |
| ส่งข้อความสุดท้ายต่อไปยังหน้าบน CM55 ผ่าน IPC แล้วรีเซ็ต ฟิลด์ "text" เป็นตัวชี้ขาด | |
| int | nus_agent_handle_tool_call (const char *json, const jsmntok_t *toks, int n_toks) |
| เพื่อการสังเกตเท่านั้น — ส่งข้อความใบ้สั้น ๆ ผ่าน IPC ให้ marquee บน CM55 แสดงว่าเครื่องมือใดกำลังทำงาน | |
| size_t | nus_agent_buffer_len (void) |
| จำนวนไบต์ที่พักไว้สำหรับ ask ที่ค้างอยู่ เป็น probe สำหรับ telemetry ไม่ใช่กลไกการซิงโครไนซ์ | |
6 ฟังก์ชัน: handler ของ stream ในกลุ่ม nus_agent_* คอมไพล์เฉพาะเมื่อ ENABLE_PAGE_BENTO_BUDDY=1 (ค่าตั้งต้นคือ 0, proj_cm33_ns/Makefile:64, :305) ให้ build ใหม่หลังจาก make getlibs — ดู Flag gate (อ่านก่อน)
การประกาศ: nus_agent.h (มี #include "vendor/jsmn.h" ซึ่งไม่มีอยู่ในชุด include ของ dist — หมายเหตุเรื่องการแพ็กเกจ header) ส่วนการนำไปสร้างจริงใน nus_agent.c ถูกเก็บไว้ใน libbento_secure.a สถานะของโมดูลนี้คือ ask ที่ค้างอยู่ได้เพียงรายการเดียว ซึ่ง task NUS RX ตัวเดียวเป็นเจ้าของ (nus_agent.c:44) เฟรม token ที่ id ไม่ตรงกับ ask ล่าสุดจะถูกทิ้งไปเงียบ ๆ และ accumulator มีขอบเขตจำกัดที่ 256 อักขระ ส่วนที่ล้นจะถูกตัดทิ้ง
| void nus_agent_reset | ( | void | ) |
ล้าง id ของ ask ที่ค้างอยู่และ accumulator ไม่ต้อง init ไม่มีการจับ lock ไม่มีค่าคืน
| void nus_agent_note_ask | ( | const char * | id | ) |
บันทึก id ของ ask ที่ค้างอยู่ id ที่เป็น NULL หรือว่างเปล่าจะรีเซ็ต agent ไม่มีผู้เรียกที่ใดเลย
| int nus_agent_handle_token | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n_toks ) |
ต่อ "delta" เข้ากับ accumulator คืน -1 เมื่อ id ไม่ตรง (ถูกทิ้งไปเงียบ ๆ)
| int nus_agent_handle_done | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n_toks ) |
ส่งข้อความสุดท้ายต่อไปยังหน้าบน CM55 ผ่าน IPC แล้วรีเซ็ต ฟิลด์ "text" เป็นตัวชี้ขาด
| int nus_agent_handle_tool_call | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n_toks ) |
เพื่อการสังเกตเท่านั้น — ส่งข้อความใบ้สั้น ๆ ผ่าน IPC ให้ marquee บน CM55 แสดงว่าเครื่องมือใดกำลังทำงาน
| size_t nus_agent_buffer_len | ( | void | ) |
จำนวนไบต์ที่พักไว้สำหรับ ask ที่ค้างอยู่ เป็น probe สำหรับ telemetry ไม่ใช่กลไกการซิงโครไนซ์