reach_commons 0.16.0__py3-none-any.whl → 0.17.1__py3-none-any.whl
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.
- reach_commons/clients/reach_ops_api.py +7 -0
- reach_commons/sms_smart_encoding.py +9 -2
- {reach_commons-0.16.0.dist-info → reach_commons-0.17.1.dist-info}/METADATA +1 -1
- {reach_commons-0.16.0.dist-info → reach_commons-0.17.1.dist-info}/RECORD +5 -5
- {reach_commons-0.16.0.dist-info → reach_commons-0.17.1.dist-info}/WHEEL +0 -0
|
@@ -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
|
-
|
|
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
|
|
|
@@ -9,7 +9,7 @@ reach_commons/clients/event_processor.py,sha256=KmYF0kuZxLmHQjJASXMr5jz2D_D3WNHB
|
|
|
9
9
|
reach_commons/clients/hubspot.py,sha256=ntAzvwoaq78MkKaVoZ7geND-AafAzccNnJogfJDahVA,5497
|
|
10
10
|
reach_commons/clients/outscraper.py,sha256=vA3m9xYVNH47x0IbqWL05Kb-wBv_F2vcZOCsKvgL_50,2040
|
|
11
11
|
reach_commons/clients/reach_data_bridge.py,sha256=la2dPajeHlugbMZ-JY1JCURhZKCnw_sF1M7CCewb6N8,5142
|
|
12
|
-
reach_commons/clients/reach_ops_api.py,sha256
|
|
12
|
+
reach_commons/clients/reach_ops_api.py,sha256=OLJ-PPQ_og49cAHDZ90BySJNtnQegDVFqs2KjHcv_cs,2407
|
|
13
13
|
reach_commons/mongo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
reach_commons/mongo/customer_persistence.py,sha256=acrtpyCWr9vLVq61saJ3_Vp4DYHFBTM9XqoYC72J84w,3735
|
|
15
15
|
reach_commons/mongo/customer_persistence_async.py,sha256=BmcP8TXyyQah-GYM3wcKi1baqSCycjw7UadlxGywyQM,3892
|
|
@@ -24,9 +24,9 @@ reach_commons/reach_aws/s3.py,sha256=KLWvlQVakaaGfFg3110QHc1PlxCb1pUhmJQ-VggLEj4
|
|
|
24
24
|
reach_commons/reach_aws/sqs.py,sha256=LKQ42vRJko2HTE8gO_lRvftnstIMI3DeFZakvLUM0BQ,15864
|
|
25
25
|
reach_commons/reach_base_model.py,sha256=uMmDGjwKTZ3h7f8Pfvc99FCsAt5eZNlUJnLLbB5EqGY,2907
|
|
26
26
|
reach_commons/redis_manager.py,sha256=tK-kBw1fO1f-phsxGI-7W_MEtHQsRz7JY9LEN8OBcNY,2600
|
|
27
|
-
reach_commons/sms_smart_encoding.py,sha256=
|
|
27
|
+
reach_commons/sms_smart_encoding.py,sha256=92y0RmZ0l4ONHpC9qeO5KfViSNq64yE2rc7lhNDSZqE,1241
|
|
28
28
|
reach_commons/utils.py,sha256=dMgKIGqTgoSItuBI8oz81gKtW3qi21Jkljv9leS_V88,8475
|
|
29
29
|
reach_commons/validations.py,sha256=jc78boM62S9Z0Ip_nV1z7I983gGpW2Y7vOCQtmia8OU,964
|
|
30
|
-
reach_commons-0.
|
|
31
|
-
reach_commons-0.
|
|
32
|
-
reach_commons-0.
|
|
30
|
+
reach_commons-0.17.1.dist-info/METADATA,sha256=R71WCJeoNjTYXBd60arLnk2CbhRlqYVlGuVfBmMdOUY,1860
|
|
31
|
+
reach_commons-0.17.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
32
|
+
reach_commons-0.17.1.dist-info/RECORD,,
|
|
File without changes
|