lionagi 0.15.14__py3-none-any.whl → 0.16.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.
Files changed (53) hide show
  1. lionagi/adapters/async_postgres_adapter.py +1 -1
  2. lionagi/libs/nested/ninsert.py +3 -6
  3. lionagi/libs/nested/nmerge.py +1 -2
  4. lionagi/libs/validate/fuzzy_match_keys.py +5 -182
  5. lionagi/libs/validate/string_similarity.py +6 -331
  6. lionagi/ln/__init__.py +56 -66
  7. lionagi/ln/_async_call.py +13 -10
  8. lionagi/ln/_hash.py +33 -8
  9. lionagi/ln/_list_call.py +2 -35
  10. lionagi/ln/_to_list.py +51 -28
  11. lionagi/ln/_utils.py +156 -0
  12. lionagi/ln/concurrency/__init__.py +39 -31
  13. lionagi/ln/concurrency/_compat.py +65 -0
  14. lionagi/ln/concurrency/cancel.py +92 -109
  15. lionagi/ln/concurrency/errors.py +17 -17
  16. lionagi/ln/concurrency/patterns.py +249 -206
  17. lionagi/ln/concurrency/primitives.py +257 -216
  18. lionagi/ln/concurrency/resource_tracker.py +42 -155
  19. lionagi/ln/concurrency/task.py +55 -73
  20. lionagi/ln/concurrency/throttle.py +3 -0
  21. lionagi/ln/concurrency/utils.py +1 -0
  22. lionagi/ln/fuzzy/__init__.py +15 -0
  23. lionagi/ln/{_extract_json.py → fuzzy/_extract_json.py} +22 -9
  24. lionagi/ln/{_fuzzy_json.py → fuzzy/_fuzzy_json.py} +14 -8
  25. lionagi/ln/fuzzy/_fuzzy_match.py +172 -0
  26. lionagi/ln/fuzzy/_fuzzy_validate.py +46 -0
  27. lionagi/ln/fuzzy/_string_similarity.py +332 -0
  28. lionagi/ln/{_models.py → types.py} +153 -4
  29. lionagi/operations/ReAct/utils.py +1 -2
  30. lionagi/operations/flow.py +2 -1
  31. lionagi/operations/operate/operate.py +26 -16
  32. lionagi/protocols/action/function_calling.py +1 -4
  33. lionagi/protocols/contracts.py +46 -0
  34. lionagi/protocols/generic/element.py +1 -58
  35. lionagi/protocols/generic/event.py +6 -6
  36. lionagi/protocols/generic/processor.py +9 -5
  37. lionagi/protocols/graph/graph.py +1 -2
  38. lionagi/protocols/graph/node.py +2 -4
  39. lionagi/protocols/ids.py +82 -0
  40. lionagi/protocols/messages/instruction.py +1 -2
  41. lionagi/protocols/messages/manager.py +1 -2
  42. lionagi/protocols/messages/message.py +1 -4
  43. lionagi/protocols/types.py +10 -12
  44. lionagi/service/connections/providers/claude_code_.py +1 -2
  45. lionagi/service/resilience.py +1 -2
  46. lionagi/tools/memory/tools.py +2 -4
  47. lionagi/utils.py +34 -64
  48. lionagi/version.py +1 -1
  49. {lionagi-0.15.14.dist-info → lionagi-0.16.1.dist-info}/METADATA +4 -2
  50. {lionagi-0.15.14.dist-info → lionagi-0.16.1.dist-info}/RECORD +52 -45
  51. lionagi/ln/_types.py +0 -146
  52. {lionagi-0.15.14.dist-info → lionagi-0.16.1.dist-info}/WHEEL +0 -0
  53. {lionagi-0.15.14.dist-info → lionagi-0.16.1.dist-info}/licenses/LICENSE +0 -0
lionagi/utils.py CHANGED
@@ -5,7 +5,6 @@
5
5
  import contextlib
6
6
  import copy as _copy
7
7
  import dataclasses
8
- import importlib.util
9
8
  import json
10
9
  import logging
11
10
  import types
@@ -37,11 +36,29 @@ from pydantic_core import PydanticUndefinedType
37
36
  from typing_extensions import deprecated
38
37
 
39
38
  from .libs.validate.xml_parser import xml_to_dict
40
- from .ln import DataClass, Enum, KeysDict, Params, Undefined, UndefinedType
41
- from .ln import extract_json as to_json
42
- from .ln import fuzzy_json as fuzzy_parse_json
43
- from .ln import hash_dict, to_list
44
- from .ln.concurrency import is_coro_func
39
+ from .ln import (
40
+ extract_json,
41
+ fuzzy_json,
42
+ get_bins,
43
+ hash_dict,
44
+ import_module,
45
+ is_coro_func,
46
+ is_import_installed,
47
+ to_list,
48
+ )
49
+ from .ln.types import (
50
+ DataClass,
51
+ Enum,
52
+ KeysDict,
53
+ MaybeSentinel,
54
+ MaybeUndefined,
55
+ MaybeUnset,
56
+ Params,
57
+ Undefined,
58
+ UndefinedType,
59
+ Unset,
60
+ UnsetType,
61
+ )
45
62
  from .settings import Settings
46
63
 
47
64
  R = TypeVar("R")
@@ -52,6 +69,9 @@ logger = logging.getLogger(__name__)
52
69
 
53
70
  UNDEFINED = Undefined
54
71
 
72
+ to_json = extract_json
73
+ fuzzy_parse_json = fuzzy_json
74
+
55
75
  __all__ = (
56
76
  "UndefinedType",
57
77
  "KeysDict",
@@ -76,7 +96,6 @@ __all__ = (
76
96
  "get_bins",
77
97
  "EventStatus",
78
98
  "logger",
79
- "throttle",
80
99
  "max_concurrent",
81
100
  "force_async",
82
101
  "breakdown_pydantic_annotation",
@@ -87,6 +106,14 @@ __all__ = (
87
106
  "is_union_type",
88
107
  "union_members",
89
108
  "to_json",
109
+ "Unset",
110
+ "UnsetType",
111
+ "Undefined",
112
+ "MaybeSentinel",
113
+ "MaybeUndefined",
114
+ "MaybeUnset",
115
+ "is_import_installed",
116
+ "import_module",
90
117
  )
91
118
 
92
119
 
@@ -888,60 +915,3 @@ def _is_pydantic_model(x: Any) -> bool:
888
915
  return isclass(x) and issubclass(x, BaseModel)
889
916
  except TypeError:
890
917
  return False
891
-
892
-
893
- def import_module(
894
- package_name: str,
895
- module_name: str = None,
896
- import_name: str | list = None,
897
- ) -> Any:
898
- """
899
- Import a module by its path.
900
-
901
- Args:
902
- module_path: The path of the module to import.
903
-
904
- Returns:
905
- The imported module.
906
-
907
- Raises:
908
- ImportError: If the module cannot be imported.
909
- """
910
- try:
911
- full_import_path = (
912
- f"{package_name}.{module_name}" if module_name else package_name
913
- )
914
-
915
- if import_name:
916
- import_name = (
917
- [import_name]
918
- if not isinstance(import_name, list)
919
- else import_name
920
- )
921
- a = __import__(
922
- full_import_path,
923
- fromlist=import_name,
924
- )
925
- if len(import_name) == 1:
926
- return getattr(a, import_name[0])
927
- return [getattr(a, name) for name in import_name]
928
- else:
929
- return __import__(full_import_path)
930
-
931
- except ImportError as e:
932
- raise ImportError(
933
- f"Failed to import module {full_import_path}: {e}"
934
- ) from e
935
-
936
-
937
- def is_import_installed(package_name: str) -> bool:
938
- """
939
- Check if a package is installed.
940
-
941
- Args:
942
- package_name: The name of the package to check.
943
-
944
- Returns:
945
- bool: True if the package is installed, False otherwise.
946
- """
947
- return importlib.util.find_spec(package_name) is not None
lionagi/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.15.14"
1
+ __version__ = "0.16.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lionagi
3
- Version: 0.15.14
3
+ Version: 0.16.1
4
4
  Summary: An Intelligence Operating System.
5
5
  Author-email: HaiyangLi <quantocean.li@gmail.com>
6
6
  License: Apache License
@@ -225,10 +225,12 @@ Requires-Dist: anyio>=4.7.0
225
225
  Requires-Dist: backoff>=2.0.0
226
226
  Requires-Dist: jinja2>=3.0.0
227
227
  Requires-Dist: json-repair>=0.40.0
228
+ Requires-Dist: msgspec>=0.18.0
228
229
  Requires-Dist: pillow>=10.0.0
229
230
  Requires-Dist: psutil>=6.0.0
230
231
  Requires-Dist: pydantic-settings>=2.8.0
231
- Requires-Dist: pydapter[pandas]>=1.0.4
232
+ Requires-Dist: pydantic>=2.8.0
233
+ Requires-Dist: pydapter[pandas]>=1.1.1
232
234
  Requires-Dist: python-dotenv>=1.1.0
233
235
  Requires-Dist: tiktoken>=0.9.0
234
236
  Requires-Dist: toml>=0.8.0
@@ -5,11 +5,11 @@ lionagi/_types.py,sha256=j8XwSGeGrYwfmSJ8o-80bsfoalLWJgQH41ZkVevc4wk,75
5
5
  lionagi/config.py,sha256=D13nnjpgJKz_LlQrzaKKVefm4hqesz_dP9ROjWmGuLE,3811
6
6
  lionagi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  lionagi/settings.py,sha256=HDuKCEJCpc4HudKodBnhoQUGuTGhRHdlIFhbtf3VBtY,1633
8
- lionagi/utils.py,sha256=7Hlt60LiShRdNPXv4y2e_xq7W2N0PM5cGRJnc8qXAVw,28660
9
- lionagi/version.py,sha256=twn0Vrxaz4hLyeNEgJYUkN06H8sXuoxF6BpefwWSUTU,24
8
+ lionagi/utils.py,sha256=cFUhOL2clDwsRnBjNdysnK-_0Z9SmejPIkg6_i2jLXE,27512
9
+ lionagi/version.py,sha256=R5mBEOxhwu470g2hhSdRVj5XDTgHKYJlCXukuZUxrtI,23
10
10
  lionagi/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  lionagi/adapters/_utils.py,sha256=n4DS27CZfC-0O_UFaYtlUdjiMx9IeYsGpP7MVaFO5ZA,885
12
- lionagi/adapters/async_postgres_adapter.py,sha256=OEJd9ie8prxRQK2_-W9qmdI3Sl6Q7xxRs7Vey16G3pQ,3172
12
+ lionagi/adapters/async_postgres_adapter.py,sha256=StjdjzHVkYOC_xVfmaVBd0E34tdsUrbR3ENSpmZIfeI,3169
13
13
  lionagi/adapters/postgres_model_adapter.py,sha256=uwWrbnihtYsCIttHExmtAIZwyohFtKoxnHU1N1M2NvQ,4519
14
14
  lionagi/fields/__init__.py,sha256=yrn9NDAM6_v73kK7aJeb-Pvqigeu8WASaV-My-6CDsc,939
15
15
  lionagi/fields/action.py,sha256=OziEpbaUeEVo34KdtbzDxXJBgkf3QLxlcKIQAfHe4O0,5791
@@ -35,8 +35,8 @@ lionagi/libs/nested/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFC
35
35
  lionagi/libs/nested/flatten.py,sha256=sB4jxZRoaUbjak9RbIWVWNKz2hzkhQJPFffV_Ws1GA0,5479
36
36
  lionagi/libs/nested/nfilter.py,sha256=kF7AWjLFHr22SOjRBSTx-7iRPaR7gs0FY5Y4XF2sWJ8,1768
37
37
  lionagi/libs/nested/nget.py,sha256=sQRz3OKx3bYlgoyLSHOXlHzd3ob-f_jmsMfTCNZkJfo,1284
38
- lionagi/libs/nested/ninsert.py,sha256=IjJXhg-O_svHaJkLuWX1xvUQ6YTtsEnOIi8BfVpbeSM,3887
39
- lionagi/libs/nested/nmerge.py,sha256=w8frt7tw1SFonHxo9uJpPjK2_ss-OWqOc-c1Bf7sjt0,5304
38
+ lionagi/libs/nested/ninsert.py,sha256=NiQk4Ne5YKGGW4qiKXDkOkNvrIOeNQsM0lPVCQZ-KMg,3822
39
+ lionagi/libs/nested/nmerge.py,sha256=Jve5-BC4XXGVPbYNewrOOb57WOSV50CKMLbwqI0qwgs,5289
40
40
  lionagi/libs/nested/npop.py,sha256=jxzjDPF-3gGPjrs_jWaG-g1u-kSa74jOI3EotOS4s8I,2173
41
41
  lionagi/libs/nested/nset.py,sha256=vkLR970hSzj8xCk-Z3RNQMJL2x0uMHmx1pw0VZQx2T0,3393
42
42
  lionagi/libs/nested/unflatten.py,sha256=lTON1LfCyhZ3xeTEdBiIONcHLQouPcBNARTbXzHZ03U,2618
@@ -75,31 +75,36 @@ lionagi/libs/unstructured/pdf_to_image.py,sha256=lJ2CVxOYh61-3-55nusHXMOGqtEyLXs
75
75
  lionagi/libs/unstructured/read_image_to_base64.py,sha256=EJXWBJxCTa9vHBIFPRqQj0jeFXyDv1cs2oPBrWt-waQ,897
76
76
  lionagi/libs/validate/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
77
77
  lionagi/libs/validate/common_field_validators.py,sha256=1BHznXnJYcLQrHqvHKUnP6aqCptuQ0qN7KJRCExcJBU,4778
78
- lionagi/libs/validate/fuzzy_match_keys.py,sha256=M4EfpeWKE1eACLxeC4K-VDmHZXMRHeGUkDFbfny80AM,6255
78
+ lionagi/libs/validate/fuzzy_match_keys.py,sha256=Nec5W1CVdmUgzcyDHcHiaELY6tFsicjbVsMI5dsIilk,190
79
79
  lionagi/libs/validate/fuzzy_validate_mapping.py,sha256=MZpRop3whCQQtgYwJgg66nbN0KxNuKXqulaAgA0Y1_g,4935
80
- lionagi/libs/validate/string_similarity.py,sha256=axgLjDgDfBT-soxZFU2iH2bZYmGePSzc9Mxl3WlOxAA,8718
80
+ lionagi/libs/validate/string_similarity.py,sha256=kuOQFNnI773bV8KKj_PUYxx8vLRdWay8PhuvkOWsU9E,186
81
81
  lionagi/libs/validate/to_num.py,sha256=ZRHDjpTCykPfDIZZa4rZKNaR_8ZHbPDFlw9rc02DrII,11610
82
82
  lionagi/libs/validate/validate_boolean.py,sha256=bjiX_WZ3Bg8XcqoWLzE1G9BpO0AisrlZUxrpye_mlGk,3614
83
83
  lionagi/libs/validate/xml_parser.py,sha256=PHBYAre4hhthPpDP9Yrp3UYSWdANPx60F1qhxe0m4uw,7004
84
- lionagi/ln/__init__.py,sha256=aunFi1qRkEuTzdcrkN9pv499aynmQdjlNbJJBRPwRvc,1754
85
- lionagi/ln/_async_call.py,sha256=pRwJqUELQ22YMiLVv4zS-NSuTGHftqBvxSnt5P_ReZk,9390
86
- lionagi/ln/_extract_json.py,sha256=K82UBoVQbb6hib9bIqnYgFFYefvw7hIx11D6NKMZfws,1843
87
- lionagi/ln/_fuzzy_json.py,sha256=zJGyyBoEidLFSIF9i8sactTrQOhyAecQhtvhls9w4mU,3541
88
- lionagi/ln/_hash.py,sha256=g20yJfuVhAsfsBOWlkO889DHte6cbUCl6vV5QMT8nUo,3499
84
+ lionagi/ln/__init__.py,sha256=w38jHMfmmdUJc6_ZVo5x7Ieh2ugmbcTxkb4yLlmmAHI,1487
85
+ lionagi/ln/_async_call.py,sha256=mnqq5l-hNIBWrWh7X7CtmwPafg1kT-lnWWm3nJnbPoI,9384
86
+ lionagi/ln/_hash.py,sha256=WLwKsbJISE7KtOrpiE30AFtfwyOCSBjb1GslBlvj5ac,4529
89
87
  lionagi/ln/_json_dump.py,sha256=M4ceccjkU7AN6wd5fUWKFmHytE-EVe8wqoQEFP0OkoA,2026
90
- lionagi/ln/_list_call.py,sha256=oDCyTzz7F7KVAMjekKftJp7qgIZ9Yo8BUNMHasKoJhU,3935
91
- lionagi/ln/_models.py,sha256=Txhdtp2YNq6ZsK9kLza40hRpWu27DzaVNMthCG7-zJM,4786
92
- lionagi/ln/_to_list.py,sha256=DKjZAah6pm6frHls773yTMVK1I3OY7qxwLemOjRPr5A,5600
93
- lionagi/ln/_types.py,sha256=usVaL2tGnYVQ2W12eUhJYiXY-m55b_5e0tUOFcuDtkc,3607
94
- lionagi/ln/concurrency/__init__.py,sha256=Sv1LEvwN1hRESLtuYM5UltyJqx6DRsHvGmr8aof16cA,1286
95
- lionagi/ln/concurrency/cancel.py,sha256=TYLxQ1D7mqhs8J4qJ_yTqP0j01zBe-Qed8-YnJlgKi0,4018
96
- lionagi/ln/concurrency/errors.py,sha256=FhLgXGFSbKZYPNfXjdnkV-0ShPF_S34RBLyTO_Pk5C8,938
97
- lionagi/ln/concurrency/patterns.py,sha256=dlC7nhIYE-D5VySNAPsd6PYYlORRAqNX50oKJRR1PO8,7796
98
- lionagi/ln/concurrency/primitives.py,sha256=fgml37nggaEGuvAJHQY6-rpSuAuei56YVSjTlIieM2o,8996
99
- lionagi/ln/concurrency/resource_tracker.py,sha256=52Rq7yMWK7DlebBW90imSjYeEAp8Gp9nL0dG2PD8Ivs,5464
100
- lionagi/ln/concurrency/task.py,sha256=nVts_yPylkZVSk3l3I4MkUdC7rhoN2qQeFfrsvekVgE,3146
101
- lionagi/ln/concurrency/throttle.py,sha256=Ho5zh_3beSXi9cMDDj70xz447BLzBJVopnUlQ18k9Lc,2198
102
- lionagi/ln/concurrency/utils.py,sha256=4TvDnPKhtbesb6YWZ9QlhskiOb07ai_eJ-PrmqY14IE,346
88
+ lionagi/ln/_list_call.py,sha256=zvISmCeNAH7yjBcusQI1s17n556tILgePhRMdAM2plA,2831
89
+ lionagi/ln/_to_list.py,sha256=YOlrMplSpQhXDSTK4fkMF7Mhuw1wS0jGip5mS88Otro,6610
90
+ lionagi/ln/_utils.py,sha256=5Z_AsDxdtH5wNB-P4IiihhH0dYUcZMT-hTxFQBQPwL0,4303
91
+ lionagi/ln/types.py,sha256=MfLUa5iZnOdAJI4owNXA-w41l1ZL7Fs8DVE4OGXQPF8,8517
92
+ lionagi/ln/concurrency/__init__.py,sha256=xt_GLZ1Zb-nC-RnrNt8jOBWb_uf1md__B1R5cplMShg,1190
93
+ lionagi/ln/concurrency/_compat.py,sha256=itxdRzl95PLEBQvNY0zTriF39kymaNRpKncT8QsOomA,2065
94
+ lionagi/ln/concurrency/cancel.py,sha256=8JlWy_EVto4Fls1yQLBteCbpn4zP6ydnqIa_EL5kxZc,3313
95
+ lionagi/ln/concurrency/errors.py,sha256=Tg76ods-CG_9rz7TksTiRGqpTzWHi-Wm9JPotGB9iEM,869
96
+ lionagi/ln/concurrency/patterns.py,sha256=08eebVxbBxkcMFgJqZB-cXS7lRZduH1Y-zorb8fTTZs,9447
97
+ lionagi/ln/concurrency/primitives.py,sha256=-mXU-mUThbr9YUH2viw8mY5iOuKn5E5CoiTlG41NO3k,9543
98
+ lionagi/ln/concurrency/resource_tracker.py,sha256=ffLr0FkHyaHsUa4UDyWwse-8wGLaLMnAyfyeTDyzrDA,1512
99
+ lionagi/ln/concurrency/task.py,sha256=VS5keFI3Ct0fqCKbFl4kEWT5I2CgjIYizPU-S2YjGKo,2675
100
+ lionagi/ln/concurrency/throttle.py,sha256=yUAM4hnone6VzlFEos0fWERkZU9YC4J6TncZL-MqkG4,2319
101
+ lionagi/ln/concurrency/utils.py,sha256=MUWupnFtWxR15hWnligLZrS4Z1SAQ7j3cuCG08cK3GQ,431
102
+ lionagi/ln/fuzzy/__init__.py,sha256=_OE6Scyw99uU7gcCmYS4mB29LrpPayUJXeYlGhZTjlg,445
103
+ lionagi/ln/fuzzy/_extract_json.py,sha256=rYHaK36yzRpie8qO-T7mZKOue2yqCLx3ixiuKhsaKvg,2224
104
+ lionagi/ln/fuzzy/_fuzzy_json.py,sha256=S0lCkNvprn7XZHoYdRfzXueexSbjxTeLPkpyJ9IAO3A,3860
105
+ lionagi/ln/fuzzy/_fuzzy_match.py,sha256=MBL2qB180MsGkIvhiHQpVObfikBFjcLcFWG9T6vLZQ0,5915
106
+ lionagi/ln/fuzzy/_fuzzy_validate.py,sha256=ISC6EulV9VhIfR5Hh8JIq6WMcZOqt3AJPLUY6ZqpM1Y,1458
107
+ lionagi/ln/fuzzy/_string_similarity.py,sha256=axgLjDgDfBT-soxZFU2iH2bZYmGePSzc9Mxl3WlOxAA,8718
103
108
  lionagi/models/__init__.py,sha256=R7DEGWuhH-izP7eN6SOw24-I4Mr2IVPXF4gNysmF2zQ,457
104
109
  lionagi/models/field_model.py,sha256=JdmCp2pmwoy5HuduF21ivqyvMaJ04CTXu6Un-AeSwLU,23652
105
110
  lionagi/models/hashable_model.py,sha256=oOqR3OJCU9cJfWHiG0WaEw0GMqfE2WTt4cy7WsAsiRg,829
@@ -109,14 +114,14 @@ lionagi/models/operable_model.py,sha256=Zm_Hxdauqyh0za3_TJLCZ3g6nR4F45Rrnc0ZM3d5
109
114
  lionagi/models/schema_model.py,sha256=ghRIM8aBNaToAknwNlhQKpuKXcwzyCw5pDE31bVKxs0,667
110
115
  lionagi/operations/__init__.py,sha256=a1EqxC5jRgVM1z_srZsxXtTC2Q6iA79ofpcd7cyT3B8,632
111
116
  lionagi/operations/builder.py,sha256=tMl3zZkp-dQAdR27chrAmjmYVaJGshP7tf6AyNJyCUw,23177
112
- lionagi/operations/flow.py,sha256=JB0SnVZbqLJc9cRGHy_p7QKvTBcB63H9n1iDyhWJDRo,22202
117
+ lionagi/operations/flow.py,sha256=ZfCN_xlPuI2ZJAPL4opYNkTvNMaVQxTq-HKRZ4Lybjk,22248
113
118
  lionagi/operations/manager.py,sha256=YZr3VjPAZVVFd_bIjF1aoQqzzKZHNA1kcqefNi5QFFM,683
114
119
  lionagi/operations/node.py,sha256=qmjhv-8UzQMO5ocBlNWuv9nqQiLh5CV7AW_tno8jIUM,3183
115
120
  lionagi/operations/types.py,sha256=fM8HphnbBifMzhoKKvdl3JxGCBHlEGPJEYkLWj9b7vE,704
116
121
  lionagi/operations/utils.py,sha256=b8HmpF5vRgmf6PTzg3_fZCIKMnhoGa0HCyOlX6JCz7g,1263
117
122
  lionagi/operations/ReAct/ReAct.py,sha256=UzW3MClv9_w1AqrZIuATOZ9ASTb8HPD0Rlotlp0mYOg,13388
118
123
  lionagi/operations/ReAct/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
119
- lionagi/operations/ReAct/utils.py,sha256=mBKii3zIxVg-l18fXUfDqGTK0h0JX_DcM2jO_YwRRu4,4117
124
+ lionagi/operations/ReAct/utils.py,sha256=qYh-zTRCHXyuNpSgBmooTG0TVp9Pdht0tONPwdv8BT4,4102
120
125
  lionagi/operations/_act/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
121
126
  lionagi/operations/_act/act.py,sha256=LfN4UqTTHVvO1h9tqmDhVfVafVUOry4YGEivIZbmLqc,2810
122
127
  lionagi/operations/brainstorm/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
@@ -131,7 +136,7 @@ lionagi/operations/instruct/instruct.py,sha256=7pxhyP5jxwpgqjmQNb1rnGF4QAVlbMENp
131
136
  lionagi/operations/interpret/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
132
137
  lionagi/operations/interpret/interpret.py,sha256=yl1NSp2iOm3dbycVLEcnV3absnqKoubfH15v6lQgySU,1500
133
138
  lionagi/operations/operate/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
134
- lionagi/operations/operate/operate.py,sha256=G-VGjvhKxxgQLyoxigOYcYHMOazyM1ESQMfbrM33SPM,7233
139
+ lionagi/operations/operate/operate.py,sha256=SHk-BqjUWnN5aT7Xrm3lzR6yDppq_i2sbN8Iny8PelE,7512
135
140
  lionagi/operations/parse/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
136
141
  lionagi/operations/parse/parse.py,sha256=xS9uIxBzHLGD-1VpBVgGUhxF-tQDkF2KLmIpErM47RQ,6661
137
142
  lionagi/operations/plan/__init__.py,sha256=yGBPll6lOqVjadbTvDLGrTlMx3FfBW-e00z7AMvg7Uo,156
@@ -144,9 +149,11 @@ lionagi/operations/translate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
144
149
  lionagi/operations/translate/translate.py,sha256=6eBVoQRarGEJ8Tfcl6Z__PLHQTTIbM5MaPVYNeKHRIs,1397
145
150
  lionagi/protocols/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
146
151
  lionagi/protocols/_concepts.py,sha256=ZBN5OYpLMWLrl9uZqSg9GD4uwf60V4VHcxRnBTRWIRc,1555
147
- lionagi/protocols/types.py,sha256=rc1RZSxNEHSrOw72IIlWXI8vzgEmCGkZI98GIYG6sTU,2505
152
+ lionagi/protocols/contracts.py,sha256=ii7luaPJsEKOb3J-rcaNysPDGU3nEzpgy_8g1z5_CCA,1398
153
+ lionagi/protocols/ids.py,sha256=RM40pP_4waMJcfCGmEK_PfS8-k_DuDbC1fG-2Peuf6s,2472
154
+ lionagi/protocols/types.py,sha256=EEmgYcaMCbgLU2rk7lTyKyRh_B15BeMccciv097j3Eg,2828
148
155
  lionagi/protocols/action/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
149
- lionagi/protocols/action/function_calling.py,sha256=rfuzIowjJpyqO5Ynfs5fGnxsDIU5aKinTj1NI6bGlEU,5106
156
+ lionagi/protocols/action/function_calling.py,sha256=jFy6Ruh3QWkERtBHXqPWVwrOH5aDitEo8oJHZgW5xnI,5066
150
157
  lionagi/protocols/action/manager.py,sha256=XmdQIaVgSpmFBFW9kbW_rdwdQmlBteP4VRanxh_f918,8549
151
158
  lionagi/protocols/action/tool.py,sha256=h2FAY1b8y3LXrvAtfFhvdv1nu8cwz2knUeRCi2G9k1E,5243
152
159
  lionagi/protocols/forms/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
@@ -155,17 +162,17 @@ lionagi/protocols/forms/flow.py,sha256=t9Ycvmb-stj0rCyvXXwd7WBcDtuCCTEKYst2aqFDV
155
162
  lionagi/protocols/forms/form.py,sha256=B4903km_Ljz-OxYkb1ZT_cpHZSaAYYJpZMsffWlooo8,3062
156
163
  lionagi/protocols/forms/report.py,sha256=SvJJjOSCTfVuqK7AKaY8ldQIGJeSK2zoyPWUV41ge2c,1609
157
164
  lionagi/protocols/generic/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
158
- lionagi/protocols/generic/element.py,sha256=5R9cLodaPzSPbellgFEudRxZIOMJDiCV8emyQKuEbPI,18621
159
- lionagi/protocols/generic/event.py,sha256=Rwke4sNLddQlJ8PTu-dTPZYBy1qmwaLAERbOLd_udpg,6512
165
+ lionagi/protocols/generic/element.py,sha256=etpT_ANFgBYYCPRzbVgX16i6C1tZaxNXL5PuY-rqhmA,16205
166
+ lionagi/protocols/generic/event.py,sha256=n5EraAJ5bPiwegTdkxsILs7-vFJwmnXhB2om4xMQnK0,6529
160
167
  lionagi/protocols/generic/log.py,sha256=Y06zAQewkNlaIWjut_c6c45KY_LJfLHwzUaDGLULaas,8212
161
168
  lionagi/protocols/generic/pile.py,sha256=mc10zh9RdqfozPEBOgRdkrTgIWUHBz8enAcQ-8pFhRQ,37046
162
- lionagi/protocols/generic/processor.py,sha256=GvHblXvOaZJ485L3bWcV3S4w9x0GYxWH-LkPXv00zMI,11700
169
+ lionagi/protocols/generic/processor.py,sha256=uiNIldAYPEujuboLFyrIJADMlhRghy3H86hYintj5D4,11705
163
170
  lionagi/protocols/generic/progression.py,sha256=HCV_EnQCFvjg6D7eF4ygGrZNQPEOtu75zvW1sJbAVrM,15190
164
171
  lionagi/protocols/graph/__init__.py,sha256=UPu3OmUpjSgX2aBuBJUdG2fppGlfqAH96hU0qIMBMp0,253
165
172
  lionagi/protocols/graph/_utils.py,sha256=mts4M2wcGKdY9hC-1917lxIJT5oycW9VnRgfRx8ydbI,605
166
173
  lionagi/protocols/graph/edge.py,sha256=YxSGj4w_fG7khm-zpKduuK5fJzhJDx23JhU1dZp29d8,5241
167
- lionagi/protocols/graph/graph.py,sha256=iM54gAluKgnYtv-6UaYqWhlzdijZPw0B1vren-LrNes,10605
168
- lionagi/protocols/graph/node.py,sha256=JwX-yaXgjifZbWYUtfL99H2_9T8EnWs73tPqo5xvI00,4594
174
+ lionagi/protocols/graph/graph.py,sha256=eczTdL6XoeSmG6gqF-iTQXDurPAq0y1jMF0FNoCjUX4,10586
175
+ lionagi/protocols/graph/node.py,sha256=DZapkk4SJSzDEB1BfD3S2DUelcheTha2JoW8rSIcqxY,4562
169
176
  lionagi/protocols/mail/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
170
177
  lionagi/protocols/mail/exchange.py,sha256=P1PcrFylIBeiQa8kox9H1qyJ4kjhUlbLiTUT8rs1OXg,7041
171
178
  lionagi/protocols/mail/mail.py,sha256=RB5CUft_4J85H9nM9g6aRXomTaqKwF5xVjJacPAhoa8,1356
@@ -177,9 +184,9 @@ lionagi/protocols/messages/action_request.py,sha256=-tG9ViTSiZ2beM0onE6C552H5oth
177
184
  lionagi/protocols/messages/action_response.py,sha256=SM3_vA9QPXz3Gc9uPhXm3zOXYheHZZGtl67Yff48Vu8,5272
178
185
  lionagi/protocols/messages/assistant_response.py,sha256=jrzRPVHHDnPw86Xp0IHnPy0tOZdsk7rBwhG5xnBXAjs,6912
179
186
  lionagi/protocols/messages/base.py,sha256=Ng1Q8yIIIFauUv53LnwDeyOrM-cSCfsHM1GwkxChf2o,2317
180
- lionagi/protocols/messages/instruction.py,sha256=0dUsUYd6xYsbOHU7GafvqBkpDQQoFOXJXT-UoJArYWU,21146
181
- lionagi/protocols/messages/manager.py,sha256=zN8LaWFWhNHZ1eB03XqDUqsab_EJ8CBZunohMt3-4JY,16916
182
- lionagi/protocols/messages/message.py,sha256=OV9jnRRvhwIib5Sg8Md6XlFk-V7dTvKdLcf1K-l7vZE,7784
187
+ lionagi/protocols/messages/instruction.py,sha256=Qpme1oSc406V3-F2iOyqC8TVT2GWVduZaoDfdGdBnDI,21127
188
+ lionagi/protocols/messages/manager.py,sha256=ABDiN-QULbfbSrHVlPe3kqBxr7e7sYoT49wHQMLiT6c,16897
189
+ lionagi/protocols/messages/message.py,sha256=eXBLDsu8D7x7lkksub23rseOHTHIDXKSg4wRnbSuSOU,7744
183
190
  lionagi/protocols/messages/system.py,sha256=x0F1C57SFHaO2-Z9cy1QshYlxv8wjl7VppooaGKbMIg,4658
184
191
  lionagi/protocols/messages/templates/README.md,sha256=Ch4JrKSjd85fLitAYO1OhZjNOGKHoEwaKQlcV16jiUI,1286
185
192
  lionagi/protocols/messages/templates/action_request.jinja2,sha256=d6OmxHKyvvNDSK4bnBM3TGSUk_HeE_Q2EtLAQ0ZBEJg,120
@@ -195,7 +202,7 @@ lionagi/service/__init__.py,sha256=C_TPk1roVYz6uVLK1JVxrK3tPtYqN6W0D7FzI-s6CWY,5
195
202
  lionagi/service/imodel.py,sha256=ya406sf42-KRrKN4TJJLtI6wsKeM5hAhWr7Hubg7W0E,16371
196
203
  lionagi/service/manager.py,sha256=tN3p0kM7pg_CEs6wXK62_B_h49Q3nrU-9qniFhw2ABE,1164
197
204
  lionagi/service/rate_limited_processor.py,sha256=JhkuzJMHUCdndkRbAUf9wUQI9zOw-dutRy_nHf8EE5I,6101
198
- lionagi/service/resilience.py,sha256=uYJYZQ9M-tje8ME3vJmYabXwKHF1c3Ij4-WrdCwogcs,18742
205
+ lionagi/service/resilience.py,sha256=91RPFtQY4QyNga_nuSNLsbzNE26pXJMTAfLaQqVdvmg,18714
199
206
  lionagi/service/token_calculator.py,sha256=piTidArzUkIMCtOLC_HBLoZNYZcENQywgeKM31bxezM,6457
200
207
  lionagi/service/types.py,sha256=9zX08BhdmPE9FE1YTyvsy14hdDGRYzyyVBmoBURzQvI,1096
201
208
  lionagi/service/connections/__init__.py,sha256=yHQZ7OJpCftd6CStYR8inbxjJydYdmv9kCvbUBhJ2zU,362
@@ -206,7 +213,7 @@ lionagi/service/connections/header_factory.py,sha256=IYeTQQk7r8FXcdhmW7orCxHjNO-
206
213
  lionagi/service/connections/match_endpoint.py,sha256=Df5v3bprnJq5CqOzuK0KzwawOIfAsGZZM4CnE-sliu4,2850
207
214
  lionagi/service/connections/providers/__init__.py,sha256=3lzOakDoBWmMaNnT2g-YwktPKa_Wme4lnPRSmOQfayY,105
208
215
  lionagi/service/connections/providers/anthropic_.py,sha256=vok8mIyFiuV3K83tOjdYfruA6cv1h_57ML6RtpuW-bU,3157
209
- lionagi/service/connections/providers/claude_code_.py,sha256=dix4VoR2YwRabJ0F8I3mV8sVtRQEquExqP6mfbE_rGk,10435
216
+ lionagi/service/connections/providers/claude_code_.py,sha256=lCQd6HQ-5CsOKc-YtBbYMsumfKswW2-gFaXjWpo9V6U,10420
210
217
  lionagi/service/connections/providers/claude_code_cli.py,sha256=kqEOnCUOOh2O_3NGi6W7r-gdLsbW-Jcp11tm30VEv4Q,4455
211
218
  lionagi/service/connections/providers/exa_.py,sha256=kuWD7yyYRqIa4ChSn0TsxFA5V5LwvFUD-w8TZ6mx4rk,1048
212
219
  lionagi/service/connections/providers/nvidia_nim_.py,sha256=95vmo0DSONYBVHkR9SGJ5BiHNKFZNZBrjw4_7ShOXQA,3154
@@ -235,8 +242,8 @@ lionagi/tools/base.py,sha256=hEGnE4MD0CM4UqnF0xsDRKB0aM-pyrTFHl8utHhyJLU,1897
235
242
  lionagi/tools/types.py,sha256=XtJLY0m-Yi_ZLWhm0KycayvqMCZd--HxfQ0x9vFUYDE,230
236
243
  lionagi/tools/file/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
237
244
  lionagi/tools/file/reader.py,sha256=2YKgU3VKo76zfL_buDAUQJoPLC56f6WJ4_mdJjlMDIM,9509
238
- lionagi/tools/memory/tools.py,sha256=earYkKxSOz_iXkqVZYTEDfE3dwZYIWPXZrqQ1DYGz4I,15941
239
- lionagi-0.15.14.dist-info/METADATA,sha256=B9IMnGWdUDI43F5aDYmhldz7LynHcJ8mjRp_2xubKgk,23052
240
- lionagi-0.15.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
241
- lionagi-0.15.14.dist-info/licenses/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
242
- lionagi-0.15.14.dist-info/RECORD,,
245
+ lionagi/tools/memory/tools.py,sha256=7hO0Ua3D7sP_VS0VTqd6pbRd80nQX8Zl9nTJyGXjtMo,15911
246
+ lionagi-0.16.1.dist-info/METADATA,sha256=n7VXqGgUE7Ajne1SHvzGF8XHt-JpWjMIvscXCBwQ9nE,23113
247
+ lionagi-0.16.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
248
+ lionagi-0.16.1.dist-info/licenses/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
249
+ lionagi-0.16.1.dist-info/RECORD,,
lionagi/ln/_types.py DELETED
@@ -1,146 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from enum import Enum as _Enum
4
- from typing import Any, Final, Literal, TypeVar, Union
5
-
6
- from typing_extensions import TypedDict
7
-
8
- __all__ = (
9
- "Undefined",
10
- "Unset",
11
- "MaybeUndefined",
12
- "MaybeUnset",
13
- "MaybeSentinel",
14
- "SingletonType",
15
- "UndefinedType",
16
- "UnsetType",
17
- "KeysDict",
18
- "T",
19
- "Enum",
20
- "is_sentinel",
21
- "not_sentinel",
22
- )
23
-
24
- T = TypeVar("T")
25
-
26
-
27
- class _SingletonMeta(type):
28
- """Metaclass that guarantees exactly one instance per subclass.
29
-
30
- This ensures that sentinel values maintain identity across the entire application,
31
- allowing safe identity checks with 'is' operator.
32
- """
33
-
34
- _cache: dict[type, SingletonType] = {}
35
-
36
- def __call__(cls, *a, **kw):
37
- if cls not in cls._cache:
38
- cls._cache[cls] = super().__call__(*a, **kw)
39
- return cls._cache[cls]
40
-
41
-
42
- class SingletonType(metaclass=_SingletonMeta):
43
- """Base class for singleton sentinel types.
44
-
45
- Provides consistent interface for sentinel values with:
46
- - Identity preservation across deepcopy
47
- - Falsy boolean evaluation
48
- - Clear string representation
49
- """
50
-
51
- __slots__: tuple[str, ...] = ()
52
-
53
- def __deepcopy__(self, memo): # copy & deepcopy both noop
54
- return self
55
-
56
- def __copy__(self):
57
- return self
58
-
59
- # concrete classes *must* override the two methods below
60
- def __bool__(self) -> bool: ...
61
- def __repr__(self) -> str: ...
62
-
63
-
64
- class UndefinedType(SingletonType):
65
- """Sentinel for a key or field entirely missing from a namespace.
66
-
67
- Use this when:
68
- - A field has never been set
69
- - A key doesn't exist in a mapping
70
- - A value is conceptually undefined (not just unset)
71
-
72
- Example:
73
- >>> d = {"a": 1}
74
- >>> d.get("b", Undefined) is Undefined
75
- True
76
- """
77
-
78
- __slots__ = ()
79
-
80
- def __bool__(self) -> Literal[False]:
81
- return False
82
-
83
- def __repr__(self) -> Literal["Undefined"]:
84
- return "Undefined"
85
-
86
- def __str__(self) -> Literal["Undefined"]:
87
- return "Undefined"
88
-
89
-
90
- class UnsetType(SingletonType):
91
- """Sentinel for a key present but value not yet provided.
92
-
93
- Use this when:
94
- - A parameter exists but hasn't been given a value
95
- - Distinguishing between None and "not provided"
96
- - API parameters that are optional but need explicit handling
97
-
98
- Example:
99
- >>> def func(param=Unset):
100
- ... if param is not Unset:
101
- ... # param was explicitly provided
102
- ... process(param)
103
- """
104
-
105
- __slots__ = ()
106
-
107
- def __bool__(self) -> Literal[False]:
108
- return False
109
-
110
- def __repr__(self) -> Literal["Unset"]:
111
- return "Unset"
112
-
113
- def __str__(self) -> Literal["Unset"]:
114
- return "Unset"
115
-
116
-
117
- Undefined: Final = UndefinedType()
118
- """A key or field entirely missing from a namespace"""
119
- Unset: Final = UnsetType()
120
- """A key present but value not yet provided."""
121
-
122
- MaybeUndefined = Union[T, UndefinedType]
123
- MaybeUnset = Union[T, UnsetType]
124
- MaybeSentinel = Union[T, UndefinedType, UnsetType]
125
-
126
-
127
- def is_sentinel(value: Any) -> bool:
128
- """Check if a value is any sentinel (Undefined or Unset)."""
129
- return value is Undefined or value is Unset
130
-
131
-
132
- def not_sentinel(value: Any) -> bool:
133
- """Check if a value is NOT a sentinel. Useful for filtering operations."""
134
- return value is not Undefined and value is not Unset
135
-
136
-
137
- class Enum(_Enum):
138
- @classmethod
139
- def allowed(cls) -> tuple[str, ...]:
140
- return tuple(e.value for e in cls)
141
-
142
-
143
- class KeysDict(TypedDict, total=False):
144
- """TypedDict for keys dictionary."""
145
-
146
- key: Any # Represents any key-type pair