|
@@ -1,4 +1,4 @@
|
|
-const api_key = 'app-NvKwdHvEK2UmJdmjTGDR0xu6'
|
|
|
|
|
|
+const api_key = 'app-NRQwVZmqF8a1yuhzgB96Ndj1'
|
|
const url = 'http://192.168.2.24/v1'
|
|
const url = 'http://192.168.2.24/v1'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
@@ -37,13 +37,20 @@ export default {
|
|
// var params = {
|
|
// var params = {
|
|
// inputs:{
|
|
// inputs:{
|
|
// fileUrl:'http://192.168.2.24:8803/fileManager/downloadFile?fileId='+this.notice_file.guid,
|
|
// fileUrl:'http://192.168.2.24:8803/fileManager/downloadFile?fileId='+this.notice_file.guid,
|
|
- // patent_fileUrls:JSON.stringify(patent_fileUrls)
|
|
|
|
|
|
+ // patent_fileUrls:JSON.stringify(patent_fileUrls),
|
|
|
|
+ // patent_files:[],
|
|
|
|
+ // changeClaim:this.changeClaim.changeClaim + '',
|
|
|
|
+ // claim:this.changeClaim.claim,
|
|
|
|
+ // near_index:this.changeClaim.near_index,
|
|
|
|
+ // main_claim_reason:JSON.stringify(this.main_claim_reason)
|
|
// },
|
|
// },
|
|
// query:'OA答辩',
|
|
// query:'OA答辩',
|
|
// response_mode:'streaming',
|
|
// response_mode:'streaming',
|
|
// user:this.userinfo.id
|
|
// user:this.userinfo.id
|
|
// }
|
|
// }
|
|
// this.loading = true
|
|
// this.loading = true
|
|
|
|
+ // this.loading_text = ''
|
|
|
|
+ // var loading_text = ''
|
|
// this.result = null
|
|
// this.result = null
|
|
// const response = await fetch('https://ai.xsip.cn/v1/chat-messages', {
|
|
// const response = await fetch('https://ai.xsip.cn/v1/chat-messages', {
|
|
// method: 'POST',
|
|
// method: 'POST',
|
|
@@ -59,7 +66,11 @@ export default {
|
|
confessionSessionId:this.currentConversation.id,
|
|
confessionSessionId:this.currentConversation.id,
|
|
patentFileUrls:JSON.stringify(patent_fileUrls),
|
|
patentFileUrls:JSON.stringify(patent_fileUrls),
|
|
appFileGuid:this.relevant_file.app_file.guid,
|
|
appFileGuid:this.relevant_file.app_file.guid,
|
|
- modifyFileGuid:this.relevant_file.modify_file.guid
|
|
|
|
|
|
+ modifyFileGuid:this.relevant_file.modify_file.guid,
|
|
|
|
+ changeClaim:this.changeClaim.changeClaim + '',
|
|
|
|
+ claim:this.changeClaim.claim,
|
|
|
|
+ nearIndex:this.changeClaim.near_index,
|
|
|
|
+ mainClaimReason:JSON.stringify(this.main_claim_reason)
|
|
}
|
|
}
|
|
this.loading = true
|
|
this.loading = true
|
|
this.loading_text = ''
|
|
this.loading_text = ''
|
|
@@ -103,16 +114,24 @@ export default {
|
|
this.$refs.errorTip.open(answer_json)
|
|
this.$refs.errorTip.open(answer_json)
|
|
}else if(answer_json.code == 200){
|
|
}else if(answer_json.code == 200){
|
|
this.queryConfessionSession(false,false,true)
|
|
this.queryConfessionSession(false,false,true)
|
|
- }else if(answer_json.code == 1003){
|
|
|
|
|
|
+ }else if(answer_json.code == 1003){//中间过程
|
|
this.loading_text = answer_json.data
|
|
this.loading_text = answer_json.data
|
|
loading_text = answer_json.data
|
|
loading_text = answer_json.data
|
|
|
|
+ }else if(answer_json.code == 1002){//请求超时
|
|
|
|
+ this.result = answer_json
|
|
|
|
+ }else if(answer_json.code == 201){//修改后的权利要求输出
|
|
|
|
+ this.result = answer_json
|
|
|
|
+ this.$set(this.changeClaim,'claim',answer_json.data)
|
|
|
|
+ }else if(answer_json.code == 202){//区别技术特征
|
|
|
|
+ this.result = answer_json
|
|
|
|
+ this.$set(this,'main_claim_reason',answer_json.data)
|
|
}
|
|
}
|
|
}catch(e){
|
|
}catch(e){
|
|
if(loading_text!=''){
|
|
if(loading_text!=''){
|
|
loading_text = ''
|
|
loading_text = ''
|
|
this.loading_text = ''
|
|
this.loading_text = ''
|
|
}
|
|
}
|
|
- this.result += answer;
|
|
|
|
|
|
+ this.result += answer.replace(/\n|\\n|\\\n|\\\\n/g,'<br>');
|
|
}
|
|
}
|
|
|
|
|
|
}else if(json.event == 'message_replace'){
|
|
}else if(json.event == 'message_replace'){
|
|
@@ -135,20 +154,26 @@ export default {
|
|
if(answer_json.code == 1001){//缺少专利文件
|
|
if(answer_json.code == 1001){//缺少专利文件
|
|
this.result = answer_json
|
|
this.result = answer_json
|
|
this.$refs.errorTip.open(answer_json)
|
|
this.$refs.errorTip.open(answer_json)
|
|
- }else if(answer_json.code == 1001){//请求超时
|
|
|
|
|
|
+ }else if(answer_json.code == 1002){//请求超时
|
|
this.result = answer_json
|
|
this.result = answer_json
|
|
}else if(answer_json.code == 200){
|
|
}else if(answer_json.code == 200){
|
|
this.queryConfessionSession(false,false,true)
|
|
this.queryConfessionSession(false,false,true)
|
|
- }else if(answer_json.code == 1003){
|
|
|
|
|
|
+ }else if(answer_json.code == 1003){//中间过程
|
|
this.loading_text = answer_json.data
|
|
this.loading_text = answer_json.data
|
|
loading_text = answer_json.data
|
|
loading_text = answer_json.data
|
|
|
|
+ }else if(answer_json.code == 201){//修改后的权利要求输出
|
|
|
|
+ this.result = answer_json
|
|
|
|
+ this.$set(this.changeClaim,'claim',answer_json.data)
|
|
|
|
+ }else if(answer_json.code == 202){//区别技术特征
|
|
|
|
+ this.result = answer_json
|
|
|
|
+ this.$set(this,'main_claim_reason',answer_json.data)
|
|
}
|
|
}
|
|
}catch(e){
|
|
}catch(e){
|
|
if(loading_text!=''){
|
|
if(loading_text!=''){
|
|
loading_text = ''
|
|
loading_text = ''
|
|
this.loading_text = ''
|
|
this.loading_text = ''
|
|
}
|
|
}
|
|
- this.result += answer;
|
|
|
|
|
|
+ this.result += answer.replace(/\n|\\n|\\\n|\\\\n/g,'<br>');
|
|
}
|
|
}
|
|
}else if(json.event == 'message_replace'){
|
|
}else if(json.event == 'message_replace'){
|
|
this.result = json.answer
|
|
this.result = json.answer
|
|
@@ -175,7 +200,7 @@ export default {
|
|
},
|
|
},
|
|
//格式化AI答复
|
|
//格式化AI答复
|
|
formateAIAnswer(chat){
|
|
formateAIAnswer(chat){
|
|
- let answer = chat.replace('null','')
|
|
|
|
|
|
+ let answer = chat.replace('null','').replace(/<br>/gi, '</p><p>').replace(/^<p>|<\/p>$/gi, '')
|
|
|
|
|
|
// let regx1 = /<think>[\s\S]*<\/think>/g
|
|
// let regx1 = /<think>[\s\S]*<\/think>/g
|
|
// let regx2 = /<details style="color:gray;background-color: #f8f8f8;padding: 8px;border-radius: 4px;" open> <summary> Thinking... <\/summary>[\s\S]*<\/details>/g
|
|
// let regx2 = /<details style="color:gray;background-color: #f8f8f8;padding: 8px;border-radius: 4px;" open> <summary> Thinking... <\/summary>[\s\S]*<\/details>/g
|