agi-med-common 4.2.12__py3-none-any.whl → 4.2.14__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.
@@ -1,10 +1,8 @@
1
- __version__ = "4.2.12"
1
+ __version__ = "4.2.14"
2
2
 
3
3
  from .logger import LogLevelEnum, logger_init, log_llm_error
4
4
  from .models import (
5
- StateEnum,
6
5
  MTRSLabelEnum,
7
- ActionEnum,
8
6
  ModerationLabelEnum,
9
7
  ChatItem,
10
8
  InnerContextItem,
@@ -1,7 +1,6 @@
1
1
  from ._base import _Base
2
2
 
3
- from .enums import StateEnum, MTRSLabelEnum, ActionEnum, ModerationLabelEnum
4
- from .enums import DiagnosticsXMLTagEnum, MTRSXMLTagEnum, DoctorChoiceXMLTagEnum
3
+ from .enums import MTRSLabelEnum, ModerationLabelEnum, DiagnosticsXMLTagEnum, MTRSXMLTagEnum, DoctorChoiceXMLTagEnum
5
4
 
6
5
  from .chat_item import ChatItem, OuterContextItem, InnerContextItem, ReplicaItem, ReplicaItemPair
7
6
  from .base_config_models import GigaChatConfig
@@ -4,7 +4,7 @@ from typing import Any
4
4
  from pydantic import Field, ConfigDict
5
5
  from agi_med_common.models.widget import Widget
6
6
 
7
- from .enums import ModerationLabelEnum, StateEnum, ActionEnum
7
+ from .enums import ModerationLabelEnum
8
8
  from ._base import _Base
9
9
 
10
10
 
@@ -59,8 +59,8 @@ class ReplicaItem(_Base):
59
59
  examples=[_EXAMPLE_DATETIME],
60
60
  description=f"Format: {_DATETIME_FORMAT}",
61
61
  )
62
- state: StateEnum = Field("EMPTY", alias="State", description="chat manager fsm state", examples=["COLLECTION"])
63
- action: ActionEnum = Field("START", alias="Action", description="chat manager fsm action", examples=["DIAGNOSIS"])
62
+ state: str = Field("EMPTY", alias="State", description="chat manager fsm state", examples=["COLLECTION"])
63
+ action: str = Field("START", alias="Action", description="chat manager fsm action", examples=["DIAGNOSIS"])
64
64
  moderation: ModerationLabelEnum = Field(
65
65
  ModerationLabelEnum.OK,
66
66
  alias="Moderation",
@@ -1,9 +1,6 @@
1
1
  from enum import IntEnum, StrEnum, auto
2
2
 
3
3
 
4
- StateEnum, ActionEnum = str, str
5
-
6
-
7
4
  class ModerationLabelEnum(IntEnum):
8
5
  @staticmethod
9
6
  def _generate_next_value_(name, start, count, last_values):
agi_med_common/utils.py CHANGED
@@ -15,11 +15,14 @@ def read_json(path: Path | os.PathLike[str] | str) -> list | dict:
15
15
 
16
16
 
17
17
  def try_parse_json(text: str | None) -> str | None:
18
+ # taken from agi_med_common
19
+ if not isinstance(text, str):
20
+ return None
18
21
  if not text:
19
22
  return None
20
- if not text.startswith("{"):
23
+ if text[0] not in "{[":
21
24
  return None
22
- if not text.endswith("}"):
25
+ if text[-1] not in "}]":
23
26
  return None
24
27
  try:
25
28
  return json.loads(text)
@@ -38,8 +41,8 @@ def pretty_line(text: str, cut_count: int = 100) -> str:
38
41
  if len(text) > 100:
39
42
  text_cut = text[:cut_count]
40
43
  size = len(text)
41
- text_pretty = f'{text_cut}..(total {size} characters)'
44
+ text_pretty = f"{text_cut}..(total {size} characters)"
42
45
  else:
43
46
  text_pretty = text
44
- text_pretty = text_pretty.replace('\n', '\\n')
47
+ text_pretty = text_pretty.replace("\n", "\\n")
45
48
  return text_pretty
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agi_med_common
3
- Version: 4.2.12
3
+ Version: 4.2.14
4
4
  Summary: Сommon for agi-med team
5
5
  Author: AGI-MED-TEAM
6
6
  Requires-Python: >=3.11
@@ -1,20 +1,20 @@
1
- agi_med_common/__init__.py,sha256=7GZe14D48F8klVwUrPho7sj0WVGQYrKj4aGrjNhXjcU,722
1
+ agi_med_common/__init__.py,sha256=hJaRvT7XCX5rGHrwZAiwZGYywG6B9oOIs4ju560j0ZA,691
2
2
  agi_med_common/file_storage.py,sha256=yAP65qT0NbkaasFLhwnNzXOpd5vAetF3wP6Sbf_tbak,1766
3
3
  agi_med_common/parallel_map.py,sha256=Qx6xe7DqlEUDpSucp5Hm8r9y9Iquwh9JvX7lOqHhnOw,921
4
- agi_med_common/utils.py,sha256=pG4ayRBBgYKfEBULV6gZgl7AbI_K7VfByoSsB1BCIEI,1044
4
+ agi_med_common/utils.py,sha256=pHJ4jB7mwLvdRCh0dkSt3aWpQnNKX-HqpuIQZaB2gUY,1123
5
5
  agi_med_common/validators.py,sha256=vMoPN42XzC8re-zdjekk5_lNQYHuTiAWD56YLvj2Z2w,2824
6
6
  agi_med_common/xml_parser.py,sha256=VvLIX_XCZao9i0qqpTVx8nx0vbFXSe8pEbdJdXnj97g,568
7
7
  agi_med_common/logger/__init__.py,sha256=RW_0VZtbeJ4RsLqUXZUQWl5CtV9g840rU7qRlf5u49E,96
8
8
  agi_med_common/logger/log_level_enum.py,sha256=lWuSMho9I0v_xf1RuwpERx5o8NJXaavjwxSdh8fxMqE,477
9
9
  agi_med_common/logger/logger.py,sha256=-VU69ULbw2-pNpOcxKiMpOeRAPe6H-EsGV9WRTv1SUo,839
10
- agi_med_common/models/__init__.py,sha256=KXnXxD2c5v2TVXrc-n7gJipTAyvtMasbocxThINIojs,330
10
+ agi_med_common/models/__init__.py,sha256=Kek8n74nuozGZRL-brljKpYyXb1uWFEDu5ufrzrDq5o,289
11
11
  agi_med_common/models/_base.py,sha256=qNdH8x3x3mYbo5XgWtR9VpEarxsEvXvzynadUlDvHmU,149
12
- agi_med_common/models/chat_item.py,sha256=0-CWepFcFKEyJS-Vbq21xpwLO0wbdFYHiWGqA6UKFFI,4376
13
- agi_med_common/models/enums.py,sha256=RxPPbkW1NcHAGO-gHuzwIvOjv0_ZBsr9b1aq_wk4WFM,1313
12
+ agi_med_common/models/chat_item.py,sha256=eSM3ZHQzhRiOlbQ5_2gafoRvZVTny-QmgTNM4enj97o,4340
13
+ agi_med_common/models/enums.py,sha256=zv8BwaloRMp6TFEzdGsdcxnz97a4jKZ9zOSzWdG2QcY,1278
14
14
  agi_med_common/models/widget.py,sha256=g7Bobyk_gANghGEhjDjvi4i-YRoHo5Bm1Pr4eF-zf0U,661
15
15
  agi_med_common/models/base_config_models/__init__.py,sha256=KjS_bSCka8BOMsigwcIML-e6eNB2ouMU6gxlhRmzeuY,44
16
16
  agi_med_common/models/base_config_models/gigachat_config.py,sha256=WNSCTO8Fjpxc1v2LRUHfKqo9aeMDpXltTHYBFgTD2N0,422
17
- agi_med_common-4.2.12.dist-info/METADATA,sha256=OrORy6dyLhEKWcE75DzpjkcAJLRfaNLWJ8lmUZf35jk,547
18
- agi_med_common-4.2.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- agi_med_common-4.2.12.dist-info/top_level.txt,sha256=26o565jF_7wYQj7-YJfTedtT9yDxDcf8RNikOYuPq78,15
20
- agi_med_common-4.2.12.dist-info/RECORD,,
17
+ agi_med_common-4.2.14.dist-info/METADATA,sha256=Bydq0h2WwtPgFq0Cc5qbcWvsHSWKDOy0EUYIdHOtun4,547
18
+ agi_med_common-4.2.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ agi_med_common-4.2.14.dist-info/top_level.txt,sha256=26o565jF_7wYQj7-YJfTedtT9yDxDcf8RNikOYuPq78,15
20
+ agi_med_common-4.2.14.dist-info/RECORD,,