agi-med-common 3.6.2__py3-none-any.whl → 4.0.0__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.
- agi_med_common/__init__.py +1 -1
- agi_med_common/models/chat_item/replica_item.py +3 -6
- agi_med_common/models/enums/__init__.py +2 -2
- agi_med_common/parallel_map.py +6 -4
- {agi_med_common-3.6.2.dist-info → agi_med_common-4.0.0.dist-info}/METADATA +3 -2
- {agi_med_common-3.6.2.dist-info → agi_med_common-4.0.0.dist-info}/RECORD +8 -10
- {agi_med_common-3.6.2.dist-info → agi_med_common-4.0.0.dist-info}/WHEEL +1 -1
- agi_med_common/models/enums/action_enum.py +0 -18
- agi_med_common/models/enums/state_enum.py +0 -9
- {agi_med_common-3.6.2.dist-info → agi_med_common-4.0.0.dist-info}/top_level.txt +0 -0
agi_med_common/__init__.py
CHANGED
@@ -6,6 +6,7 @@ from pydantic import Field, ConfigDict
|
|
6
6
|
from .. import _Base
|
7
7
|
from ..enums import StateEnum, ActionEnum, ModerationLabelEnum
|
8
8
|
|
9
|
+
|
9
10
|
_DATETIME_FORMAT: str = "%Y-%m-%d-%H-%M-%S"
|
10
11
|
_EXAMPLE_DATETIME: str = datetime(1970, 1, 1, 0, 0, 0).strftime(_DATETIME_FORMAT)
|
11
12
|
|
@@ -20,12 +21,8 @@ class ReplicaItem(_Base):
|
|
20
21
|
examples=[_EXAMPLE_DATETIME],
|
21
22
|
description=f"Format: {_DATETIME_FORMAT}",
|
22
23
|
)
|
23
|
-
state: StateEnum = Field(
|
24
|
-
|
25
|
-
)
|
26
|
-
action: ActionEnum = Field(
|
27
|
-
ActionEnum.START, alias="Action", description="chat manager fsm action", examples=[ActionEnum.DIAGNOSIS]
|
28
|
-
)
|
24
|
+
state: StateEnum = Field("EMPTY", alias="State", description="chat manager fsm state", examples=["COLLECTION"])
|
25
|
+
action: ActionEnum = Field("START", alias="Action", description="chat manager fsm action", examples=["DIAGNOSIS"])
|
29
26
|
moderation: ModerationLabelEnum = Field(
|
30
27
|
ModerationLabelEnum.OK,
|
31
28
|
alias="Moderation",
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from .track_id_enum import TrackIdEnum
|
2
|
-
from .state_enum import StateEnum
|
3
2
|
from .mtrs_label_enum import MTRSLabelEnum
|
4
|
-
from .action_enum import ActionEnum
|
5
3
|
from .moderation_label_enum import ModerationLabelEnum
|
6
4
|
|
7
5
|
from .diagnostics_xml_tag_enum import DiagnosticsXMLTagEnum
|
8
6
|
from .mtrs_xml_tag_enum import MTRSXMLTagEnum
|
9
7
|
from .doctor_choice_xml_tag_enum import DoctorChoiceXMLTagEnum
|
8
|
+
|
9
|
+
StateEnum, ActionEnum = str, str
|
agi_med_common/parallel_map.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any, Callable, TypeVar
|
1
|
+
from typing import Any, Callable, TypeVar, Iterable
|
2
2
|
import concurrent.futures
|
3
3
|
from tqdm import tqdm
|
4
4
|
|
@@ -8,12 +8,12 @@ X = TypeVar("X")
|
|
8
8
|
|
9
9
|
def parallel_map(
|
10
10
|
func: Callable[..., X],
|
11
|
-
items:
|
11
|
+
items: Iterable[Any],
|
12
12
|
process: bool = False,
|
13
13
|
multiple_args: bool = False,
|
14
14
|
max_workers: int = 2,
|
15
15
|
show_tqdm: bool = False,
|
16
|
-
desc: str = ""
|
16
|
+
desc: str = ""
|
17
17
|
) -> list[X]:
|
18
18
|
pool = (
|
19
19
|
concurrent.futures.ProcessPoolExecutor(max_workers=max_workers)
|
@@ -27,5 +27,7 @@ def parallel_map(
|
|
27
27
|
futures.append(executor.submit(func, *item))
|
28
28
|
else:
|
29
29
|
futures.append(executor.submit(func, item))
|
30
|
-
results: list[X] = [
|
30
|
+
results: list[X] = [
|
31
|
+
future.result() for future in tqdm(futures, disable=(not show_tqdm), desc=desc)
|
32
|
+
]
|
31
33
|
return results
|
@@ -1,12 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: agi_med_common
|
3
|
-
Version:
|
3
|
+
Version: 4.0.0
|
4
4
|
Summary: Сommon for agi-med team
|
5
5
|
Author: AGI-MED-TEAM
|
6
6
|
Requires-Python: >=3.11
|
7
7
|
Description-Content-Type: text/markdown
|
8
8
|
Requires-Dist: pydantic<=3.0.0,>=2.9.2
|
9
9
|
Requires-Dist: loguru~=0.7.2
|
10
|
+
Requires-Dist: tqdm==4.67.*
|
10
11
|
|
11
12
|
# agi-med-common
|
12
13
|
|
@@ -14,7 +15,7 @@ Common компонент
|
|
14
15
|
|
15
16
|
## Ответственный разработчик
|
16
17
|
|
17
|
-
@
|
18
|
+
@bakulin
|
18
19
|
|
19
20
|
## Общая информация
|
20
21
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
agi_med_common/__init__.py,sha256=
|
1
|
+
agi_med_common/__init__.py,sha256=NU3IwKvif4JVeoBOH5-VLR9nTUifoee2Dyi50DuUElc,575
|
2
2
|
agi_med_common/file_storage.py,sha256=GR6_jKZ0o9uwUkOKZd1XaCVOSw0YmFlCOlC6EX8zz0I,1247
|
3
|
-
agi_med_common/parallel_map.py,sha256=
|
3
|
+
agi_med_common/parallel_map.py,sha256=Qx6xe7DqlEUDpSucp5Hm8r9y9Iquwh9JvX7lOqHhnOw,921
|
4
4
|
agi_med_common/utils.py,sha256=5iurKl5d1zZ_cN4yqtc0_FhrwuNBcDurbWilu28_saE,325
|
5
5
|
agi_med_common/validators.py,sha256=R678gjPp-5XbnocRuEtdOQgJyCCOurxwaOe2nT04kSg,705
|
6
6
|
agi_med_common/xml_parser.py,sha256=VvLIX_XCZao9i0qqpTVx8nx0vbFXSe8pEbdJdXnj97g,568
|
@@ -15,17 +15,15 @@ agi_med_common/models/chat_item/__init__.py,sha256=NG1optUYwjnxfpTXntUfTDOA0eKTg
|
|
15
15
|
agi_med_common/models/chat_item/chat_item.py,sha256=Ym-afB9-7NI6QquhMPqd2ZBkbcx-Txr-ZiXwn0PTO-0,1182
|
16
16
|
agi_med_common/models/chat_item/inner_context_item.py,sha256=YXmlNLabKN3O84UWJENsjfdtPq2XRH1VqKiyIxS-p64,255
|
17
17
|
agi_med_common/models/chat_item/outer_context_item.py,sha256=IzrwhqbLKR8ZF8-Sd2CyNSa0eqb21NQH7LUqkg9se2Y,1046
|
18
|
-
agi_med_common/models/chat_item/replica_item.py,sha256=
|
19
|
-
agi_med_common/models/enums/__init__.py,sha256=
|
20
|
-
agi_med_common/models/enums/action_enum.py,sha256=J0S_CkCTDoebbdGbzfrnNTOXla-yMXsPsQI_dyXH2iE,348
|
18
|
+
agi_med_common/models/chat_item/replica_item.py,sha256=2N586TCQ33YoBOeghvvPnIPHSEtnWMQOr_ZldNfLH3o,1676
|
19
|
+
agi_med_common/models/enums/__init__.py,sha256=NFgy8J-bET2GQqUyTaKYLzaLaM-jDR8-7TBTadWKm5o,341
|
21
20
|
agi_med_common/models/enums/diagnostics_xml_tag_enum.py,sha256=aiUJpe5joh5EOcJ5sk1Xs003XkRry2CBL6H-bIEiapA,278
|
22
21
|
agi_med_common/models/enums/doctor_choice_xml_tag_enum.py,sha256=MsSFI0vFHJVujhoj7fNX-fcGVV3jMF_nEDOJnjzh4ac,291
|
23
22
|
agi_med_common/models/enums/moderation_label_enum.py,sha256=lbGG4Pu7cQp57uEyQEptNeYsQszK6yyxJ5AEhq4SGkE,292
|
24
23
|
agi_med_common/models/enums/mtrs_label_enum.py,sha256=6emBndt3SCsQVZZFKQYCV2_iyjjmZEhwejJKJu39ZAw,257
|
25
24
|
agi_med_common/models/enums/mtrs_xml_tag_enum.py,sha256=6OxuRsrx4b2uBjfrBgm4Y789Ly337_mQXL9VPRCpLyg,273
|
26
|
-
agi_med_common/models/enums/state_enum.py,sha256=p7XhDxBxPeeSgbLWitq6JpJLKntS3XMHon_EevbnhEs,163
|
27
25
|
agi_med_common/models/enums/track_id_enum.py,sha256=N3KUd97a4xDet_NKZ5URm0qWAAv3ts1l_foOjdlGY4c,532
|
28
|
-
agi_med_common-
|
29
|
-
agi_med_common-
|
30
|
-
agi_med_common-
|
31
|
-
agi_med_common-
|
26
|
+
agi_med_common-4.0.0.dist-info/METADATA,sha256=j8n2jal1fUydQ8rD9Y5t5Ra9UmcxilK-j6cCdUjY5OU,546
|
27
|
+
agi_med_common-4.0.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
28
|
+
agi_med_common-4.0.0.dist-info/top_level.txt,sha256=26o565jF_7wYQj7-YJfTedtT9yDxDcf8RNikOYuPq78,15
|
29
|
+
agi_med_common-4.0.0.dist-info/RECORD,,
|
@@ -1,18 +0,0 @@
|
|
1
|
-
from enum import StrEnum, auto
|
2
|
-
|
3
|
-
|
4
|
-
class ActionEnum(StrEnum):
|
5
|
-
START = auto()
|
6
|
-
ASK_FILE_AGAIN = auto()
|
7
|
-
|
8
|
-
GREETING = auto()
|
9
|
-
MODERATION = auto()
|
10
|
-
ANSWER = auto()
|
11
|
-
QUESTION = auto()
|
12
|
-
CRITICAL = auto()
|
13
|
-
MED_TEST_DECRYPTION = auto()
|
14
|
-
|
15
|
-
DIAGNOSIS = auto()
|
16
|
-
REPORT = auto()
|
17
|
-
FINANCIAL_EXTRACTION = auto()
|
18
|
-
FINAL = auto()
|
File without changes
|