The basic issue is that complex Prompt fields can confuse Textract.
Textract's Query features do not use an LLM, so your verbose Prompt is confusing Textract to the point that it actually returns no data.
Workaround 1
The qbo4.Document.Amazon.TextractService does provide a hook to "bridge" this gap: it will only use the first line of a prompt.
So, the simple workaround is to ensure the first line of your prompt is "simple.
E.g., instead of:
- Item: APN/Parcel ID
- Prompt:
Extract the APN / PARCEL ID.
Rules:
- Labels: “APN”, “Parcel No.”, “Tax ID”.
- Preserve dashes/format.
Ensure LLM-intended words are not in the first sentence:
APN / PARCEL ID
Extract the APN / Parcel ID using these rules:
- Labels: “APN”, “Parcel No.”, “Tax ID”.
- Preserve dashes/format."
The qbo4.Document.TextractService will only use the first line of a prompt.
Robust workaround:
Workaround 2
If the conflict between LLM prompting and Textract prompting proves too difficult, you can create different ScoreTemplates:
- 1 using
AIScoreEngine, and
- the other using
TextractEngine.
You lost the simplicity of a Composite engine composing the results of multiple engines with a single template, but you get precise prompting for each engine.