File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,7 +129,8 @@ def onFilterText(text):
129129 if runtime .isStarted ('i01.mouth' ):
130130 i01_mouth .speak (filtered_text )
131131 if runtime .isStarted ('i01.chatBot' ):
132- i01_chatBot .getResponse ("LLM_RESPONSE " + filtered_text )
132+ if filtered_text and not re .match (r'^\s*\*[\w\s]+\*\s*$' , filtered_text ):
133+ send_llm_to_chatbotUI (filtered_text )
133134 print ("Extracted Word:" , extracted_word )
134135 print ("Parameters:" , params )
135136 function_to_call = globals ().get (extracted_word )
@@ -141,6 +142,17 @@ def onFilterText(text):
141142 else :
142143 result = "No function found matching '{}'" .format (extracted_word )
143144 print (result )
144-
145+
146+ def send_llm_to_chatbotUI (text ):
147+ from org .myrobotlab .programab import Response
148+ from java .util import ArrayList
149+ payloads = ArrayList ()
150+ resp = Response (i01_chatBot .getCurrentBotName (),
151+ i01_chatBot .getCurrentUserName (),
152+ text ,
153+ payloads )
154+ #i01_chatBot.publishResponse(resp)
155+ i01_chatBot .invoke ("publishResponse" , resp )
156+
145157if runtime .isStarted ('i01.mouth' ):
146158 initMouth ()
You can’t perform that action at this time.
0 commit comments