bugfix
This commit is contained in:
parent
09eb4e09a9
commit
5da4f203c4
@ -15,16 +15,17 @@ bricks.ModelOutput = class extends bricks.HBox {
|
||||
super(opts);
|
||||
this.img = new bricks.Icon({rate:2,url:this.icon||bricks_resource('imgs/llm.png')});
|
||||
this.run = new bricks.BaseRunning({target:this});
|
||||
this.add_widget(img);
|
||||
this.add_widget(this.img);
|
||||
this.add_widget(this.run)
|
||||
}
|
||||
async update_data(data){
|
||||
this.run.stop_timepass();
|
||||
if (this.run) this.run.stop_timepass();
|
||||
this.run = null;
|
||||
var w = await bricks.widgetBuild(this.output_view, this.llmio, data);
|
||||
w.set_css('llm_msg');
|
||||
w.set_css('filler');
|
||||
this.clear_widgets();
|
||||
this.add+widget(img);
|
||||
this.add_widget(this.img);
|
||||
this.add_widget(w);
|
||||
this.add_widget(new bricks.BlankIcon({rate:2, flexShrink:0}));
|
||||
}
|
||||
@ -57,15 +58,14 @@ bricks.LlmModel = class {
|
||||
render_title(){
|
||||
var w = new bricks.HBox({});
|
||||
w.bind('click', this.show_setup_panel.bind(this))
|
||||
var img = new bricks.Icon({rate:2,url:this.icon||bricks_resource('imgs/llm.png')});
|
||||
var txt = new bricks.Text({text:this.model});
|
||||
this.add_widget(img);
|
||||
this.add_widget(txt);
|
||||
this.llmmodels.forEach(lm => {
|
||||
var tw = ml.render_title();
|
||||
w.add_widget(tw);
|
||||
});
|
||||
var img = new bricks.Icon({rate:2,url:this.opts.icon||bricks_resource('imgs/llm.png')});
|
||||
var txt = new bricks.Text({text:this.opts.model});
|
||||
w.add_widget(img);
|
||||
w.add_widget(txt);
|
||||
return w;
|
||||
}
|
||||
show_setup_panel(event){
|
||||
|
||||
}
|
||||
async model_inputed(data){
|
||||
var mout = new bricks.ModelOutput({icon:this.opts.icon, output_view:this.opts.output_view});
|
||||
@ -106,7 +106,7 @@ bricks.LlmModel = class {
|
||||
}
|
||||
}
|
||||
}
|
||||
is_acccept_source(source){
|
||||
is_accept_source(source){
|
||||
if (this.opts.input_from == source){
|
||||
return true;
|
||||
}
|
||||
@ -174,16 +174,18 @@ bricks.LlmIO = class extends bricks.VBox {
|
||||
constructor(opts){
|
||||
super(opts);
|
||||
this.llmmodels = [];
|
||||
this.models.forEach( m =>{
|
||||
var lm = new bricks.LlmModel(this, m);
|
||||
this.llmmodels.push(lm);
|
||||
});
|
||||
this.title_w = new bricks.HBox({cheight:2});
|
||||
this.i_w = new bricks.VBox({cheight:5});
|
||||
this.o_w = new bricks.Filler({});
|
||||
this.add_widget(this.title_w);
|
||||
this.add_widget(this.o_w);
|
||||
this.add_widget(this.i_w);
|
||||
this.models.forEach( m =>{
|
||||
var lm = new bricks.LlmModel(this, m);
|
||||
this.llmmodels.push(lm);
|
||||
var tw = lm.render_title();
|
||||
this.title_w.add_widget(tw);
|
||||
});
|
||||
this.build_input();
|
||||
}
|
||||
async handle_input(event){
|
||||
@ -198,7 +200,7 @@ bricks.LlmIO = class extends bricks.VBox {
|
||||
}
|
||||
async show_input(params){
|
||||
var box = new bricks.HBox({width:'100%'});
|
||||
var w = new bricks.widgetBuild(this.input_view, this.o_w, params);
|
||||
var w = await bricks.widgetBuild(this.input_view, this.o_w, params);
|
||||
w.set_css(this.msg_css||'user_msg');
|
||||
w.set_css('filler');
|
||||
var img = new bricks.Icon({rate:2,url:this.user_icon||bricks_resource('imgs/user.png')});
|
||||
|
Loading…
Reference in New Issue
Block a user