lionagi 0.12.2__py3-none-any.whl → 0.12.4__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 (86) hide show
  1. lionagi/config.py +123 -0
  2. lionagi/fields/file.py +1 -1
  3. lionagi/fields/reason.py +1 -1
  4. lionagi/libs/file/concat.py +1 -6
  5. lionagi/libs/file/concat_files.py +1 -5
  6. lionagi/libs/file/save.py +1 -1
  7. lionagi/libs/package/imports.py +8 -177
  8. lionagi/libs/parse.py +30 -0
  9. lionagi/libs/schema/load_pydantic_model_from_schema.py +259 -0
  10. lionagi/libs/token_transform/perplexity.py +2 -4
  11. lionagi/libs/token_transform/synthlang_/resources/frameworks/framework_options.json +46 -46
  12. lionagi/libs/token_transform/synthlang_/translate_to_synthlang.py +1 -1
  13. lionagi/operations/chat/chat.py +2 -2
  14. lionagi/operations/communicate/communicate.py +20 -5
  15. lionagi/operations/parse/parse.py +131 -43
  16. lionagi/protocols/generic/log.py +1 -2
  17. lionagi/protocols/generic/pile.py +18 -4
  18. lionagi/protocols/messages/assistant_response.py +20 -1
  19. lionagi/protocols/messages/templates/README.md +6 -10
  20. lionagi/service/connections/__init__.py +15 -0
  21. lionagi/service/connections/api_calling.py +230 -0
  22. lionagi/service/connections/endpoint.py +410 -0
  23. lionagi/service/connections/endpoint_config.py +137 -0
  24. lionagi/service/connections/header_factory.py +56 -0
  25. lionagi/service/connections/match_endpoint.py +49 -0
  26. lionagi/service/connections/providers/__init__.py +3 -0
  27. lionagi/service/connections/providers/anthropic_.py +87 -0
  28. lionagi/service/connections/providers/exa_.py +33 -0
  29. lionagi/service/connections/providers/oai_.py +166 -0
  30. lionagi/service/connections/providers/ollama_.py +122 -0
  31. lionagi/service/connections/providers/perplexity_.py +29 -0
  32. lionagi/service/imodel.py +36 -144
  33. lionagi/service/manager.py +1 -7
  34. lionagi/service/{endpoints/rate_limited_processor.py → rate_limited_processor.py} +4 -2
  35. lionagi/service/resilience.py +545 -0
  36. lionagi/service/third_party/README.md +71 -0
  37. lionagi/service/third_party/__init__.py +0 -0
  38. lionagi/service/third_party/anthropic_models.py +159 -0
  39. lionagi/service/third_party/exa_models.py +165 -0
  40. lionagi/service/third_party/openai_models.py +18241 -0
  41. lionagi/service/third_party/pplx_models.py +156 -0
  42. lionagi/service/types.py +5 -4
  43. lionagi/session/branch.py +12 -7
  44. lionagi/tools/file/reader.py +1 -1
  45. lionagi/tools/memory/tools.py +497 -0
  46. lionagi/utils.py +921 -123
  47. lionagi/version.py +1 -1
  48. {lionagi-0.12.2.dist-info → lionagi-0.12.4.dist-info}/METADATA +33 -16
  49. {lionagi-0.12.2.dist-info → lionagi-0.12.4.dist-info}/RECORD +53 -63
  50. lionagi/libs/file/create_path.py +0 -80
  51. lionagi/libs/file/file_util.py +0 -358
  52. lionagi/libs/parse/__init__.py +0 -3
  53. lionagi/libs/parse/fuzzy_parse_json.py +0 -117
  54. lionagi/libs/parse/to_dict.py +0 -336
  55. lionagi/libs/parse/to_json.py +0 -61
  56. lionagi/libs/parse/to_num.py +0 -378
  57. lionagi/libs/parse/to_xml.py +0 -57
  58. lionagi/libs/parse/xml_parser.py +0 -148
  59. lionagi/libs/schema/breakdown_pydantic_annotation.py +0 -48
  60. lionagi/service/endpoints/__init__.py +0 -3
  61. lionagi/service/endpoints/base.py +0 -706
  62. lionagi/service/endpoints/chat_completion.py +0 -116
  63. lionagi/service/endpoints/match_endpoint.py +0 -72
  64. lionagi/service/providers/__init__.py +0 -3
  65. lionagi/service/providers/anthropic_/__init__.py +0 -3
  66. lionagi/service/providers/anthropic_/messages.py +0 -99
  67. lionagi/service/providers/exa_/models.py +0 -3
  68. lionagi/service/providers/exa_/search.py +0 -80
  69. lionagi/service/providers/exa_/types.py +0 -7
  70. lionagi/service/providers/groq_/__init__.py +0 -3
  71. lionagi/service/providers/groq_/chat_completions.py +0 -56
  72. lionagi/service/providers/ollama_/__init__.py +0 -3
  73. lionagi/service/providers/ollama_/chat_completions.py +0 -134
  74. lionagi/service/providers/openai_/__init__.py +0 -3
  75. lionagi/service/providers/openai_/chat_completions.py +0 -101
  76. lionagi/service/providers/openai_/spec.py +0 -14
  77. lionagi/service/providers/openrouter_/__init__.py +0 -3
  78. lionagi/service/providers/openrouter_/chat_completions.py +0 -62
  79. lionagi/service/providers/perplexity_/__init__.py +0 -3
  80. lionagi/service/providers/perplexity_/chat_completions.py +0 -44
  81. lionagi/service/providers/perplexity_/models.py +0 -5
  82. lionagi/service/providers/types.py +0 -17
  83. /lionagi/{service/providers/exa_/__init__.py → py.typed} +0 -0
  84. /lionagi/service/{endpoints/token_calculator.py → token_calculator.py} +0 -0
  85. {lionagi-0.12.2.dist-info → lionagi-0.12.4.dist-info}/WHEEL +0 -0
  86. {lionagi-0.12.2.dist-info → lionagi-0.12.4.dist-info}/licenses/LICENSE +0 -0
lionagi/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.12.2"
1
+ __version__ = "0.12.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lionagi
3
- Version: 0.12.2
3
+ Version: 0.12.4
4
4
  Summary: An Intelligence Operating System.
5
5
  Author-email: HaiyangLi <quantocean.li@gmail.com>, Liangbingyan Luo <llby_luo@outlook.com>
6
6
  License: Apache License
@@ -219,19 +219,37 @@ Classifier: Programming Language :: Python :: 3.11
219
219
  Classifier: Programming Language :: Python :: 3.12
220
220
  Classifier: Programming Language :: Python :: 3.13
221
221
  Requires-Python: >=3.10
222
- Requires-Dist: jinja2>=3.0.0
223
- Requires-Dist: khive>=0.2.7
222
+ Requires-Dist: aiocache>=0.12.0
223
+ Requires-Dist: aiohttp>=3.12.0
224
+ Requires-Dist: backoff>=2.2.1
225
+ Requires-Dist: jinja2>=3.1.0
224
226
  Requires-Dist: pandas>=2.0.0
227
+ Requires-Dist: pillow>=11.0.0
228
+ Requires-Dist: pydantic-settings>=2.8.0
229
+ Requires-Dist: pydantic>2.0.0
230
+ Requires-Dist: python-dotenv>=1.1.0
225
231
  Requires-Dist: tiktoken>=0.8.0
232
+ Requires-Dist: toml>=0.9.0
226
233
  Provides-Extra: all
227
- Requires-Dist: khive[ollama,reader]; extra == 'all'
228
- Requires-Dist: litellm; extra == 'all'
229
- Provides-Extra: llms
230
- Requires-Dist: litellm; extra == 'llms'
234
+ Requires-Dist: docling>=2.15.1; extra == 'all'
235
+ Requires-Dist: ollama>=0.5.0; extra == 'all'
236
+ Provides-Extra: docs
237
+ Requires-Dist: furo>=2024.8.6; extra == 'docs'
238
+ Requires-Dist: sphinx-autobuild>=2024.10.3; extra == 'docs'
239
+ Requires-Dist: sphinx>=8.1.3; extra == 'docs'
240
+ Provides-Extra: lint
241
+ Requires-Dist: black[jupyter]>=24.10.0; extra == 'lint'
242
+ Requires-Dist: isort>=5.13.2; extra == 'lint'
243
+ Requires-Dist: pre-commit>=4.0.1; extra == 'lint'
231
244
  Provides-Extra: ollama
232
- Requires-Dist: khive[ollama]; extra == 'ollama'
245
+ Requires-Dist: ollama>=0.5.0; extra == 'ollama'
246
+ Provides-Extra: reader
247
+ Requires-Dist: docling>=2.15.1; extra == 'reader'
248
+ Provides-Extra: test
249
+ Requires-Dist: pytest-asyncio>=1.0.0; extra == 'test'
250
+ Requires-Dist: pytest>=8.3.4; extra == 'test'
233
251
  Provides-Extra: tools
234
- Requires-Dist: khive[reader]; extra == 'tools'
252
+ Requires-Dist: docling>=2.15.1; extra == 'tools'
235
253
  Description-Content-Type: text/markdown
236
254
 
237
255
  ![PyPI - Version](https://img.shields.io/pypi/v/lionagi?labelColor=233476aa&color=231fc935)
@@ -239,9 +257,8 @@ Description-Content-Type: text/markdown
239
257
  ![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)
240
258
 
241
259
  [Documentation](https://lion-agi.github.io/lionagi/) |
242
- [Discord](https://discord.gg/aqSJ2v46vu) |
260
+ [Discord](https://discord.gg/JDj9ENhUE8) |
243
261
  [PyPI](https://pypi.org/project/lionagi/) |
244
- [Roadmap](https://trello.com/b/3seomsrI/lionagi)
245
262
 
246
263
  # LION - Language InterOperable Network
247
264
 
@@ -267,9 +284,6 @@ integrations, and custom validations in a single coherent pipeline.
267
284
  pip install lionagi
268
285
  ```
269
286
 
270
- Dependencies: • aiocahce • aiohttp • jinja2 • pandas • pillow • pydantic
271
- • python-dotenv • tiktoken
272
-
273
287
  ## Quick Start
274
288
 
275
289
  ```python
@@ -321,6 +335,10 @@ With fiery claws, dragons hide their laughter flaws!
321
335
  LionAGI supports advanced multi-step reasoning with ReAct. Tools let the LLM
322
336
  invoke external actions:
323
337
 
338
+ ```
339
+ pip install "lionagi[reader]"
340
+ ```
341
+
324
342
  ```python
325
343
  from lionagi.tools.types import ReaderTool
326
344
 
@@ -375,8 +393,7 @@ Seamlessly route to different models in the same workflow.
375
393
  ### optional dependencies
376
394
 
377
395
  ```
378
- pip install "lionagi[tools]"
379
- pip install "lionagi[llms]"
396
+ pip install "lionagi[reader]"
380
397
  pip install "lionagi[ollama]"
381
398
  ```
382
399
 
@@ -2,9 +2,11 @@ lionagi/__init__.py,sha256=wg2mLxXbJ5pQKrRMIEoQ0_BlHrxjuR1zmc3SAYN7PBc,513
2
2
  lionagi/_class_registry.py,sha256=pfUO1DjFZIqr3OwnNMkFqL_fiEBrrf8-swkGmP_KDLE,3112
3
3
  lionagi/_errors.py,sha256=JlBTFJnRWtVYcRxKb7fWFiJHLbykl1E19mSJ8sXYVxg,455
4
4
  lionagi/_types.py,sha256=iDdYewsP9rDrM7QY19_NDTcWUk7swp8vnGCrloHMtUM,53
5
+ lionagi/config.py,sha256=dAhDFKtaaSfn6WT9dwX9Vd4TWWs6-Su1FgYIrFgYcgc,3709
6
+ lionagi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
7
  lionagi/settings.py,sha256=W52mM34E6jXF3GyqCFzVREKZrmnUqtZm_BVDsUiDI_s,1627
6
- lionagi/utils.py,sha256=KDcxyMcDrAMxixkQ1FhGkC81bXjae5_nYWB-vh8lyEc,53114
7
- lionagi/version.py,sha256=NJQQPiZZfrBXFMqZlsia0JrhloS2PexbdxYYUs0c2Us,23
8
+ lionagi/utils.py,sha256=uLTJKl7aTnFXV6ehA6zwiwEB7G2nQYKsO2pZ6mqFzUk,78908
9
+ lionagi/version.py,sha256=DoMS9KOhsApLyuLYhLEsd5nmoLFQ_IvVkEs_jKRzFk8,23
8
10
  lionagi/adapters/__init__.py,sha256=FJBV1Fb7GR9mcRApEB9bNP3IRMQ9Qjg5aVTouZFyTBU,45
9
11
  lionagi/adapters/adapter.py,sha256=aW7s1OKAdxHd8HBv2UcThn-r2Q08EyArssNyFobMLuA,3357
10
12
  lionagi/adapters/json_adapter.py,sha256=EJj0Jev46ZhU3ZMnlYwyzN2rLxjLCVrMDpHkEuggBvk,4561
@@ -19,21 +21,20 @@ lionagi/fields/__init__.py,sha256=8oU7Vfk-fKiULFKqhM6VpJMqdZcVXPTM7twVfNDN_SQ,60
19
21
  lionagi/fields/action.py,sha256=iWSApCM77jS0Oc28lb7G601Etkp-yjx5U1hfI_FQgfA,5792
20
22
  lionagi/fields/base.py,sha256=5CJc7j8kTTWzXwpYzkSAFzx4BglABfx3AElIATKB7bg,3857
21
23
  lionagi/fields/code.py,sha256=TFym51obzaSfCmeRoHZJyBtjfDI4tvl9F-1sjFc9rMw,7713
22
- lionagi/fields/file.py,sha256=BMrjxyyfQwC-7w5tA8sJmyjsKcWkldfHAL6dl8UGJr0,7313
24
+ lionagi/fields/file.py,sha256=DhQ_HE0RvTNzkvBGQHRgbMYSokDkzE8GEu814i6jw5Q,7297
23
25
  lionagi/fields/instruct.py,sha256=sMbCxEv0HQLa31JkJDmdrWWEzIfeKbcmN2hYOehz3Q0,4773
24
- lionagi/fields/reason.py,sha256=TnsViRY1QdwvEmfeUiYR8Mt0VAhyIHmlEesmYVEjcH0,1450
26
+ lionagi/fields/reason.py,sha256=3Ksz9_40dI-oQ9VtmpnYAmJdeDDIO-TwLDrf1ijbXGM,1438
25
27
  lionagi/fields/research.py,sha256=eEPKocx8eQy2E9FExRWVIo6MK_xvmwBAoRZciBY3RG0,1421
26
28
  lionagi/libs/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
29
+ lionagi/libs/parse.py,sha256=JRS3bql0InHJqATnAatl-hQv4N--XXw4P77JHhTFnrc,1011
27
30
  lionagi/libs/file/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
28
31
  lionagi/libs/file/chunk.py,sha256=XeVMwM33JF0X1W6udz_nhlb3DCevA_EK6A50Hn_e5SY,9300
29
- lionagi/libs/file/concat.py,sha256=nrL155_92YRTKAymAHbFY5CFNFiRwIc6-KRdjDydVzY,4018
30
- lionagi/libs/file/concat_files.py,sha256=r8-W8vI9nZFQ36hgQJkiSHT63gCQi9ckkE1hBkXzdtE,3218
31
- lionagi/libs/file/create_path.py,sha256=dCM_P2Nxmy9j2icB0CLMukwwQS4_IN219vsklQo4UsI,2704
32
+ lionagi/libs/file/concat.py,sha256=YSauXVBL3WWx5Mvpn208Cj7q9TLt_aq-0M9J1fm-ins,3864
33
+ lionagi/libs/file/concat_files.py,sha256=FoI983oWFzp9VfFDP7kmbRb3t1CPe5F5LCtsux0ASAs,3089
32
34
  lionagi/libs/file/file_ops.py,sha256=HBiIh1EljIJ5VTIXuyvJM0ppSs0YYOPUWmgDMJT634U,3430
33
- lionagi/libs/file/file_util.py,sha256=BNP1rhWCJXnj2FmOOb_QrxDlZOVC5ohMOSL4TSWS4PI,10562
34
35
  lionagi/libs/file/params.py,sha256=SZ5DkoffWfxWudOAYCfCxpL8UIm-1UjeyTtploo-Lqs,5824
35
36
  lionagi/libs/file/process.py,sha256=EsnEJcQUm4ReP7qkCeMvL4Qe6fLRcENVWZndh9TSUsc,8692
36
- lionagi/libs/file/save.py,sha256=Fo2C96XQ0orlnPE70ThLgqUx_tEnp4ZwGmU0FQy-cZ8,2862
37
+ lionagi/libs/file/save.py,sha256=TCxVlKxFFnr3xZ-HAXPpTomQoyiVrp6nKRoj-bcQt4k,2863
37
38
  lionagi/libs/nested/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
38
39
  lionagi/libs/nested/flatten.py,sha256=sB4jxZRoaUbjak9RbIWVWNKz2hzkhQJPFffV_Ws1GA0,5479
39
40
  lionagi/libs/nested/nfilter.py,sha256=kF7AWjLFHr22SOjRBSTx-7iRPaR7gs0FY5Y4XF2sWJ8,1768
@@ -45,37 +46,30 @@ lionagi/libs/nested/nset.py,sha256=vkLR970hSzj8xCk-Z3RNQMJL2x0uMHmx1pw0VZQx2T0,3
45
46
  lionagi/libs/nested/unflatten.py,sha256=lTON1LfCyhZ3xeTEdBiIONcHLQouPcBNARTbXzHZ03U,2618
46
47
  lionagi/libs/nested/utils.py,sha256=r8xuBpH0qQaHMnCqXPF6unIKzw-TqwVbq-ARooWRERo,6090
47
48
  lionagi/libs/package/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
48
- lionagi/libs/package/imports.py,sha256=AY8G7g3LdK1WdrpNhhAUrDum0sKeF8wJ7EXtzjS-Cz0,5624
49
+ lionagi/libs/package/imports.py,sha256=wg6Ip9dnW5rNPxINu-AT3XQLp1EQLaAFdehVZAVB140,424
49
50
  lionagi/libs/package/management.py,sha256=zgzZ1lNpUhunu_QExiobSYWlvBbR0EORXW4jrtV0wuE,1684
50
51
  lionagi/libs/package/params.py,sha256=4dJiuaTlnhho6OHmBv-02cHx89XRCjnKqpMhVRvTse8,1056
51
52
  lionagi/libs/package/system.py,sha256=UW8Y6tEPRCy_pBv_Q8CXJAIbuo7CJDDoWEDdnP0ixp4,564
52
- lionagi/libs/parse/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
53
- lionagi/libs/parse/fuzzy_parse_json.py,sha256=tavyEg8s3oWAEdrusBb-Aj2fnMwnVJLOVkViboVAq9Q,3544
54
- lionagi/libs/parse/to_dict.py,sha256=t7zGXEVLOxfeHBm4vsmwaj44An2dwRNYt0xSy1SjEAM,9608
55
- lionagi/libs/parse/to_json.py,sha256=cCpLH5uUwDWqNUfeJ29LXLtOo4q1uHVG6xU5_I9ZNJQ,1893
56
- lionagi/libs/parse/to_num.py,sha256=ZRHDjpTCykPfDIZZa4rZKNaR_8ZHbPDFlw9rc02DrII,11610
57
- lionagi/libs/parse/to_xml.py,sha256=g-VkdVcDkFymiq_ggtO97OTGZaj7wwLJr0WEMuIDN-M,2112
58
- lionagi/libs/parse/xml_parser.py,sha256=2SVlNxKDqqJscmLN906Ns-uF9-pHAzs77IQ4RoeN5-g,4920
59
53
  lionagi/libs/schema/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
60
54
  lionagi/libs/schema/as_readable.py,sha256=W4fi98WVkP5rfZ6A-iWqP5YFJexYCjt9Hf-l0iNs-2Q,5916
61
- lionagi/libs/schema/breakdown_pydantic_annotation.py,sha256=-Brc42n6VC66UHmbyNwnRJFxyzzz3XvuLvr54IEPXb0,1333
62
55
  lionagi/libs/schema/extract_code_block.py,sha256=PuJbJj1JnqR5fSZudowPcVPpEoKISLr0MjTOOVXSzwY,2394
63
56
  lionagi/libs/schema/extract_docstring.py,sha256=aYyLSRlB8lTH9QF9-6a56uph3AAkNuTyZ0S_duf5-fw,5729
64
57
  lionagi/libs/schema/function_to_schema.py,sha256=XAB031WbYu3a7eFJyYjXVMAjmtWYSYr5kC_DYgjiuyM,5604
65
58
  lionagi/libs/schema/json_schema.py,sha256=cuHcaMr748O9g6suNGmRx4tRXcidd5-c7AMGjTIZyHM,7670
59
+ lionagi/libs/schema/load_pydantic_model_from_schema.py,sha256=WwmOqo4mlSjClYb8s0jOr4PODeFz777TxfeyBnzZ3rc,10899
66
60
  lionagi/libs/token_transform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
61
  lionagi/libs/token_transform/base.py,sha256=LBnaDgi4HNgaJJGwIzWcQjVMdu49i_93rRvOvMU22Rw,1545
68
62
  lionagi/libs/token_transform/llmlingua.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
69
- lionagi/libs/token_transform/perplexity.py,sha256=tcVRjPBX3nuVqsoTkowCf6RBXuybO--owH1lf2Ywj1s,14470
63
+ lionagi/libs/token_transform/perplexity.py,sha256=EcINACZyMZfWyU9ESS0eBaFby9y44YMgaDC_ANfDtkw,14436
70
64
  lionagi/libs/token_transform/symbolic_compress_context.py,sha256=J8UleoCRDBvbFvmss2JjOvJfuBT7LXUW7AsRB-oQq7c,4598
71
65
  lionagi/libs/token_transform/synthlang.py,sha256=W6e-_265UXqVosM9X0TLKW53rNHvWCKhsWbVAop49Ac,259
72
66
  lionagi/libs/token_transform/types.py,sha256=4HgAfNDlJ_Hu18kLt59GHr_76eF3xLpNCTbOXlAYVlA,491
73
67
  lionagi/libs/token_transform/synthlang_/base.py,sha256=GDle72c8EjFz_3hg_k-y0YmksBsn5TSRVTw5_cwfWTo,4109
74
- lionagi/libs/token_transform/synthlang_/translate_to_synthlang.py,sha256=lRBpeKGhyNlf8ngigjYAw56QbIAVZWLQUzRg2wpwMfQ,4956
68
+ lionagi/libs/token_transform/synthlang_/translate_to_synthlang.py,sha256=guA5v8CQRdAOsznsUSoK_x2JFzGbHE079AijDqqPPOw,4946
75
69
  lionagi/libs/token_transform/synthlang_/resources/frameworks/abstract_algebra.toml,sha256=2TuOAo97g8mNhdPH96HP8vYZpnC8neiP-KlhVqbp1Us,970
76
70
  lionagi/libs/token_transform/synthlang_/resources/frameworks/category_theory.toml,sha256=Stg9W3h8o7VkQ9tdAfSZmR3LctFqcH6OhOPdaw9BlIg,1064
77
71
  lionagi/libs/token_transform/synthlang_/resources/frameworks/complex_analysis.toml,sha256=iE6FS7Cn5_uJRG5-StLuMM4XVAk95bxhbYWwlstw_tA,1044
78
- lionagi/libs/token_transform/synthlang_/resources/frameworks/framework_options.json,sha256=_MQcXWBcgzPM6F13e_JDoF7rzTbi_zlXOXutyyYahBY,1384
72
+ lionagi/libs/token_transform/synthlang_/resources/frameworks/framework_options.json,sha256=phAkedPGrwgNGW8hgPyH6pKU47pvKEAnG7vheWFvOLc,1760
79
73
  lionagi/libs/token_transform/synthlang_/resources/frameworks/group_theory.toml,sha256=iVlcS250YMosNRv3l8bz3BT9Tx1xCmiwhfNt4CjjRYc,713
80
74
  lionagi/libs/token_transform/synthlang_/resources/frameworks/math_logic.toml,sha256=jeFOF8gjRhb4hYXpW7AxTX8uk9c6DvGulJK5Bowxhq4,1037
81
75
  lionagi/libs/token_transform/synthlang_/resources/frameworks/reflective_patterns.toml,sha256=LxBIVLHNLfvVdXjLAzqivrYaHNix514DLNYsbA-VSQ4,5730
@@ -111,9 +105,9 @@ lionagi/operations/brainstorm/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5
111
105
  lionagi/operations/brainstorm/brainstorm.py,sha256=N9LpFZCdYn8L8AnTFOoMnjK7nkFrjgrfj2Vhz759dXM,18701
112
106
  lionagi/operations/brainstorm/prompt.py,sha256=Dqi4NNeztdI4iutggRqjnOrG4a4E2JtwIAtRnjZ_ghQ,610
113
107
  lionagi/operations/chat/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
114
- lionagi/operations/chat/chat.py,sha256=xJAH2H0zyVvxiL3XtW3MC6YrwCCB1uCkwcQIJ1YsIOk,5466
108
+ lionagi/operations/chat/chat.py,sha256=F5ugFtMm4OdNCQhaKN-0ezIcfInR_za5I7WbBC9qfzQ,5493
115
109
  lionagi/operations/communicate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
116
- lionagi/operations/communicate/communicate.py,sha256=dPaPqg898biY6j_FlgH4HEJxTK6T_87ixXWhD6kbk40,3077
110
+ lionagi/operations/communicate/communicate.py,sha256=J23XkCk_oUD-cGYOuy4stwrwbeiQYLnq2l8xNX2ri5U,3670
117
111
  lionagi/operations/instruct/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
118
112
  lionagi/operations/instruct/instruct.py,sha256=7pxhyP5jxwpgqjmQNb1rnGF4QAVlbMENpsyl22mbKRM,794
119
113
  lionagi/operations/interpret/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
@@ -121,7 +115,7 @@ lionagi/operations/interpret/interpret.py,sha256=8_F3oYaoYK8MDcK4iCwksBP7sI0UlgB
121
115
  lionagi/operations/operate/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
122
116
  lionagi/operations/operate/operate.py,sha256=cMc-n_uBPC8L8URIHHdR9N2LiwFlOiVv8yazmrFxX8g,7358
123
117
  lionagi/operations/parse/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
124
- lionagi/operations/parse/parse.py,sha256=Jvne8zuOqsgyXBxlH08EEEl-gb8-zkxvbihcwWKBW68,3295
118
+ lionagi/operations/parse/parse.py,sha256=xS9uIxBzHLGD-1VpBVgGUhxF-tQDkF2KLmIpErM47RQ,6661
125
119
  lionagi/operations/plan/__init__.py,sha256=yGBPll6lOqVjadbTvDLGrTlMx3FfBW-e00z7AMvg7Uo,156
126
120
  lionagi/operations/plan/plan.py,sha256=ndExZm_kE04i6npJq1rhyRdKaoXWpVk3F-dEN59I_94,15305
127
121
  lionagi/operations/plan/prompt.py,sha256=GUNZ8RpHIa89D-_y7GK--Spg0JADI3K13sjf_w3a2mI,993
@@ -145,8 +139,8 @@ lionagi/protocols/forms/report.py,sha256=SvJJjOSCTfVuqK7AKaY8ldQIGJeSK2zoyPWUV41
145
139
  lionagi/protocols/generic/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
146
140
  lionagi/protocols/generic/element.py,sha256=Eaij2YpTWsGk28Tqjazmjmc_tOnalH7_iGFZrL6QJb4,14420
147
141
  lionagi/protocols/generic/event.py,sha256=InjBd2K9aSYxgai1c20d4jaJOkEx5VGFfb7iZbiMiNA,5200
148
- lionagi/protocols/generic/log.py,sha256=oXFldqTAGmLo32EZzxQT7J-CVR3ohQwmMZKR_ZbX0wQ,7482
149
- lionagi/protocols/generic/pile.py,sha256=DfD1hOc7Mb3Iv-HMBPF9Y9HBjUYEJLUot-3AKniEjSo,31299
142
+ lionagi/protocols/generic/log.py,sha256=vepclOaY3fdR1QgFDj9usOffsx9T-9PbgwXjTvm6twQ,7441
143
+ lionagi/protocols/generic/pile.py,sha256=0nAfmCb_0RjiSQPvW6tkzuHUk9aPHFvCySlL-TkokFI,31803
150
144
  lionagi/protocols/generic/processor.py,sha256=LTF9Enb-9jj5Wuy_jLanAhiesc5-Gm6WiSntZoAAm8w,10382
151
145
  lionagi/protocols/generic/progression.py,sha256=qlITq1qzV119iR5qR__fBAzV489S7d4t20E8uDRicEw,15189
152
146
  lionagi/protocols/graph/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
@@ -162,13 +156,13 @@ lionagi/protocols/mail/package.py,sha256=DyedMJaCRp4kf9MJtprcrN55rPoSR_v6MXdbINo
162
156
  lionagi/protocols/messages/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
163
157
  lionagi/protocols/messages/action_request.py,sha256=-tG9ViTSiZ2beM0onE6C552H5oth-sHLHP6KsBV8OMk,6868
164
158
  lionagi/protocols/messages/action_response.py,sha256=SM3_vA9QPXz3Gc9uPhXm3zOXYheHZZGtl67Yff48Vu8,5272
165
- lionagi/protocols/messages/assistant_response.py,sha256=LTSmW9ZbDnV6tSjNMoecICI2_wqNirG5D4CT1IpDtvs,5797
159
+ lionagi/protocols/messages/assistant_response.py,sha256=6bNyY2YkFHKPY3HECSb8Tj82dW4-VA5yVs2P3M_MM4Q,6796
166
160
  lionagi/protocols/messages/base.py,sha256=Ng1Q8yIIIFauUv53LnwDeyOrM-cSCfsHM1GwkxChf2o,2317
167
161
  lionagi/protocols/messages/instruction.py,sha256=0dUsUYd6xYsbOHU7GafvqBkpDQQoFOXJXT-UoJArYWU,21146
168
162
  lionagi/protocols/messages/manager.py,sha256=e1jW5JH_3jZpZbFCvWZX0TG0DCgzANRUejW_6NqbtDc,17182
169
163
  lionagi/protocols/messages/message.py,sha256=rrGbya6rF86UB8xZcRP1YjgfJIFCxEWPQfHDcMuyBnM,7724
170
164
  lionagi/protocols/messages/system.py,sha256=x0F1C57SFHaO2-Z9cy1QshYlxv8wjl7VppooaGKbMIg,4658
171
- lionagi/protocols/messages/templates/README.md,sha256=Ux1ua0lN8AP2Ry5_6_eyiPCBtcFHV6e-GdpmEFu3XCs,1282
165
+ lionagi/protocols/messages/templates/README.md,sha256=Ch4JrKSjd85fLitAYO1OhZjNOGKHoEwaKQlcV16jiUI,1286
172
166
  lionagi/protocols/messages/templates/action_request.jinja2,sha256=d6OmxHKyvvNDSK4bnBM3TGSUk_HeE_Q2EtLAQ0ZBEJg,120
173
167
  lionagi/protocols/messages/templates/action_response.jinja2,sha256=Mg0UxmXlIvtP_KPB0GcJxE1TP6lml9BwdPkW1PZxkg8,142
174
168
  lionagi/protocols/messages/templates/assistant_response.jinja2,sha256=oKOX4myBy7it1J1f92mvTS1iBUUlZfsJsY2fC42ygvc,119
@@ -179,45 +173,41 @@ lionagi/protocols/operatives/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5Z
179
173
  lionagi/protocols/operatives/operative.py,sha256=PXEMzD6tFM5PPK9kkPaSb7DBIzy7TNC3f2evuGhWhpg,6677
180
174
  lionagi/protocols/operatives/step.py,sha256=AXXRhjsbWqkoMDQ_JyqsfQItQsjBJmldugJz36mA4N0,9772
181
175
  lionagi/service/__init__.py,sha256=DMGXIqPsmut9H5GT0ZeSzQIzYzzPwI-2gLXydpbwiV8,21
182
- lionagi/service/imodel.py,sha256=OaoEsL1SrltEqDR-dCDSKzEy2wF8BUNnCc-3fsJmESE,15289
183
- lionagi/service/manager.py,sha256=FkuqAtLErqLmXNnDtuAdTUFo4uuE_VL660BBGBhzInU,1435
184
- lionagi/service/types.py,sha256=CHPi8Bxl_yJ1pl2jYZBOrTHbT8_oO9sK75d4LMB651g,486
185
- lionagi/service/endpoints/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
186
- lionagi/service/endpoints/base.py,sha256=lIxjzGIIVu9AQ_FdgR_u7XKDZXrJNfEZbGahmq3crFo,26126
187
- lionagi/service/endpoints/chat_completion.py,sha256=nihV7kCYm7ixdm8dH0JW7vKjqH9yIom4QDXGeDwuO6E,2964
188
- lionagi/service/endpoints/match_endpoint.py,sha256=x2T-ftzdqCrdITRLkH8UNRDY2Pm359DnX2RDXTBnbpc,2082
189
- lionagi/service/endpoints/rate_limited_processor.py,sha256=-hBWStV3W57emw4AmXJBLM20NapFPLwiXmLX3p6tNrE,5187
190
- lionagi/service/endpoints/token_calculator.py,sha256=zpbk1YlFW5M_e-vs9YJyhDThMm3U3IaZ7hKm-_6XrDU,6460
191
- lionagi/service/providers/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
192
- lionagi/service/providers/types.py,sha256=NS91ysRFwOs0cpNeQgFhmtl7JrSz2pJm-tt7sZILmQY,683
193
- lionagi/service/providers/anthropic_/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
194
- lionagi/service/providers/anthropic_/messages.py,sha256=EnV2vh60k0aQvtnUitHzTlSmyrFxTVxcXAldANg7Rzc,3148
195
- lionagi/service/providers/exa_/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
196
- lionagi/service/providers/exa_/models.py,sha256=wwcMB-NOQ0uswK4ymc89bgCudcA_rkj_xogt6jF_rrI,83
197
- lionagi/service/providers/exa_/search.py,sha256=Z3pyJH8KiWiquJSJw8Rd6D7x43BwTFHb2ESsgSicCk0,1932
198
- lionagi/service/providers/exa_/types.py,sha256=8ODjXpFajBE9-DGqBJNS--GObwmLSDi667xS84z_AgA,139
199
- lionagi/service/providers/groq_/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
200
- lionagi/service/providers/groq_/chat_completions.py,sha256=q1p_1qus4vduWWBzs9V_KbNrqU2Tu2o8TZm6Fh09fw4,1343
201
- lionagi/service/providers/ollama_/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
202
- lionagi/service/providers/ollama_/chat_completions.py,sha256=hsxgmMq-ujGAlrNQ3pF8q2hA9BVqol7HObGu9kR_t4s,3796
203
- lionagi/service/providers/openai_/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
204
- lionagi/service/providers/openai_/chat_completions.py,sha256=CxALMCOP3KH16O583xngkAfFot8Hvbr_o1HeLvCh0Us,2938
205
- lionagi/service/providers/openai_/spec.py,sha256=GJkndsSQmGT-DpSnePz077HK7YQ-xp6-SCTlws6RRf0,217
206
- lionagi/service/providers/openrouter_/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
207
- lionagi/service/providers/openrouter_/chat_completions.py,sha256=0pdXjJCXmCPPbKKVubrnqofaodTOxWTJam8fd3NgrNk,1525
208
- lionagi/service/providers/perplexity_/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
209
- lionagi/service/providers/perplexity_/chat_completions.py,sha256=O4MIS_3xIINGjkAZdlw0Bu_jAfBDR4VZA1F8JW2EU1M,1197
210
- lionagi/service/providers/perplexity_/models.py,sha256=T2GFWKvCTDjp4kFobuAqzuAYBX0_VlmHhYacHloR3uo,154
176
+ lionagi/service/imodel.py,sha256=ho5vINb0xQVOmUsZj1TR4hfXsfNPqsyW1tfDH2Us-nU,11211
177
+ lionagi/service/manager.py,sha256=9-dIE4ZftI94RLLLPXH-yB4E3zfnbTs3yppdFDPNchM,1165
178
+ lionagi/service/rate_limited_processor.py,sha256=PnO0rBf9ObKhD3vtl6pYZX3nHVDvMPdOww59zCWgslQ,5230
179
+ lionagi/service/resilience.py,sha256=uYJYZQ9M-tje8ME3vJmYabXwKHF1c3Ij4-WrdCwogcs,18742
180
+ lionagi/service/token_calculator.py,sha256=zpbk1YlFW5M_e-vs9YJyhDThMm3U3IaZ7hKm-_6XrDU,6460
181
+ lionagi/service/types.py,sha256=6zavqBxK1Fj0nB9eZgJn3JICxmdT-n0nn8YWZFzM5LU,508
182
+ lionagi/service/connections/__init__.py,sha256=yHQZ7OJpCftd6CStYR8inbxjJydYdmv9kCvbUBhJ2zU,362
183
+ lionagi/service/connections/api_calling.py,sha256=KMO4BQf3z-WM2-pG2lhoNzxMb-zzCMKMhbrQPOPIwgI,7929
184
+ lionagi/service/connections/endpoint.py,sha256=HqeLUP0XvUrPpsHraYbKXO9EUIuoivChWju30dVgFrs,14494
185
+ lionagi/service/connections/endpoint_config.py,sha256=jCgMOujN5KzQ2miOrfEqKrVZW3jlZEgBp2R3_2sXynI,4380
186
+ lionagi/service/connections/header_factory.py,sha256=22sG4ian3MiNklF6SdQqkEYgtWKOZik_yDE0Lna6BiE,1754
187
+ lionagi/service/connections/match_endpoint.py,sha256=lwFFpiEfkaMuznjQcqfJlvDLm5EVUs9scAnthVghPuY,1571
188
+ lionagi/service/connections/providers/__init__.py,sha256=3lzOakDoBWmMaNnT2g-YwktPKa_Wme4lnPRSmOQfayY,105
189
+ lionagi/service/connections/providers/anthropic_.py,sha256=SUPnw2UqjY5wuHXLHas6snMTzhQ-UuixvPYbkVnXn34,3083
190
+ lionagi/service/connections/providers/exa_.py,sha256=GGWaD9jd5gKM257OfUaIBBKIqR1NrNcBE67p_7JbK7g,938
191
+ lionagi/service/connections/providers/oai_.py,sha256=rKZdGufX4vpj88rr98KqoOHzHa7HgH_pCVWjCqAq-XU,4971
192
+ lionagi/service/connections/providers/ollama_.py,sha256=jdx6dGeChwVk5TFfFRbpnrpKzj8YQZw6D5iWJ6zYmfk,4096
193
+ lionagi/service/connections/providers/perplexity_.py,sha256=9MH9YmMy9Jg7JDMJHQxxMYHyjJ4NP0OlN7sCuhla85I,917
194
+ lionagi/service/third_party/README.md,sha256=qFjWnI8rmLivIyr6Tc-hRZh-rQwntROp76af4MBNJJc,2214
195
+ lionagi/service/third_party/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
196
+ lionagi/service/third_party/anthropic_models.py,sha256=wA2NiiPJzkkVF_-wFgnTJoKwvuoduqHw-yVSetp0XZI,4014
197
+ lionagi/service/third_party/exa_models.py,sha256=G_hnekcy-DillPLzMoDQ8ZisVAL8Mp7iMAK4xqAT_3w,5470
198
+ lionagi/service/third_party/openai_models.py,sha256=sF-fQ726CnaDBgLY_r2NdPqc3GicPKhZjh5F8IfjBO0,501904
199
+ lionagi/service/third_party/pplx_models.py,sha256=Nkm1ftESBa_NwP9ITBUNqLmAZ3Jh92aL732g_i6T8LQ,5947
211
200
  lionagi/session/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
212
- lionagi/session/branch.py,sha256=-4VZJna20HrftkVJoYiEgCb4HrUlP6aBRA-XlrHageQ,69722
201
+ lionagi/session/branch.py,sha256=APvq4vQvlk6nPOWezL7sY59h2T-ndxONuBwYvu5ZcsA,69942
213
202
  lionagi/session/prompts.py,sha256=AhuHL19s0TijVZX3tMKUKMi6l88xeVdpkuEn2vJSRyU,3236
214
203
  lionagi/session/session.py,sha256=4Rk5_DB9y-yaqyfQ9tHYOMUy_0HCgCoGqeSc2Y5riu0,9172
215
204
  lionagi/tools/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
216
205
  lionagi/tools/base.py,sha256=cld32pyjaTUdyiqZ8hNyJjWKAhcJ8RQNhgImI7R8b-E,1940
217
206
  lionagi/tools/types.py,sha256=XtJLY0m-Yi_ZLWhm0KycayvqMCZd--HxfQ0x9vFUYDE,230
218
207
  lionagi/tools/file/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
219
- lionagi/tools/file/reader.py,sha256=K0PtEI1s-Ol-uthBUdGFzDLrQNFr4l1bRkosn2jios8,9539
220
- lionagi-0.12.2.dist-info/METADATA,sha256=JrekthbdkAaX3sK7DWVfz_tN6vfb_YrSzfIXca88npQ,18423
221
- lionagi-0.12.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
222
- lionagi-0.12.2.dist-info/licenses/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
223
- lionagi-0.12.2.dist-info/RECORD,,
208
+ lionagi/tools/file/reader.py,sha256=0TdnfVGVCKuM58MmGM-NyVjhU9BFoitkNYEepdc0z_Y,9529
209
+ lionagi/tools/memory/tools.py,sha256=zTGBenVsF8Wuh303kWntmQSGlAFKonHNdh5ePuQ26KE,15948
210
+ lionagi-0.12.4.dist-info/METADATA,sha256=qWskGXtFjTqx7LFfsjeVdiFFSgV4CerJiJTrhyhaxgk,18980
211
+ lionagi-0.12.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
212
+ lionagi-0.12.4.dist-info/licenses/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
213
+ lionagi-0.12.4.dist-info/RECORD,,
@@ -1,80 +0,0 @@
1
- # Copyright (c) 2023 - 2025, HaiyangLi <quantocean.li at gmail dot com>
2
- #
3
- # SPDX-License-Identifier: Apache-2.0
4
-
5
- import uuid
6
- from datetime import datetime
7
- from pathlib import Path
8
-
9
-
10
- def create_path(
11
- directory: Path | str,
12
- filename: str,
13
- extension: str = None,
14
- timestamp: bool = False,
15
- dir_exist_ok: bool = True,
16
- file_exist_ok: bool = False,
17
- time_prefix: bool = False,
18
- timestamp_format: str | None = None,
19
- random_hash_digits: int = 0,
20
- ) -> Path:
21
- """
22
- Generate a new file path with optional timestamp and a random suffix.
23
-
24
- Args:
25
- directory: The directory where the file will be created.
26
- filename: The base name of the file to create.
27
- extension: The file extension, if not part of filename.
28
- timestamp: If True, add a timestamp to the filename.
29
- dir_exist_ok: If True, don't error if directory exists.
30
- file_exist_ok: If True, allow overwriting existing files.
31
- time_prefix: If True, timestamp is prefixed instead of suffixed.
32
- timestamp_format: Custom format for timestamp (default: "%Y%m%d%H%M%S").
33
- random_hash_digits: Number of hex digits for a random suffix.
34
-
35
- Returns:
36
- The full Path to the new or existing file.
37
-
38
- Raises:
39
- ValueError: If filename is invalid.
40
- FileExistsError: If file exists and file_exist_ok=False.
41
- """
42
- if "/" in filename:
43
- sub_dir, filename = filename.split("/")[:-1], filename.split("/")[-1]
44
- directory = Path(directory) / "/".join(sub_dir)
45
-
46
- if "\\" in filename:
47
- raise ValueError("Filename cannot contain directory separators.")
48
-
49
- directory = Path(directory)
50
-
51
- # Extract name and extension from filename if present
52
- if "." in filename:
53
- name, ext = filename.rsplit(".", 1)
54
- else:
55
- name, ext = filename, extension
56
-
57
- # Ensure extension has a single leading dot
58
- ext = f".{ext.lstrip('.')}" if ext else ""
59
-
60
- # Add timestamp if requested
61
- if timestamp:
62
- ts_str = datetime.now().strftime(timestamp_format or "%Y%m%d%H%M%S")
63
- name = f"{ts_str}_{name}" if time_prefix else f"{name}_{ts_str}"
64
-
65
- # Add random suffix if requested
66
- if random_hash_digits > 0:
67
- # Use UUID4 and truncate its hex for random suffix
68
- random_suffix = uuid.uuid4().hex[:random_hash_digits]
69
- name = f"{name}-{random_suffix}"
70
-
71
- full_path = directory / f"{name}{ext}"
72
-
73
- # Check if file or directory existence
74
- full_path.parent.mkdir(parents=True, exist_ok=dir_exist_ok)
75
- if full_path.exists() and not file_exist_ok:
76
- raise FileExistsError(
77
- f"File {full_path} already exists and file_exist_ok is False."
78
- )
79
-
80
- return full_path