Skip to content

Commit 2f0cb0d

Browse files
authored
Merge pull request #7 from hanno-meister/gp_multi_choice_decision
parallel ReAct agent
2 parents 4745dda + 7ca9ee0 commit 2f0cb0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1086
-212
lines changed

.gitignore

Lines changed: 86 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,138 @@
1-
# Byte-compiled / optimized / DLL files
1+
# byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
44
*$py.class
55

66
# C extensions
77
*.so
88

9-
# Distribution / packaging
9+
# Celery
10+
celerybeat-schedule
11+
celerybeat.pid
12+
13+
# Cython debug symbols
14+
cython_debug/
15+
16+
# distribution / packaging
17+
.eggs/
18+
.installed.cfg
1019
.Python
20+
*.egg
21+
*.egg-info/
1122
build/
1223
develop-eggs/
1324
dist/
1425
downloads/
1526
eggs/
16-
.eggs/
1727
lib/
1828
lib64/
29+
MANIFEST
1930
parts/
2031
sdist/
32+
share/python-wheels/
2133
var/
2234
wheels/
23-
share/python-wheels/
24-
*.egg-info/
25-
.installed.cfg
26-
*.egg
27-
MANIFEST
28-
29-
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32-
*.manifest
33-
*.spec
34-
35-
# Installer logs
36-
pip-log.txt
37-
pip-delete-this-directory.txt
38-
39-
# Unit test / coverage reports
40-
htmlcov/
41-
.tox/
42-
.nox/
43-
.coverage
44-
.coverage.*
45-
.cache
46-
nosetests.xml
47-
coverage.xml
48-
*.cover
49-
*.py,cover
50-
.hypothesis/
51-
.pytest_cache/
52-
cover/
53-
54-
# Translations
55-
*.mo
56-
*.pot
5735

58-
# Django stuff:
36+
# Django
5937
*.log
60-
local_settings.py
6138
db.sqlite3
6239
db.sqlite3-journal
40+
local_settings.py
6341

64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
42+
# environments
43+
.env
44+
.venv
45+
env.bak/
46+
env/
47+
ENV/
48+
venv.bak/
49+
venv/
6750

68-
# Scrapy stuff:
69-
.scrapy
51+
# Flask
52+
.webassets-cache
53+
instance/
7054

71-
# Sphinx documentation
72-
docs/_build/
55+
# IDEs
56+
.idea/
57+
.vscode/
7358

74-
# PyBuilder
75-
.pybuilder/
76-
target/
59+
# IPython
60+
ipython_config.py
61+
profile_default/
7762

78-
# Jupyter Notebook
63+
# Jupyter
7964
.ipynb_checkpoints
8065

81-
# IPython
82-
profile_default/
83-
ipython_config.py
66+
# logging
67+
pip-delete-this-directory.txt
68+
pip-log.txt
8469

85-
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# UV
98-
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
#uv.lock
102-
103-
# poetry
104-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105-
# This is especially recommended for binary packages to ensure reproducibility, and is more
106-
# commonly ignored for libraries.
107-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108-
#poetry.lock
70+
# macOS system files
71+
.DS_Store
72+
73+
# mkdocs documentation
74+
/site
10975

11076
# pdm
111-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112-
#pdm.lock
113-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114-
# in version control.
77+
# pdm stores project-wide configurations in .pdm.toml,
78+
# but it is recommended to not include it in version control.
11579
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116-
.pdm.toml
117-
.pdm-python
11880
.pdm-build/
81+
.pdm-python
82+
.pdm.toml
11983

12084
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
12185
__pypackages__/
12286

123-
# Celery stuff
124-
celerybeat-schedule
125-
celerybeat.pid
87+
# PyBuilder
88+
.pybuilder/
89+
target/
90+
91+
# PyInstaller
92+
*.manifest
93+
*.spec
94+
95+
# PyPI configuration file
96+
.pypirc
97+
98+
# Rope settings
99+
.ropeproject
126100

127101
# SageMath parsed files
128102
*.sage.py
129103

130-
# Environments
131-
.env
132-
.venv
133-
env/
134-
venv/
135-
ENV/
136-
env.bak/
137-
venv.bak/
104+
# Scrapy
105+
.scrapy
106+
107+
# Sphinx documentation
108+
docs/_build/
138109

139-
# Spyder project settings
110+
# Spyder settings
140111
.spyderproject
141112
.spyproject
142113

143-
# Rope project settings
144-
.ropeproject
145-
146-
# mkdocs documentation
147-
/site
148-
149-
# mypy
150-
.mypy_cache/
114+
# static analysis
151115
.dmypy.json
152-
dmypy.json
153-
154-
# Pyre type checker
116+
.mypy_cache/
155117
.pyre/
156-
157-
# pytype static type analyzer
158118
.pytype/
119+
dmypy.json
159120

160-
# Cython debug symbols
161-
cython_debug/
162-
163-
# PyCharm
164-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166-
# and can be added to the global gitignore or merged into this file. For a more nuclear
167-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168-
#.idea/
121+
# testing
122+
.cache
123+
.coverage
124+
.coverage.*
125+
.hypothesis/
126+
.nox/
127+
.pytest_cache/
128+
.tox/
129+
*.cover
130+
*.py,cover
131+
cover/
132+
coverage.xml
133+
htmlcov/
134+
nosetests.xml
169135

170-
# PyPI configuration file
171-
.pypirc
136+
# translations
137+
*.mo
138+
*.pot

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<div align="center">
32
<img height=200 src="https://github.com/SynaLinks/synalinks/blob/main/img/synalinks_logo_square.png?raw=true">
43
</div>
@@ -439,4 +438,4 @@ Synalinks would not be possible without the great work of the following open-sou
439438
- [Keras](https://keras.io/) for the graph-based computation backbone, API and overall code, design and philosophy.
440439
- [DSPy](https://dspy.ai/) for the modules/optimizers inspiration.
441440
- [Pydantic](https://docs.pydantic.dev/latest/) for the backend data layer.
442-
- [LiteLLM](https://docs.litellm.ai/docs/) for the LMs integrations.
441+
- [LiteLLM](https://docs.litellm.ai/docs/) for the LMs integrations.

coverage-badge.svg

Lines changed: 2 additions & 1 deletion
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
::: synalinks.src.modules.agents.parallel_react_agent

docs/Synalinks API/Modules API/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,5 @@ if __name__ == "__main__":
8484

8585
### Agents Modules
8686

87-
- [ReACT Agent module](Agents Modules/ReACT Agent module.md)
87+
- [ReACT Agent module](Agents Modules/ReACT Agent module.md)
88+
- [Parallel ReACT Agent module](Agents Modules/Parallel ReACT Agent module.md)

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ nav:
116116
- Agents Modules:
117117
- Synalinks API/Modules API/Agents Modules/index.md
118118
- Synalinks API/Modules API/Agents Modules/ReACT Agent module.md
119+
- Synalinks API/Modules API/Agents Modules/Parallel ReACT Agent module.md
119120
- Callbacks API:
120121
- Synalinks API/Callbacks API/index.md
121122
- Synalinks API/Callbacks API/Base Callback class.md

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ classifiers = [
2222
dependencies = [
2323
"absl-py",
2424
"asyncio",
25+
"click",
2526
"datasets",
27+
"docstring-parser",
28+
"graphviz",
29+
"inquirer",
2630
"jinja2",
2731
"litellm",
32+
"matplotlib",
2833
"namex",
34+
"neo4j",
35+
"nest-asyncio",
2936
"numpy",
3037
"optree",
3138
"pydantic",
3239
"pydotplus",
3340
"rich",
34-
"matplotlib",
35-
"docstring-parser",
36-
"nest-asyncio",
37-
"graphviz",
38-
"click",
39-
"inquirer",
40-
"neo4j",
4141
"sentry-sdk",
4242
]
4343

synalinks/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@
3333
from synalinks.api import LanguageModel
3434
from synalinks.api import Metric
3535
from synalinks.api import Module
36+
from synalinks.api import MultiDecision
3637
from synalinks.api import Not
3738
from synalinks.api import Operation
3839
from synalinks.api import Or
40+
from synalinks.api import ParallelReACTAgent
3941
from synalinks.api import Prediction
4042
from synalinks.api import Program
4143
from synalinks.api import ReACTAgent
@@ -44,6 +46,7 @@
4446
from synalinks.api import Reward
4547
from synalinks.api import SelfCritique
4648
from synalinks.api import Sequential
49+
from synalinks.api import SequentialReACTAgent
4750
from synalinks.api import SimilaritySearch
4851
from synalinks.api import StatelessScope
4952
from synalinks.api import SymbolicDataModel

synalinks/api/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@
7272
from synalinks.src.knowledge_bases.knowledge_base import KnowledgeBase as KnowledgeBase
7373
from synalinks.src.language_models.language_model import LanguageModel as LanguageModel
7474
from synalinks.src.metrics.metric import Metric as Metric
75+
from synalinks.src.modules.agents.parallel_react_agent import (
76+
ParallelReACTAgent as ParallelReACTAgent,
77+
)
7578
from synalinks.src.modules.agents.react_agent import ReACTAgent as ReACTAgent
79+
from synalinks.src.modules.agents.react_agent import ReACTAgent as SequentialReACTAgent
7680
from synalinks.src.modules.core.action import Action as Action
7781
from synalinks.src.modules.core.branch import Branch as Branch
7882
from synalinks.src.modules.core.decision import Decision as Decision
@@ -85,6 +89,7 @@
8589
)
8690
from synalinks.src.modules.core.identity import Identity as Identity
8791
from synalinks.src.modules.core.input_module import Input as Input
92+
from synalinks.src.modules.core.multi_decision import MultiDecision as MultiDecision
8893
from synalinks.src.modules.core.not_module import Not as Not
8994
from synalinks.src.modules.knowledge.embedding import Embedding as Embedding
9095
from synalinks.src.modules.knowledge.entity_retriever import (

synalinks/api/modules/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@
66

77
from synalinks.src.modules import deserialize as deserialize
88
from synalinks.src.modules import serialize as serialize
9+
from synalinks.src.modules.agents.parallel_react_agent import (
10+
ParallelReACTAgent as ParallelReACTAgent,
11+
)
912
from synalinks.src.modules.agents.react_agent import ReACTAgent as ReACTAgent
13+
from synalinks.src.modules.agents.react_agent import ReACTAgent as SequentialReACTAgent
1014
from synalinks.src.modules.core.action import Action as Action
1115
from synalinks.src.modules.core.branch import Branch as Branch
1216
from synalinks.src.modules.core.decision import Decision as Decision
1317
from synalinks.src.modules.core.generator import Generator as Generator
1418
from synalinks.src.modules.core.identity import Identity as Identity
1519
from synalinks.src.modules.core.input_module import Input as Input
1620
from synalinks.src.modules.core.input_module import InputModule as InputModule
21+
from synalinks.src.modules.core.multi_decision import MultiDecision as MultiDecision
1722
from synalinks.src.modules.core.not_module import Not as Not
1823
from synalinks.src.modules.knowledge.embedding import Embedding as Embedding
1924
from synalinks.src.modules.knowledge.entity_retriever import (

0 commit comments

Comments
 (0)