Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@

@bp.route("/")
async def index():
# TODO: use msal loginRedirect on a blankish page
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to remove this TODO in the built-in auth PR but forgot to push the removal commit before merging. This TODO isn't actually needed, since built-in auth works.

return await bp.send_static_file("index.html")


Expand Down
7 changes: 5 additions & 2 deletions app/backend/prepdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ async def main(strategy: Strategy, setup_index: bool = True):

if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Prepare documents by extracting content from PDFs, splitting content into sections, uploading to blob storage, and indexing in a search index.",
epilog="Example: prepdocs.py '.\\data\*' -v",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This epilog causes a SyntaxWarning in Python 3.12, and also isnt entirely accurate. The docs for data ingestion are the most accurate.

description="Prepare documents by extracting content from PDFs, splitting content into sections, uploading to blob storage, and indexing in a search index."
)
parser.add_argument("files", nargs="?", help="Files to be processed")

Expand Down Expand Up @@ -302,6 +301,10 @@ async def main(strategy: Strategy, setup_index: bool = True):

load_azd_env()

if os.getenv("AZURE_PUBLIC_NETWORK_ACCESS") == "Disabled":
logger.error("AZURE_PUBLIC_NETWORK_ACCESS is set to Disabled. Exiting.")
exit(0)

use_int_vectorization = os.getenv("USE_FEATURE_INT_VECTORIZATION", "").lower() == "true"
use_gptvision = os.getenv("USE_GPT4V", "").lower() == "true"
use_acls = os.getenv("AZURE_ADLS_GEN2_STORAGE_ACCOUNT") is not None
Expand Down
8 changes: 0 additions & 8 deletions scripts/prepdocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@

echo 'Running "prepdocs.py"'

AZURE_USE_AUTHENTICATION=$(azd env get-value AZURE_PUBLIC_NETWORK_ACCESS)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prepdocs.ps1 was already missing this check, so we just remove it from sh and add it to prepdocs.py.

AZURE_PUBLIC_NETWORK_ACCESS=$(azd env get-value AZURE_PUBLIC_NETWORK_ACCESS)

if [ -n "$AZURE_USE_AUTHENTICATION" ] && [ "$AZURE_PUBLIC_NETWORK_ACCESS" = "Disabled" ]; then
echo "AZURE_PUBLIC_NETWORK_ACCESS is set to Disabled. Exiting."
exit 0
fi

additionalArgs=""
if [ $# -gt 0 ]; then
additionalArgs="$@"
Expand Down