最終更新:2025-01-19 (日) 11:30:42 (20d)
Module LLM/API
Top / Module LLM / API
ドキュメント
動作の流れ
M5Stack側
- M5ModuleLLMの関数を実行→JSONのコマンドがUART経由でModule LLM側に伝わる
Module LLM側
- StackFlowのModule LLM/llm-sysがサービスとして常駐している
- /dev/ttyS1からのUARTも待ち受け (M-BUS経由のM5Stack向け)
- 10001ポートでTCPで待ち受けている (ネットワーク経由向け)
- コマンドを受け取って各Module LLM/ユニットで実行
M5Stack利用時の動作
M5ModuleLLMのAPIの関数の内部動作
M5ModuleLLM.llm.setup(m5_module_llm::ApiLlmSetupConfig_t) (例)
- M5ModuleLLM.msg.sendCmdAndWaitToTakeMsg?(送りたいJSON)
M5ModuleLLM.msg.sendCmd?
M5ModuleLLM.comm.sendCmd?
- _serial->print(cmd);
- Serial2
- →M-BUSのUART経由でStackFlow/main_sys (Module LLM/llm_sys?)へ
パケット
{ "request_id": "001", "work_id": "llm.1001", "action": "taskinfo", "object": "None", "data":"None" }
フィールド
request_id The session ID used to distinguish context, corresponding to the service invocation and response. work_id When calling the service unit, enter keyword + ID, e.g., llm.xxxx(id).
When initializing the service unit in setup, enter the unit name keyword without the ID, e.g., llm.action The method being called, corresponding to the unit method. Please refer to the unit list below. object Sets the structure of the parameters passed in data. Refer to the parameter structure list for all parameter structures. If there are no parameters, this can be omitted. data Parameters to be transmitted; can be omitted if there are no parameters.