lionagi 0.16.1__py3-none-any.whl → 0.16.3__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.
- lionagi/adapters/_utils.py +0 -14
- lionagi/libs/file/save.py +8 -1
- lionagi/ln/__init__.py +10 -0
- lionagi/ln/_json_dump.py +322 -49
- lionagi/ln/fuzzy/__init__.py +4 -1
- lionagi/ln/fuzzy/_fuzzy_validate.py +109 -0
- lionagi/ln/fuzzy/_to_dict.py +388 -0
- lionagi/models/__init__.py +0 -2
- lionagi/operations/brainstorm/brainstorm.py +10 -10
- lionagi/operations/communicate/communicate.py +1 -1
- lionagi/operations/parse/parse.py +1 -1
- lionagi/protocols/generic/element.py +5 -14
- lionagi/protocols/generic/log.py +2 -2
- lionagi/protocols/generic/pile.py +1 -1
- lionagi/protocols/messages/message.py +8 -1
- lionagi/protocols/operatives/operative.py +2 -2
- lionagi/service/connections/endpoint.py +7 -0
- lionagi/service/connections/match_endpoint.py +2 -10
- lionagi/service/connections/providers/types.py +1 -3
- lionagi/service/hooks/hook_event.py +1 -1
- lionagi/service/hooks/hook_registry.py +1 -1
- lionagi/service/rate_limited_processor.py +1 -1
- lionagi/session/branch.py +1 -101
- lionagi/session/session.py +9 -14
- lionagi/utils.py +3 -334
- lionagi/version.py +1 -1
- {lionagi-0.16.1.dist-info → lionagi-0.16.3.dist-info}/METADATA +3 -13
- {lionagi-0.16.1.dist-info → lionagi-0.16.3.dist-info}/RECORD +30 -78
- lionagi/adapters/postgres_model_adapter.py +0 -131
- lionagi/libs/concurrency.py +0 -1
- lionagi/libs/file/params.py +0 -175
- lionagi/libs/nested/__init__.py +0 -3
- lionagi/libs/nested/flatten.py +0 -172
- lionagi/libs/nested/nfilter.py +0 -59
- lionagi/libs/nested/nget.py +0 -45
- lionagi/libs/nested/ninsert.py +0 -104
- lionagi/libs/nested/nmerge.py +0 -158
- lionagi/libs/nested/npop.py +0 -69
- lionagi/libs/nested/nset.py +0 -94
- lionagi/libs/nested/unflatten.py +0 -83
- lionagi/libs/nested/utils.py +0 -189
- lionagi/libs/parse.py +0 -31
- lionagi/libs/schema/json_schema.py +0 -231
- lionagi/libs/token_transform/__init__.py +0 -0
- lionagi/libs/token_transform/base.py +0 -54
- lionagi/libs/token_transform/llmlingua.py +0 -1
- lionagi/libs/token_transform/perplexity.py +0 -450
- lionagi/libs/token_transform/symbolic_compress_context.py +0 -152
- lionagi/libs/token_transform/synthlang.py +0 -9
- lionagi/libs/token_transform/synthlang_/base.py +0 -128
- lionagi/libs/token_transform/synthlang_/resources/frameworks/abstract_algebra.toml +0 -11
- lionagi/libs/token_transform/synthlang_/resources/frameworks/category_theory.toml +0 -11
- lionagi/libs/token_transform/synthlang_/resources/frameworks/complex_analysis.toml +0 -11
- lionagi/libs/token_transform/synthlang_/resources/frameworks/framework_options.json +0 -52
- lionagi/libs/token_transform/synthlang_/resources/frameworks/group_theory.toml +0 -11
- lionagi/libs/token_transform/synthlang_/resources/frameworks/math_logic.toml +0 -11
- lionagi/libs/token_transform/synthlang_/resources/frameworks/reflective_patterns.toml +0 -11
- lionagi/libs/token_transform/synthlang_/resources/frameworks/set_theory.toml +0 -11
- lionagi/libs/token_transform/synthlang_/resources/frameworks/topology_fundamentals.toml +0 -11
- lionagi/libs/token_transform/synthlang_/resources/mapping/lion_emoji_mapping.toml +0 -61
- lionagi/libs/token_transform/synthlang_/resources/mapping/python_math_mapping.toml +0 -41
- lionagi/libs/token_transform/synthlang_/resources/mapping/rust_chinese_mapping.toml +0 -60
- lionagi/libs/token_transform/synthlang_/resources/utility/base_synthlang_system_prompt.toml +0 -11
- lionagi/libs/token_transform/synthlang_/translate_to_synthlang.py +0 -140
- lionagi/libs/token_transform/types.py +0 -15
- lionagi/libs/unstructured/__init__.py +0 -0
- lionagi/libs/unstructured/pdf_to_image.py +0 -45
- lionagi/libs/unstructured/read_image_to_base64.py +0 -33
- lionagi/libs/validate/fuzzy_match_keys.py +0 -7
- lionagi/libs/validate/fuzzy_validate_mapping.py +0 -144
- lionagi/libs/validate/string_similarity.py +0 -7
- lionagi/libs/validate/xml_parser.py +0 -203
- lionagi/models/note.py +0 -383
- lionagi/operations/translate/__init__.py +0 -0
- lionagi/operations/translate/translate.py +0 -47
- lionagi/service/connections/providers/claude_code_.py +0 -294
- lionagi/tools/memory/tools.py +0 -495
- {lionagi-0.16.1.dist-info → lionagi-0.16.3.dist-info}/WHEEL +0 -0
- {lionagi-0.16.1.dist-info → lionagi-0.16.3.dist-info}/licenses/LICENSE +0 -0
@@ -5,12 +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=
|
9
|
-
lionagi/version.py,sha256=
|
8
|
+
lionagi/utils.py,sha256=pfAibR84sx-aPxGNPrdlHqUAf2OXoCBGRCMseMrzhi4,18046
|
9
|
+
lionagi/version.py,sha256=VI_bTBU6ZbRZpVhA2ix956hkRwHW57V59GEZJkhU-vc,23
|
10
10
|
lionagi/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
lionagi/adapters/_utils.py,sha256=
|
11
|
+
lionagi/adapters/_utils.py,sha256=Lq_tP6zU5HasADuHNDLQf7mqdPSwKyayvfJBLx41Pag,444
|
12
12
|
lionagi/adapters/async_postgres_adapter.py,sha256=StjdjzHVkYOC_xVfmaVBd0E34tdsUrbR3ENSpmZIfeI,3169
|
13
|
-
lionagi/adapters/postgres_model_adapter.py,sha256=uwWrbnihtYsCIttHExmtAIZwyohFtKoxnHU1N1M2NvQ,4519
|
14
13
|
lionagi/fields/__init__.py,sha256=yrn9NDAM6_v73kK7aJeb-Pvqigeu8WASaV-My-6CDsc,939
|
15
14
|
lionagi/fields/action.py,sha256=OziEpbaUeEVo34KdtbzDxXJBgkf3QLxlcKIQAfHe4O0,5791
|
16
15
|
lionagi/fields/base.py,sha256=mvgqxLonCROszMjnG8QWt00l-MvIr_mnGvCtaH-SQ_k,3814
|
@@ -20,71 +19,28 @@ lionagi/fields/instruct.py,sha256=2koYdY7XyJh5lrd7tD_BA9bqCbmpsdTDaASEv_dX4i8,43
|
|
20
19
|
lionagi/fields/reason.py,sha256=6IjgJWv-dhsGmg5O1sq2J5syBibYfRBy3--7q7_ZpMY,1452
|
21
20
|
lionagi/fields/research.py,sha256=eEPKocx8eQy2E9FExRWVIo6MK_xvmwBAoRZciBY3RG0,1421
|
22
21
|
lionagi/libs/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
23
|
-
lionagi/libs/concurrency.py,sha256=45iic6IdetVFMXFhUWTGfj3g8A0dd2eaVvCSiK-cIWc,57
|
24
|
-
lionagi/libs/parse.py,sha256=6tDijmB7yzHLHbLtDnc8Bsn7NgIDWta4JKjdwodTF9E,1051
|
25
22
|
lionagi/libs/file/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
26
23
|
lionagi/libs/file/_utils.py,sha256=lCNCD-WNUq9f8ZlNecGESIz0GncWkJei8xYtvyY8qd4,334
|
27
24
|
lionagi/libs/file/chunk.py,sha256=XeVMwM33JF0X1W6udz_nhlb3DCevA_EK6A50Hn_e5SY,9300
|
28
25
|
lionagi/libs/file/concat.py,sha256=YSauXVBL3WWx5Mvpn208Cj7q9TLt_aq-0M9J1fm-ins,3864
|
29
26
|
lionagi/libs/file/concat_files.py,sha256=FoI983oWFzp9VfFDP7kmbRb3t1CPe5F5LCtsux0ASAs,3089
|
30
27
|
lionagi/libs/file/file_ops.py,sha256=HBiIh1EljIJ5VTIXuyvJM0ppSs0YYOPUWmgDMJT634U,3430
|
31
|
-
lionagi/libs/file/params.py,sha256=SZ5DkoffWfxWudOAYCfCxpL8UIm-1UjeyTtploo-Lqs,5824
|
32
28
|
lionagi/libs/file/process.py,sha256=XTfh1JDPancjFU0qr4-ONB2OXfKKkhQxL49sChYLl-0,8672
|
33
|
-
lionagi/libs/file/save.py,sha256=
|
34
|
-
lionagi/libs/nested/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
35
|
-
lionagi/libs/nested/flatten.py,sha256=sB4jxZRoaUbjak9RbIWVWNKz2hzkhQJPFffV_Ws1GA0,5479
|
36
|
-
lionagi/libs/nested/nfilter.py,sha256=kF7AWjLFHr22SOjRBSTx-7iRPaR7gs0FY5Y4XF2sWJ8,1768
|
37
|
-
lionagi/libs/nested/nget.py,sha256=sQRz3OKx3bYlgoyLSHOXlHzd3ob-f_jmsMfTCNZkJfo,1284
|
38
|
-
lionagi/libs/nested/ninsert.py,sha256=NiQk4Ne5YKGGW4qiKXDkOkNvrIOeNQsM0lPVCQZ-KMg,3822
|
39
|
-
lionagi/libs/nested/nmerge.py,sha256=Jve5-BC4XXGVPbYNewrOOb57WOSV50CKMLbwqI0qwgs,5289
|
40
|
-
lionagi/libs/nested/npop.py,sha256=jxzjDPF-3gGPjrs_jWaG-g1u-kSa74jOI3EotOS4s8I,2173
|
41
|
-
lionagi/libs/nested/nset.py,sha256=vkLR970hSzj8xCk-Z3RNQMJL2x0uMHmx1pw0VZQx2T0,3393
|
42
|
-
lionagi/libs/nested/unflatten.py,sha256=lTON1LfCyhZ3xeTEdBiIONcHLQouPcBNARTbXzHZ03U,2618
|
43
|
-
lionagi/libs/nested/utils.py,sha256=r8xuBpH0qQaHMnCqXPF6unIKzw-TqwVbq-ARooWRERo,6090
|
29
|
+
lionagi/libs/file/save.py,sha256=jTiJMTOK3IiuCz1XbYZlzFmsqiy2q_Xz6subc4ZTJps,3063
|
44
30
|
lionagi/libs/schema/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
45
31
|
lionagi/libs/schema/as_readable.py,sha256=p8ke8ZxLwLQxmsJWD_N7Q_AYDYK60nuHztUREbTa5sk,12027
|
46
32
|
lionagi/libs/schema/extract_code_block.py,sha256=PuJbJj1JnqR5fSZudowPcVPpEoKISLr0MjTOOVXSzwY,2394
|
47
33
|
lionagi/libs/schema/extract_docstring.py,sha256=uWyUevXS4JSN60tfouoBBAyE4_jyE-fz45CiS-fvKeI,5714
|
48
34
|
lionagi/libs/schema/function_to_schema.py,sha256=XAB031WbYu3a7eFJyYjXVMAjmtWYSYr5kC_DYgjiuyM,5604
|
49
|
-
lionagi/libs/schema/json_schema.py,sha256=cuHcaMr748O9g6suNGmRx4tRXcidd5-c7AMGjTIZyHM,7670
|
50
35
|
lionagi/libs/schema/load_pydantic_model_from_schema.py,sha256=WIgJPmOu558az35CfOHvwyyTYQ5OBlk0hchvaEOADjQ,10109
|
51
|
-
lionagi/libs/token_transform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
52
|
-
lionagi/libs/token_transform/base.py,sha256=LBnaDgi4HNgaJJGwIzWcQjVMdu49i_93rRvOvMU22Rw,1545
|
53
|
-
lionagi/libs/token_transform/llmlingua.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
54
|
-
lionagi/libs/token_transform/perplexity.py,sha256=m-n_ErNfFZ9fvM9TReBnfSmp-89PKM7bCmtAAszFnS0,14458
|
55
|
-
lionagi/libs/token_transform/symbolic_compress_context.py,sha256=hcYxvL0q2Lr8SIOPN09339TIQ8iROCwhBEUnwt9llXU,4636
|
56
|
-
lionagi/libs/token_transform/synthlang.py,sha256=W6e-_265UXqVosM9X0TLKW53rNHvWCKhsWbVAop49Ac,259
|
57
|
-
lionagi/libs/token_transform/types.py,sha256=4HgAfNDlJ_Hu18kLt59GHr_76eF3xLpNCTbOXlAYVlA,491
|
58
|
-
lionagi/libs/token_transform/synthlang_/base.py,sha256=djsR3Lc0UH1PYy2q4fpqL9tp-ZNKOYbmVTDP-_d1Poo,4107
|
59
|
-
lionagi/libs/token_transform/synthlang_/translate_to_synthlang.py,sha256=guA5v8CQRdAOsznsUSoK_x2JFzGbHE079AijDqqPPOw,4946
|
60
|
-
lionagi/libs/token_transform/synthlang_/resources/frameworks/abstract_algebra.toml,sha256=2TuOAo97g8mNhdPH96HP8vYZpnC8neiP-KlhVqbp1Us,970
|
61
|
-
lionagi/libs/token_transform/synthlang_/resources/frameworks/category_theory.toml,sha256=Stg9W3h8o7VkQ9tdAfSZmR3LctFqcH6OhOPdaw9BlIg,1064
|
62
|
-
lionagi/libs/token_transform/synthlang_/resources/frameworks/complex_analysis.toml,sha256=iE6FS7Cn5_uJRG5-StLuMM4XVAk95bxhbYWwlstw_tA,1044
|
63
|
-
lionagi/libs/token_transform/synthlang_/resources/frameworks/framework_options.json,sha256=phAkedPGrwgNGW8hgPyH6pKU47pvKEAnG7vheWFvOLc,1760
|
64
|
-
lionagi/libs/token_transform/synthlang_/resources/frameworks/group_theory.toml,sha256=iVlcS250YMosNRv3l8bz3BT9Tx1xCmiwhfNt4CjjRYc,713
|
65
|
-
lionagi/libs/token_transform/synthlang_/resources/frameworks/math_logic.toml,sha256=jeFOF8gjRhb4hYXpW7AxTX8uk9c6DvGulJK5Bowxhq4,1037
|
66
|
-
lionagi/libs/token_transform/synthlang_/resources/frameworks/reflective_patterns.toml,sha256=LxBIVLHNLfvVdXjLAzqivrYaHNix514DLNYsbA-VSQ4,5730
|
67
|
-
lionagi/libs/token_transform/synthlang_/resources/frameworks/set_theory.toml,sha256=SZpBvUySZ3_0pIrRko24a3KfbPHd55LyNwzFHyznjs4,1457
|
68
|
-
lionagi/libs/token_transform/synthlang_/resources/frameworks/topology_fundamentals.toml,sha256=nnhfbIJQ5pTGlX7lo1XzjyOevaZOHuusvBuhwWHzbLk,1008
|
69
|
-
lionagi/libs/token_transform/synthlang_/resources/mapping/lion_emoji_mapping.toml,sha256=THLrry9RTHMCMv-g6VCwrlaE4_9_fjXkABgyAyhokew,1323
|
70
|
-
lionagi/libs/token_transform/synthlang_/resources/mapping/python_math_mapping.toml,sha256=Q0MqTf9t5rWuKHLsKu9WS8NSBSb9FsGAAaG5EYQiGCA,964
|
71
|
-
lionagi/libs/token_transform/synthlang_/resources/mapping/rust_chinese_mapping.toml,sha256=o-7KACVDQYkpAGSFgsMCeIy_S93CilUP9w1ZKM0w62A,1217
|
72
|
-
lionagi/libs/token_transform/synthlang_/resources/utility/base_synthlang_system_prompt.toml,sha256=8xhY14WdDRF6GIToqzRPM7EjM6-uO6-hQ9Muei1A2Iw,3458
|
73
|
-
lionagi/libs/unstructured/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
74
|
-
lionagi/libs/unstructured/pdf_to_image.py,sha256=lJ2CVxOYh61-3-55nusHXMOGqtEyLXsXmDjZ9yjkM48,1394
|
75
|
-
lionagi/libs/unstructured/read_image_to_base64.py,sha256=EJXWBJxCTa9vHBIFPRqQj0jeFXyDv1cs2oPBrWt-waQ,897
|
76
36
|
lionagi/libs/validate/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
77
37
|
lionagi/libs/validate/common_field_validators.py,sha256=1BHznXnJYcLQrHqvHKUnP6aqCptuQ0qN7KJRCExcJBU,4778
|
78
|
-
lionagi/libs/validate/fuzzy_match_keys.py,sha256=Nec5W1CVdmUgzcyDHcHiaELY6tFsicjbVsMI5dsIilk,190
|
79
|
-
lionagi/libs/validate/fuzzy_validate_mapping.py,sha256=MZpRop3whCQQtgYwJgg66nbN0KxNuKXqulaAgA0Y1_g,4935
|
80
|
-
lionagi/libs/validate/string_similarity.py,sha256=kuOQFNnI773bV8KKj_PUYxx8vLRdWay8PhuvkOWsU9E,186
|
81
38
|
lionagi/libs/validate/to_num.py,sha256=ZRHDjpTCykPfDIZZa4rZKNaR_8ZHbPDFlw9rc02DrII,11610
|
82
39
|
lionagi/libs/validate/validate_boolean.py,sha256=bjiX_WZ3Bg8XcqoWLzE1G9BpO0AisrlZUxrpye_mlGk,3614
|
83
|
-
lionagi/
|
84
|
-
lionagi/ln/__init__.py,sha256=w38jHMfmmdUJc6_ZVo5x7Ieh2ugmbcTxkb4yLlmmAHI,1487
|
40
|
+
lionagi/ln/__init__.py,sha256=6AUiutwLj15M6R6Z2915AC3zKQoLcuqwnnmMJ6OOcq0,1689
|
85
41
|
lionagi/ln/_async_call.py,sha256=mnqq5l-hNIBWrWh7X7CtmwPafg1kT-lnWWm3nJnbPoI,9384
|
86
42
|
lionagi/ln/_hash.py,sha256=WLwKsbJISE7KtOrpiE30AFtfwyOCSBjb1GslBlvj5ac,4529
|
87
|
-
lionagi/ln/_json_dump.py,sha256=
|
43
|
+
lionagi/ln/_json_dump.py,sha256=r3Hwsl94Z9b4Kr6PCT-AYXWZkEeFXuPwpbpLDPjooew,10550
|
88
44
|
lionagi/ln/_list_call.py,sha256=zvISmCeNAH7yjBcusQI1s17n556tILgePhRMdAM2plA,2831
|
89
45
|
lionagi/ln/_to_list.py,sha256=YOlrMplSpQhXDSTK4fkMF7Mhuw1wS0jGip5mS88Otro,6610
|
90
46
|
lionagi/ln/_utils.py,sha256=5Z_AsDxdtH5wNB-P4IiihhH0dYUcZMT-hTxFQBQPwL0,4303
|
@@ -99,17 +55,17 @@ lionagi/ln/concurrency/resource_tracker.py,sha256=ffLr0FkHyaHsUa4UDyWwse-8wGLaLM
|
|
99
55
|
lionagi/ln/concurrency/task.py,sha256=VS5keFI3Ct0fqCKbFl4kEWT5I2CgjIYizPU-S2YjGKo,2675
|
100
56
|
lionagi/ln/concurrency/throttle.py,sha256=yUAM4hnone6VzlFEos0fWERkZU9YC4J6TncZL-MqkG4,2319
|
101
57
|
lionagi/ln/concurrency/utils.py,sha256=MUWupnFtWxR15hWnligLZrS4Z1SAQ7j3cuCG08cK3GQ,431
|
102
|
-
lionagi/ln/fuzzy/__init__.py,sha256=
|
58
|
+
lionagi/ln/fuzzy/__init__.py,sha256=Py7hPV7uk5rPRGvQ4yPjMzXS32aQ7QVkO-mX69FfsMM,544
|
103
59
|
lionagi/ln/fuzzy/_extract_json.py,sha256=rYHaK36yzRpie8qO-T7mZKOue2yqCLx3ixiuKhsaKvg,2224
|
104
60
|
lionagi/ln/fuzzy/_fuzzy_json.py,sha256=S0lCkNvprn7XZHoYdRfzXueexSbjxTeLPkpyJ9IAO3A,3860
|
105
61
|
lionagi/ln/fuzzy/_fuzzy_match.py,sha256=MBL2qB180MsGkIvhiHQpVObfikBFjcLcFWG9T6vLZQ0,5915
|
106
|
-
lionagi/ln/fuzzy/_fuzzy_validate.py,sha256=
|
62
|
+
lionagi/ln/fuzzy/_fuzzy_validate.py,sha256=kl-IUGA6O8rY2eKXSwMMTRX6YIV4986r9zd0djidr-o,5212
|
107
63
|
lionagi/ln/fuzzy/_string_similarity.py,sha256=axgLjDgDfBT-soxZFU2iH2bZYmGePSzc9Mxl3WlOxAA,8718
|
108
|
-
lionagi/
|
64
|
+
lionagi/ln/fuzzy/_to_dict.py,sha256=H9W6f5-QWR0_40kzKLf5_CMF4iUd1IRqBDwPmthsX5c,11844
|
65
|
+
lionagi/models/__init__.py,sha256=b7A4AaVGq4pZvYyTG8N_yvtRzwWJ8MxE9Y6mDZb8U0k,422
|
109
66
|
lionagi/models/field_model.py,sha256=JdmCp2pmwoy5HuduF21ivqyvMaJ04CTXu6Un-AeSwLU,23652
|
110
67
|
lionagi/models/hashable_model.py,sha256=oOqR3OJCU9cJfWHiG0WaEw0GMqfE2WTt4cy7WsAsiRg,829
|
111
68
|
lionagi/models/model_params.py,sha256=zVU-PHp3skjK5ZVjpsPs1k_VJiS8X0hgct0xs6Z6W_Y,10955
|
112
|
-
lionagi/models/note.py,sha256=okWJL4mGqt0bUVxHRyqsfJr7tEh6wwgYhF1CegxudIA,12202
|
113
69
|
lionagi/models/operable_model.py,sha256=Zm_Hxdauqyh0za3_TJLCZ3g6nR4F45Rrnc0ZM3d54Gs,20111
|
114
70
|
lionagi/models/schema_model.py,sha256=ghRIM8aBNaToAknwNlhQKpuKXcwzyCw5pDE31bVKxs0,667
|
115
71
|
lionagi/operations/__init__.py,sha256=a1EqxC5jRgVM1z_srZsxXtTC2Q6iA79ofpcd7cyT3B8,632
|
@@ -125,12 +81,12 @@ lionagi/operations/ReAct/utils.py,sha256=qYh-zTRCHXyuNpSgBmooTG0TVp9Pdht0tONPwdv
|
|
125
81
|
lionagi/operations/_act/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
126
82
|
lionagi/operations/_act/act.py,sha256=LfN4UqTTHVvO1h9tqmDhVfVafVUOry4YGEivIZbmLqc,2810
|
127
83
|
lionagi/operations/brainstorm/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
128
|
-
lionagi/operations/brainstorm/brainstorm.py,sha256=
|
84
|
+
lionagi/operations/brainstorm/brainstorm.py,sha256=FBgw0YIx18fFms_6Oiz9kklKWrq-ncJeJV-d05MH_BI,18781
|
129
85
|
lionagi/operations/brainstorm/prompt.py,sha256=Dqi4NNeztdI4iutggRqjnOrG4a4E2JtwIAtRnjZ_ghQ,610
|
130
86
|
lionagi/operations/chat/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
131
87
|
lionagi/operations/chat/chat.py,sha256=F5ugFtMm4OdNCQhaKN-0ezIcfInR_za5I7WbBC9qfzQ,5493
|
132
88
|
lionagi/operations/communicate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
133
|
-
lionagi/operations/communicate/communicate.py,sha256=
|
89
|
+
lionagi/operations/communicate/communicate.py,sha256=AKMcLle8roqB9Yn280VnaG0Qcd6Js9L3ccAIRy1Go3Y,3658
|
134
90
|
lionagi/operations/instruct/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
135
91
|
lionagi/operations/instruct/instruct.py,sha256=7pxhyP5jxwpgqjmQNb1rnGF4QAVlbMENpsyl22mbKRM,794
|
136
92
|
lionagi/operations/interpret/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
@@ -138,15 +94,13 @@ lionagi/operations/interpret/interpret.py,sha256=yl1NSp2iOm3dbycVLEcnV3absnqKoub
|
|
138
94
|
lionagi/operations/operate/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
139
95
|
lionagi/operations/operate/operate.py,sha256=SHk-BqjUWnN5aT7Xrm3lzR6yDppq_i2sbN8Iny8PelE,7512
|
140
96
|
lionagi/operations/parse/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
141
|
-
lionagi/operations/parse/parse.py,sha256=
|
97
|
+
lionagi/operations/parse/parse.py,sha256=dePMjGF-ReP4Z32iTzaqNY0wSV2u_JSIV_X8qDZONqU,6649
|
142
98
|
lionagi/operations/plan/__init__.py,sha256=yGBPll6lOqVjadbTvDLGrTlMx3FfBW-e00z7AMvg7Uo,156
|
143
99
|
lionagi/operations/plan/plan.py,sha256=qonV5kJjJCBAWfsvH7gqUj5Gyo-N-Nh_2dr-OZcDQ1Q,15315
|
144
100
|
lionagi/operations/plan/prompt.py,sha256=GUNZ8RpHIa89D-_y7GK--Spg0JADI3K13sjf_w3a2mI,993
|
145
101
|
lionagi/operations/select/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
146
102
|
lionagi/operations/select/select.py,sha256=2l16ySPiqp5vyAMYm0CNBpNRVB0zvS76QwNAyFQ7tB4,2491
|
147
103
|
lionagi/operations/select/utils.py,sha256=1S4Wo59hr0rbZG72EPnVExfx4G72sIeUh2vlqVtslqE,3711
|
148
|
-
lionagi/operations/translate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
149
|
-
lionagi/operations/translate/translate.py,sha256=6eBVoQRarGEJ8Tfcl6Z__PLHQTTIbM5MaPVYNeKHRIs,1397
|
150
104
|
lionagi/protocols/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
151
105
|
lionagi/protocols/_concepts.py,sha256=ZBN5OYpLMWLrl9uZqSg9GD4uwf60V4VHcxRnBTRWIRc,1555
|
152
106
|
lionagi/protocols/contracts.py,sha256=ii7luaPJsEKOb3J-rcaNysPDGU3nEzpgy_8g1z5_CCA,1398
|
@@ -162,10 +116,10 @@ lionagi/protocols/forms/flow.py,sha256=t9Ycvmb-stj0rCyvXXwd7WBcDtuCCTEKYst2aqFDV
|
|
162
116
|
lionagi/protocols/forms/form.py,sha256=B4903km_Ljz-OxYkb1ZT_cpHZSaAYYJpZMsffWlooo8,3062
|
163
117
|
lionagi/protocols/forms/report.py,sha256=SvJJjOSCTfVuqK7AKaY8ldQIGJeSK2zoyPWUV41ge2c,1609
|
164
118
|
lionagi/protocols/generic/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
165
|
-
lionagi/protocols/generic/element.py,sha256=
|
119
|
+
lionagi/protocols/generic/element.py,sha256=yD4SWNOGZsLTgxtz6TKtJfqkUvDmUH9wIH3Liw6QmmA,15839
|
166
120
|
lionagi/protocols/generic/event.py,sha256=n5EraAJ5bPiwegTdkxsILs7-vFJwmnXhB2om4xMQnK0,6529
|
167
|
-
lionagi/protocols/generic/log.py,sha256=
|
168
|
-
lionagi/protocols/generic/pile.py,sha256=
|
121
|
+
lionagi/protocols/generic/log.py,sha256=AnPr2RweSZcJdxOK0KGb1eyvAPZmME3hEm9HraUoftQ,8212
|
122
|
+
lionagi/protocols/generic/pile.py,sha256=zfTb2yBva6hqrPd7TB8KmwLCb4Np87LR_N-bISDTcXE,37044
|
169
123
|
lionagi/protocols/generic/processor.py,sha256=uiNIldAYPEujuboLFyrIJADMlhRghy3H86hYintj5D4,11705
|
170
124
|
lionagi/protocols/generic/progression.py,sha256=HCV_EnQCFvjg6D7eF4ygGrZNQPEOtu75zvW1sJbAVrM,15190
|
171
125
|
lionagi/protocols/graph/__init__.py,sha256=UPu3OmUpjSgX2aBuBJUdG2fppGlfqAH96hU0qIMBMp0,253
|
@@ -186,7 +140,7 @@ lionagi/protocols/messages/assistant_response.py,sha256=jrzRPVHHDnPw86Xp0IHnPy0t
|
|
186
140
|
lionagi/protocols/messages/base.py,sha256=Ng1Q8yIIIFauUv53LnwDeyOrM-cSCfsHM1GwkxChf2o,2317
|
187
141
|
lionagi/protocols/messages/instruction.py,sha256=Qpme1oSc406V3-F2iOyqC8TVT2GWVduZaoDfdGdBnDI,21127
|
188
142
|
lionagi/protocols/messages/manager.py,sha256=ABDiN-QULbfbSrHVlPe3kqBxr7e7sYoT49wHQMLiT6c,16897
|
189
|
-
lionagi/protocols/messages/message.py,sha256=
|
143
|
+
lionagi/protocols/messages/message.py,sha256=y8jSG5GQUjppvvMRDOWGlPNQn_I8MgATiU1AjsH2TKQ,7953
|
190
144
|
lionagi/protocols/messages/system.py,sha256=x0F1C57SFHaO2-Z9cy1QshYlxv8wjl7VppooaGKbMIg,4658
|
191
145
|
lionagi/protocols/messages/templates/README.md,sha256=Ch4JrKSjd85fLitAYO1OhZjNOGKHoEwaKQlcV16jiUI,1286
|
192
146
|
lionagi/protocols/messages/templates/action_request.jinja2,sha256=d6OmxHKyvvNDSK4bnBM3TGSUk_HeE_Q2EtLAQ0ZBEJg,120
|
@@ -196,36 +150,35 @@ lionagi/protocols/messages/templates/instruction_message.jinja2,sha256=L-ptw5OHx
|
|
196
150
|
lionagi/protocols/messages/templates/system_message.jinja2,sha256=JRKJ0aFpYfaXSFouKc_N4unZ35C3yZTOWhIrIdCB5qk,215
|
197
151
|
lionagi/protocols/messages/templates/tool_schemas.jinja2,sha256=ozIaSDCRjIAhLyA8VM6S-YqS0w2NcctALSwx4LjDwII,126
|
198
152
|
lionagi/protocols/operatives/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
199
|
-
lionagi/protocols/operatives/operative.py,sha256=
|
153
|
+
lionagi/protocols/operatives/operative.py,sha256=Y_prGR7aPQtO3ws91W_KkjJTVnb5lYkfwMKaEIN2FVU,13331
|
200
154
|
lionagi/protocols/operatives/step.py,sha256=uF92QO2KZiY3YR1cxhrbD844VFidOKfmeQn2Fv637iY,9280
|
201
155
|
lionagi/service/__init__.py,sha256=C_TPk1roVYz6uVLK1JVxrK3tPtYqN6W0D7FzI-s6CWY,556
|
202
156
|
lionagi/service/imodel.py,sha256=ya406sf42-KRrKN4TJJLtI6wsKeM5hAhWr7Hubg7W0E,16371
|
203
157
|
lionagi/service/manager.py,sha256=tN3p0kM7pg_CEs6wXK62_B_h49Q3nrU-9qniFhw2ABE,1164
|
204
|
-
lionagi/service/rate_limited_processor.py,sha256=
|
158
|
+
lionagi/service/rate_limited_processor.py,sha256=h2_F71aVeBrgZ0a7ARS8-8NDaAHvfWrLykI5QcNuYbk,6099
|
205
159
|
lionagi/service/resilience.py,sha256=91RPFtQY4QyNga_nuSNLsbzNE26pXJMTAfLaQqVdvmg,18714
|
206
160
|
lionagi/service/token_calculator.py,sha256=piTidArzUkIMCtOLC_HBLoZNYZcENQywgeKM31bxezM,6457
|
207
161
|
lionagi/service/types.py,sha256=9zX08BhdmPE9FE1YTyvsy14hdDGRYzyyVBmoBURzQvI,1096
|
208
162
|
lionagi/service/connections/__init__.py,sha256=yHQZ7OJpCftd6CStYR8inbxjJydYdmv9kCvbUBhJ2zU,362
|
209
163
|
lionagi/service/connections/api_calling.py,sha256=fY-fzwSJvQKpUT27TF0MTfE5TxroYKkL4SHWYrmYznI,9958
|
210
|
-
lionagi/service/connections/endpoint.py,sha256=
|
164
|
+
lionagi/service/connections/endpoint.py,sha256=kpSWQzPWh4WdjlZRuTAmPmeg-Z9g2NFx4b_pJMkWJq0,15055
|
211
165
|
lionagi/service/connections/endpoint_config.py,sha256=6sA06uCzriT6p0kFxhDCFH8N6V6MVp8ytlOw5ctBhDI,5169
|
212
166
|
lionagi/service/connections/header_factory.py,sha256=IYeTQQk7r8FXcdhmW7orCxHjNO-Nb1EOXhgNK7CAp-I,1821
|
213
|
-
lionagi/service/connections/match_endpoint.py,sha256=
|
167
|
+
lionagi/service/connections/match_endpoint.py,sha256=QlOw9CbR1peExP-b-XlkRpqqGIksfNefI2EZCw9P7_E,2575
|
214
168
|
lionagi/service/connections/providers/__init__.py,sha256=3lzOakDoBWmMaNnT2g-YwktPKa_Wme4lnPRSmOQfayY,105
|
215
169
|
lionagi/service/connections/providers/anthropic_.py,sha256=vok8mIyFiuV3K83tOjdYfruA6cv1h_57ML6RtpuW-bU,3157
|
216
|
-
lionagi/service/connections/providers/claude_code_.py,sha256=lCQd6HQ-5CsOKc-YtBbYMsumfKswW2-gFaXjWpo9V6U,10420
|
217
170
|
lionagi/service/connections/providers/claude_code_cli.py,sha256=kqEOnCUOOh2O_3NGi6W7r-gdLsbW-Jcp11tm30VEv4Q,4455
|
218
171
|
lionagi/service/connections/providers/exa_.py,sha256=kuWD7yyYRqIa4ChSn0TsxFA5V5LwvFUD-w8TZ6mx4rk,1048
|
219
172
|
lionagi/service/connections/providers/nvidia_nim_.py,sha256=95vmo0DSONYBVHkR9SGJ5BiHNKFZNZBrjw4_7ShOXQA,3154
|
220
173
|
lionagi/service/connections/providers/oai_.py,sha256=3x5d6Ei1hKu8Mix0N2V2K21O9dd-2jtAELHhHXj5iHk,6071
|
221
174
|
lionagi/service/connections/providers/ollama_.py,sha256=oqYLWn81KrWoQgId4e4GD_bgrDjQLPOmhqlc5uBuFGk,4569
|
222
175
|
lionagi/service/connections/providers/perplexity_.py,sha256=1GMmxAXsKGsB-xlqxO6hW-QdqoqkU2705NLyejetFSw,1646
|
223
|
-
lionagi/service/connections/providers/types.py,sha256=
|
176
|
+
lionagi/service/connections/providers/types.py,sha256=omKWbmJYu_ozK_qJLcxQezVcauXTqhp4ClOWAyENEFU,807
|
224
177
|
lionagi/service/hooks/__init__.py,sha256=Ayllxjd1fR_6NByZlE2zslQ7I0Od-s6-OVe0mzZIeu4,569
|
225
178
|
lionagi/service/hooks/_types.py,sha256=AJKODnj0bWmXZrcMgIdZpJNTgaSCzouCheiQXPpxetg,1169
|
226
179
|
lionagi/service/hooks/_utils.py,sha256=51dqdRrln2aJCkCz8g4L6Ik_v9atdFHPzjm9ASu6OvA,2560
|
227
|
-
lionagi/service/hooks/hook_event.py,sha256=
|
228
|
-
lionagi/service/hooks/hook_registry.py,sha256=
|
180
|
+
lionagi/service/hooks/hook_event.py,sha256=NH3PdoWwAt96GQQi99TjqAu-zU-zTgWz6pDdIaKureE,2418
|
181
|
+
lionagi/service/hooks/hook_registry.py,sha256=IEJF3UpLCmTXkd-7daFIo_p0CVTuAoA6Z8gzXkMIGsg,7870
|
229
182
|
lionagi/service/third_party/README.md,sha256=qFjWnI8rmLivIyr6Tc-hRZh-rQwntROp76af4MBNJJc,2214
|
230
183
|
lionagi/service/third_party/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
231
184
|
lionagi/service/third_party/anthropic_models.py,sha256=oqSPSlcayYG-fS5BLiLeTtkrpaxgkPhEK_YgneumrOo,4004
|
@@ -234,16 +187,15 @@ lionagi/service/third_party/exa_models.py,sha256=G_hnekcy-DillPLzMoDQ8ZisVAL8Mp7
|
|
234
187
|
lionagi/service/third_party/openai_model_names.py,sha256=C44tnqexgc4ZU2-3I_sn5d688hf3WWx-25xBd50bvas,5121
|
235
188
|
lionagi/service/third_party/pplx_models.py,sha256=-EhyJgOWR6rzSv3zczUtk80X6c19p18Dg9KC6l8BFRQ,6473
|
236
189
|
lionagi/session/__init__.py,sha256=kDypY6L3kGPnatAw7YNQAykgg-9MlIBnlhHExaXvt-c,202
|
237
|
-
lionagi/session/branch.py,sha256=
|
190
|
+
lionagi/session/branch.py,sha256=3AZMLLinpVGRd6e99I9AxYx03U2CBG68dgJRKe1NGDo,64808
|
238
191
|
lionagi/session/prompts.py,sha256=GPr0jibyAAqS3awDzGC8SoCL6aWJLLCCbXY0JUuxOC0,3170
|
239
|
-
lionagi/session/session.py,sha256=
|
192
|
+
lionagi/session/session.py,sha256=OZPLXmKP-WGBU_TW1gAp4sv5WsNqO0VphWCXfbQf5YE,13382
|
240
193
|
lionagi/tools/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
241
194
|
lionagi/tools/base.py,sha256=hEGnE4MD0CM4UqnF0xsDRKB0aM-pyrTFHl8utHhyJLU,1897
|
242
195
|
lionagi/tools/types.py,sha256=XtJLY0m-Yi_ZLWhm0KycayvqMCZd--HxfQ0x9vFUYDE,230
|
243
196
|
lionagi/tools/file/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
244
197
|
lionagi/tools/file/reader.py,sha256=2YKgU3VKo76zfL_buDAUQJoPLC56f6WJ4_mdJjlMDIM,9509
|
245
|
-
lionagi/
|
246
|
-
lionagi-0.16.
|
247
|
-
lionagi-0.16.
|
248
|
-
lionagi-0.16.
|
249
|
-
lionagi-0.16.1.dist-info/RECORD,,
|
198
|
+
lionagi-0.16.3.dist-info/METADATA,sha256=OF1sbSC2VVo8wFFfP8HFf5r42g53Q0QjxUAUj3bxW8k,22682
|
199
|
+
lionagi-0.16.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
200
|
+
lionagi-0.16.3.dist-info/licenses/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
|
201
|
+
lionagi-0.16.3.dist-info/RECORD,,
|
@@ -1,131 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Clean LionAGI PostgreSQL adapter for integration into lionagi core.
|
3
|
-
|
4
|
-
This adapter handles the metadata field conflict and provides seamless
|
5
|
-
PostgreSQL persistence for lionagi Nodes.
|
6
|
-
"""
|
7
|
-
|
8
|
-
from __future__ import annotations
|
9
|
-
|
10
|
-
from typing import Union, get_args, get_origin
|
11
|
-
|
12
|
-
from pydantic import BaseModel
|
13
|
-
|
14
|
-
from ._utils import check_postgres_available
|
15
|
-
|
16
|
-
_POSTGRES_AVAILABLE = check_postgres_available()
|
17
|
-
if isinstance(_POSTGRES_AVAILABLE, ImportError):
|
18
|
-
raise _POSTGRES_AVAILABLE
|
19
|
-
|
20
|
-
from pydapter.model_adapters.postgres_model import PostgresModelAdapter
|
21
|
-
from sqlalchemy import String
|
22
|
-
from sqlalchemy.orm import DeclarativeBase
|
23
|
-
|
24
|
-
|
25
|
-
class LionAGIPostgresAdapter(PostgresModelAdapter):
|
26
|
-
"""
|
27
|
-
PostgreSQL adapter for lionagi Nodes with automatic metadata field mapping.
|
28
|
-
|
29
|
-
Solves the core issue where lionagi's 'metadata' field conflicts with
|
30
|
-
SQLAlchemy's reserved 'metadata' attribute by automatically mapping it
|
31
|
-
to 'node_metadata' in the database schema.
|
32
|
-
|
33
|
-
Features:
|
34
|
-
- Automatic metadata field mapping (metadata → node_metadata)
|
35
|
-
- Handles Union types like list[float] | None for embedding fields
|
36
|
-
- Preserves all PostgreSQL-specific type support from parent
|
37
|
-
- Transparent to lionagi users - Elements work seamlessly
|
38
|
-
"""
|
39
|
-
|
40
|
-
# Core field mapping to resolve SQLAlchemy conflicts
|
41
|
-
FIELD_MAPPINGS = {"metadata": "node_metadata"}
|
42
|
-
|
43
|
-
def __init__(self):
|
44
|
-
super().__init__()
|
45
|
-
self._register_lionagi_types()
|
46
|
-
|
47
|
-
def _register_lionagi_types(self):
|
48
|
-
"""Register lionagi-specific type mappings."""
|
49
|
-
try:
|
50
|
-
# Handle lionagi IDType as String (UUID)
|
51
|
-
from lionagi.protocols.generic.element import IDType
|
52
|
-
|
53
|
-
self.register_type_mapping(
|
54
|
-
python_type=IDType,
|
55
|
-
sql_type_factory=lambda: String(36), # UUID string length
|
56
|
-
python_to_sql=lambda x: str(x),
|
57
|
-
sql_to_python=lambda x: IDType.validate(x) if x else None,
|
58
|
-
)
|
59
|
-
except ImportError:
|
60
|
-
pass # lionagi not available
|
61
|
-
|
62
|
-
@classmethod
|
63
|
-
def pydantic_model_to_sql(
|
64
|
-
cls,
|
65
|
-
model: type[BaseModel],
|
66
|
-
*,
|
67
|
-
table_name: str | None = None,
|
68
|
-
pk_field: str = "id",
|
69
|
-
schema: str | None = None,
|
70
|
-
) -> type[DeclarativeBase]:
|
71
|
-
"""
|
72
|
-
Generate SQLAlchemy model with lionagi field mapping.
|
73
|
-
|
74
|
-
Automatically handles:
|
75
|
-
- metadata → node_metadata mapping
|
76
|
-
- Union type resolution (e.g., list[float] | None → list[float])
|
77
|
-
- Standard lionagi Node field structure
|
78
|
-
"""
|
79
|
-
|
80
|
-
# Create modified field mapping for lionagi compatibility
|
81
|
-
modified_fields = {}
|
82
|
-
|
83
|
-
for name, info in model.model_fields.items():
|
84
|
-
# Apply field name mapping
|
85
|
-
field_name = cls.FIELD_MAPPINGS.get(name, name)
|
86
|
-
|
87
|
-
# Resolve Union types by extracting non-None type
|
88
|
-
annotation = info.annotation
|
89
|
-
origin = get_origin(annotation)
|
90
|
-
|
91
|
-
if origin is Union or (
|
92
|
-
hasattr(annotation, "__class__")
|
93
|
-
and annotation.__class__.__name__ == "UnionType"
|
94
|
-
):
|
95
|
-
args = get_args(annotation)
|
96
|
-
non_none_args = [arg for arg in args if arg is not type(None)]
|
97
|
-
if len(non_none_args) == 1:
|
98
|
-
annotation = non_none_args[0]
|
99
|
-
|
100
|
-
# Create field info with resolved annotation
|
101
|
-
from pydantic.fields import FieldInfo
|
102
|
-
|
103
|
-
modified_fields[field_name] = FieldInfo(
|
104
|
-
annotation=annotation,
|
105
|
-
default=info.default,
|
106
|
-
default_factory=info.default_factory,
|
107
|
-
alias=info.alias,
|
108
|
-
title=info.title,
|
109
|
-
description=info.description,
|
110
|
-
json_schema_extra=info.json_schema_extra,
|
111
|
-
frozen=info.frozen,
|
112
|
-
validate_default=info.validate_default,
|
113
|
-
repr=info.repr,
|
114
|
-
init_var=info.init_var,
|
115
|
-
kw_only=info.kw_only,
|
116
|
-
)
|
117
|
-
|
118
|
-
# Create temporary model with mapped fields
|
119
|
-
class ModifiedModel(BaseModel):
|
120
|
-
model_config = getattr(model, "model_config", {})
|
121
|
-
|
122
|
-
ModifiedModel.model_fields = modified_fields
|
123
|
-
ModifiedModel.__name__ = model.__name__
|
124
|
-
|
125
|
-
# Generate SQLAlchemy model with parent's logic
|
126
|
-
return super().pydantic_model_to_sql(
|
127
|
-
ModifiedModel,
|
128
|
-
table_name=table_name,
|
129
|
-
pk_field=pk_field,
|
130
|
-
schema=schema,
|
131
|
-
)
|
lionagi/libs/concurrency.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
from ..ln.concurrency import * # backward compatibility
|
lionagi/libs/file/params.py
DELETED
@@ -1,175 +0,0 @@
|
|
1
|
-
# Copyright (c) 2023 - 2025, HaiyangLi <quantocean.li at gmail dot com>
|
2
|
-
#
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
4
|
-
|
5
|
-
from collections.abc import Callable
|
6
|
-
from pathlib import Path
|
7
|
-
from typing import Any, Literal
|
8
|
-
|
9
|
-
from pydantic import BaseModel, Field
|
10
|
-
|
11
|
-
|
12
|
-
class ChunkContentParams(BaseModel):
|
13
|
-
"""Parameters for chunking text content into smaller pieces.
|
14
|
-
|
15
|
-
This model defines parameters used by the chunk_content function to split text
|
16
|
-
content into chunks, with support for both character-based and token-based chunking.
|
17
|
-
"""
|
18
|
-
|
19
|
-
content: str = Field(description="The text content to be chunked")
|
20
|
-
chunk_by: Literal["chars", "tokens"] = Field(
|
21
|
-
default="chars",
|
22
|
-
description="Method to use for chunking: 'chars' for character-based or 'tokens' for token-based",
|
23
|
-
)
|
24
|
-
tokenizer: Callable[[str], list[str]] | None = Field(
|
25
|
-
default=None,
|
26
|
-
description="Function to use for tokenization. Defaults to str.split if None",
|
27
|
-
)
|
28
|
-
chunk_size: int = Field(
|
29
|
-
default=1024, ge=1, description="Target size for each chunk"
|
30
|
-
)
|
31
|
-
overlap: float = Field(
|
32
|
-
default=0.0,
|
33
|
-
ge=0.0,
|
34
|
-
le=1.0,
|
35
|
-
description="Fraction of overlap between chunks (0.0 to 1.0)",
|
36
|
-
)
|
37
|
-
threshold: int = Field(
|
38
|
-
default=256,
|
39
|
-
ge=0,
|
40
|
-
description="Minimum size threshold for the last chunk",
|
41
|
-
)
|
42
|
-
metadata: dict[str, Any] = Field(
|
43
|
-
default_factory=dict,
|
44
|
-
description="Additional metadata to include with each chunk",
|
45
|
-
)
|
46
|
-
return_tokens: bool = Field(
|
47
|
-
default=False,
|
48
|
-
description="If True, return chunks as token lists; if False, return as joined strings",
|
49
|
-
)
|
50
|
-
|
51
|
-
|
52
|
-
class DirToFilesParams(BaseModel):
|
53
|
-
"""Parameters for processing directories and collecting file paths.
|
54
|
-
|
55
|
-
This model defines parameters used by the dir_to_files function to recursively
|
56
|
-
process directories and collect matching file paths.
|
57
|
-
"""
|
58
|
-
|
59
|
-
directory: Path | str = Field(
|
60
|
-
description="Directory to process recursively"
|
61
|
-
)
|
62
|
-
file_types: list[str] | None = Field(
|
63
|
-
default=None,
|
64
|
-
description="List of file extensions to include (e.g., ['.txt', '.pdf']). If None, includes all types",
|
65
|
-
)
|
66
|
-
max_workers: int | None = Field(
|
67
|
-
default=None,
|
68
|
-
description="Maximum number of worker threads for concurrent processing",
|
69
|
-
)
|
70
|
-
ignore_errors: bool = Field(
|
71
|
-
default=False,
|
72
|
-
description="If True, log warnings for errors instead of raising exceptions",
|
73
|
-
)
|
74
|
-
verbose: bool = Field(
|
75
|
-
default=False,
|
76
|
-
description="If True, print verbose output during processing",
|
77
|
-
)
|
78
|
-
|
79
|
-
|
80
|
-
class FileToChunksParams(BaseModel):
|
81
|
-
"""Parameters for splitting file content into chunks.
|
82
|
-
|
83
|
-
This model defines parameters used by the file_to_chunks function to read
|
84
|
-
and split file content into chunks with metadata.
|
85
|
-
"""
|
86
|
-
|
87
|
-
file_path: Path | str = Field(
|
88
|
-
description="Path to the file to be processed"
|
89
|
-
)
|
90
|
-
chunk_func: Callable[[str, int, float, int], list[str]] = Field(
|
91
|
-
description="Function to use for chunking the content"
|
92
|
-
)
|
93
|
-
chunk_size: int = Field(
|
94
|
-
default=1500, ge=1, description="Target size for each chunk"
|
95
|
-
)
|
96
|
-
overlap: float = Field(
|
97
|
-
default=0.1,
|
98
|
-
ge=0.0,
|
99
|
-
le=1.0,
|
100
|
-
description="Fraction of overlap between chunks (0.0 to 1.0)",
|
101
|
-
)
|
102
|
-
threshold: int = Field(
|
103
|
-
default=200,
|
104
|
-
ge=0,
|
105
|
-
description="Minimum size threshold for the last chunk",
|
106
|
-
)
|
107
|
-
encoding: str = Field(
|
108
|
-
default="utf-8",
|
109
|
-
description="File encoding to use when reading the file",
|
110
|
-
)
|
111
|
-
custom_metadata: dict[str, Any] | None = Field(
|
112
|
-
default=None,
|
113
|
-
description="Additional metadata to include with each chunk",
|
114
|
-
)
|
115
|
-
output_dir: Path | str | None = Field(
|
116
|
-
default=None,
|
117
|
-
description="Directory to save output chunks (if provided)",
|
118
|
-
)
|
119
|
-
verbose: bool = Field(
|
120
|
-
default=False,
|
121
|
-
description="If True, print verbose output during processing",
|
122
|
-
)
|
123
|
-
timestamp: bool = Field(
|
124
|
-
default=True,
|
125
|
-
description="If True, include timestamp in output filenames",
|
126
|
-
)
|
127
|
-
random_hash_digits: int = Field(
|
128
|
-
default=4,
|
129
|
-
ge=0,
|
130
|
-
description="Number of random hash digits to include in output filenames",
|
131
|
-
)
|
132
|
-
|
133
|
-
|
134
|
-
class SaveToFileParams(BaseModel):
|
135
|
-
"""Parameters for saving text content to a file.
|
136
|
-
|
137
|
-
This model defines parameters used by the save_to_file function to save
|
138
|
-
text content to a file with various options for naming and handling.
|
139
|
-
"""
|
140
|
-
|
141
|
-
text: str = Field(description="The text content to save to file")
|
142
|
-
directory: Path | str = Field(
|
143
|
-
description="Directory where the file will be saved"
|
144
|
-
)
|
145
|
-
filename: str = Field(description="Name of the file to create")
|
146
|
-
extension: str | None = Field(
|
147
|
-
default=None,
|
148
|
-
description="File extension (with or without leading dot)",
|
149
|
-
)
|
150
|
-
timestamp: bool = Field(
|
151
|
-
default=False, description="If True, append timestamp to filename"
|
152
|
-
)
|
153
|
-
dir_exist_ok: bool = Field(
|
154
|
-
default=True,
|
155
|
-
description="If True, creates directory if it doesn't exist",
|
156
|
-
)
|
157
|
-
file_exist_ok: bool = Field(
|
158
|
-
default=False, description="If True, allows overwriting existing files"
|
159
|
-
)
|
160
|
-
time_prefix: bool = Field(
|
161
|
-
default=False,
|
162
|
-
description="If True, prepend timestamp instead of append",
|
163
|
-
)
|
164
|
-
timestamp_format: str | None = Field(
|
165
|
-
default=None,
|
166
|
-
description="Custom format for timestamp (strftime format)",
|
167
|
-
)
|
168
|
-
random_hash_digits: int = Field(
|
169
|
-
default=0,
|
170
|
-
ge=0,
|
171
|
-
description="Number of random hash digits to append to filename",
|
172
|
-
)
|
173
|
-
verbose: bool = Field(
|
174
|
-
default=True, description="If True, logs the file path after saving"
|
175
|
-
)
|
lionagi/libs/nested/__init__.py
DELETED