|
|
@@ -130,6 +130,7 @@ const props = defineProps({
|
|
|
* */
|
|
|
conversation_params: Object
|
|
|
});
|
|
|
+const emit = defineEmits(['updateSessionId']);
|
|
|
|
|
|
const i18n = useI18n();
|
|
|
|
|
|
@@ -741,12 +742,15 @@ const sseOnMessage = (ev) => {
|
|
|
// return;
|
|
|
// sse流返回的数据
|
|
|
const res_data = JSON.parse(ev.data);
|
|
|
+ if (res_data.session_id) {
|
|
|
+ emit('updateSessionId', res_data.session_id);
|
|
|
+ }
|
|
|
//sse流式结束
|
|
|
if (res_data.event === 'message_end') {
|
|
|
stopStream();
|
|
|
}
|
|
|
//sse错误,显示错误信息
|
|
|
- if (res_data.event === 'error') {
|
|
|
+ if (res_data.event === 'error' || res_data.message === 'error') {
|
|
|
handleChatRequestionException({
|
|
|
message: res_data.error
|
|
|
});
|