my-aws-helpers 6.0.0__tar.gz → 6.0.2__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-6.0.0 → my_aws_helpers-6.0.2}/PKG-INFO +1 -1
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/bedrock.py +6 -4
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/dynamo.py +1 -1
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/s3.py +2 -3
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers.egg-info/PKG-INFO +1 -1
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers.egg-info/requires.txt +3 -3
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/setup.py +2 -2
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/MANIFEST.in +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/README.md +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/api.py +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/auth.py +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/cognito.py +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/errors.py +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/event.py +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/logging.py +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/prompts/__init__.py +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/prompts/markdown_system_prompt.txt +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/prompts/transactions_headers_prompt.txt +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/prompts/transactions_headers_prompt_v2.txt +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/prompts/transactions_prompt.txt +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/sfn.py +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers.egg-info/SOURCES.txt +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers.egg-info/dependency_links.txt +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers.egg-info/top_level.txt +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers.egg-info/zip-safe +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/setup.cfg +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/tests/test_cognito.py +0 -0
- {my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/tests/test_event.py +0 -0
|
@@ -65,12 +65,14 @@ class OCRResult(BaseS3Object):
|
|
|
65
65
|
|
|
66
66
|
@classmethod
|
|
67
67
|
def from_s3_representation(cls, obj: dict) -> OCRResult:
|
|
68
|
-
obj[
|
|
68
|
+
obj["token_usage"] = (TokenUsage.from_dict(obj.get("token_usage", {})),)
|
|
69
69
|
return cls(**obj)
|
|
70
70
|
|
|
71
71
|
def to_s3_representation(self) -> dict:
|
|
72
72
|
obj = copy(vars(self))
|
|
73
|
-
obj[
|
|
73
|
+
obj["token_usage"] = S3Serialiser.object_serialiser(
|
|
74
|
+
obj=vars(obj["token_usage"])
|
|
75
|
+
)
|
|
74
76
|
return S3Serialiser.object_serialiser(obj=obj)
|
|
75
77
|
|
|
76
78
|
def get_save_location(self, bucket_name: str) -> S3Location:
|
|
@@ -123,7 +125,7 @@ class OCRResultQueries(BaseS3Queries):
|
|
|
123
125
|
class Bedrock:
|
|
124
126
|
def __init__(
|
|
125
127
|
self,
|
|
126
|
-
model_id: str = "apac.anthropic.claude-3-5-sonnet-20241022-v2:0"
|
|
128
|
+
model_id: str = "apac.anthropic.claude-3-5-sonnet-20241022-v2:0", # anthropic.claude-sonnet-4-20250514-v1:0
|
|
127
129
|
logger=None,
|
|
128
130
|
sleep_time: float = 1.0,
|
|
129
131
|
):
|
|
@@ -354,7 +356,7 @@ class Bedrock:
|
|
|
354
356
|
|
|
355
357
|
result = {}
|
|
356
358
|
result["content"] = Bedrock.extract_json_from_markdown(
|
|
357
|
-
text
|
|
359
|
+
text=response["output"]["message"]["content"][0]["text"]
|
|
358
360
|
)
|
|
359
361
|
result["token_usage"] = response["usage"]
|
|
360
362
|
return OCRResult.from_dict(data=result)
|
|
@@ -113,7 +113,7 @@ class Dynamo:
|
|
|
113
113
|
return self.table.get_item(Item=item)
|
|
114
114
|
|
|
115
115
|
def delete_item(self, item: dict):
|
|
116
|
-
return self.table.delete_item(
|
|
116
|
+
return self.table.delete_item(Key=item)
|
|
117
117
|
|
|
118
118
|
def batch_put(self, items: List[dict]) -> None:
|
|
119
119
|
with self.table.batch_writer() as batch:
|
|
@@ -112,12 +112,11 @@ class S3:
|
|
|
112
112
|
response = self.client.list_objects_v2(
|
|
113
113
|
Bucket=bucket_name,
|
|
114
114
|
Prefix=prefix,
|
|
115
|
-
ContinuationToken=continuation_token
|
|
115
|
+
ContinuationToken=continuation_token,
|
|
116
116
|
)
|
|
117
117
|
else:
|
|
118
118
|
response = self.client.list_objects_v2(
|
|
119
|
-
Bucket=bucket_name,
|
|
120
|
-
Prefix=prefix
|
|
119
|
+
Bucket=bucket_name, Prefix=prefix
|
|
121
120
|
)
|
|
122
121
|
|
|
123
122
|
# Append current batch
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
boto3
|
|
1
|
+
boto3
|
|
2
2
|
python-jose==3.5.0
|
|
3
3
|
|
|
4
4
|
[all]
|
|
5
5
|
PyMuPDF==1.26.0
|
|
6
6
|
black<26.0.0,<=25.1.0
|
|
7
|
-
boto3
|
|
7
|
+
boto3
|
|
8
8
|
coverage==7.3.2
|
|
9
9
|
pytest==7.4.3
|
|
10
10
|
python-jose==3.5.0
|
|
11
11
|
|
|
12
12
|
[bedrock]
|
|
13
13
|
PyMuPDF==1.26.0
|
|
14
|
-
boto3
|
|
14
|
+
boto3
|
|
15
15
|
python-jose==3.5.0
|
|
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-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/prompts/markdown_system_prompt.txt
RENAMED
|
File without changes
|
{my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/prompts/transactions_headers_prompt.txt
RENAMED
|
File without changes
|
|
File without changes
|
{my_aws_helpers-6.0.0 → my_aws_helpers-6.0.2}/my_aws_helpers/prompts/transactions_prompt.txt
RENAMED
|
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
|