azure-search-openai-demo icon indicating copy to clipboard operation
azure-search-openai-demo copied to clipboard

add page to upload files

Open lordlinus opened this issue 1 year ago • 8 comments

Purpose

Add page to upload PDF files directly from the UI instead of running separate script

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
azd up
cd app
run start.cmd or start.sh
go to http://127.0.0.1:5000/#/ul
upload the PDF files from the repository data directory
  • Test the code

Manual test

check console for success of file upload and index status

What to Check

Verify that the following are valid:

  • check the chat and ask your data is working as expected

Other Information

UI page could make use of status message better (need help on react code to update progress for long running jobs)

lordlinus avatar Mar 21 '23 04:03 lordlinus

Seems like this is one of those features that should be considered critical. Why has this not been lifted / merged?

sigglep avatar May 16 '23 14:05 sigglep

{'error': 'This request is not authorized to perform this operation using this permission.\nRequestId:36f8347b-b01e-0065-4ba2-8dc669000000\nTime:2023-05-23T18:17:38.0661381Z\nErrorCode:AuthorizationPermissionMismatch\nContent: <Error><Code>AuthorizationPermissionMismatch</Code><Message>This request is not authorized to perform this operation using this permission.\nRequestId:36f8347b-b01e-0065-4ba2-8dc669000000\nTime:2023-05-23T18:17:38.0661381Z</Message></Error>'}

I get his @lordlinus how do you handle connection to blob storage here ?

itmilos avatar May 23 '23 18:05 itmilos

Hello,

Has this branch got stale? At least I didn't manage to upload files.

Exception has occurred: HttpResponseError () The request is invalid. Details: parameters : The property 'category' does not exist on type 'search.documentFields'. Make sure to only use property names that are defined by the type. Code: Message: The request is invalid. Details: parameters : The property 'category' does not exist on type 'search.documentFields'. Make sure to only use property names that are defined by the type. File "/workspaces/azure-search-openai-demo/app/backend/indexdocs.py", line 151, in index_sections

image

TimoRiikonen avatar Jun 12 '23 13:06 TimoRiikonen

My colleague who has admin permissions got this running. I am unable to delete my comment.

TimoRiikonenIF avatar Jun 15 '23 06:06 TimoRiikonenIF

doesn't not work for me , even if the UPLOAD_FOLDER variable is mapped to a file storage in the webapp. I can see the file in the storage but the ui always says : "Some files failed to upload" @lordlinus any idea

thanks in advance

superpoussin22 avatar Jun 19 '23 19:06 superpoussin22

think the application need more rights to be able to upload files, meaning that it must be able to add files to blob storage and use index [{'success': False, 'message': '() Authorization failed.\nCode: \nMessage: Authorization failed.'}]

superpoussin22 avatar Jun 20 '23 11:06 superpoussin22

Yes, I didn't have admin permissions at the time. I should have had blob upload permissions, but I am not 100% sure.

TimoRiikonen avatar Jun 20 '23 11:06 TimoRiikonen

the bicep file need to be updated: the app identity (user) must have rights on index (search ) , storage and blob to be able to work :) thoses rights must be added at RG level

what is also good is to set a path to a file share in the storage and set a path to ot on the web app and use a variable to point to it like UPLOAD_FOLDER=/upload so the web server will copy files to the storage then work on it

@TimoRiikonen @lordlinus

superpoussin22 avatar Jun 22 '23 17:06 superpoussin22

Hi, sorry if this is a silly question, but I get an error trying to "azd up" because the "FileUploader.tsx" states on line 6 "Import { uploadApi, UploadFileRequest, UploadFileResponse } from "../../api";

However in app/frontend/src/api/api.ts there are no exports "UploadApi", "UploadFileRequest", "UploadFileResponse".

Has anyone encountered the same issue please?

Many thanks for your help

AIconcepts2023 avatar Jul 08 '23 21:07 AIconcepts2023

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed.

github-actions[bot] avatar Jan 03 '24 01:01 github-actions[bot]

@pamelafox looking at building my own UI upload solution but wanted to see if there's an estimate for an 'official' feature?

ntabernacle avatar Mar 08 '24 09:03 ntabernacle

Per other thread, am working on it now and will aim to send WIP PR today (but it will not have all the components needed).

pamelafox avatar Mar 08 '24 17:03 pamelafox

Update: Now that #1395 is nearing mergability, I am closing this PR. Thanks so much for the contribution!

pamelafox avatar Mar 19 '24 23:03 pamelafox