reach_commons 0.16.0__tar.gz → 0.17.1__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.
Files changed (32) hide show
  1. {reach_commons-0.16.0 → reach_commons-0.17.1}/PKG-INFO +1 -1
  2. {reach_commons-0.16.0 → reach_commons-0.17.1}/pyproject.toml +1 -1
  3. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/clients/reach_ops_api.py +7 -0
  4. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/sms_smart_encoding.py +9 -2
  5. {reach_commons-0.16.0 → reach_commons-0.17.1}/README.md +0 -0
  6. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/__init__.py +0 -0
  7. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/app_logging/__init__.py +0 -0
  8. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/app_logging/http_logger.py +0 -0
  9. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/app_logging/log_deprecated_endpoints.py +0 -0
  10. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/app_logging/logger.py +0 -0
  11. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/app_logging/logging_config.py +0 -0
  12. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/clients/__init__.py +0 -0
  13. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/clients/event_processor.py +0 -0
  14. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/clients/hubspot.py +0 -0
  15. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/clients/outscraper.py +0 -0
  16. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/clients/reach_data_bridge.py +0 -0
  17. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/mongo/__init__.py +0 -0
  18. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/mongo/customer_persistence.py +0 -0
  19. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/mongo/customer_persistence_async.py +0 -0
  20. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/mongo/validation/__init__.py +0 -0
  21. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/reach_aws/__init__.py +0 -0
  22. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/reach_aws/commons.py +0 -0
  23. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/reach_aws/dynamo_db.py +0 -0
  24. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/reach_aws/exceptions.py +0 -0
  25. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/reach_aws/firehose.py +0 -0
  26. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/reach_aws/kms.py +0 -0
  27. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/reach_aws/s3.py +0 -0
  28. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/reach_aws/sqs.py +0 -0
  29. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/reach_base_model.py +0 -0
  30. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/redis_manager.py +0 -0
  31. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/utils.py +0 -0
  32. {reach_commons-0.16.0 → reach_commons-0.17.1}/reach_commons/validations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reach_commons
3
- Version: 0.16.0
3
+ Version: 0.17.1
4
4
  Summary: Reach Commons is a versatile utility library designed to streamline and enhance development workflows within the Reach ecosystem.
5
5
  License: MIT
6
6
  Author: Wilson Moraes
@@ -1,7 +1,7 @@
1
1
  # isort .; black .; poetry build; poetry publish
2
2
  [tool.poetry]
3
3
  name = "reach_commons"
4
- version = "0.16.0"
4
+ version = "0.17.1"
5
5
  description = "Reach Commons is a versatile utility library designed to streamline and enhance development workflows within the Reach ecosystem."
6
6
  authors = ["Wilson Moraes <wmoraes@getreach.ai>"]
7
7
  license = "MIT"
@@ -63,3 +63,10 @@ class ReachOpsApiClient:
63
63
  data=json.dumps(invoice),
64
64
  )
65
65
  return resp
66
+
67
+ def enable_text_ai(self, business_id):
68
+ resp = requests.post(
69
+ f"{self.base_url}/conversations/{business_id}/text-ai/enable",
70
+ headers=self.gateway_headers,
71
+ )
72
+ return resp
@@ -1,5 +1,6 @@
1
1
  from dataclasses import dataclass, field
2
2
  from math import ceil
3
+ from typing import Union
3
4
 
4
5
 
5
6
  @dataclass
@@ -24,13 +25,19 @@ class MessageSmartEncoding:
24
25
  "\u0002": "",
25
26
  "\u001b": "",
26
27
  }
27
- body: str
28
+ body: Union[str, list]
28
29
  normalized_text: str = field(init=False)
29
30
  length: int = field(init=False)
30
31
  segments: int = field(init=False)
31
32
 
32
33
  def __post_init__(self):
33
- self.normalized_text = self.normalize(self.body)
34
+ # Convert body to string if it's a list
35
+ if isinstance(self.body, list):
36
+ body_text = " ".join(str(item) for item in self.body)
37
+ else:
38
+ body_text = self.body
39
+
40
+ self.normalized_text = self.normalize(body_text)
34
41
  self.length = len(self.normalized_text)
35
42
  self.segments = ceil(self.length / 160)
36
43
 
File without changes