my-aws-helpers 3.0.0.dev2__tar.gz → 3.0.0.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of my-aws-helpers might be problematic. Click here for more details.
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/PKG-INFO +1 -1
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/bedrock.py +13 -5
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/prompts/transactions_headers_prompt.txt +2 -8
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/prompts/transactions_prompt.txt +1 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers.egg-info/PKG-INFO +1 -1
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/setup.py +1 -1
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/MANIFEST.in +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/README.md +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/api.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/auth.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/cognito.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/dynamo.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/errors.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/event.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/logging.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/prompts/__init__.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/prompts/markdown_system_prompt.txt +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/s3.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers/sfn.py +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers.egg-info/SOURCES.txt +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers.egg-info/dependency_links.txt +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers.egg-info/requires.txt +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers.egg-info/top_level.txt +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers.egg-info/zip-safe +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/setup.cfg +0 -0
- {my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/tests/test_event.py +0 -0
|
@@ -183,15 +183,23 @@ class Bedrock:
|
|
|
183
183
|
except Exception as e:
|
|
184
184
|
self.logger.error(f"Could not get pix map for page {i}")
|
|
185
185
|
continue
|
|
186
|
+
header_ocr_result = None
|
|
186
187
|
if len(image_bytes_list) > 1:
|
|
187
188
|
headers_prompt = self._get_prompt(prompt_type=PromptType.transaction_headers.value)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
self.
|
|
191
|
-
|
|
189
|
+
for i in range(2):
|
|
190
|
+
# try to get headers from the first or second page
|
|
191
|
+
header_ocr_result = self._ocr(prompt=headers_prompt, image_bytes=image_bytes_list[i])
|
|
192
|
+
if header_ocr_result is None:
|
|
193
|
+
self.logger.info(f"No ocr result returned when getting headers {PromptType.transaction_headers.value}")
|
|
194
|
+
headers = header_ocr_result.content.get("headers")
|
|
195
|
+
if (len(headers) < 1) or (headers is None):
|
|
196
|
+
continue
|
|
197
|
+
else:
|
|
198
|
+
break
|
|
192
199
|
|
|
193
200
|
transactions_prompt = self._get_prompt(prompt_type=prompt_type)
|
|
194
|
-
|
|
201
|
+
if header_ocr_result:
|
|
202
|
+
transactions_prompt = transactions_prompt.replace("#### TABLE HEADERS ####", json.dumps(header_ocr_result.content))
|
|
195
203
|
|
|
196
204
|
self.logger.info("Got Prompt")
|
|
197
205
|
results = list()
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
You are an intelligent document and image interpreter.
|
|
2
2
|
|
|
3
|
-
Your task is to analyze the provided image and extract
|
|
3
|
+
Your task is to analyze the provided image and extract the headers of a table that contains transactions.
|
|
4
4
|
|
|
5
5
|
## Output Requirements
|
|
6
6
|
|
|
7
7
|
- Return **only valid JSON**.
|
|
8
8
|
- If the image contains one or more **tables**, use only the transactions table represent the headers as a JSON object.
|
|
9
|
-
-
|
|
10
|
-
- if the table headers are not present use:
|
|
11
|
-
#### TABLE HEADERS ####
|
|
12
|
-
- if i have just told you to use "TABLE HEADERS", ignore that instruction
|
|
13
|
-
- if there are multiple sections, only include the row data in transactions
|
|
14
|
-
- Every row should have the consistent headers
|
|
9
|
+
- **If there is no table containing transactions, return an empty array for the headers**
|
|
15
10
|
- **Do not fabricate** values not visible in the image
|
|
16
|
-
- if a descripion contains 2 lines of text, only include the most important text and the text should reside in 1 key in json response, do not split it
|
|
17
11
|
- Do not return anything except the json content
|
|
18
12
|
|
|
19
13
|
## Example
|
|
@@ -9,6 +9,7 @@ Your task is to analyze the provided image and extract all meaningful data as st
|
|
|
9
9
|
- Use **the table headers as keys**.
|
|
10
10
|
- if the table headers are not present use:
|
|
11
11
|
#### TABLE HEADERS ####
|
|
12
|
+
- if i have just told you to use "TABLE HEADERS", ignore that instruction
|
|
12
13
|
- if there are multiple sections, only include the row data in transactions
|
|
13
14
|
- Every row should have the consistent headers
|
|
14
15
|
- If content is unclear, use: `"[Unclear]"`.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers.egg-info/requires.txt
RENAMED
|
File without changes
|
{my_aws_helpers-3.0.0.dev2 → my_aws_helpers-3.0.0.dev4}/my_aws_helpers.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|