Skip to content

Commit 6ef5a95

Browse files
Forairaaaaalbuque
authored andcommitted
example/module/llm: Update voice assistant demo.
Signed-off-by: Forairaaaaa <[email protected]>
1 parent 90ee068 commit 6ef5a95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"V2.0","versionNumber":"V2.1.6","type":"basic","components":[{"name":"screen","type":"screen","layer":0,"screenId":"builtin","screenName":"","id":"__basic_screen","createTime":1730168951327,"x":0,"y":0,"width":320,"height":240,"backgroundColor":"#000000","size":0,"isSelected":true},{"name":"labelStateTitle","type":"label","layer":1,"screenId":"builtin","screenName":"","id":"w%Tp_ZulyjjcG507","createTime":1730169187592,"x":5,"y":4,"color":"#ffffff","backgroundColor":"#000000","text":"ModuleLLM state:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":157,"height":20},{"name":"labelState","type":"label","layer":2,"screenId":"builtin","screenName":"","id":"x8W9hBAizCN!7bb_","createTime":1730169187592,"x":5,"y":30,"color":"#f2e838","backgroundColor":"#000000","text":"~","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":15,"height":20},{"name":"labelAsrDataTitle","type":"label","layer":3,"screenId":"builtin","screenName":"","id":"anvPQ6!tE5hAhaIh","createTime":1730169187592,"x":5,"y":60,"color":"#ffffff","backgroundColor":"#000000","text":"ASR input data:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":140,"height":20},{"name":"labelAsrData","type":"label","layer":4,"screenId":"builtin","screenName":"","id":"fVSUQRLG99!Jm#EH","createTime":1730169187592,"x":4,"y":89,"color":"#66f830","backgroundColor":"#000000","text":"~","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":15,"height":20},{"name":"labelLlmDataTile","type":"label","layer":5,"screenId":"builtin","screenName":"","id":"z5BvFudNDWkq4LJ&","createTime":1730169187592,"x":5,"y":119,"color":"#ffffff","backgroundColor":"#000000","text":"LLM input data:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":139,"height":20},{"name":"labelLlmData","type":"label","layer":6,"screenId":"builtin","screenName":"","id":"lDJ+RyY1-_^2bJEy","createTime":1730169187592,"x":5,"y":149,"color":"#f2e838","backgroundColor":"#000000","text":"~","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":15,"height":20}],"resources":[{"hardware":["hardware_button","hardware_pin_button","imu","rgb","speaker"]},{"module":["module_llm"]}],"units":[],"hats":[],"bases":[],"i2cs":[],"blockly":"<variables><variable id=\"#+u,PY`|c.[PPvrTR8N7\">asr_data</variable><variable id=\"mQwfQj]ECSv^xp3{a=`b\">asr_is_finish</variable><variable id=\"-,YJjn_%Iq2[k0-0P+mJ\">asr_index</variable><variable id=\"tP`$B-_6$ZP.w4JJ+dDi\">llm_is_finish</variable><variable id=\"L?p59UxOQwf7wow[{KcJ\">llm_index</variable><variable id=\"i}H?^ASGbq`H_2;JkJ3s\">llm_data</variable></variables><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"50\" y=\"50\"><mutation isBegin=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_begin\" id=\"system_m5_begin\"><next><block type=\"module_llm_init\" id=\"T|H,omP=DUw_3FI`it*0\"><field name=\"NAME\">llm_0</field><next><block type=\"controls_whileUntil\" id=\"n@X+3SQ2j_1Sej`s$bqK\"><field name=\"MODE\">UNTIL</field><value name=\"BOOL\"><block type=\"module_llm_check_connection\" id=\"KP~_*@@9mJ%|vw$K[WW`\"><field name=\"NAME\">llm_0</field></block></value><statement name=\"DO\"><block type=\"label_set_text\" id=\"}X{I_.#vLU@^hK}Kk=VN\"><field name=\"NAME\">labelState</field><value name=\"TEXT\"><shadow type=\"text\" id=\"?Jsy0Il5rXXKk03cJ,U:\"><field name=\"TEXT\">Wait ModuleLLM Connection..</field></shadow></value><next><block type=\"time_sleep_second\" id=\"!W!.LR.s!Zk4#(/HW)q[\"><value name=\"SECOND\"><shadow type=\"math_number\" id=\"iN4gUd{.7e0~7,c[Shcl\"><mutation max=\"Infinity\" min=\"0\" precision=\"0\"></mutation><field name=\"NUM\">1</field></shadow></value></block></next></block></statement><next><block type=\"label_set_text\" id=\"S}#UzttSzErBu$l2of4Y\"><field name=\"NAME\">labelState</field><value name=\"TEXT\"><shadow type=\"text\" id=\"6mKA(f$7$[T6GN2?$NO^\"><field name=\"TEXT\">Begin voice assistant preset..</field></shadow></value><next><block type=\"controls_if\" id=\"_IGiM{EtH]*-%yC6Ae.6\"><value name=\"IF0\"><block type=\"logic_negate\" id=\"9YGdYQ(FcVuqm8zBvsl/\"><value name=\"BOOL\"><block type=\"module_llm_begin_voice_assistant\" id=\"*Z}_9r.i;i|#/0#{Fc~c\"><field name=\"NAME\">llm_0</field><value name=\"KEYWORD\"><shadow type=\"text\" id=\"TE{~9!*q?To^cI;J`c3n\"><field name=\"TEXT\">HELLO</field></shadow></value><value name=\"PROMPT\"><shadow type=\"text\" id=\"]ZPlWg=UzV$p@+0kGvNm\"><field name=\"TEXT\"></field></shadow></value></block></value></block></value><statement name=\"DO0\"><block type=\"label_set_text\" id=\"ZKC{ZI)hCRmyrLr+Wl`^\"><field name=\"NAME\">labelState</field><value name=\"TEXT\"><shadow type=\"text\" id=\"Yo;#*)7H85USbqy2[r62\"><field name=\"TEXT\">Voice assistant preset begin failed</field></shadow></value></block></statement><next><block type=\"label_set_text\" id=\"sfRHn;~@m3:/{Jn+eJ^X\"><field name=\"NAME\">labelState</field><value name=\"TEXT\"><shadow type=\"text\" id=\"DuU~?niqMt!nsMTpbdi*\"><field name=\"TEXT\">OK</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type=\"basic_on_loop\" id=\"loop_block\" deletable=\"false\" x=\"50\" y=\"630\"><mutation isUpdate=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_update\" id=\"system_m5_update\"><next><block type=\"module_llm_update\" id=\"FRR6%V|=7J8`t3+E9T-@\"><field name=\"NAME\">llm_0</field></block></next></block></statement></block><block type=\"module_llm_keyword_detected_callback\" id=\"ciK7Q_*evAfW47`a%|V:\" x=\"410\" y=\"630\"><field name=\"NAME\">llm_0</field><statement name=\"FUNC\"><block type=\"text_print\" id=\"j,Q=6OR,AB8McS/F.c/9\"><value name=\"TEXT\"><shadow type=\"text\" id=\"_ozPr(@%E]pCv1i`A6GF\"><field name=\"TEXT\">Key-word detected</field></shadow></value></block></statement></block><block type=\"module_llm_asr_data_input_callback\" id=\"iiVN,[nQDfuD{J4OgL7!\" x=\"410\" y=\"770\"><field name=\"NAME\">llm_0</field><value name=\"DATA\"><block type=\"variables_get\" id=\"oqS[?tn~mcAL@02b4`@C\"><field name=\"VAR\" id=\"#+u,PY`|c.[PPvrTR8N7\">asr_data</field></block></value><value name=\"FINISH\"><block type=\"variables_get\" id=\"!0FWfs|cG%12bM,Na1^=\"><field name=\"VAR\" id=\"mQwfQj]ECSv^xp3{a=`b\">asr_is_finish</field></block></value><value name=\"INDEX\"><block type=\"variables_get\" id=\"B7(=sCXyL=#s{/fNlxgv\"><field name=\"VAR\" id=\"-,YJjn_%Iq2[k0-0P+mJ\">asr_index</field></block></value><statement name=\"FUNC\"><block type=\"text_print\" id=\"YmJ*~,!iyd?e.@qWs{AB\"><value name=\"TEXT\"><shadow type=\"text\" id=\"_ozPr(@%E]pCv1i`A6GF\"><field name=\"TEXT\">hello M5</field></shadow><block type=\"variables_get\" id=\"@{ZBEJ!4USho6V|xn+C9\"><field name=\"VAR\" id=\"#+u,PY`|c.[PPvrTR8N7\">asr_data</field></block></value><next><block type=\"label_set_text\" id=\".7S)_-~T4x$_At9i~^[i\"><field name=\"NAME\">labelAsrData</field><value name=\"TEXT\"><shadow type=\"text\" id=\"6WD=sT3t.yVLsf2OIox=\"><field name=\"TEXT\">State: Voice assistant preset begin failed</field></shadow><block type=\"variables_get\" id=\"m~AG7cpRRK89NgfVACXa\"><field name=\"VAR\" id=\"#+u,PY`|c.[PPvrTR8N7\">asr_data</field></block></value></block></next></block></statement></block><block type=\"module_llm_data_input_callback\" id=\"q^KpWa7j-=i_:Vuz2ln2\" x=\"410\" y=\"1031\"><field name=\"NAME\">llm_0</field><value name=\"DATA\"><block type=\"variables_get\" id=\"EcIYzeW3/J%g{@E3g|`Q\"><field name=\"VAR\" id=\"i}H?^ASGbq`H_2;JkJ3s\">llm_data</field></block></value><value name=\"FINISH\"><block type=\"variables_get\" id=\"9[{0Jy$TbEB[XV1G1_vV\"><field name=\"VAR\" id=\"tP`$B-_6$ZP.w4JJ+dDi\">llm_is_finish</field></block></value><value name=\"INDEX\"><block type=\"variables_get\" id=\"TPn,)5B*z_6VK[NIffqZ\"><field name=\"VAR\" id=\"L?p59UxOQwf7wow[{KcJ\">llm_index</field></block></value><statement name=\"FUNC\"><block type=\"text_print\" id=\",K|vo?v9ttz91:/YxTL{\"><value name=\"TEXT\"><shadow type=\"text\" id=\"_ozPr(@%E]pCv1i`A6GF\"><field name=\"TEXT\">hello M5</field></shadow><block type=\"variables_get\" id=\"_3($GbRkTLf^?4PHGSuD\"><field name=\"VAR\" id=\"i}H?^ASGbq`H_2;JkJ3s\">llm_data</field></block></value><next><block type=\"label_set_text\" id=\"rQuM9XFZKh#pOG``IB(-\"><field name=\"NAME\">labelLlmData</field><value name=\"TEXT\"><shadow type=\"text\" id=\"6WD=sT3t.yVLsf2OIox=\"><field name=\"TEXT\">State: Voice assistant preset begin failed</field></shadow><block type=\"variables_get\" id=\"Yh?Z!@UhdVTSMxF|HzE#\"><field name=\"VAR\" id=\"i}H?^ASGbq`H_2;JkJ3s\">llm_data</field></block></value></block></next></block></statement></block>","screen":[{"simulationName":"Built-in","type":"builtin","width":320,"height":240,"scale":0.78,"screenName":"","blockId":"","screenColorType":0,"id":"builtin","createTime":1730168951327}],"logicWhenNum":0,"customList":[]}
1+
{"version":"V2.0","versionNumber":"V2.1.6","type":"basic","components":[{"name":"screen","type":"screen","layer":0,"screenId":"builtin","screenName":"","id":"__basic_screen","createTime":1730434067328,"x":0,"y":0,"width":320,"height":240,"backgroundColor":"#000000","size":0,"isSelected":true},{"name":"label0","type":"label","layer":1,"screenId":"builtin","screenName":"","id":"ka`#@Jl^@F!KK1ib","createTime":1730434126508,"x":11,"y":11,"color":"#ffffff","backgroundColor":"#000000","text":"State:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":53,"height":20},{"name":"label1","type":"label","layer":2,"screenId":"builtin","screenName":"","id":"d3O0*0blDWVFtFUH","createTime":1730434126508,"x":11,"y":37,"color":"#ffe600","backgroundColor":"#000000","text":"~","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":15,"height":20},{"name":"label2","type":"label","layer":3,"screenId":"builtin","screenName":"","id":"kQO^%L8-QSR6LpS&","createTime":1730434126508,"x":11,"y":64,"color":"#ffffff","backgroundColor":"#000000","text":"ASR input data:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":140,"height":20},{"name":"label3","type":"label","layer":4,"screenId":"builtin","screenName":"","id":"t$y+U^fuW-iSR*vA","createTime":1730434126508,"x":11,"y":94,"color":"#65f62f","backgroundColor":"#000000","text":"~","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":15,"height":20},{"name":"label4","type":"label","layer":5,"screenId":"builtin","screenName":"","id":"jLx-gxqRgf&UeV5r","createTime":1730434126508,"x":11,"y":120,"color":"#ffffff","backgroundColor":"#000000","text":"LLM input data:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":139,"height":20},{"name":"label5","type":"label","layer":6,"screenId":"builtin","screenName":"","id":"qA5h=*^6j7U9*l0p","createTime":1730434126508,"x":11,"y":151,"color":"#ffe600","backgroundColor":"#000000","text":"~","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false,"width":15,"height":20}],"resources":[{"hardware":["hardware_button","hardware_pin_button","imu","rgb","speaker"]},{"module":["module_llm"]}],"units":[],"hats":[],"bases":[],"i2cs":[],"blockly":"<variables><variable id=\"D7J2!]!LA`M/y17zD0Z]\">asr_data</variable><variable id=\".z]IUgvKj]{;?D,{3r}_\">asr_is_finish</variable><variable id=\"rTY9$f1wkg_$u;pEpW?D\">asr_index</variable><variable id=\"@*R`N9Ea;gp/;)k07*Y/\">llm_data</variable><variable id=\"%:wWU8Y0CM}XL;WR6dg|\">llm_is_finish</variable><variable id=\"9NGj};Zz3jJ5Bic%zo+*\">llm_index</variable></variables><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"50\" y=\"50\"><mutation isBegin=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_begin\" id=\"system_m5_begin\"><next><block type=\"module_llm_init\" id=\"M:YtNS*2N:aynNI[03q$\"><field name=\"NAME\">llm_0</field><value name=\"UART\"><shadow type=\"module_llm_id_option\" id=\"_ApF;V,S[eWc-J58~)ef\"><field name=\"VALUE\">2</field></shadow></value><value name=\"TX\"><shadow type=\"module_llm_tx_option\" id=\"*zu|Rop}:*fr[p=!R,VH\"><field name=\"VALUE\">17</field></shadow></value><value name=\"RX\"><shadow type=\"module_llm_rx_option\" id=\"ZgaNSqzRxHZeMMTL.E;K\"><field name=\"VALUE\">16</field></shadow></value><next><block type=\"label_set_text\" id=\"G_CtBY:|x-6@0A_}n=wJ\"><field name=\"NAME\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\"#fywX1o@r]E01_G/(P+.\"><field name=\"TEXT\">Wait ModuleLLM connection..</field></shadow></value><next><block type=\"controls_whileUntil\" id=\"vIi$9W+B,,r!2YOraP/%\"><field name=\"MODE\">UNTIL</field><value name=\"BOOL\"><block type=\"module_llm_check_connection\" id=\"7^MX]DJYC#-1qxu%(e24\"><field name=\"NAME\">llm_0</field></block></value><statement name=\"DO\"><block type=\"time_sleep_second\" id=\"AI9FzYr9W8!:.D%};L*/\"><value name=\"SECOND\"><shadow type=\"math_number\" id=\"FSrBYpB)`GH9xhaK8h,`\"><mutation max=\"Infinity\" min=\"0\" precision=\"0\"></mutation><field name=\"NUM\">1</field></shadow></value></block></statement><next><block type=\"label_set_text\" id=\"hYc{425Gt0XHmY9WQL|n\"><field name=\"NAME\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\"+~M;7/^)/UorrL0rz+WT\"><field name=\"TEXT\">Reset ModuleLLM..</field></shadow></value><next><block type=\"module_llm_sys_reset\" id=\"D5u,DNdT$W6[:MUSsdF|\"><field name=\"NAME\">llm_0</field><field name=\"VALUE\">True</field><next><block type=\"label_set_text\" id=\"lNph.gTy-M#sh8xAF8Eu\"><field name=\"NAME\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\";BJK-;;!XM~b$A66p!Fb\"><field name=\"TEXT\">Begin voice assistant preset..</field></shadow></value><next><block type=\"controls_if\" id=\"a;O1hf~SLtVKSL,_SL#B\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_negate\" id=\"-+WhcI.~UHS9PH#?cfji\"><value name=\"BOOL\"><block type=\"module_llm_begin_voice_assistant\" id=\"UHH;xwtO5$*VeN.!#sL,\"><field name=\"NAME\">llm_0</field><value name=\"KEYWORD\"><shadow type=\"text\" id=\"@$IKg6#V.D7JKl`JGskp\"><field name=\"TEXT\">HI JIMMY</field></shadow></value><value name=\"PROMPT\"><shadow type=\"text\" id=\"Ggz}x?7#=Gu;5_GxLM#y\"><field name=\"TEXT\">You are a helpful assistant.</field></shadow></value></block></value></block></value><statement name=\"DO0\"><block type=\"label_set_text\" id=\"X}kQdEF+TWqtrQhREI_3\"><field name=\"NAME\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\"LV^ltDT}l;S2/FKOx$r.\"><field name=\"TEXT\">Failed!</field></shadow></value></block></statement><statement name=\"ELSE\"><block type=\"label_set_text\" id=\"wM0HsN-V8)t]W]j-Stvj\"><field name=\"NAME\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\":vgW;63|oPO_tzAHr4.9\"><field name=\"TEXT\">OK</field></shadow></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type=\"basic_on_loop\" id=\"loop_block\" deletable=\"false\" x=\"470\" y=\"50\"><mutation isUpdate=\"false\"></mutation><field name=\"UPDATEOP\">false</field><statement name=\"FUNC\"><block type=\"module_llm_tick\" id=\"7[.uKa.K!=X0P{HFVg*!\"><field name=\"NAME\">llm_0</field></block></statement></block><block type=\"module_llm_asr_data_input_callback\" id=\",}Aq!^_M@/P1l}gPEHJi\" x=\"50\" y=\"790\"><field name=\"NAME\">llm_0</field><value name=\"DATA\"><block type=\"variables_get\" id=\"``_9MQC/(7A4fUAOS[2P\"><field name=\"VAR\" id=\"D7J2!]!LA`M/y17zD0Z]\">asr_data</field></block></value><value name=\"FINISH\"><block type=\"variables_get\" id=\"7|NZ/HaH7m5Yz%E=S{n)\"><field name=\"VAR\" id=\".z]IUgvKj]{;?D,{3r}_\">asr_is_finish</field></block></value><value name=\"INDEX\"><block type=\"variables_get\" id=\";Hd)BiLv?qtCM..hmtR2\"><field name=\"VAR\" id=\"rTY9$f1wkg_$u;pEpW?D\">asr_index</field></block></value><statement name=\"FUNC\"><block type=\"label_set_text\" id=\"ta?;oiWwH]fIrcB-DR)+\"><field name=\"NAME\">label3</field><value name=\"TEXT\"><shadow type=\"text\" id=\"#606T)y=RifctO3$oBNs\"><field name=\"TEXT\">Label</field></shadow><block type=\"variables_get\" id=\"o;dWf9{#WPyH,)B^#sgr\"><field name=\"VAR\" id=\"D7J2!]!LA`M/y17zD0Z]\">asr_data</field></block></value></block></statement></block><block type=\"module_llm_data_input_callback\" id=\":;NJ}?4GgP6sR(@.{XRL\" x=\"50\" y=\"1030\"><field name=\"NAME\">llm_0</field><value name=\"DATA\"><block type=\"variables_get\" id=\"|XCDMPud3vj+3,+}d|Mf\"><field name=\"VAR\" id=\"@*R`N9Ea;gp/;)k07*Y/\">llm_data</field></block></value><value name=\"FINISH\"><block type=\"variables_get\" id=\"7W9j~X.~.%Jq?_D#a;vw\"><field name=\"VAR\" id=\"%:wWU8Y0CM}XL;WR6dg|\">llm_is_finish</field></block></value><value name=\"INDEX\"><block type=\"variables_get\" id=\"AA84DqS]C6[4Y7^viQB}\"><field name=\"VAR\" id=\"9NGj};Zz3jJ5Bic%zo+*\">llm_index</field></block></value><statement name=\"FUNC\"><block type=\"label_set_text\" id=\"):}hw:m.7m5@DFgNvH-)\"><field name=\"NAME\">label5</field><value name=\"TEXT\"><shadow type=\"text\" id=\"#606T)y=RifctO3$oBNs\"><field name=\"TEXT\">Label</field></shadow><block type=\"variables_get\" id=\"ialOe@yhZSp3xU2|n7dK\"><field name=\"VAR\" id=\"@*R`N9Ea;gp/;)k07*Y/\">llm_data</field></block></value></block></statement></block>","screen":[{"simulationName":"Built-in","type":"builtin","width":320,"height":240,"scale":0.78,"screenName":"","blockId":"","screenColorType":0,"id":"builtin","createTime":1730434067327}],"logicWhenNum":0,"customList":[]}

0 commit comments

Comments
 (0)