|
23 | 23 | "metadata": {},
|
24 | 24 | "outputs": [],
|
25 | 25 | "source": [
|
26 |
| - "%pip install -r requirements.txt" |
| 26 | + "%pip install -r ../requirements.txt" |
27 | 27 | ]
|
28 | 28 | },
|
29 | 29 | {
|
|
85 | 85 | "cell_type": "markdown",
|
86 | 86 | "metadata": {},
|
87 | 87 | "source": [
|
88 |
| - "## 3. Configure Azure AI Service Settings\n", |
| 88 | + "## 3. Configure Azure AI Service Settings and Prepare the Sample\n", |
89 | 89 | "\n",
|
90 | 90 | "Update these settings to match your Azure environment:\n",
|
91 | 91 | "\n",
|
92 |
| - "- **azure_ai_service_endpoint**: Your Azure AI service endpoint URL\n", |
93 |
| - "- **subscription_key**: Your subscription key (optional if using token authentication)\n", |
94 |
| - "- **file_location**: Path to the PDF document you want to process" |
| 92 | + "- **AZURE_AI_ENDPOINT**: Your Azure AI service endpoint URL or set up in \".env\" file\n", |
| 93 | + "- **AZURE_AI_API_VERSION**: The Azure AI API version to use. Default is \"2025-05-01-preview\". \n", |
| 94 | + "- **SUBSCRIPTION_KEY**: Your subscription key (optional if using token authentication)\n", |
| 95 | + "- **ANALYZER_SAMPLE_FILE**: Path to the PDF document you want to process" |
95 | 96 | ]
|
96 | 97 | },
|
97 | 98 | {
|
|
102 | 103 | "source": [
|
103 | 104 | "AZURE_AI_ENDPOINT = os.getenv(\"AZURE_AI_ENDPOINT\")\n",
|
104 | 105 | "AZURE_AI_API_VERSION = os.getenv(\"AZURE_AI_API_VERSION\", \"2025-05-01-preview\")\n",
|
105 |
| - "ANALYZER_SAMPLE_FILE = '../data/MS_Annual_Report_2024.pdf' # Update this path to your PDF file\n", |
106 |
| - "\n", |
107 |
| - "file_location = Path(ANALYZER_SAMPLE_FILE)\n", |
| 106 | + "ANALYZER_SAMPLE_FILE = \"../data/MS_Annual_Report_2024.pdf\" # Update this path to your PDF file\n", |
108 | 107 | "\n",
|
109 | 108 | "# For authentication, you can use either token-based auth or subscription key, and only one of them is required\n",
|
| 109 | + "# IMPORTANT: Replace with your actual subscription key if not using token auth\n", |
| 110 | + "SUBSCRIPTION_KEY = \"dummy_key\"\n", |
110 | 111 | "\n",
|
111 | 112 | "# Authentication - Using DefaultAzureCredential for token-based auth\n",
|
112 | 113 | "credential = DefaultAzureCredential()\n",
|
113 | 114 | "token_provider = get_bearer_token_provider(credential, \"https://cognitiveservices.azure.com/.default\")\n",
|
114 | 115 | "\n",
|
115 |
| - "# IMPORTANT: Replace with your actual subscription key if not using token auth\n", |
116 |
| - "subscription_key = \"dummy_key\"\n", |
| 116 | + "file_location = Path(ANALYZER_SAMPLE_FILE)\n", |
117 | 117 | "\n",
|
118 | 118 | "print(\"📋 Configuration Summary:\")\n",
|
119 | 119 | "print(f\" Endpoint: {AZURE_AI_ENDPOINT}\")\n",
|
|
188 | 188 | " # IMPORTANT: Comment out token_provider if using subscription key\n",
|
189 | 189 | " token_provider=token_provider,\n",
|
190 | 190 | " # IMPORTANT: Uncomment this if using subscription key\n",
|
191 |
| - " # subscription_key=subscription_key\n", |
| 191 | + " # subscription_key=SUBSCRIPTION_KEY\n", |
192 | 192 | " )\n",
|
193 | 193 | " print(\"✅ Content Understanding client initialized successfully!\")\n",
|
194 | 194 | " print(\" Ready to create classifiers and analyzers.\")\n",
|
|
0 commit comments