This commit is contained in:
yumoqing 2024-06-17 21:32:44 +08:00
parent 5da4f203c4
commit 5fd801d5b9

View File

@ -79,21 +79,21 @@ bricks.LlmModel = class {
messages:this.messages,
mapi:this.mapi,
prompt:prompt,
model:this.model
model:this.opts.model
}
} else {
d = bricks.extend({}, data);
d.model = this.model;
d.model = this.opts.model;
}
if (this.response_mode == 'stream') {
var hr = new bricks.HttpResponseStream();
this.set_stream_data();
var resp = await hr.post(this.url, {params:d});
var resp = await hr.post(this.opts.url, {params:d});
await hr.handle_chunk(resp, this.chunk_response.bind(this, mout));
this.chunk_ended(mout);
} else {
var hj = new bricks.HttpJson()
var resp = await hj.post(this.url, {params:d});
var resp = await hj.post(this.opts.url, {params:d});
if (this.response_mode == 'sync'){
mout.update_data(resp);
if (this.messages){