diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 6376206..e1cfea5 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -110,7 +110,7 @@ "id": "chat_io", "options": { "css": "filler", - "url": "/pipeline-sdlc/api/cockpit_chat.dspy", + "url": "/pipeline-sdlc/api/cockpit_chat_v2.dspy", "model_dataurl": "/pipeline-sdlc/api/cockpit_model_options.dspy", "model_cwidth": 14, "placeholder": "输入你的需求..." diff --git a/wwwroot/index_cockpit.ui b/wwwroot/index_cockpit.ui index 8f4f595..198a888 100644 --- a/wwwroot/index_cockpit.ui +++ b/wwwroot/index_cockpit.ui @@ -182,7 +182,7 @@ "id": "chat_input", "options": { "placeholder": "输入你的需求...", - "url": "/pipeline-sdlc/api/cockpit_chat.dspy", + "url": "/pipeline-sdlc/api/cockpit_chat_v2.dspy", "model_dataurl": "/pipeline-sdlc/api/cockpit_model_options.dspy", "model_cwidth": 14 }, @@ -192,7 +192,7 @@ "event": "inputed", "actiontype": "script", "target": "self", - "script": "var ai=bricks.getWidgetById('chat_input',bricks.app);if(ai&&ai.inputw&&!ai._hooked){ai._hooked=true;ai.inputw.unbind('inputed');ai.inputw.bind('inputed',function(e){console.log('HOOKED inputed');var p=e.params.prompt||'';var mid=e.params.model_id||'';var chat=bricks.getWidgetById('chat_scroll',bricks.app);var at=null;if(chat){var ab=new bricks.HBox({width:'100%'});var am=new bricks.VBox({width:'85%',alignSelf:'flex-start',bgcolor:'#e8f0fe',borderRadius:'12px',padding:'12px 16px',marginBottom:'10px',gap:'4px'});am.add_widget(new bricks.Text({text:'Agent',cfontsize:0.75,color:'#3b82f6',fontWeight:'bold'}));at=new bricks.Text({text:'...',cfontsize:0.85,color:'#64748b'});am.add_widget(at);ab.add_widget(new bricks.Svg({rate:2,url:bricks_resource('imgs/llm.svg')}));ab.add_widget(am);ab.add_widget(new bricks.VBox({css:'filler'}));chat.add_widget(ab)}var xhr=new XMLHttpRequest();xhr.open('POST','/pipeline-sdlc/api/cockpit_chat.dspy');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;var lines=d.split(String.fromCharCode(10));for(var j=0;j