diff --git a/wwwroot/index.ui b/wwwroot/index.ui index f9c22a9..eebdc86 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -116,7 +116,7 @@ }, "subwidgets": [ { - "widgettype": "VScrollPanel", + "widgettype": "AgentIO", "id": "chat_scroll", "options": { "css": "filler", @@ -157,15 +157,7 @@ ] } ], - "binds": [ - { - "wid": "self", - "event": "inputed", - "actiontype": "script", - "target": "self", - "script": "console.log('AGENTIO inputed bind fired',JSON.stringify(params));var ai=this;if(ai.inputw&&!ai._done){ai._done=true;var orig=ai.user_inputed.bind(ai);ai.inputw.unbind('inputed');ai.inputw.bind('inputed',function(e){console.log('HOOKED:',e.params.prompt);orig(e);var p=e.params.prompt||'';var mid=e.params.model_id||'';var xhr=new XMLHttpRequest();xhr.open('POST',ai.opts.url);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');var lastLen=0;xhr.onprogress=function(){var t=xhr.responseText;var d=t.substring(lastLen);lastLen=t.length;d.split(String.fromCharCode(10)).forEach(function(line){line=line.trim();if(!line)return;try{var obj=JSON.parse(line);console.log('STREAM:',line.substring(0,40))}catch(e){}})};xhr.onload=function(){console.log('DONE')};xhr.send('action=send_message&message_text='+encodeURIComponent(p)+'&model_id='+encodeURIComponent(mid))})}" - } - ] + "binds": [] }, { "widgettype": "VBox",