@@ -134,7 +134,10 @@ export default defineComponent({
const sendChat = ()=>{
if(!data.chatContent)return
data.loadingShow = true
- Https.axiosGet(Https.httpUrls.chatCreateProject, {params:{prompt:data.chatContent,process:data.selectFlow.value}}).then((rv)=>{
+ let fileList = JSON.parse(JSON.stringify(data.filList))
+ let fileUrl = (fileList.filter((item:any)=>item.type == 'file').length > 0) ? fileList.filter((item:any)=>item.type == 'file')[0].minioPath : ''
+ let imageUrlList = (fileList.filter((item:any)=>item.type == 'image').length > 0)? fileList.filter((item:any)=>item.type == 'image').map((item:any)=>item.minioPath).join(',') : ''
+ Https.axiosGet(Https.httpUrls.chatCreateProject, {params:{prompt:data.chatContent,process:data.selectFlow.value,fileUrl:fileUrl,imageUrlList}}).then((rv)=>{
if(rv){
data.loadingShow = false
router.push(`home?history=${rv}`)
@@ -188,9 +191,13 @@ export default defineComponent({
}
Https.axiosPost(Https.httpUrls.llmUploadFile,formData,config)
.then((rv: any) => {
- rv.name = event.target.files[0].name
- rv.type = type?'image':'file'
- data.filList.push(rv)
+ let obj = {
+ name:event.target.files[0].name,
+ type:type?'image':'file',
+ minioPath:rv[0],
+ url:rv[1],
+ }
+ data.filList.push(obj)
data.loadingShow = false
}
).catch(rv=>{