beeai-framework 0.1.0__tar.gz
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.
- beeai_framework-0.1.0/LICENSE +201 -0
- beeai_framework-0.1.0/PKG-INFO +172 -0
- beeai_framework-0.1.0/README.md +142 -0
- beeai_framework-0.1.0/beeai_framework/__init__.py +42 -0
- beeai_framework-0.1.0/beeai_framework/adapters/__init__.py +1 -0
- beeai_framework-0.1.0/beeai_framework/adapters/litellm/chat.py +158 -0
- beeai_framework-0.1.0/beeai_framework/adapters/ollama/__init__.py +1 -0
- beeai_framework-0.1.0/beeai_framework/adapters/ollama/backend/__init__.py +1 -0
- beeai_framework-0.1.0/beeai_framework/adapters/ollama/backend/chat.py +19 -0
- beeai_framework-0.1.0/beeai_framework/adapters/watsonx/__init__.py +1 -0
- beeai_framework-0.1.0/beeai_framework/adapters/watsonx/backend/__init__.py +1 -0
- beeai_framework-0.1.0/beeai_framework/adapters/watsonx/backend/chat.py +19 -0
- beeai_framework-0.1.0/beeai_framework/agents/__init__.py +6 -0
- beeai_framework-0.1.0/beeai_framework/agents/base.py +60 -0
- beeai_framework-0.1.0/beeai_framework/agents/bee/__init__.py +5 -0
- beeai_framework-0.1.0/beeai_framework/agents/bee/agent.py +165 -0
- beeai_framework-0.1.0/beeai_framework/agents/errors.py +10 -0
- beeai_framework-0.1.0/beeai_framework/agents/runners/base.py +130 -0
- beeai_framework-0.1.0/beeai_framework/agents/runners/default/prompts.py +152 -0
- beeai_framework-0.1.0/beeai_framework/agents/runners/default/runner.py +185 -0
- beeai_framework-0.1.0/beeai_framework/agents/runners/granite/prompts.py +94 -0
- beeai_framework-0.1.0/beeai_framework/agents/runners/granite/runner.py +67 -0
- beeai_framework-0.1.0/beeai_framework/agents/types.py +89 -0
- beeai_framework-0.1.0/beeai_framework/backend/__init__.py +25 -0
- beeai_framework-0.1.0/beeai_framework/backend/chat.py +266 -0
- beeai_framework-0.1.0/beeai_framework/backend/constants.py +28 -0
- beeai_framework-0.1.0/beeai_framework/backend/errors.py +25 -0
- beeai_framework-0.1.0/beeai_framework/backend/message.py +141 -0
- beeai_framework-0.1.0/beeai_framework/backend/utils.py +66 -0
- beeai_framework-0.1.0/beeai_framework/cancellation.py +76 -0
- beeai_framework-0.1.0/beeai_framework/context.py +160 -0
- beeai_framework-0.1.0/beeai_framework/emitter/__init__.py +27 -0
- beeai_framework-0.1.0/beeai_framework/emitter/emitter.py +192 -0
- beeai_framework-0.1.0/beeai_framework/emitter/errors.py +10 -0
- beeai_framework-0.1.0/beeai_framework/emitter/types.py +24 -0
- beeai_framework-0.1.0/beeai_framework/emitter/utils.py +17 -0
- beeai_framework-0.1.0/beeai_framework/errors.py +179 -0
- beeai_framework-0.1.0/beeai_framework/llms/__init__.py +27 -0
- beeai_framework-0.1.0/beeai_framework/llms/base_output.py +27 -0
- beeai_framework-0.1.0/beeai_framework/llms/llm.py +133 -0
- beeai_framework-0.1.0/beeai_framework/llms/output.py +29 -0
- beeai_framework-0.1.0/beeai_framework/memory/__init__.py +34 -0
- beeai_framework-0.1.0/beeai_framework/memory/base_cache.py +109 -0
- beeai_framework-0.1.0/beeai_framework/memory/base_memory.py +83 -0
- beeai_framework-0.1.0/beeai_framework/memory/errors.py +32 -0
- beeai_framework-0.1.0/beeai_framework/memory/file_cache.py +238 -0
- beeai_framework-0.1.0/beeai_framework/memory/readonly_memory.py +34 -0
- beeai_framework-0.1.0/beeai_framework/memory/serializable.py +97 -0
- beeai_framework-0.1.0/beeai_framework/memory/serializer.py +254 -0
- beeai_framework-0.1.0/beeai_framework/memory/sliding_cache.py +111 -0
- beeai_framework-0.1.0/beeai_framework/memory/sliding_memory.py +129 -0
- beeai_framework-0.1.0/beeai_framework/memory/summarize_memory.py +76 -0
- beeai_framework-0.1.0/beeai_framework/memory/task_map.py +144 -0
- beeai_framework-0.1.0/beeai_framework/memory/token_memory.py +123 -0
- beeai_framework-0.1.0/beeai_framework/memory/unconstrained_cache.py +161 -0
- beeai_framework-0.1.0/beeai_framework/memory/unconstrained_memory.py +37 -0
- beeai_framework-0.1.0/beeai_framework/parsers/line_prefix.py +55 -0
- beeai_framework-0.1.0/beeai_framework/tools/__init__.py +18 -0
- beeai_framework-0.1.0/beeai_framework/tools/errors.py +13 -0
- beeai_framework-0.1.0/beeai_framework/tools/mcp_tools.py +80 -0
- beeai_framework-0.1.0/beeai_framework/tools/search/__init__.py +20 -0
- beeai_framework-0.1.0/beeai_framework/tools/search/base.py +42 -0
- beeai_framework-0.1.0/beeai_framework/tools/search/duckduckgo.py +56 -0
- beeai_framework-0.1.0/beeai_framework/tools/search/wikipedia.py +15 -0
- beeai_framework-0.1.0/beeai_framework/tools/tool.py +133 -0
- beeai_framework-0.1.0/beeai_framework/tools/weather/openmeteo.py +124 -0
- beeai_framework-0.1.0/beeai_framework/utils/__init__.py +8 -0
- beeai_framework-0.1.0/beeai_framework/utils/_types.py +21 -0
- beeai_framework-0.1.0/beeai_framework/utils/config.py +18 -0
- beeai_framework-0.1.0/beeai_framework/utils/counter.py +37 -0
- beeai_framework-0.1.0/beeai_framework/utils/custom_logger.py +107 -0
- beeai_framework-0.1.0/beeai_framework/utils/errors.py +17 -0
- beeai_framework-0.1.0/beeai_framework/utils/events.py +11 -0
- beeai_framework-0.1.0/beeai_framework/utils/models.py +34 -0
- beeai_framework-0.1.0/beeai_framework/utils/regex.py +11 -0
- beeai_framework-0.1.0/beeai_framework/utils/templates.py +41 -0
- beeai_framework-0.1.0/beeai_framework/workflows/__init__.py +18 -0
- beeai_framework-0.1.0/beeai_framework/workflows/agent.py +110 -0
- beeai_framework-0.1.0/beeai_framework/workflows/errors.py +8 -0
- beeai_framework-0.1.0/beeai_framework/workflows/workflow.py +159 -0
- beeai_framework-0.1.0/pyproject.toml +267 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: beeai-framework
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary:
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
Author: IBM Corp.
|
|
7
|
+
Requires-Python: >=3.11,<4.0
|
|
8
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
|
|
14
|
+
Requires-Dist: chevron (>=0.14.0,<0.15.0)
|
|
15
|
+
Requires-Dist: duckduckgo-search (>=7.3.2,<8.0.0)
|
|
16
|
+
Requires-Dist: litellm (>=1.60.2,<2.0.0)
|
|
17
|
+
Requires-Dist: mcp (>=1.2.0,<2.0.0)
|
|
18
|
+
Requires-Dist: pydantic (>=2.10,<3.0)
|
|
19
|
+
Requires-Dist: pydantic-settings (>=2.7,<3.0)
|
|
20
|
+
Requires-Dist: pylint (>=3.3.2,<4.0.0)
|
|
21
|
+
Requires-Dist: pyventus (>=0.6.0,<0.7.0)
|
|
22
|
+
Requires-Dist: requests (>=2.32,<3.0)
|
|
23
|
+
Requires-Dist: types-requests (>=2.32.0.20241016,<3.0.0.0)
|
|
24
|
+
Requires-Dist: wikipedia (>=1.4.0,<2.0.0)
|
|
25
|
+
Project-URL: Documentation, https://i-am-bee.github.io/beeai-framework/#/python/
|
|
26
|
+
Project-URL: Homepage, https://iambee.ai
|
|
27
|
+
Project-URL: Repository, https://github.com/i-am-bee/beeai-framework
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
> [!WARNING]
|
|
31
|
+
> PRE-Alpha! Please reach out if you want to get involved in the discussions. All feedback is welcomed
|
|
32
|
+
|
|
33
|
+
<p align="center">
|
|
34
|
+
<img alt="BeeAI Framework logo" src="/docs/assets/Bee_Dark.svg" height="128">
|
|
35
|
+
<h1 align="center">BeeAI Agent Framework for Python</h1>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<img align="center" alt="Project Status: Alpha" src="https://img.shields.io/badge/Status-Alpha-red">
|
|
40
|
+
<h4 align="center">Python implementation of the BeeAI Agent Framework for building, deploying, and serving powerful agentic workflows at scale.</h4>
|
|
41
|
+
</p>
|
|
42
|
+
|
|
43
|
+
The BeeAI Agent Framework for Python makes it easy to build scalable agent-based workflows with your model of choice. This framework is designed to perform robustly with [IBM Granite](https://www.ibm.com/granite?adoper=255252_0_LS1) and [Llama 3.x](https://ai.meta.com/blog/meta-llama-3-1/) models. Varying level of support is currently available for [other LLMs using LiteLLM](https://docs.litellm.ai/docs/providers). We're actively working on optimizing its performance with these popular LLMs.
|
|
44
|
+
|
|
45
|
+
Our goal is to empower Python developers to adopt the latest open-source and proprietary models with minimal changes to their current agent implementation.
|
|
46
|
+
|
|
47
|
+
## Key Features
|
|
48
|
+
|
|
49
|
+
- π€ **AI agents**: Use our powerful BeeAI agent refined for Llama 3.x and Granite 3.x, or build your own.
|
|
50
|
+
- π οΈ **Tools**: Use our built-in tools or create your own in Python.
|
|
51
|
+
- πΎ **Memory**: Multiple strategies to optimize token spend.
|
|
52
|
+
- ... more on our Roadmap
|
|
53
|
+
|
|
54
|
+
## Getting Started
|
|
55
|
+
|
|
56
|
+
### Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install beeai-framework
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Quick Example
|
|
63
|
+
|
|
64
|
+
```py
|
|
65
|
+
from beeai_framework import BeeAgent, LLM
|
|
66
|
+
|
|
67
|
+
agent = BeeAgent(llm=LLM())
|
|
68
|
+
|
|
69
|
+
agent.run("What is the capital of Massachusetts")
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
> [!NOTE]
|
|
73
|
+
> To run this example, ensure you have [ollama](https://ollama.com) installed with the [llama3.1](https://ollama.com/library/llama3.1) model downloaded.
|
|
74
|
+
|
|
75
|
+
to run other examples you can use, "python -m examples/beeai/[example_name]":
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python examples/basic.py
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Local Development
|
|
82
|
+
|
|
83
|
+
Please check our [contributing guide](./CONTRIBUTING.md)
|
|
84
|
+
|
|
85
|
+
### Prerequisites
|
|
86
|
+
|
|
87
|
+
For development, there are some tools you will need prior cloning the code.
|
|
88
|
+
|
|
89
|
+
#### Poetry
|
|
90
|
+
|
|
91
|
+
[Poetry](https://python-poetry.org/) is a tool for Python packaging, dependency and virtual environment management that is used to manage the development of this project. Verify version 2 is installed on your machine. There are several ways to install it including through the package manager of your operating system, however, the easiest way to install is using the official installer, as follows:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
curl -sSL https://install.python-poetry.org | python3 -
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
You can also use `pip` and `pipx` to install poetry.
|
|
98
|
+
|
|
99
|
+
Once you have Poetry installed, you will also need to add the poetry shell plugin:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
poetry self add poetry-plugin-shell
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
> [!IMPORTANT]
|
|
106
|
+
> You must have poetry >= 2.0 installed
|
|
107
|
+
|
|
108
|
+
### Clone and set up the code
|
|
109
|
+
|
|
110
|
+
Follow these steps:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Clone the repository
|
|
114
|
+
git clone https://github.com/i-am-bee/beeai-framework
|
|
115
|
+
|
|
116
|
+
cd python
|
|
117
|
+
|
|
118
|
+
# Use Poetry to install the project dependencies and activate a virtual environment
|
|
119
|
+
poetry install
|
|
120
|
+
poetry shell
|
|
121
|
+
|
|
122
|
+
# Copy .env.example to .env and fill in required values
|
|
123
|
+
cp .env.example .env
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Build the pip package
|
|
127
|
+
|
|
128
|
+
#### Build the package:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
poetry build
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Modules
|
|
135
|
+
|
|
136
|
+
The package provides several modules:
|
|
137
|
+
|
|
138
|
+
| Module | Description |
|
|
139
|
+
| -------- | ----------------------------------------------------- |
|
|
140
|
+
| `agents` | Base classes defining the common interface for agents |
|
|
141
|
+
| `llms` | Base classes for text inference (standard or chat) |
|
|
142
|
+
| `tools` | Tools that an agent can use |
|
|
143
|
+
|
|
144
|
+
## Roadmap
|
|
145
|
+
|
|
146
|
+
- π©βπ» **Code interpreter**: Run code safely in a sandbox container.
|
|
147
|
+
- βΈοΈ **Serialization**: Handle complex agentic workflows and easily pause/resume them without losing state.
|
|
148
|
+
- π **Instrumentation**: Full visibility of your agent's inner workings.
|
|
149
|
+
- ποΈ **Production-level** control with caching and error handling.
|
|
150
|
+
- π **API**: OpenAI-compatible Assistants API integration.
|
|
151
|
+
- BeeAI agent performance optimization with additional models
|
|
152
|
+
- Examples, tutorials, and comprehensive documentation
|
|
153
|
+
- Improvements to building custom agents
|
|
154
|
+
- Multi-agent orchestration
|
|
155
|
+
- Feature parity with TypeScript version
|
|
156
|
+
|
|
157
|
+
## Contributing
|
|
158
|
+
|
|
159
|
+
The BeeAI Agent Framework for Python is an open-source project and we β€οΈ contributions. Please check our [contribution guidelines](./CONTRIBUTING.md) before getting started.
|
|
160
|
+
|
|
161
|
+
### Reporting Issues
|
|
162
|
+
|
|
163
|
+
We use [GitHub Issues](https://github.com/i-am-bee/beeai-framework/issues) to track public bugs. Please check existing issues before filing new ones.
|
|
164
|
+
|
|
165
|
+
### Code of Conduct
|
|
166
|
+
|
|
167
|
+
This project adheres to our [Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
|
|
168
|
+
|
|
169
|
+
## Legal Notice
|
|
170
|
+
|
|
171
|
+
Initial content in these repositories including code has been provided by IBM under the associated open source software license and IBM is under no obligation to provide enhancements, updates, or support. IBM developers produced this code as an open source project (not as an IBM product), and IBM makes no assertions as to the level of quality nor security, and will not be maintaining this code going forward.
|
|
172
|
+
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
> [!WARNING]
|
|
2
|
+
> PRE-Alpha! Please reach out if you want to get involved in the discussions. All feedback is welcomed
|
|
3
|
+
|
|
4
|
+
<p align="center">
|
|
5
|
+
<img alt="BeeAI Framework logo" src="/docs/assets/Bee_Dark.svg" height="128">
|
|
6
|
+
<h1 align="center">BeeAI Agent Framework for Python</h1>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<img align="center" alt="Project Status: Alpha" src="https://img.shields.io/badge/Status-Alpha-red">
|
|
11
|
+
<h4 align="center">Python implementation of the BeeAI Agent Framework for building, deploying, and serving powerful agentic workflows at scale.</h4>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
The BeeAI Agent Framework for Python makes it easy to build scalable agent-based workflows with your model of choice. This framework is designed to perform robustly with [IBM Granite](https://www.ibm.com/granite?adoper=255252_0_LS1) and [Llama 3.x](https://ai.meta.com/blog/meta-llama-3-1/) models. Varying level of support is currently available for [other LLMs using LiteLLM](https://docs.litellm.ai/docs/providers). We're actively working on optimizing its performance with these popular LLMs.
|
|
15
|
+
|
|
16
|
+
Our goal is to empower Python developers to adopt the latest open-source and proprietary models with minimal changes to their current agent implementation.
|
|
17
|
+
|
|
18
|
+
## Key Features
|
|
19
|
+
|
|
20
|
+
- π€ **AI agents**: Use our powerful BeeAI agent refined for Llama 3.x and Granite 3.x, or build your own.
|
|
21
|
+
- π οΈ **Tools**: Use our built-in tools or create your own in Python.
|
|
22
|
+
- πΎ **Memory**: Multiple strategies to optimize token spend.
|
|
23
|
+
- ... more on our Roadmap
|
|
24
|
+
|
|
25
|
+
## Getting Started
|
|
26
|
+
|
|
27
|
+
### Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install beeai-framework
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Quick Example
|
|
34
|
+
|
|
35
|
+
```py
|
|
36
|
+
from beeai_framework import BeeAgent, LLM
|
|
37
|
+
|
|
38
|
+
agent = BeeAgent(llm=LLM())
|
|
39
|
+
|
|
40
|
+
agent.run("What is the capital of Massachusetts")
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> [!NOTE]
|
|
44
|
+
> To run this example, ensure you have [ollama](https://ollama.com) installed with the [llama3.1](https://ollama.com/library/llama3.1) model downloaded.
|
|
45
|
+
|
|
46
|
+
to run other examples you can use, "python -m examples/beeai/[example_name]":
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
python examples/basic.py
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Local Development
|
|
53
|
+
|
|
54
|
+
Please check our [contributing guide](./CONTRIBUTING.md)
|
|
55
|
+
|
|
56
|
+
### Prerequisites
|
|
57
|
+
|
|
58
|
+
For development, there are some tools you will need prior cloning the code.
|
|
59
|
+
|
|
60
|
+
#### Poetry
|
|
61
|
+
|
|
62
|
+
[Poetry](https://python-poetry.org/) is a tool for Python packaging, dependency and virtual environment management that is used to manage the development of this project. Verify version 2 is installed on your machine. There are several ways to install it including through the package manager of your operating system, however, the easiest way to install is using the official installer, as follows:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
curl -sSL https://install.python-poetry.org | python3 -
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
You can also use `pip` and `pipx` to install poetry.
|
|
69
|
+
|
|
70
|
+
Once you have Poetry installed, you will also need to add the poetry shell plugin:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
poetry self add poetry-plugin-shell
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
> [!IMPORTANT]
|
|
77
|
+
> You must have poetry >= 2.0 installed
|
|
78
|
+
|
|
79
|
+
### Clone and set up the code
|
|
80
|
+
|
|
81
|
+
Follow these steps:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Clone the repository
|
|
85
|
+
git clone https://github.com/i-am-bee/beeai-framework
|
|
86
|
+
|
|
87
|
+
cd python
|
|
88
|
+
|
|
89
|
+
# Use Poetry to install the project dependencies and activate a virtual environment
|
|
90
|
+
poetry install
|
|
91
|
+
poetry shell
|
|
92
|
+
|
|
93
|
+
# Copy .env.example to .env and fill in required values
|
|
94
|
+
cp .env.example .env
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Build the pip package
|
|
98
|
+
|
|
99
|
+
#### Build the package:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
poetry build
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Modules
|
|
106
|
+
|
|
107
|
+
The package provides several modules:
|
|
108
|
+
|
|
109
|
+
| Module | Description |
|
|
110
|
+
| -------- | ----------------------------------------------------- |
|
|
111
|
+
| `agents` | Base classes defining the common interface for agents |
|
|
112
|
+
| `llms` | Base classes for text inference (standard or chat) |
|
|
113
|
+
| `tools` | Tools that an agent can use |
|
|
114
|
+
|
|
115
|
+
## Roadmap
|
|
116
|
+
|
|
117
|
+
- π©βπ» **Code interpreter**: Run code safely in a sandbox container.
|
|
118
|
+
- βΈοΈ **Serialization**: Handle complex agentic workflows and easily pause/resume them without losing state.
|
|
119
|
+
- π **Instrumentation**: Full visibility of your agent's inner workings.
|
|
120
|
+
- ποΈ **Production-level** control with caching and error handling.
|
|
121
|
+
- π **API**: OpenAI-compatible Assistants API integration.
|
|
122
|
+
- BeeAI agent performance optimization with additional models
|
|
123
|
+
- Examples, tutorials, and comprehensive documentation
|
|
124
|
+
- Improvements to building custom agents
|
|
125
|
+
- Multi-agent orchestration
|
|
126
|
+
- Feature parity with TypeScript version
|
|
127
|
+
|
|
128
|
+
## Contributing
|
|
129
|
+
|
|
130
|
+
The BeeAI Agent Framework for Python is an open-source project and we β€οΈ contributions. Please check our [contribution guidelines](./CONTRIBUTING.md) before getting started.
|
|
131
|
+
|
|
132
|
+
### Reporting Issues
|
|
133
|
+
|
|
134
|
+
We use [GitHub Issues](https://github.com/i-am-bee/beeai-framework/issues) to track public bugs. Please check existing issues before filing new ones.
|
|
135
|
+
|
|
136
|
+
### Code of Conduct
|
|
137
|
+
|
|
138
|
+
This project adheres to our [Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
|
|
139
|
+
|
|
140
|
+
## Legal Notice
|
|
141
|
+
|
|
142
|
+
Initial content in these repositories including code has been provided by IBM under the associated open source software license and IBM is under no obligation to provide enhancements, updates, or support. IBM developers produced this code as an open source project (not as an IBM product), and IBM makes no assertions as to the level of quality nor security, and will not be maintaining this code going forward.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
from beeai_framework.agents import BaseAgent
|
|
3
|
+
from beeai_framework.agents.bee.agent import BeeAgent
|
|
4
|
+
from beeai_framework.backend import (
|
|
5
|
+
AssistantMessage,
|
|
6
|
+
CustomMessage,
|
|
7
|
+
Message,
|
|
8
|
+
Role,
|
|
9
|
+
SystemMessage,
|
|
10
|
+
ToolMessage,
|
|
11
|
+
UserMessage,
|
|
12
|
+
)
|
|
13
|
+
from beeai_framework.llms import LLM, AgentInput, BaseLLM
|
|
14
|
+
from beeai_framework.memory import BaseMemory, ReadOnlyMemory, TokenMemory, UnconstrainedMemory
|
|
15
|
+
from beeai_framework.memory.serializable import Serializable
|
|
16
|
+
from beeai_framework.tools import Tool, tool
|
|
17
|
+
from beeai_framework.tools.weather.openmeteo import OpenMeteoTool
|
|
18
|
+
from beeai_framework.utils.templates import Prompt
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"LLM",
|
|
22
|
+
"AgentInput",
|
|
23
|
+
"AssistantMessage",
|
|
24
|
+
"BaseAgent",
|
|
25
|
+
"BaseLLM",
|
|
26
|
+
"BaseMemory",
|
|
27
|
+
"BeeAgent",
|
|
28
|
+
"CustomMessage",
|
|
29
|
+
"Message",
|
|
30
|
+
"OpenMeteoTool",
|
|
31
|
+
"Prompt",
|
|
32
|
+
"ReadOnlyMemory",
|
|
33
|
+
"Role",
|
|
34
|
+
"Serializable",
|
|
35
|
+
"SystemMessage",
|
|
36
|
+
"TokenMemory",
|
|
37
|
+
"Tool",
|
|
38
|
+
"ToolMessage",
|
|
39
|
+
"UnconstrainedMemory",
|
|
40
|
+
"UserMessage",
|
|
41
|
+
"tool",
|
|
42
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|