|
14 | 14 | "- Handle errors and monitor performance\n", |
15 | 15 | "\n", |
16 | 16 | "**Prerequisites:**\n", |
17 | | - "- Completed Step 2 (Classification)\n", |
| 17 | + "- Completed Step 2 (Classification) (`notebooks/fewshot_dataset_import.ipynb`)\n", |
18 | 18 | "- AWS Lambda permissions to create/invoke functions\n", |
19 | 19 | "- Dynamic few-shot Lambda function deployed\n", |
20 | | - "- S3 Vectors index populated with examples (`notebooks/misc/fewshot_dataset_import.ipynb`)\n", |
| 20 | + "- S3 Vectors index populated with examples (`notebooks/fewshot_dataset_import.ipynb`)\n", |
21 | 21 | "\n", |
22 | 22 | "**Key Feature:**\n", |
23 | | - "The `dynamic_few_shot_lambda_arn` configuration field allows you to dynamically retrieve similar examples using S3 Vectors similarity search to improve extraction accuracy through few-shot prompting." |
| 23 | + "The `custom_prompt_lambda_arn` configuration field allows you to dynamically retrieve similar examples using S3 Vectors similarity search to improve extraction accuracy through few-shot prompting." |
24 | 24 | ] |
25 | 25 | }, |
26 | 26 | { |
|
71 | 71 | "outputs": [], |
72 | 72 | "source": [ |
73 | 73 | "# Load document from previous step\n", |
74 | | - "classification_data_dir = Path(\".data/step2_classification\")\n", |
| 74 | + "classification_data_dir = Path(\"../../../notebooks/examples/.data/step2_classification\")\n", |
75 | 75 | "\n", |
76 | 76 | "# Load document object from JSON\n", |
77 | 77 | "document_path = classification_data_dir / \"document.json\"\n", |
|
174 | 174 | "source": [ |
175 | 175 | "# Create configuration WITHOUT dynamic few-shot Lambda\n", |
176 | 176 | "config_default = CONFIG.copy()\n", |
177 | | - "if 'dynamic_few_shot_lambda_arn' in config_default.get('extraction', {}):\n", |
178 | | - " del config_default['extraction']['dynamic_few_shot_lambda_arn']\n", |
| 177 | + "if 'custom_prompt_lambda_arn' in config_default.get('extraction', {}):\n", |
| 178 | + " del config_default['extraction']['custom_prompt_lambda_arn']\n", |
179 | 179 | "\n", |
180 | 180 | "print(\"=== DEFAULT EXTRACTION CONFIGURATION ===\")\n", |
181 | 181 | "print(f\"Model: {config_default.get('extraction', {}).get('model')}\")\n", |
182 | | - "print(f\"Dynamic Few-Shot Lambda: {config_default.get('extraction', {}).get('dynamic_few_shot_lambda_arn', 'None')}\")\n", |
| 182 | + "print(f\"Dynamic Few-Shot Lambda: {config_default.get('extraction', {}).get('custom_prompt_lambda_arn', 'None')}\")\n", |
183 | 183 | "\n", |
184 | 184 | "# Create extraction service with default config\n", |
185 | 185 | "extraction_service_default = extraction.ExtractionService(config=config_default)\n", |
|
259 | 259 | "if DYNAMIC_FEW_SHOT_LAMBDA_ARN:\n", |
260 | 260 | " # Create configuration WITH dynamic few-shot Lambda\n", |
261 | 261 | " config_few_shot = CONFIG.copy()\n", |
262 | | - " config_few_shot['extraction']['dynamic_few_shot_lambda_arn'] = DYNAMIC_FEW_SHOT_LAMBDA_ARN\n", |
| 262 | + " config_few_shot['extraction']['custom_prompt_lambda_arn'] = DYNAMIC_FEW_SHOT_LAMBDA_ARN\n", |
263 | 263 | " \n", |
264 | 264 | " print(\"=== DYNAMIC FEW-SHOT EXTRACTION CONFIGURATION ===\")\n", |
265 | 265 | " print(f\"Model: {config_few_shot.get('extraction', {}).get('model')}\")\n", |
|
0 commit comments