mmar-mapi 1.0.8__py3-none-any.whl → 1.0.10__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.
Potentially problematic release.
This version of mmar-mapi might be problematic. Click here for more details.
- mmar_mapi/__init__.py +3 -1
- mmar_mapi/models/chat.py +3 -0
- mmar_mapi/models/widget.py +1 -1
- mmar_mapi/utils.py +11 -0
- {mmar_mapi-1.0.8.dist-info → mmar_mapi-1.0.10.dist-info}/METADATA +1 -1
- {mmar_mapi-1.0.8.dist-info → mmar_mapi-1.0.10.dist-info}/RECORD +8 -8
- {mmar_mapi-1.0.8.dist-info → mmar_mapi-1.0.10.dist-info}/WHEEL +0 -0
- {mmar_mapi-1.0.8.dist-info → mmar_mapi-1.0.10.dist-info}/licenses/LICENSE +0 -0
mmar_mapi/__init__.py
CHANGED
|
@@ -15,9 +15,10 @@ from .models.chat_item import ChatItem, OuterContextItem, InnerContextItem, Repl
|
|
|
15
15
|
from .models.enums import MTRSLabelEnum, DiagnosticsXMLTagEnum, MTRSXMLTagEnum, DoctorChoiceXMLTagEnum
|
|
16
16
|
from .models.tracks import TrackInfo, DomainInfo
|
|
17
17
|
from .models.widget import Widget
|
|
18
|
-
from .utils import make_session_id
|
|
18
|
+
from .utils import make_session_id, chunked
|
|
19
19
|
from .xml_parser import XMLParser
|
|
20
20
|
|
|
21
|
+
|
|
21
22
|
__all__ = [
|
|
22
23
|
"AIMessage",
|
|
23
24
|
"Base",
|
|
@@ -42,6 +43,7 @@ __all__ = [
|
|
|
42
43
|
"TrackInfo",
|
|
43
44
|
"Widget",
|
|
44
45
|
"XMLParser",
|
|
46
|
+
"chunked",
|
|
45
47
|
"make_content",
|
|
46
48
|
"make_session_id",
|
|
47
49
|
]
|
mmar_mapi/models/chat.py
CHANGED
|
@@ -249,6 +249,9 @@ class Chat(Base):
|
|
|
249
249
|
message = messages[-1]
|
|
250
250
|
return message if isinstance(message, HumanMessage) else None
|
|
251
251
|
|
|
252
|
+
def count_messages(self, func: Callable[[ChatMessage], bool]) -> int:
|
|
253
|
+
return sum(map(func, self.messages))
|
|
254
|
+
|
|
252
255
|
|
|
253
256
|
def make_content(
|
|
254
257
|
text: str | None = None,
|
mmar_mapi/models/widget.py
CHANGED
mmar_mapi/utils.py
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
from itertools import islice
|
|
2
|
+
from collections.abc import Iterable
|
|
1
3
|
from datetime import datetime
|
|
2
4
|
|
|
3
5
|
|
|
4
6
|
def make_session_id() -> str:
|
|
5
7
|
return f"{datetime.now():%Y-%m-%d--%H-%M-%S}"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def chunked(items: Iterable, n) -> list:
|
|
11
|
+
"behavior like in more_itertools.chunked"
|
|
12
|
+
iterator = iter(items)
|
|
13
|
+
res = []
|
|
14
|
+
while chunk := list(islice(iterator, n)):
|
|
15
|
+
res.append(chunk)
|
|
16
|
+
return res
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
mmar_mapi/__init__.py,sha256=
|
|
1
|
+
mmar_mapi/__init__.py,sha256=NxCsA3aMKjxIZ2f4pQTJ1LPpg7t2yz7PsiDeb_HrAJE,1109
|
|
2
2
|
mmar_mapi/api.py,sha256=C9Sr8dISvf51xfEznPjccI_odaG4coQE3HI_0jVpjMQ,1677
|
|
3
3
|
mmar_mapi/file_storage.py,sha256=GbahBabBdAKjlAnv1MszERUxxZyA9HGMiR9tz2a9dgY,4409
|
|
4
4
|
mmar_mapi/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
mmar_mapi/models/base.py,sha256=mKtXV2x51XVj7W-et9tjGcPMDUUUMelW-BywMgFc2p0,411
|
|
6
|
-
mmar_mapi/models/chat.py,sha256=
|
|
6
|
+
mmar_mapi/models/chat.py,sha256=HC-zl32wu5xMyam3iZXZKc4vSfxtc4f-vMb9FgB8m1Q,13655
|
|
7
7
|
mmar_mapi/models/chat_item.py,sha256=ZfCKvTqr7gpuJSAuHVxWRnlTefRwki_IVNA2N_CXGdg,5557
|
|
8
8
|
mmar_mapi/models/enums.py,sha256=J-GNpql9MCnKnWiV9aJRQGI-pAybvV86923RZs99grA,1006
|
|
9
9
|
mmar_mapi/models/tracks.py,sha256=HKDp-BX1p7AlDfSEKfOKCu0TRSK9cD4Dmq1vJt8oRjw,307
|
|
10
|
-
mmar_mapi/models/widget.py,sha256=
|
|
10
|
+
mmar_mapi/models/widget.py,sha256=ue5o4AkN8SG09aA8eQLOOxbwah-mkZir0ZGL6OA8S9Q,1355
|
|
11
11
|
mmar_mapi/type_union.py,sha256=diwmzcnbqkpGFckPHNw9o8zyQ955mOGNvhTlcBJ0RMI,1905
|
|
12
|
-
mmar_mapi/utils.py,sha256=
|
|
12
|
+
mmar_mapi/utils.py,sha256=oVrEAHGcfFBprwdTEzSbFCpdLtkDRVzWtOnYpS439os,394
|
|
13
13
|
mmar_mapi/xml_parser.py,sha256=VvLIX_XCZao9i0qqpTVx8nx0vbFXSe8pEbdJdXnj97g,568
|
|
14
|
-
mmar_mapi-1.0.
|
|
15
|
-
mmar_mapi-1.0.
|
|
16
|
-
mmar_mapi-1.0.
|
|
17
|
-
mmar_mapi-1.0.
|
|
14
|
+
mmar_mapi-1.0.10.dist-info/licenses/LICENSE,sha256=2A90w8WjhOgQXnFuUijKJYazaqZ4_NTokYb9Po4y-9k,1061
|
|
15
|
+
mmar_mapi-1.0.10.dist-info/WHEEL,sha256=Pi5uDq5Fdo_Rr-HD5h9BiPn9Et29Y9Sh8NhcJNnFU1c,79
|
|
16
|
+
mmar_mapi-1.0.10.dist-info/METADATA,sha256=cL99l0W1GOtgnJOUNDyflzdkbMNHNfGwNpdiLnhFIz0,915
|
|
17
|
+
mmar_mapi-1.0.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|