Skip to content

Commit db92334

Browse files
author
Daniel Lorch
committed
feat: add few-shot-lambda to configuration schema
1 parent 2fb8dc3 commit db92334

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/idp_common_pkg/idp_common/config/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ class ExtractionConfig(BaseModel):
115115
custom_prompt_lambda_arn: Optional[str] = Field(
116116
default=None, description="ARN of custom prompt Lambda"
117117
)
118+
dynamic_few_shot_lambda_arn: Optional[str] = Field(
119+
default=None, description="ARN of Lambda to provide dynamic few-shot document examples with ground truth data"
120+
)
118121

119122
@field_validator("temperature", "top_p", "top_k", mode="before")
120123
@classmethod

patterns/pattern-2/template.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,10 @@ Resources:
10081008
type: string
10091009
description: "(Optional) ARN of a Lambda function to generate custom extraction prompts. Function name must start with 'GENAIIDP-'. If not provided, default prompts will be used. The Lambda function receives the complete config, prompt placeholders, default task prompt content, and serialized document, and returns custom system_prompt and task_prompt_content. Example: arn:${AWS::Partition}:lambda:us-east-1:123456789012:function:GENAIIDP-my-extractor"
10101010
order: 8
1011+
dynamic_few_shot_lambda_arn:
1012+
type: string
1013+
description: !Sub "(Optional) ARN of Lambda to provide dynamic few-shot document examples with ground truth data. Function name must start with 'GENAIIDP-'. If not provided, few-shot examples from config are used. The Lambda function receives the class label, document texts and base64 encoded images, and returns images with expected attributes. Example: arn:${AWS::Partition}:lambda:us-east-1:123456789012:function:GENAIIDP-dynamic-few-shot-examples"
1014+
order: 9
10111015
assessment:
10121016
order: 5
10131017
type: object

0 commit comments

Comments
 (0)