AgentOut: handle bricks widget descriptor JSON (widgettype) in streamed response
This commit is contained in:
parent
8b4897ea14
commit
9a6e7e1a75
@ -55,9 +55,20 @@ bricks.AgentOut = class extends bricks.VBox {
|
||||
this.content = '';
|
||||
this.error = '';
|
||||
this.qa_w = null;
|
||||
this.bricks_widgets = []; // bricks widget descriptor chunks
|
||||
}
|
||||
|
||||
update(data){
|
||||
// Handle bricks widget descriptor JSON ({"widgettype": "Text", "options": {...}})
|
||||
if (data.widgettype){
|
||||
bricks.widgetBuild(data).then(function(w){
|
||||
if (w){
|
||||
this.bricks_widgets.push(w);
|
||||
this.add_widget(w);
|
||||
}
|
||||
}.bind(this));
|
||||
return;
|
||||
}
|
||||
if (data.audio){
|
||||
var url = data.audio;
|
||||
if (! data.audio.startsWith('http')){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user