azure-search-openai-demo
azure-search-openai-demo copied to clipboard
add page to upload files
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)
Seems like this is one of those features that should be considered critical. Why has this not been lifted / merged?
{'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 ?
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
My colleague who has admin permissions got this running. I am unable to delete my comment.
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
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.'}]
Yes, I didn't have admin permissions at the time. I should have had blob upload permissions, but I am not 100% sure.
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
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
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed.
@pamelafox looking at building my own UI upload solution but wanted to see if there's an estimate for an 'official' feature?
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).
Update: Now that #1395 is nearing mergability, I am closing this PR. Thanks so much for the contribution!