agi-med-common 3.3.4__tar.gz → 3.5.3__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 (35) hide show
  1. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/PKG-INFO +1 -1
  2. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/__init__.py +4 -1
  3. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/__init__.py +3 -0
  4. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/chat_item/replica_item.py +7 -1
  5. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/enums/__init__.py +4 -0
  6. agi_med_common-3.5.3/src/agi_med_common/models/enums/diagnostics_xml_tag_enum.py +11 -0
  7. agi_med_common-3.5.3/src/agi_med_common/models/enums/doctor_choice_xml_tag_enum.py +11 -0
  8. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/enums/moderation_label_enum.py +1 -0
  9. agi_med_common-3.5.3/src/agi_med_common/models/enums/mtrs_xml_tag_enum.py +11 -0
  10. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/xml_parser.py +3 -2
  11. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common.egg-info/PKG-INFO +1 -1
  12. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common.egg-info/SOURCES.txt +3 -0
  13. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/README.md +0 -0
  14. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/pyproject.toml +0 -0
  15. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/requirements.txt +0 -0
  16. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/setup.cfg +0 -0
  17. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/logger/__init__.py +0 -0
  18. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/logger/log_level_enum.py +0 -0
  19. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/logger/logger.py +0 -0
  20. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/_base.py +0 -0
  21. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/base_config_models/__init__.py +0 -0
  22. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/base_config_models/gigachat_config.py +0 -0
  23. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/chat_item/__init__.py +0 -0
  24. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/chat_item/chat_item.py +0 -0
  25. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/chat_item/inner_context_item.py +0 -0
  26. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/chat_item/outer_context_item.py +0 -0
  27. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/enums/action_enum.py +0 -0
  28. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/enums/mtrs_label_enum.py +0 -0
  29. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/enums/state_enum.py +0 -0
  30. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/models/enums/track_id_enum.py +0 -0
  31. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/utils.py +0 -0
  32. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common/validators.py +0 -0
  33. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common.egg-info/dependency_links.txt +0 -0
  34. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common.egg-info/requires.txt +0 -0
  35. {agi_med_common-3.3.4 → agi_med_common-3.5.3}/src/agi_med_common.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: agi_med_common
3
- Version: 3.3.4
3
+ Version: 3.5.3
4
4
  Summary: Сommon for agi-med team
5
5
  Author: AGI-MED-TEAM
6
6
  Requires-Python: >=3.11
@@ -1,4 +1,4 @@
1
- __version__ = "3.3.4"
1
+ __version__ = "3.5.3"
2
2
 
3
3
  from .logger import LogLevelEnum, logger_init
4
4
  from .models import (
@@ -13,6 +13,9 @@ from .models import (
13
13
  ReplicaItem,
14
14
  ReplicaItemPair,
15
15
  )
16
+
17
+ from .models import DiagnosticsXMLTagEnum, MTRSXMLTagEnum, DoctorChoiceXMLTagEnum
18
+
16
19
  from .utils import make_session_id, read_json, replace_n
17
20
  from .validators import is_file_exist, validate_prompt
18
21
  from .xml_parser import XMLParser
@@ -1,4 +1,7 @@
1
1
  from ._base import _Base
2
+
2
3
  from .enums import TrackIdEnum, StateEnum, MTRSLabelEnum, ActionEnum, ModerationLabelEnum
4
+ from .enums import DiagnosticsXMLTagEnum, MTRSXMLTagEnum, DoctorChoiceXMLTagEnum
5
+
3
6
  from .chat_item import ChatItem, OuterContextItem, InnerContextItem, ReplicaItem, ReplicaItemPair
4
7
  from .base_config_models import GigaChatConfig
@@ -4,7 +4,7 @@ from typing import Any
4
4
  from pydantic import Field
5
5
 
6
6
  from .. import _Base
7
- from ..enums import StateEnum, ActionEnum
7
+ from ..enums import StateEnum, ActionEnum, ModerationLabelEnum
8
8
 
9
9
  _DATETIME_FORMAT: str = "%Y-%m-%d-%H-%M-%S"
10
10
  _EXAMPLE_DATETIME: str = datetime(1970, 1, 1, 0, 0, 0).strftime(_DATETIME_FORMAT)
@@ -25,6 +25,12 @@ class ReplicaItem(_Base):
25
25
  action: ActionEnum = Field(
26
26
  ActionEnum.START, alias="Action", description="chat manager fsm action", examples=[ActionEnum.DIAGNOSIS]
27
27
  )
28
+ moderation: ModerationLabelEnum = Field(
29
+ ModerationLabelEnum.OK,
30
+ alias="Moderation",
31
+ description="chat manager moderated outcome type",
32
+ examples=[ModerationLabelEnum.NON_MED],
33
+ )
28
34
 
29
35
  def to_dict(self) -> dict[str, Any]:
30
36
  return self.model_dump(by_alias=True)
@@ -3,3 +3,7 @@ from .state_enum import StateEnum
3
3
  from .mtrs_label_enum import MTRSLabelEnum
4
4
  from .action_enum import ActionEnum
5
5
  from .moderation_label_enum import ModerationLabelEnum
6
+
7
+ from .diagnostics_xml_tag_enum import DiagnosticsXMLTagEnum
8
+ from .mtrs_xml_tag_enum import MTRSXMLTagEnum
9
+ from .doctor_choice_xml_tag_enum import DoctorChoiceXMLTagEnum
@@ -0,0 +1,11 @@
1
+ from enum import StrEnum, auto
2
+
3
+
4
+ class DiagnosticsXMLTagEnum(StrEnum):
5
+ @staticmethod
6
+ def _generate_next_value_(name: str, start: int, count: int, last_values: list[str]) -> str:
7
+ return f"diag_{name.lower()}"
8
+
9
+ DIAG = auto()
10
+ DOC = auto()
11
+ DESC = auto()
@@ -0,0 +1,11 @@
1
+ from enum import StrEnum, auto
2
+
3
+
4
+ class DoctorChoiceXMLTagEnum(StrEnum):
5
+ @staticmethod
6
+ def _generate_next_value_(name: str, start: int, count: int, last_values: list[str]) -> str:
7
+ return f"{name.lower()}"
8
+
9
+ DIAGNOSTICS = auto()
10
+ SUMMARIZATION = auto()
11
+ MTRS = auto()
@@ -11,3 +11,4 @@ class ModerationLabelEnum(IntEnum):
11
11
  CHILD = auto()
12
12
  ABSURD = auto()
13
13
  GREETING = auto()
14
+ RECEIPT = auto()
@@ -0,0 +1,11 @@
1
+ from enum import StrEnum, auto
2
+
3
+
4
+ class MTRSXMLTagEnum(StrEnum):
5
+ @staticmethod
6
+ def _generate_next_value_(name: str, start: int, count: int, last_values: list[str]) -> str:
7
+ return f"mtrs_{name.lower()}"
8
+
9
+ NAME = auto()
10
+ LABEL = auto()
11
+ DESC = auto()
@@ -1,9 +1,10 @@
1
1
  import re
2
+ from enum import StrEnum
2
3
 
3
4
 
4
5
  class XMLParser:
5
6
  @staticmethod
6
- def make_xml(body: str, tag: str) -> str:
7
+ def make_xml(body: str, tag: str | StrEnum) -> str:
7
8
  return f"<{tag}>{body}</{tag}>"
8
9
 
9
10
  @staticmethod
@@ -12,6 +13,6 @@ class XMLParser:
12
13
  return re.sub(re_xml, "", text).replace(" ", " ").strip()
13
14
 
14
15
  @staticmethod
15
- def get_tag_list(response: str, tag: str) -> list[str]:
16
+ def get_tag_list(response: str, tag: str | StrEnum) -> list[str]:
16
17
  tag_content = re.findall(f"<{tag}>(.*?)</{tag}>", response, re.DOTALL)
17
18
  return [content.lower().strip() for content in tag_content]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: agi_med_common
3
- Version: 3.3.4
3
+ Version: 3.5.3
4
4
  Summary: Сommon for agi-med team
5
5
  Author: AGI-MED-TEAM
6
6
  Requires-Python: >=3.11
@@ -24,7 +24,10 @@ src/agi_med_common/models/chat_item/outer_context_item.py
24
24
  src/agi_med_common/models/chat_item/replica_item.py
25
25
  src/agi_med_common/models/enums/__init__.py
26
26
  src/agi_med_common/models/enums/action_enum.py
27
+ src/agi_med_common/models/enums/diagnostics_xml_tag_enum.py
28
+ src/agi_med_common/models/enums/doctor_choice_xml_tag_enum.py
27
29
  src/agi_med_common/models/enums/moderation_label_enum.py
28
30
  src/agi_med_common/models/enums/mtrs_label_enum.py
31
+ src/agi_med_common/models/enums/mtrs_xml_tag_enum.py
29
32
  src/agi_med_common/models/enums/state_enum.py
30
33
  src/agi_med_common/models/enums/track_id_enum.py
File without changes
File without changes