-
Notifications
You must be signed in to change notification settings - Fork 41
Review main-notebooks/management.ipynb
#125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ | |
| "metadata": {}, | ||
| "source": [ | ||
| "## Prerequisites\n", | ||
| "1. Ensure your Azure AI service is configured following the [configuration steps](../README.md#configure-azure-ai-service-resource).\n", | ||
| "1. Please ensure your Azure AI service is configured by following the [configuration steps](../README.md#configure-azure-ai-service-resource).\n", | ||
| "2. Install the required packages to run this sample." | ||
| ] | ||
| }, | ||
|
|
@@ -40,12 +40,12 @@ | |
| "\n", | ||
| "> The [AzureContentUnderstandingClient](../python/content_understanding_client.py) is a utility class that provides functions to interact with the Content Understanding API. Before the official release of the Content Understanding SDK, this client serves as a lightweight SDK.\n", | ||
| "\n", | ||
| "> Fill the constants **AZURE_AI_ENDPOINT**, **AZURE_AI_API_VERSION**, and **AZURE_AI_API_KEY** with your Azure AI Service details.\n", | ||
| "> Please fill the constants **AZURE_AI_ENDPOINT**, **AZURE_AI_API_VERSION**, and **AZURE_AI_API_KEY** with your Azure AI Service details.\n", | ||
| "\n", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "> ⚠️ Important:\n", | ||
| "Update the code below to match your Azure authentication method.\n", | ||
| "Look for the `# IMPORTANT` comments and modify those sections accordingly.\n", | ||
| "If you skip this step, the sample might not run correctly.\n", | ||
| "Skipping this step might cause the sample not to run correctly.\n", | ||
| "\n", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "> ⚠️ Note: Using a subscription key works, but using Azure Active Directory (AAD) token-based authentication is more secure and highly recommended for production environments." | ||
| ] | ||
|
|
@@ -112,20 +112,21 @@ | |
| "source": [ | ||
| "## Configure Model Deployments for Prebuilt Analyzers\n", | ||
| "\n", | ||
| "> **💡 Note:** This step is only required **once per Azure Content Understanding resource**, unless the GPT deployment has been changed. You can skip this section if:\n", | ||
| "> **💡 Note:** This step is required **only once per Azure Content Understanding resource**, unless the GPT deployment has been changed.\n", | ||
| "You can skip this section if:\n", | ||
| "> - This configuration has already been run once for your resource, or\n", | ||
| "> - Your administrator has already configured the model deployments for you\n", | ||
| "> - Your administrator has already configured the model deployments for you.\n", | ||
| "\n", | ||
| "Before using prebuilt analyzers, you need to configure the default model deployment mappings. This tells Content Understanding which model deployments to use.\n", | ||
| "Before using prebuilt analyzers, please configure the default model deployment mappings. This tells Content Understanding which model deployments to use.\n", | ||
| "\n", | ||
| "**Model Requirements:**\n", | ||
| "- **GPT-4.1** - Required for most prebuilt analyzers (e.g., `prebuilt-invoice`, `prebuilt-receipt`, `prebuilt-idDocument`)\n", | ||
| "- **GPT-4.1-mini** - Required for RAG analyzers (e.g., `prebuilt-documentSearch`, `prebuilt-audioSearch`, `prebuilt-videoSearch`)\n", | ||
| "- **text-embedding-3-large** - Required for all prebuilt analyzers that use embeddings\n", | ||
| "- **GPT-4.1** - Required for most prebuilt analyzers (e.g., `prebuilt-invoice`, `prebuilt-receipt`, `prebuilt-idDocument`).\n", | ||
| "- **GPT-4.1-mini** - Required for RAG analyzers (e.g., `prebuilt-documentSearch`, `prebuilt-audioSearch`, `prebuilt-videoSearch`).\n", | ||
| "- **text-embedding-3-large** - Required for all prebuilt analyzers that use embeddings.\n", | ||
| "\n", | ||
| "**Prerequisites:**\n", | ||
| "1. Deploy **GPT-4.1**, **GPT-4.1-mini**, and **text-embedding-3-large** models in Azure AI Foundry\n", | ||
| "2. Set `GPT_4_1_DEPLOYMENT`, `GPT_4_1_MINI_DEPLOYMENT`, and `TEXT_EMBEDDING_3_LARGE_DEPLOYMENT` in your `.env` file with the deployment names" | ||
| "1. Deploy **GPT-4.1**, **GPT-4.1-mini**, and **text-embedding-3-large** models in Azure AI Foundry.\n", | ||
| "2. Set environment variables `GPT_4_1_DEPLOYMENT`, `GPT_4_1_MINI_DEPLOYMENT`, and `TEXT_EMBEDDING_3_LARGE_DEPLOYMENT` in your `.env` file with the respective deployment names." | ||
| ] | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }, | ||
| { | ||
|
|
@@ -154,12 +155,12 @@ | |
| " print(f\" - {deployment}\")\n", | ||
| " print(\"\\n Prebuilt analyzers require GPT-4.1, GPT-4.1-mini, and text-embedding-3-large deployments.\")\n", | ||
| " print(\" Please:\")\n", | ||
| " print(\" 1. Deploy all three models in Azure AI Foundry\")\n", | ||
| " print(\" 1. Deploy all three models in Azure AI Foundry.\")\n", | ||
| " print(\" 2. Add the following to notebooks/.env:\")\n", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| " print(\" GPT_4_1_DEPLOYMENT=<your-gpt-4.1-deployment-name>\")\n", | ||
| " print(\" GPT_4_1_MINI_DEPLOYMENT=<your-gpt-4.1-mini-deployment-name>\")\n", | ||
| " print(\" TEXT_EMBEDDING_3_LARGE_DEPLOYMENT=<your-text-embedding-3-large-deployment-name>\")\n", | ||
| " print(\" 3. Restart the kernel and run this cell again\")\n", | ||
| " print(\" 3. Restart the kernel and run this cell again.\")\n", | ||
| "else:\n", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| " print(f\"📋 Configuring default model deployments...\")\n", | ||
| " print(f\" GPT-4.1 deployment: {GPT_4_1_DEPLOYMENT}\")\n", | ||
|
|
@@ -181,8 +182,8 @@ | |
| " except Exception as e:\n", | ||
| " print(f\"❌ Failed to configure defaults: {e}\")\n", | ||
| " print(f\" This may happen if:\")\n", | ||
| " print(f\" - One or more deployment names don't exist in your Azure AI Foundry project\")\n", | ||
| " print(f\" - You don't have permission to update defaults\")\n", | ||
| " print(f\" - One or more deployment names don't exist in your Azure AI Foundry project.\")\n", | ||
| " print(f\" - You don't have permission to update defaults.\")\n", | ||
| " raise\n" | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ] | ||
| }, | ||
|
|
@@ -211,7 +212,7 @@ | |
| " for model_name, deployment_name in model_deployments.items():\n", | ||
| " print(f\" {model_name}: {deployment_name}\")\n", | ||
| " else:\n", | ||
| " print(\"\\n No model deployments configured\")\n", | ||
| " print(\"\\n No model deployments configured.\")\n", | ||
| " \n", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "except Exception as e:\n", | ||
| " print(f\"⚠️ Error retrieving defaults: {e}\")\n", | ||
|
|
@@ -224,7 +225,7 @@ | |
| "source": [ | ||
| "## Create a Simple Analyzer\n", | ||
| "\n", | ||
| "> **💡 Note:** This section demonstrates analyzer creation for learning purposes only. For actual invoice field extraction, we recommend using the **`prebuilt-invoice`** analyzer, which is optimized for invoice processing. See the `field_extraction.ipynb` notebook for examples of using prebuilt analyzers.\n", | ||
| "> **💡 Note:** This section demonstrates analyzer creation for learning purposes only. For actual invoice field extraction, we recommend using the **`prebuilt-invoice`** analyzer, which is optimized for invoice processing. Please see the `field_extraction.ipynb` notebook for examples of using prebuilt analyzers.\n", | ||
| "\n", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "First, we create an analyzer from a template to extract invoice fields." | ||
| ] | ||
|
|
@@ -347,7 +348,7 @@ | |
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "After successfully creating an analyzer, you can use it to analyze our input files. You can also list all analyzers available in your resource." | ||
| "After successfully creating an analyzer, you can use it to analyze your input files. You can also list all analyzers available in your resource." | ||
| ] | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }, | ||
| { | ||
|
|
@@ -387,7 +388,7 @@ | |
| "source": [ | ||
| "## Get Analyzer Details by ID\n", | ||
| "\n", | ||
| "Keep track of the analyzer ID when you create it. Use the ID to retrieve detailed analyzer definitions later." | ||
| "Keep track of the analyzer ID when you create it. You can use the ID to retrieve detailed analyzer definitions later." | ||
| ] | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }, | ||
| { | ||
|
|
@@ -414,7 +415,7 @@ | |
| "metadata": {}, | ||
| "source": [ | ||
| "## Delete an Analyzer\n", | ||
| "If you no longer need an analyzer, delete it using its ID." | ||
| "If you no longer need an analyzer, you can delete it using its ID." | ||
| ] | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }, | ||
| { | ||
|
|
@@ -452,4 +453,4 @@ | |
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 2 | ||
| } | ||
| } | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.