badgerflow 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.
- badgerflow-0.1.0/LICENSE +202 -0
- badgerflow-0.1.0/NOTICE +11 -0
- badgerflow-0.1.0/PKG-INFO +210 -0
- badgerflow-0.1.0/README.md +159 -0
- badgerflow-0.1.0/agiel/__init__.py +57 -0
- badgerflow-0.1.0/badgerflow/__init__.py +38 -0
- badgerflow-0.1.0/badgerflow/auth/__init__.py +26 -0
- badgerflow-0.1.0/badgerflow/auth/run_token.py +333 -0
- badgerflow-0.1.0/badgerflow/cli/__init__.py +5 -0
- badgerflow-0.1.0/badgerflow/cli/main.py +1324 -0
- badgerflow-0.1.0/badgerflow/cli/preview.py +494 -0
- badgerflow-0.1.0/badgerflow/cli/project.py +198 -0
- badgerflow-0.1.0/badgerflow/cli/scaffold.py +270 -0
- badgerflow-0.1.0/badgerflow/client/__init__.py +40 -0
- badgerflow-0.1.0/badgerflow/client/adapters/__init__.py +0 -0
- badgerflow-0.1.0/badgerflow/client/adapters/autogen.py +94 -0
- badgerflow-0.1.0/badgerflow/client/adapters/crewai.py +93 -0
- badgerflow-0.1.0/badgerflow/client/adapters/langchain.py +85 -0
- badgerflow-0.1.0/badgerflow/client/cli/__init__.py +0 -0
- badgerflow-0.1.0/badgerflow/client/cli/main.py +327 -0
- badgerflow-0.1.0/badgerflow/client/cli/manifest.py +81 -0
- badgerflow-0.1.0/badgerflow/client/client.py +153 -0
- badgerflow-0.1.0/badgerflow/client/exceptions.py +44 -0
- badgerflow-0.1.0/badgerflow/client/resources/__init__.py +0 -0
- badgerflow-0.1.0/badgerflow/client/resources/agents.py +149 -0
- badgerflow-0.1.0/badgerflow/client/resources/auth.py +53 -0
- badgerflow-0.1.0/badgerflow/client/resources/dependencies.py +136 -0
- badgerflow-0.1.0/badgerflow/client/resources/guardrail_profiles.py +226 -0
- badgerflow-0.1.0/badgerflow/client/resources/guardrails.py +137 -0
- badgerflow-0.1.0/badgerflow/client/resources/models.py +59 -0
- badgerflow-0.1.0/badgerflow/client/resources/namespaces.py +58 -0
- badgerflow-0.1.0/badgerflow/client/resources/rag.py +43 -0
- badgerflow-0.1.0/badgerflow/client/resources/releases.py +95 -0
- badgerflow-0.1.0/badgerflow/client/resources/webhooks.py +57 -0
- badgerflow-0.1.0/badgerflow/client/resources/workflows.py +60 -0
- badgerflow-0.1.0/badgerflow/connectors/__init__.py +13 -0
- badgerflow-0.1.0/badgerflow/connectors/client.py +69 -0
- badgerflow-0.1.0/badgerflow/contract/README.md +72 -0
- badgerflow-0.1.0/badgerflow/contract/__init__.py +70 -0
- badgerflow-0.1.0/badgerflow/contract/constants.py +258 -0
- badgerflow-0.1.0/badgerflow/contract/event.schema.json +293 -0
- badgerflow-0.1.0/badgerflow/contract/examples/event-complete.json +10 -0
- badgerflow-0.1.0/badgerflow/contract/examples/event-pause_review.json +34 -0
- badgerflow-0.1.0/badgerflow/contract/examples/event-policy_violation.json +11 -0
- badgerflow-0.1.0/badgerflow/contract/examples/event-step_completed.json +23 -0
- badgerflow-0.1.0/badgerflow/contract/examples/event-step_started.json +12 -0
- badgerflow-0.1.0/badgerflow/contract/examples/invoke-request.json +21 -0
- badgerflow-0.1.0/badgerflow/contract/examples/invoke-response-completed.json +7 -0
- badgerflow-0.1.0/badgerflow/contract/examples/invoke-response-failed.json +7 -0
- badgerflow-0.1.0/badgerflow/contract/examples/invoke-response-paused.json +32 -0
- badgerflow-0.1.0/badgerflow/contract/examples/ir.hash +1 -0
- badgerflow-0.1.0/badgerflow/contract/examples/ir.json +131 -0
- badgerflow-0.1.0/badgerflow/contract/examples/manifest.json +198 -0
- badgerflow-0.1.0/badgerflow/contract/hash.py +161 -0
- badgerflow-0.1.0/badgerflow/contract/invoke-request.schema.json +95 -0
- badgerflow-0.1.0/badgerflow/contract/invoke-response.schema.json +56 -0
- badgerflow-0.1.0/badgerflow/contract/ir.schema.json +132 -0
- badgerflow-0.1.0/badgerflow/contract/manifest.schema.json +334 -0
- badgerflow-0.1.0/badgerflow/contract/pause.py +92 -0
- badgerflow-0.1.0/badgerflow/contract/validate.py +124 -0
- badgerflow-0.1.0/badgerflow/events/__init__.py +42 -0
- badgerflow-0.1.0/badgerflow/events/emitter.py +612 -0
- badgerflow-0.1.0/badgerflow/events/steps.py +309 -0
- badgerflow-0.1.0/badgerflow/guardrails/__init__.py +32 -0
- badgerflow-0.1.0/badgerflow/guardrails/client.py +201 -0
- badgerflow-0.1.0/badgerflow/knowledge/__init__.py +12 -0
- badgerflow-0.1.0/badgerflow/knowledge/client.py +221 -0
- badgerflow-0.1.0/badgerflow/langgraph/__init__.py +51 -0
- badgerflow-0.1.0/badgerflow/langgraph/agent.py +396 -0
- badgerflow-0.1.0/badgerflow/langgraph/callback.py +243 -0
- badgerflow-0.1.0/badgerflow/langgraph/chat.py +131 -0
- badgerflow-0.1.0/badgerflow/langgraph/checkpoint.py +155 -0
- badgerflow-0.1.0/badgerflow/langgraph/compile.py +479 -0
- badgerflow-0.1.0/badgerflow/langgraph/uses.py +139 -0
- badgerflow-0.1.0/badgerflow/llm/__init__.py +15 -0
- badgerflow-0.1.0/badgerflow/llm/client.py +425 -0
- badgerflow-0.1.0/badgerflow/ontology/__init__.py +35 -0
- badgerflow-0.1.0/badgerflow/ontology/client.py +218 -0
- badgerflow-0.1.0/badgerflow/otel/__init__.py +73 -0
- badgerflow-0.1.0/badgerflow/otel/logs.py +162 -0
- badgerflow-0.1.0/badgerflow/otel/metrics.py +355 -0
- badgerflow-0.1.0/badgerflow/otel/scope.py +185 -0
- badgerflow-0.1.0/badgerflow/otel/spans.py +392 -0
- badgerflow-0.1.0/badgerflow/otel/tracing.py +242 -0
- badgerflow-0.1.0/badgerflow/procode/__init__.py +64 -0
- badgerflow-0.1.0/badgerflow/procode/app.py +1131 -0
- badgerflow-0.1.0/badgerflow/procode/clients.py +43 -0
- badgerflow-0.1.0/badgerflow/procode/config.py +154 -0
- badgerflow-0.1.0/badgerflow/procode/context.py +274 -0
- badgerflow-0.1.0/badgerflow/procode/current.py +59 -0
- badgerflow-0.1.0/badgerflow/procode/errors.py +127 -0
- badgerflow-0.1.0/badgerflow/procode/stepctx.py +82 -0
- badgerflow-0.1.0/badgerflow/procode/transport.py +129 -0
- badgerflow-0.1.0/badgerflow/tools/__init__.py +13 -0
- badgerflow-0.1.0/badgerflow/tools/client.py +128 -0
- badgerflow-0.1.0/badgerflow.egg-info/PKG-INFO +210 -0
- badgerflow-0.1.0/badgerflow.egg-info/SOURCES.txt +129 -0
- badgerflow-0.1.0/badgerflow.egg-info/dependency_links.txt +1 -0
- badgerflow-0.1.0/badgerflow.egg-info/entry_points.txt +3 -0
- badgerflow-0.1.0/badgerflow.egg-info/requires.txt +40 -0
- badgerflow-0.1.0/badgerflow.egg-info/top_level.txt +2 -0
- badgerflow-0.1.0/pyproject.toml +101 -0
- badgerflow-0.1.0/setup.cfg +4 -0
- badgerflow-0.1.0/tests/test_agent_card.py +85 -0
- badgerflow-0.1.0/tests/test_claims_chat_example.py +124 -0
- badgerflow-0.1.0/tests/test_claims_triage_example.py +151 -0
- badgerflow-0.1.0/tests/test_cli.py +269 -0
- badgerflow-0.1.0/tests/test_cli_preview.py +362 -0
- badgerflow-0.1.0/tests/test_cli_register.py +487 -0
- badgerflow-0.1.0/tests/test_cli_release.py +367 -0
- badgerflow-0.1.0/tests/test_context_steps.py +486 -0
- badgerflow-0.1.0/tests/test_contract_constants.py +150 -0
- badgerflow-0.1.0/tests/test_contract_hash.py +154 -0
- badgerflow-0.1.0/tests/test_contract_pause.py +111 -0
- badgerflow-0.1.0/tests/test_contract_schemas.py +274 -0
- badgerflow-0.1.0/tests/test_events_emitter.py +433 -0
- badgerflow-0.1.0/tests/test_export_golden.py +116 -0
- badgerflow-0.1.0/tests/test_governed_clients.py +501 -0
- badgerflow-0.1.0/tests/test_import.py +88 -0
- badgerflow-0.1.0/tests/test_langgraph_agent.py +299 -0
- badgerflow-0.1.0/tests/test_langgraph_approval_example.py +70 -0
- badgerflow-0.1.0/tests/test_langgraph_checkpoint.py +202 -0
- badgerflow-0.1.0/tests/test_langgraph_compile.py +536 -0
- badgerflow-0.1.0/tests/test_langgraph_stream.py +478 -0
- badgerflow-0.1.0/tests/test_llm_client.py +324 -0
- badgerflow-0.1.0/tests/test_metrics_endpoint.py +294 -0
- badgerflow-0.1.0/tests/test_otel.py +490 -0
- badgerflow-0.1.0/tests/test_payout_approval_example.py +132 -0
- badgerflow-0.1.0/tests/test_procode_server.py +895 -0
- badgerflow-0.1.0/tests/test_run_token_verifier.py +216 -0
- badgerflow-0.1.0/tests/test_slow_review_example.py +83 -0
badgerflow-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
badgerflow-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
BadgerFlow Python SDK (the `badgerflow` package)
|
|
2
|
+
Copyright 2026 Influence AI
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0. See LICENSE.
|
|
5
|
+
|
|
6
|
+
SCOPE. This licence covers the contents of this `sdk/` directory only — the
|
|
7
|
+
client library, the `bf` and `agiel` CLIs, and the contract schemas they carry.
|
|
8
|
+
|
|
9
|
+
The rest of the repository this directory sits in is the BadgerFlow platform and
|
|
10
|
+
is NOT licensed under Apache-2.0, or under any other open-source licence. No
|
|
11
|
+
permission to use, copy, modify or distribute it is granted by this file.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: badgerflow
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: BadgerFlow Python SDK: governed pro-code agents, the platform REST client, and the bf / agiel CLIs
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Keywords: langgraph,agents,llm,governance,badgerflow,mlops
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
License-File: NOTICE
|
|
17
|
+
Requires-Dist: httpx>=0.27
|
|
18
|
+
Requires-Dist: pydantic>=2.0
|
|
19
|
+
Requires-Dist: pyjwt[crypto]>=2.8
|
|
20
|
+
Requires-Dist: openai>=1
|
|
21
|
+
Requires-Dist: typer>=0.12
|
|
22
|
+
Requires-Dist: pyyaml>=6
|
|
23
|
+
Requires-Dist: rich>=13
|
|
24
|
+
Requires-Dist: jsonschema>=4.23
|
|
25
|
+
Provides-Extra: langgraph
|
|
26
|
+
Requires-Dist: langgraph<2,>=1.2; extra == "langgraph"
|
|
27
|
+
Requires-Dist: langchain-core<2,>=1.6; extra == "langgraph"
|
|
28
|
+
Requires-Dist: langchain-openai<2,>=1.6; extra == "langgraph"
|
|
29
|
+
Provides-Extra: otel
|
|
30
|
+
Requires-Dist: opentelemetry-sdk>=1.27; extra == "otel"
|
|
31
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27; extra == "otel"
|
|
32
|
+
Requires-Dist: opentelemetry-instrumentation-httpx>=0.48b0; extra == "otel"
|
|
33
|
+
Requires-Dist: opentelemetry-instrumentation-logging>=0.48b0; extra == "otel"
|
|
34
|
+
Provides-Extra: server
|
|
35
|
+
Requires-Dist: fastapi>=0.115; extra == "server"
|
|
36
|
+
Requires-Dist: uvicorn>=0.30; extra == "server"
|
|
37
|
+
Requires-Dist: prometheus_client>=0.20; extra == "server"
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
|
|
41
|
+
Requires-Dist: respx>=0.21; extra == "dev"
|
|
42
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
43
|
+
Provides-Extra: langchain
|
|
44
|
+
Requires-Dist: langchain>=0.2; extra == "langchain"
|
|
45
|
+
Requires-Dist: langchain-core>=0.2; extra == "langchain"
|
|
46
|
+
Provides-Extra: crewai
|
|
47
|
+
Requires-Dist: crewai>=0.30; extra == "crewai"
|
|
48
|
+
Provides-Extra: autogen
|
|
49
|
+
Requires-Dist: pyautogen>=0.2; extra == "autogen"
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
# badgerflow
|
|
53
|
+
|
|
54
|
+
The Python SDK for building **pro-code agents** that run as your own service and
|
|
55
|
+
are governed by [BadgerFlow](https://github.com/facileai/agiel) anyway.
|
|
56
|
+
|
|
57
|
+
You deploy the container. BadgerFlow holds the release, the approval, the
|
|
58
|
+
guardrail profile, the spend and the audit trail. Your agent never handles a
|
|
59
|
+
credential and is never called by anyone but the platform.
|
|
60
|
+
|
|
61
|
+
## Install
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install 'badgerflow[server,langgraph]'
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## A LangGraph agent in one command
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
bf init claims-triage --langgraph
|
|
71
|
+
cd claims-triage
|
|
72
|
+
bf dev # serve it locally, no platform needed
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`bf init` writes `agent.py`, `badgerflow.yaml`, a `Dockerfile` and a
|
|
76
|
+
`.dockerignore`. The agent is an ordinary `StateGraph`; the only BadgerFlow
|
|
77
|
+
addition is a `@node(uses=...)` decorator declaring what each node may touch:
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
@node(uses=Uses(knowledge=["claims-manual"]), determinism="recorded_effect")
|
|
81
|
+
async def retrieve(state: State) -> State:
|
|
82
|
+
chunks = await ctx.knowledge.retrieve(state["input"]["description"], top_k=4)
|
|
83
|
+
return {"excerpts": [c.text for c in chunks]}
|
|
84
|
+
|
|
85
|
+
app = Agent.from_langgraph(build_graph(), name="claims-triage", version="0.1.0",
|
|
86
|
+
input=Claim, output=Triage)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Those declarations are the contract. The platform compiles them into a graph it
|
|
90
|
+
can render, checks them against what exists in your namespace at release time,
|
|
91
|
+
and denies a node at runtime that reaches for something it never declared.
|
|
92
|
+
|
|
93
|
+
## Work that outlives a request
|
|
94
|
+
|
|
95
|
+
An invocation is an HTTP request, and some agents run longer than one should be
|
|
96
|
+
held open. Call `ctx.accept()` and the platform stops waiting on the reply:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
@app.run
|
|
100
|
+
async def triage(ctx: Context, claim: Claim) -> Triage:
|
|
101
|
+
ctx.accept() # answered 202; the platform now waits on events
|
|
102
|
+
await slow_work(claim) # minutes, not seconds
|
|
103
|
+
return Triage(...) # becomes the run's `complete` event
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Nothing else changes. `ctx.step`, the governed clients and cancellation behave
|
|
107
|
+
identically, and the return value still becomes the run's result — it reaches
|
|
108
|
+
the platform as the terminal event rather than as the response body.
|
|
109
|
+
|
|
110
|
+
Two things to know. The platform's clock keeps running, so silence past the
|
|
111
|
+
`timeout_seconds` you registered fails the run; raise it at registration if the
|
|
112
|
+
work takes longer. And once you accept, you have accepted: the reply is 202 even
|
|
113
|
+
if the handler happens to finish first, so the same code cannot take one
|
|
114
|
+
governance path on a fast machine and another on a slow one.
|
|
115
|
+
|
|
116
|
+
## Human review in a LangGraph agent
|
|
117
|
+
|
|
118
|
+
Use LangGraph's own `interrupt()` — nothing BadgerFlow-specific:
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
def gate(state):
|
|
122
|
+
decision = interrupt({"question": f"Approve {state['amount']}?"})
|
|
123
|
+
return {"decision": decision}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The run pauses, appears in the platform's Paused Inbox, and resumes when a
|
|
127
|
+
reviewer answers; `interrupt()` returns their answer. `interrupt_before=[...]`
|
|
128
|
+
works the same way, with the prompt naming the node it stopped before.
|
|
129
|
+
|
|
130
|
+
LangGraph needs a checkpointer to resume, and your pods are stateless: the pod
|
|
131
|
+
that resumes is usually not the pod that paused, often days later. So the SDK
|
|
132
|
+
binds `BadgerFlowCheckpointSaver`, which exports the graph's checkpoint into
|
|
133
|
+
the pause and restores it on the resume. You never configure it, and your
|
|
134
|
+
compiled graph is never modified.
|
|
135
|
+
|
|
136
|
+
Keep large values out of the graph state. The checkpoint travels with the pause
|
|
137
|
+
and is capped; a state that is too big fails the run with a clear reason rather
|
|
138
|
+
than producing a pause the platform cannot file. Hold a reference instead.
|
|
139
|
+
|
|
140
|
+
## Streaming a run
|
|
141
|
+
|
|
142
|
+
Ask for `text/event-stream` and the invocation answers with the run's event
|
|
143
|
+
frames as they happen, the last one terminal:
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
data: {"seq":1,"type":"step_started","payload":{"node_id":"retrieve",...}}
|
|
147
|
+
data: {"seq":2,"type":"step_completed",...}
|
|
148
|
+
data: {"seq":3,"type":"complete","payload":{"output":{...}}}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Nothing in the handler changes: the same `ctx.step` blocks and the same return
|
|
152
|
+
value. What changes is where the evidence goes. On a streamed invocation the
|
|
153
|
+
frames ride the response instead of being posted to the platform's event
|
|
154
|
+
ingest, because both would record the run twice.
|
|
155
|
+
|
|
156
|
+
## Register and release
|
|
157
|
+
|
|
158
|
+
Deploy the container, then point the platform at it:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
bf sync --wait-for-endpoint 120 --image "$IMAGE@$DIGEST"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The platform fetches `/.well-known/badgerflow-agent.json` from your endpoint and
|
|
165
|
+
records what **it** saw, so a registration is evidence rather than a claim.
|
|
166
|
+
`bf sync` exits non-zero when what the platform fetched is not what your
|
|
167
|
+
checkout compiles to, which is what makes it safe in CI.
|
|
168
|
+
|
|
169
|
+
Registering does not change what runs. A governed release does:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
bf release submit --wait # then a second human approves it in the UI
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Each environment runs its own BadgerFlow with its own approvers, so run this
|
|
176
|
+
once per environment. Pass the image **digest**, never a tag: it is what a
|
|
177
|
+
rollback names and what makes "the same build" promoted from UAT to production
|
|
178
|
+
provable.
|
|
179
|
+
|
|
180
|
+
## Commands
|
|
181
|
+
|
|
182
|
+
| | |
|
|
183
|
+
|---|---|
|
|
184
|
+
| `bf init [--langgraph]` | scaffold a project |
|
|
185
|
+
| `bf dev` | serve locally, run-token verification off |
|
|
186
|
+
| `bf validate` | build the manifest offline, print its hash |
|
|
187
|
+
| `bf compile [--check]` | the graph the platform will see, and its hash |
|
|
188
|
+
| `bf register` / `bf sync` | register a build; `sync` is the CI form |
|
|
189
|
+
| `bf status` | registration, release, and hash agreement |
|
|
190
|
+
| `bf release submit \| status` | the governed release and its scorecard |
|
|
191
|
+
|
|
192
|
+
## Versioning
|
|
193
|
+
|
|
194
|
+
The SDK follows semantic versioning. Its version is not decoration: it lands in
|
|
195
|
+
every manifest's `sdk` block and the platform stores it with the release, so it
|
|
196
|
+
is part of what an auditor sees. The wire contract is versioned **separately**
|
|
197
|
+
as `contract_version` — an SDK major bump does not imply a contract bump, and a
|
|
198
|
+
contract bump is announced on its own.
|
|
199
|
+
|
|
200
|
+
## Requires
|
|
201
|
+
|
|
202
|
+
Python 3.11+. The `server` extra pulls FastAPI and uvicorn, `langgraph` pulls
|
|
203
|
+
LangGraph and langchain-core, `otel` pulls the OpenTelemetry SDK. Without an
|
|
204
|
+
extra the corresponding surface is inert rather than broken.
|
|
205
|
+
|
|
206
|
+
## Licence
|
|
207
|
+
|
|
208
|
+
Apache-2.0, and it covers **this SDK only**. The BadgerFlow platform the SDK
|
|
209
|
+
talks to is not open source and is licensed separately. See `LICENSE` and
|
|
210
|
+
`NOTICE`.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# badgerflow
|
|
2
|
+
|
|
3
|
+
The Python SDK for building **pro-code agents** that run as your own service and
|
|
4
|
+
are governed by [BadgerFlow](https://github.com/facileai/agiel) anyway.
|
|
5
|
+
|
|
6
|
+
You deploy the container. BadgerFlow holds the release, the approval, the
|
|
7
|
+
guardrail profile, the spend and the audit trail. Your agent never handles a
|
|
8
|
+
credential and is never called by anyone but the platform.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install 'badgerflow[server,langgraph]'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## A LangGraph agent in one command
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
bf init claims-triage --langgraph
|
|
20
|
+
cd claims-triage
|
|
21
|
+
bf dev # serve it locally, no platform needed
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`bf init` writes `agent.py`, `badgerflow.yaml`, a `Dockerfile` and a
|
|
25
|
+
`.dockerignore`. The agent is an ordinary `StateGraph`; the only BadgerFlow
|
|
26
|
+
addition is a `@node(uses=...)` decorator declaring what each node may touch:
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
@node(uses=Uses(knowledge=["claims-manual"]), determinism="recorded_effect")
|
|
30
|
+
async def retrieve(state: State) -> State:
|
|
31
|
+
chunks = await ctx.knowledge.retrieve(state["input"]["description"], top_k=4)
|
|
32
|
+
return {"excerpts": [c.text for c in chunks]}
|
|
33
|
+
|
|
34
|
+
app = Agent.from_langgraph(build_graph(), name="claims-triage", version="0.1.0",
|
|
35
|
+
input=Claim, output=Triage)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Those declarations are the contract. The platform compiles them into a graph it
|
|
39
|
+
can render, checks them against what exists in your namespace at release time,
|
|
40
|
+
and denies a node at runtime that reaches for something it never declared.
|
|
41
|
+
|
|
42
|
+
## Work that outlives a request
|
|
43
|
+
|
|
44
|
+
An invocation is an HTTP request, and some agents run longer than one should be
|
|
45
|
+
held open. Call `ctx.accept()` and the platform stops waiting on the reply:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
@app.run
|
|
49
|
+
async def triage(ctx: Context, claim: Claim) -> Triage:
|
|
50
|
+
ctx.accept() # answered 202; the platform now waits on events
|
|
51
|
+
await slow_work(claim) # minutes, not seconds
|
|
52
|
+
return Triage(...) # becomes the run's `complete` event
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Nothing else changes. `ctx.step`, the governed clients and cancellation behave
|
|
56
|
+
identically, and the return value still becomes the run's result — it reaches
|
|
57
|
+
the platform as the terminal event rather than as the response body.
|
|
58
|
+
|
|
59
|
+
Two things to know. The platform's clock keeps running, so silence past the
|
|
60
|
+
`timeout_seconds` you registered fails the run; raise it at registration if the
|
|
61
|
+
work takes longer. And once you accept, you have accepted: the reply is 202 even
|
|
62
|
+
if the handler happens to finish first, so the same code cannot take one
|
|
63
|
+
governance path on a fast machine and another on a slow one.
|
|
64
|
+
|
|
65
|
+
## Human review in a LangGraph agent
|
|
66
|
+
|
|
67
|
+
Use LangGraph's own `interrupt()` — nothing BadgerFlow-specific:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
def gate(state):
|
|
71
|
+
decision = interrupt({"question": f"Approve {state['amount']}?"})
|
|
72
|
+
return {"decision": decision}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The run pauses, appears in the platform's Paused Inbox, and resumes when a
|
|
76
|
+
reviewer answers; `interrupt()` returns their answer. `interrupt_before=[...]`
|
|
77
|
+
works the same way, with the prompt naming the node it stopped before.
|
|
78
|
+
|
|
79
|
+
LangGraph needs a checkpointer to resume, and your pods are stateless: the pod
|
|
80
|
+
that resumes is usually not the pod that paused, often days later. So the SDK
|
|
81
|
+
binds `BadgerFlowCheckpointSaver`, which exports the graph's checkpoint into
|
|
82
|
+
the pause and restores it on the resume. You never configure it, and your
|
|
83
|
+
compiled graph is never modified.
|
|
84
|
+
|
|
85
|
+
Keep large values out of the graph state. The checkpoint travels with the pause
|
|
86
|
+
and is capped; a state that is too big fails the run with a clear reason rather
|
|
87
|
+
than producing a pause the platform cannot file. Hold a reference instead.
|
|
88
|
+
|
|
89
|
+
## Streaming a run
|
|
90
|
+
|
|
91
|
+
Ask for `text/event-stream` and the invocation answers with the run's event
|
|
92
|
+
frames as they happen, the last one terminal:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
data: {"seq":1,"type":"step_started","payload":{"node_id":"retrieve",...}}
|
|
96
|
+
data: {"seq":2,"type":"step_completed",...}
|
|
97
|
+
data: {"seq":3,"type":"complete","payload":{"output":{...}}}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Nothing in the handler changes: the same `ctx.step` blocks and the same return
|
|
101
|
+
value. What changes is where the evidence goes. On a streamed invocation the
|
|
102
|
+
frames ride the response instead of being posted to the platform's event
|
|
103
|
+
ingest, because both would record the run twice.
|
|
104
|
+
|
|
105
|
+
## Register and release
|
|
106
|
+
|
|
107
|
+
Deploy the container, then point the platform at it:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
bf sync --wait-for-endpoint 120 --image "$IMAGE@$DIGEST"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The platform fetches `/.well-known/badgerflow-agent.json` from your endpoint and
|
|
114
|
+
records what **it** saw, so a registration is evidence rather than a claim.
|
|
115
|
+
`bf sync` exits non-zero when what the platform fetched is not what your
|
|
116
|
+
checkout compiles to, which is what makes it safe in CI.
|
|
117
|
+
|
|
118
|
+
Registering does not change what runs. A governed release does:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
bf release submit --wait # then a second human approves it in the UI
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Each environment runs its own BadgerFlow with its own approvers, so run this
|
|
125
|
+
once per environment. Pass the image **digest**, never a tag: it is what a
|
|
126
|
+
rollback names and what makes "the same build" promoted from UAT to production
|
|
127
|
+
provable.
|
|
128
|
+
|
|
129
|
+
## Commands
|
|
130
|
+
|
|
131
|
+
| | |
|
|
132
|
+
|---|---|
|
|
133
|
+
| `bf init [--langgraph]` | scaffold a project |
|
|
134
|
+
| `bf dev` | serve locally, run-token verification off |
|
|
135
|
+
| `bf validate` | build the manifest offline, print its hash |
|
|
136
|
+
| `bf compile [--check]` | the graph the platform will see, and its hash |
|
|
137
|
+
| `bf register` / `bf sync` | register a build; `sync` is the CI form |
|
|
138
|
+
| `bf status` | registration, release, and hash agreement |
|
|
139
|
+
| `bf release submit \| status` | the governed release and its scorecard |
|
|
140
|
+
|
|
141
|
+
## Versioning
|
|
142
|
+
|
|
143
|
+
The SDK follows semantic versioning. Its version is not decoration: it lands in
|
|
144
|
+
every manifest's `sdk` block and the platform stores it with the release, so it
|
|
145
|
+
is part of what an auditor sees. The wire contract is versioned **separately**
|
|
146
|
+
as `contract_version` — an SDK major bump does not imply a contract bump, and a
|
|
147
|
+
contract bump is announced on its own.
|
|
148
|
+
|
|
149
|
+
## Requires
|
|
150
|
+
|
|
151
|
+
Python 3.11+. The `server` extra pulls FastAPI and uvicorn, `langgraph` pulls
|
|
152
|
+
LangGraph and langchain-core, `otel` pulls the OpenTelemetry SDK. Without an
|
|
153
|
+
extra the corresponding surface is inert rather than broken.
|
|
154
|
+
|
|
155
|
+
## Licence
|
|
156
|
+
|
|
157
|
+
Apache-2.0, and it covers **this SDK only**. The BadgerFlow platform the SDK
|
|
158
|
+
talks to is not open source and is licensed separately. See `LICENSE` and
|
|
159
|
+
`NOTICE`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""
|
|
2
|
+
``agiel`` — deprecated import path for :mod:`badgerflow.client`.
|
|
3
|
+
|
|
4
|
+
The ``agiel`` distribution moved into the ``badgerflow`` package as
|
|
5
|
+
``badgerflow.client``. This shim keeps ``from agiel import AgiellClient`` (and
|
|
6
|
+
the resource classes and exceptions) working for one release cycle so existing
|
|
7
|
+
scripts, generated exports and docs do not break at import time.
|
|
8
|
+
|
|
9
|
+
It warns once on import. New code should import from ``badgerflow.client``.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import warnings
|
|
13
|
+
|
|
14
|
+
from badgerflow import __version__
|
|
15
|
+
from badgerflow.client import (
|
|
16
|
+
AgiellClient,
|
|
17
|
+
AgiellError,
|
|
18
|
+
AuthError,
|
|
19
|
+
ConflictError,
|
|
20
|
+
NotFoundError,
|
|
21
|
+
ServerError,
|
|
22
|
+
ValidationError,
|
|
23
|
+
)
|
|
24
|
+
from badgerflow.client.resources.agents import AgentClient
|
|
25
|
+
from badgerflow.client.resources.auth import AuthClient
|
|
26
|
+
from badgerflow.client.resources.guardrail_profiles import GuardrailProfilesClient
|
|
27
|
+
from badgerflow.client.resources.guardrails import GuardrailsClient
|
|
28
|
+
from badgerflow.client.resources.models import ModelRegistryClient
|
|
29
|
+
from badgerflow.client.resources.namespaces import NamespaceClient
|
|
30
|
+
from badgerflow.client.resources.rag import RAGClient
|
|
31
|
+
from badgerflow.client.resources.webhooks import WebhookClient
|
|
32
|
+
|
|
33
|
+
warnings.warn(
|
|
34
|
+
"the 'agiel' package is deprecated; import from 'badgerflow.client' instead "
|
|
35
|
+
"(e.g. 'from badgerflow.client import AgiellClient')",
|
|
36
|
+
DeprecationWarning,
|
|
37
|
+
stacklevel=2,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
__all__ = [
|
|
41
|
+
"__version__",
|
|
42
|
+
"AgiellClient",
|
|
43
|
+
"AgiellError",
|
|
44
|
+
"AuthError",
|
|
45
|
+
"ConflictError",
|
|
46
|
+
"NotFoundError",
|
|
47
|
+
"ServerError",
|
|
48
|
+
"ValidationError",
|
|
49
|
+
"AgentClient",
|
|
50
|
+
"AuthClient",
|
|
51
|
+
"GuardrailProfilesClient",
|
|
52
|
+
"GuardrailsClient",
|
|
53
|
+
"ModelRegistryClient",
|
|
54
|
+
"NamespaceClient",
|
|
55
|
+
"RAGClient",
|
|
56
|
+
"WebhookClient",
|
|
57
|
+
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""
|
|
2
|
+
badgerflow — the BadgerFlow Python SDK
|
|
3
|
+
======================================
|
|
4
|
+
|
|
5
|
+
One installable package with two halves:
|
|
6
|
+
|
|
7
|
+
* ``badgerflow.client`` — the async REST client (``AgiellClient``) and the
|
|
8
|
+
``agiel`` CLI that used to ship as the ``agiel`` distribution. The old
|
|
9
|
+
``agiel`` import path still works through a deprecated shim.
|
|
10
|
+
* ``badgerflow.procode`` and friends — the pro-code surface (a governed
|
|
11
|
+
``@app.run`` server, ``Context``, the LangGraph bridge, the ``bf`` CLI).
|
|
12
|
+
These packages are skeletons filled in by later work packages; each one's
|
|
13
|
+
docstring names the WP that owns it.
|
|
14
|
+
|
|
15
|
+
The package never imports the platform's ``libs/`` or ``services/``. The
|
|
16
|
+
constants both sides must agree on are vendored under ``badgerflow.contract``
|
|
17
|
+
and pinned to ``CONTRACT_VERSION``.
|
|
18
|
+
|
|
19
|
+
This module stays import-light on purpose: ``import badgerflow`` must not
|
|
20
|
+
pull in httpx, typer or any optional framework, so the version is the only
|
|
21
|
+
thing defined eagerly. ``badgerflow.current()`` — the running invocation's
|
|
22
|
+
``Context`` — is resolved lazily on first access so that the server package
|
|
23
|
+
(fastapi, prometheus_client) loads only for code that actually calls it.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
from typing import Any
|
|
27
|
+
|
|
28
|
+
__version__ = "0.1.0"
|
|
29
|
+
|
|
30
|
+
__all__ = ["__version__", "current"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def __getattr__(name: str) -> Any:
|
|
34
|
+
if name == "current":
|
|
35
|
+
from .procode.current import current
|
|
36
|
+
|
|
37
|
+
return current
|
|
38
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|