Skip to content

Commit 1c1cbab

Browse files
author
Daniel Lorch
committed
chore: use custom_prompt_lambda_arn parameter
1 parent bc90cd6 commit 1c1cbab

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

plugins/dynamic-few-shot-lambda/notebooks/step3_extraction_with_dynamic_few_shot.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"- Handle errors and monitor performance\n",
1515
"\n",
1616
"**Prerequisites:**\n",
17-
"- Completed Step 2 (Classification)\n",
17+
"- Completed Step 2 (Classification) (`notebooks/fewshot_dataset_import.ipynb`)\n",
1818
"- AWS Lambda permissions to create/invoke functions\n",
1919
"- 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",
2121
"\n",
2222
"**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."
2424
]
2525
},
2626
{
@@ -71,7 +71,7 @@
7171
"outputs": [],
7272
"source": [
7373
"# 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",
7575
"\n",
7676
"# Load document object from JSON\n",
7777
"document_path = classification_data_dir / \"document.json\"\n",
@@ -174,12 +174,12 @@
174174
"source": [
175175
"# Create configuration WITHOUT dynamic few-shot Lambda\n",
176176
"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",
179179
"\n",
180180
"print(\"=== DEFAULT EXTRACTION CONFIGURATION ===\")\n",
181181
"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",
183183
"\n",
184184
"# Create extraction service with default config\n",
185185
"extraction_service_default = extraction.ExtractionService(config=config_default)\n",
@@ -259,7 +259,7 @@
259259
"if DYNAMIC_FEW_SHOT_LAMBDA_ARN:\n",
260260
" # Create configuration WITH dynamic few-shot Lambda\n",
261261
" 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",
263263
" \n",
264264
" print(\"=== DYNAMIC FEW-SHOT EXTRACTION CONFIGURATION ===\")\n",
265265
" print(f\"Model: {config_few_shot.get('extraction', {}).get('model')}\")\n",

0 commit comments

Comments
 (0)