File tree Expand file tree Collapse file tree 4 files changed +17
-8
lines changed
components/ai-chat/component/chat-input-operate Expand file tree Collapse file tree 4 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -401,6 +401,10 @@ const postUploadFile: (
401401 return post ( `/oss/file` , fd , undefined , loading )
402402}
403403
404+
405+ const getFile : ( application_id : string , params : any ) => Promise < Result < any > > = ( application_id , params ) => {
406+ return get ( `/oss/get_url/${ application_id } ` , params )
407+ }
404408export default {
405409 getAllApplication,
406410 getApplication,
@@ -430,5 +434,6 @@ export default {
430434 postUploadFile,
431435 generate_prompt,
432436 getTokenUsage,
433- topQuestions
437+ topQuestions,
438+ getFile
434439}
Original file line number Diff line number Diff line change @@ -332,6 +332,10 @@ const postUploadFile: (
332332 fd . append ( 'source_type' , sourceType )
333333 return post ( `/oss/file` , fd , undefined , loading )
334334}
335+
336+ const getFile : ( application_id : string , params : any ) => Promise < Result < any > > = ( application_id , params ) => {
337+ return get ( `/oss/get_url/${ application_id } ` , params )
338+ }
335339export default {
336340 open,
337341 chat,
@@ -362,4 +366,5 @@ export default {
362366 clearChat,
363367 modifyChat,
364368 postUploadFile,
369+ getFile
365370}
Original file line number Diff line number Diff line change @@ -10,10 +10,6 @@ const postImage: (data: any) => Promise<Result<any>> = (data) => {
1010 return post ( `${ prefix } ` , data )
1111}
1212
13- const getFile : ( application_id : string , params : any ) => Promise < Result < any > > = ( application_id , params ) => {
14- return get ( `/oss/get_url/${ application_id } ` , params )
15- }
1613export default {
17- postImage,
18- getFile
14+ postImage
1915}
Original file line number Diff line number Diff line change @@ -419,7 +419,6 @@ import bus from '@/bus'
419419import ' recorder-core/src/engine/mp3'
420420import ' recorder-core/src/engine/mp3-engine'
421421import chatAPI from ' @/api/chat/chat'
422- import imageApi from ' @/api/image'
423422
424423const router = useRouter ()
425424const route = useRoute ()
@@ -1238,7 +1237,11 @@ async function saveUrl() {
12381237 async function processUrl(url : string ) {
12391238 try {
12401239 const appId = props .appId || props .applicationDetails ?.id ;
1241- const res = await imageApi .getFile (appId , {url })
1240+ const res =
1241+ props .type === ' debug-ai-chat'
1242+ ? await applicationApi .getFile (appId , {url })
1243+ : await chatAPI .getFile (appId , {url })
1244+
12421245 if (res .data [' status_code' ] !== 200 ) {
12431246 MsgWarning (url + ' ' + t (' chat.uploadFile.invalidUrl' ));
12441247 return ;
You can’t perform that action at this time.
0 commit comments