bugfix
This commit is contained in:
parent
34933b7d51
commit
20acb4f882
@ -267,7 +267,12 @@ body {
|
||||
margin-left: 5px;
|
||||
margin-right: auto;
|
||||
margin-bottom: 10px;
|
||||
background-color:#fefe44;
|
||||
background-color:#fefedd;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 0;
|
||||
box-shadow: 5px 5px 10px rgba(0, 0, 0.2, 0.5);
|
||||
}
|
||||
|
||||
.user_msg {
|
||||
@ -275,8 +280,13 @@ body {
|
||||
margin-left: auto;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 10px;
|
||||
background-color:#44fefe;
|
||||
background-color:#ddfefe;
|
||||
border-top-right-radius: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 0;
|
||||
box-shadow: 5px 5px 10px rgba(0.2, 0, 0, 0.5);
|
||||
}
|
||||
.llm_title {
|
||||
background-color:#fafafa;
|
||||
background-color:#eeeeee;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ bricks.LlmDialog = class extends bricks.VBox {
|
||||
"model",
|
||||
"mapi":
|
||||
"user_msg_css"
|
||||
"user_icon",
|
||||
"llm_icon"
|
||||
"title_ccs"
|
||||
"llm_msg_css"
|
||||
@ -21,7 +22,7 @@ bricks.LlmDialog = class extends bricks.VBox {
|
||||
super(opts);
|
||||
this.title_w = new bricks.HBox({cheight:2});
|
||||
this.title_w.add_widget(new bricks.Icon({
|
||||
url:this.llm_icon||bricks_resource('imgs/llm.png')
|
||||
rate:2,url:this.llm_icon||bricks_resource('imgs/llm.png')
|
||||
}));
|
||||
this.title_w.set_css(this.title_ccs||'llm_title');
|
||||
var t_w = new bricks.Text({text:this.model});
|
||||
@ -34,9 +35,13 @@ bricks.LlmDialog = class extends bricks.VBox {
|
||||
this.messages = [];
|
||||
}
|
||||
async set_prompt(prompt){
|
||||
var box = new bricks.HBox({width:'100%'});
|
||||
var img = new bricks.Icon({rate:2,url:this.user_icon||bricks_resource('imgs/user.png')});
|
||||
var w = new bricks.MdWidget({mdtext:prompt});
|
||||
w.set_css(this.user_msg_css||'user_msg');
|
||||
this.body.add_widget(w);
|
||||
box.add_widget(w);
|
||||
box.add_widget(img);
|
||||
this.body.add_widget(box);
|
||||
await this.llm_request(prompt);
|
||||
}
|
||||
async llm_request(prompt){
|
||||
@ -67,9 +72,13 @@ bricks.LlmDialog = class extends bricks.VBox {
|
||||
processLine(l){
|
||||
var d = JSON.parse(l);
|
||||
if (!this.llm_msg_w) {
|
||||
var box = new bricks.HBox({width:'100%'});
|
||||
var img = new bricks.Icon({rate:2,url:this.llm_icon||bricks_resource('imgs/llm.png')});
|
||||
this.llm_msg_w = new bricks.MdWidget({mdtext:d.content});
|
||||
this.llm_msg_w.set_css(this.llm_msg_css||'llm_msg');
|
||||
this.body.add_widget(this.llm_msg_w);
|
||||
box.add_widget(img);
|
||||
box.add_widget(this.llm_msg_w);
|
||||
this.body.add_widget(box);
|
||||
return;
|
||||
}
|
||||
var txt = this.llm_msg_w.md_content + d.content;
|
||||
|
Loading…
Reference in New Issue
Block a user