lionagi 0.2.1__py3-none-any.whl → 0.2.2__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/__init__.py +2 -1
- lionagi/core/generic/graph.py +10 -3
- lionagi/core/generic/node.py +5 -1
- lionagi/core/report/base.py +1 -0
- lionagi/core/work/work_edge.py +96 -0
- lionagi/core/work/work_function.py +29 -6
- lionagi/core/work/work_function_node.py +44 -0
- lionagi/core/work/work_queue.py +20 -18
- lionagi/core/work/work_task.py +155 -0
- lionagi/core/work/worker.py +164 -39
- lionagi/core/work/worker_engine.py +179 -0
- lionagi/core/work/worklog.py +5 -3
- lionagi/tests/test_core/generic/test_structure.py +193 -0
- lionagi/tests/test_core/graph/__init__.py +0 -0
- lionagi/tests/test_core/graph/test_graph.py +70 -0
- lionagi/tests/test_core/graph/test_tree.py +75 -0
- lionagi/tests/test_core/mail/__init__.py +0 -0
- lionagi/tests/test_core/mail/test_mail.py +62 -0
- lionagi/tests/test_core/test_structure/__init__.py +0 -0
- lionagi/tests/test_core/test_structure/test_base_structure.py +196 -0
- lionagi/tests/test_core/test_structure/test_graph.py +54 -0
- lionagi/tests/test_core/test_structure/test_tree.py +48 -0
- lionagi/version.py +1 -1
- {lionagi-0.2.1.dist-info → lionagi-0.2.2.dist-info}/METADATA +5 -4
- {lionagi-0.2.1.dist-info → lionagi-0.2.2.dist-info}/RECORD +28 -14
- {lionagi-0.2.1.dist-info → lionagi-0.2.2.dist-info}/LICENSE +0 -0
- {lionagi-0.2.1.dist-info → lionagi-0.2.2.dist-info}/WHEEL +0 -0
- {lionagi-0.2.1.dist-info → lionagi-0.2.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
import unittest
|
2
|
+
from lionagi.new.schema.todo.tree import Tree
|
3
|
+
from lionagi.core.generic import TreeNode
|
4
|
+
|
5
|
+
|
6
|
+
class TestTree(unittest.TestCase):
|
7
|
+
def setUp(self):
|
8
|
+
self.tree = Tree()
|
9
|
+
self.node1 = TreeNode(id_="node1", content="Node 1")
|
10
|
+
self.node2 = TreeNode(id_="node2", content="Node 2")
|
11
|
+
self.node3 = TreeNode(id_="node3", content="Node 3")
|
12
|
+
self.tree.add_structure_node(self.node1)
|
13
|
+
self.tree.add_structure_node(self.node2)
|
14
|
+
self.tree.add_structure_node(self.node3)
|
15
|
+
|
16
|
+
def test_add_parent_to_child(self):
|
17
|
+
self.tree.add_parent_to_child(self.node1, self.node2)
|
18
|
+
self.assertEqual(self.node2, self.node1.parent)
|
19
|
+
self.assertIn(self.node1, self.node2.children)
|
20
|
+
|
21
|
+
def test_add_child_to_parent(self):
|
22
|
+
self.tree.add_child_to_parent(self.node3, self.node2)
|
23
|
+
self.assertEqual(self.node2, self.node3.parent)
|
24
|
+
self.assertIn(self.node3, self.node2.children)
|
25
|
+
|
26
|
+
def test_find_parent(self):
|
27
|
+
self.tree.add_parent_to_child(self.node1, self.node2)
|
28
|
+
parent = self.tree.find_parent(self.node1)
|
29
|
+
self.assertEqual(self.node2, parent)
|
30
|
+
|
31
|
+
def test_find_child(self):
|
32
|
+
self.tree.add_parent_to_child(self.node1, self.node2)
|
33
|
+
children = self.tree.find_child(self.node2)
|
34
|
+
self.assertIn(self.node1, children)
|
35
|
+
|
36
|
+
def test_parent_child_relationship(self):
|
37
|
+
self.tree.add_parent_to_child(self.node1, self.node2)
|
38
|
+
self.tree.add_child_to_parent(self.node3, self.node2)
|
39
|
+
self.assertIn(self.node1, self.node2.children)
|
40
|
+
self.assertIn(self.node3, self.node2.children)
|
41
|
+
self.assertEqual(self.node2, self.node1.parent)
|
42
|
+
self.assertEqual(self.node2, self.node3.parent)
|
43
|
+
|
44
|
+
# Add more tests as necessary to cover edge cases and other functionalities
|
45
|
+
|
46
|
+
|
47
|
+
if __name__ == "__main__":
|
48
|
+
unittest.main()
|
lionagi/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.2.
|
1
|
+
__version__ = "0.2.2"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lionagi
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.2
|
4
4
|
Summary: Towards automated general intelligence.
|
5
5
|
Author: HaiyangLi
|
6
6
|
Author-email: Haiyang Li <ocean@lionagi.ai>
|
@@ -226,13 +226,14 @@ Requires-Dist: pandas >=2.1.0
|
|
226
226
|
 
|
227
227
|
|
228
228
|
|
229
|
-
[PyPI](https://pypi.org/project/lionagi/) | [Documentation](https://ocean-lion.com/Welcome) | [Discord](https://discord.gg/
|
229
|
+
[PyPI](https://pypi.org/project/lionagi/) | [Documentation](https://ocean-lion.com/Welcome) | [Discord](https://discord.gg/aqSJ2v46vu) | [Roadmap](https://trello.com/b/3seomsrI/lionagi)
|
230
230
|
|
231
231
|
|
232
232
|
# Language InterOperable Network - LION
|
233
|
+
### An AGentic Intelligence Operating System
|
233
234
|
|
234
235
|
```
|
235
|
-
|
236
|
+
pip install lionagi==0.2.2
|
236
237
|
```
|
237
238
|
|
238
239
|
**Powerful Intelligent Workflow Automation**
|
@@ -250,7 +251,7 @@ What goes inside of a LLM is more akin to a [black-box](https://pauldeepakraj-r.
|
|
250
251
|
|
251
252
|
### Community
|
252
253
|
|
253
|
-
We encourage contributions to LionAGI and invite you to enrich its features and capabilities. Engage with us and other community members [Join Our Discord](https://discord.gg/
|
254
|
+
We encourage contributions to LionAGI and invite you to enrich its features and capabilities. Engage with us and other community members [Join Our Discord](https://discord.gg/aqSJ2v46vu)
|
254
255
|
|
255
256
|
### Citation
|
256
257
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
lionagi/__init__.py,sha256=
|
2
|
-
lionagi/version.py,sha256=
|
1
|
+
lionagi/__init__.py,sha256=amQal6CUIv4QDI4Qmb0M5qwTbn3_F430Wl5vaSNG6-U,1952
|
2
|
+
lionagi/version.py,sha256=m6kyaNpwBcP1XYcqrelX2oS3PJuOnElOcRdBa9pEb8c,22
|
3
3
|
lionagi/core/__init__.py,sha256=Il5Q9ATdX8yXqVxtP_nYqUhExzxPC_qk_WXQ_4h0exg,16
|
4
4
|
lionagi/core/_setting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
lionagi/core/_setting/_setting.py,sha256=p23fHtrzIZlQ8s8CDZICn8C6k7mdB_088nIDx19JaqM,1907
|
@@ -47,9 +47,9 @@ lionagi/core/executor/neo4j_executor.py,sha256=POPqYo1f86PT9JMgPvTQ4dgTCw5jS17cs
|
|
47
47
|
lionagi/core/generic/__init__.py,sha256=YFIUtzKwabE4UIs9EySXMirz97vsD2aHoqEKBCpc0Z0,140
|
48
48
|
lionagi/core/generic/edge.py,sha256=5JDzy4RAaj5UQea4vbvmoyMTVQU--PUQgtMy1OoJuBU,3987
|
49
49
|
lionagi/core/generic/edge_condition.py,sha256=F1FUJNcQvksCZBMCyAaOTQNNzg4bnUi_t-O_NZOmsQk,374
|
50
|
-
lionagi/core/generic/graph.py,sha256=
|
50
|
+
lionagi/core/generic/graph.py,sha256=U99JRyZldajngvTJeTasCsIwNms2bH9Nb1P_-2dWUxM,7599
|
51
51
|
lionagi/core/generic/hyperedge.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
52
|
-
lionagi/core/generic/node.py,sha256=
|
52
|
+
lionagi/core/generic/node.py,sha256=CWfsaW4zb8IO8EQMJ9LKuk7uEouZTgNa53MMxQ6pDXM,7018
|
53
53
|
lionagi/core/generic/tree.py,sha256=HOylit6dAcUoYsqDqPIcZ2IdO92bCiwDlq_mMTOM_f4,1540
|
54
54
|
lionagi/core/generic/tree_node.py,sha256=dveu_LPUTP5LcLDuIOkWUgUqzrl8lr9HMupP66IZeAs,2411
|
55
55
|
lionagi/core/mail/__init__.py,sha256=fHNlcHwPCUbnrf8ItQ6HJQwmAG9KrDKouKBXjbo7h78,203
|
@@ -66,7 +66,7 @@ lionagi/core/message/message.py,sha256=rskq_clQNQ9gzXCTqKzsuYiJDbadaLh2dBdIOukiS
|
|
66
66
|
lionagi/core/message/system.py,sha256=4IGbtl3PzAFb-UYjNWPRAUYe9i9FCpLRIOrK5xDW7W8,2876
|
67
67
|
lionagi/core/message/util.py,sha256=sTt1iV0LGvNXnPJUThxB78g5rVcuV6wPFAb8Fqc1f1s,9764
|
68
68
|
lionagi/core/report/__init__.py,sha256=KqfJNaSx9fzRw3eyrlIlYIiueo-jVYMgjaOdfzTUAN4,80
|
69
|
-
lionagi/core/report/base.py,sha256=
|
69
|
+
lionagi/core/report/base.py,sha256=R4MDMUFz4DEXi3rMr2qIGwfx1Z_1o0BBJfXVXoCairg,7977
|
70
70
|
lionagi/core/report/form.py,sha256=wV-T-2SlkRAe2AQ_0CNKobiOSDcao_XUBw8paHvM08Q,7883
|
71
71
|
lionagi/core/report/report.py,sha256=9_OKUduQFAn6tU6cXBv6_YwaMrSKrEuDFTSyLrX3YSQ,6103
|
72
72
|
lionagi/core/report/util.py,sha256=s9TszoP9Qr0xic08Weg15IkgjcyKe1FIhWSWUk6sl9Q,894
|
@@ -107,10 +107,14 @@ lionagi/core/validator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
107
107
|
lionagi/core/validator/validator.py,sha256=ngThQTzNSOa6N0mKrAQuhwM_gb_IWhF58OefOyUjTK8,12012
|
108
108
|
lionagi/core/work/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
109
109
|
lionagi/core/work/work.py,sha256=oVbx0b8arvXSjDZa2Rs1s37_Fiue6gbR0Tt4oL7Dzkk,2532
|
110
|
-
lionagi/core/work/
|
111
|
-
lionagi/core/work/
|
112
|
-
lionagi/core/work/
|
113
|
-
lionagi/core/work/
|
110
|
+
lionagi/core/work/work_edge.py,sha256=OiJGqGV2rsRzYwmlIS9Hnf5yPAceY7gJeiHmd0Spdso,3403
|
111
|
+
lionagi/core/work/work_function.py,sha256=hFjkdTUchwnzN5DX3pe05ADKWWJktzetmH8YlPiWnaw,3971
|
112
|
+
lionagi/core/work/work_function_node.py,sha256=3X5CXtTuhhOspgZMlqt5haljCrp20vSIA59Tw8i-tLI,2069
|
113
|
+
lionagi/core/work/work_queue.py,sha256=_qbTL9M5NdAfnzUV14--dFZQXiVnqEgXP2KWB7hry60,3626
|
114
|
+
lionagi/core/work/work_task.py,sha256=t4ltNVOd1G1FLe1496H40V-kX8v22IdDHnR2VC8pAi4,5405
|
115
|
+
lionagi/core/work/worker.py,sha256=M3SSHIVf8BR-yaaqEm9xaX8EgVn4MGInn7ODwY6tXSk,14948
|
116
|
+
lionagi/core/work/worker_engine.py,sha256=1WF2aMBeQmWgfQ43-BS0PCuDmJxltznzNc-RvBx9iNw,7390
|
117
|
+
lionagi/core/work/worklog.py,sha256=R6UC7CUczne41msrV9ekvYIKkZnNUz6IT1XPZ3_Nd7I,3619
|
114
118
|
lionagi/experimental/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
115
119
|
lionagi/experimental/compressor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
116
120
|
lionagi/experimental/compressor/base.py,sha256=1BKdA6rcj0ziFNstj8Xc70aG5dL-JTiZwiM8NnwoDns,2017
|
@@ -232,9 +236,19 @@ lionagi/tests/test_core/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
232
236
|
lionagi/tests/test_core/generic/test_edge.py,sha256=_wSRz8r8bmIib-XgIVoEPSbtJ7vuuymS2mPpr4Sy01I,2532
|
233
237
|
lionagi/tests/test_core/generic/test_graph.py,sha256=-vAg45cNx0CQczURgU8E0CW8lfXnBrqZwaq4OMuPUWA,3568
|
234
238
|
lionagi/tests/test_core/generic/test_node.py,sha256=SIGKts5FURH84NEHWy1if39FeVx-RAoOryXOrtIWMFY,4417
|
239
|
+
lionagi/tests/test_core/generic/test_structure.py,sha256=wskEe7BT82qvGwUcgFVtrw4OeKS6fMF2r5RiCzuS-3k,8516
|
235
240
|
lionagi/tests/test_core/generic/test_tree_node.py,sha256=a1aMpGDAgtPD1W1HYco7Z3X7gBih-pndTbebf-K7YTA,2934
|
236
|
-
lionagi
|
237
|
-
lionagi
|
238
|
-
lionagi
|
239
|
-
lionagi
|
240
|
-
lionagi
|
241
|
+
lionagi/tests/test_core/graph/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
242
|
+
lionagi/tests/test_core/graph/test_graph.py,sha256=0v84JJ_8rUoN_TifSt_T9Uunn1gGH9PLj_ZGmyAHa1A,2584
|
243
|
+
lionagi/tests/test_core/graph/test_tree.py,sha256=bkLEu77jXc2BsD-szm1H2SnclkZaFKDsqWMF3e1TRic,3237
|
244
|
+
lionagi/tests/test_core/mail/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
245
|
+
lionagi/tests/test_core/mail/test_mail.py,sha256=rZ5ok29AFHRiOzOje0Orfj8nstsD42yrFwHvkqCL-qw,2234
|
246
|
+
lionagi/tests/test_core/test_structure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
247
|
+
lionagi/tests/test_core/test_structure/test_base_structure.py,sha256=SVIfXT_gxMG9_I2IeeEGOTawJq8XcaboF0y8gYHGwFg,9022
|
248
|
+
lionagi/tests/test_core/test_structure/test_graph.py,sha256=VJ1RIn6d65rwWl-subxnMA7m17t7Q-ShB5Bi1S_C4wA,2058
|
249
|
+
lionagi/tests/test_core/test_structure/test_tree.py,sha256=fAUDxJKF_gMS0CYb4-rtHsqfWf5qY-ALxaBWeLWT-ns,1851
|
250
|
+
lionagi-0.2.2.dist-info/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
|
251
|
+
lionagi-0.2.2.dist-info/METADATA,sha256=p3fGL0x851HByJiT3MNK_kt487ZC85NJ9sZE8A8EIjc,16156
|
252
|
+
lionagi-0.2.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
253
|
+
lionagi-0.2.2.dist-info/top_level.txt,sha256=szvch_d2jE1Lu9ZIKsl26Ll6BGfYfbOgt5lm-UpFSo4,8
|
254
|
+
lionagi-0.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|