artificialbrains-sdk 0.1.1__py3-none-any.whl → 0.1.3__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.
- ab_sdk/client.py +2 -3
- {artificialbrains_sdk-0.1.1.dist-info → artificialbrains_sdk-0.1.3.dist-info}/METADATA +20 -12
- {artificialbrains_sdk-0.1.1.dist-info → artificialbrains_sdk-0.1.3.dist-info}/RECORD +5 -5
- {artificialbrains_sdk-0.1.1.dist-info → artificialbrains_sdk-0.1.3.dist-info}/WHEEL +1 -1
- {artificialbrains_sdk-0.1.1.dist-info → artificialbrains_sdk-0.1.3.dist-info}/top_level.txt +0 -0
ab_sdk/client.py
CHANGED
|
@@ -13,7 +13,7 @@ Usage example::
|
|
|
13
13
|
|
|
14
14
|
from ab_sdk import ABClient
|
|
15
15
|
|
|
16
|
-
client = ABClient("https://
|
|
16
|
+
client = ABClient("https://app.artificialbrains.ai/api", api_key="your_key")
|
|
17
17
|
run = client.start("my_project")
|
|
18
18
|
# ... attach sensors, run loop ...
|
|
19
19
|
client.stop("my_project")
|
|
@@ -52,8 +52,7 @@ class ABClient:
|
|
|
52
52
|
|
|
53
53
|
Base URL:
|
|
54
54
|
- Provide either:
|
|
55
|
-
* https://artificialbrains.
|
|
56
|
-
* http://localhost:3000/api
|
|
55
|
+
* https://app.artificialbrains.ai/api
|
|
57
56
|
If you pass a host without `/api`, the client will append `/api` automatically.
|
|
58
57
|
"""
|
|
59
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: artificialbrains_sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: ArtificialBrains Python SDK
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: License :: Other/Proprietary License
|
|
@@ -34,11 +34,9 @@ protocol.
|
|
|
34
34
|
sensor data
|
|
35
35
|
- **Generic spike decoders** that convert brain output spikes into
|
|
36
36
|
actuator deltas using flexible mapping rules and decoding schemes
|
|
37
|
-
commands; includes
|
|
38
|
-
- **Deviation and reward plugins** for computing error signals and
|
|
39
|
-
global/per‑layer rewards
|
|
37
|
+
commands; includes four ready to use decoders
|
|
40
38
|
- **Feedback error generator** to build correction spikes from
|
|
41
|
-
deviations
|
|
39
|
+
deviations (for sensory-motor feedback)
|
|
42
40
|
- **Reward modulation** helper mirroring biological-brains behaviour around rewards for learning rules
|
|
43
41
|
|
|
44
42
|
The SDK abstracts away the networking details and allows you to
|
|
@@ -69,7 +67,7 @@ pip install git+https://github.com/artificial-brains-inc/artificial_brains_sdk_p
|
|
|
69
67
|
|
|
70
68
|
### Requirements
|
|
71
69
|
|
|
72
|
-
This SDK requires Python **3.
|
|
70
|
+
This SDK requires Python **3.12** or newer. It depends on the
|
|
73
71
|
following third party libraries:
|
|
74
72
|
|
|
75
73
|
- [`python‑socketio` ≥ 5.16.0](https://pypi.org/project/python-socketio/), released on
|
|
@@ -90,9 +88,6 @@ python-socketio==5.16.0
|
|
|
90
88
|
httpx==0.28.1
|
|
91
89
|
```
|
|
92
90
|
|
|
93
|
-
After installing dependencies you can include this SDK in your
|
|
94
|
-
project by copying the `ab_sdk` directory into your source tree or
|
|
95
|
-
adding it to your Python path.
|
|
96
91
|
|
|
97
92
|
## Quick start
|
|
98
93
|
|
|
@@ -102,12 +97,25 @@ The typical workflow when using this SDK is:
|
|
|
102
97
|
|
|
103
98
|
```python
|
|
104
99
|
from ab_sdk import ABClient
|
|
105
|
-
client = ABClient("https://artificialbrains.
|
|
100
|
+
client = ABClient("https://app.artificialbrains.ai/api/", api_key="my_secret")
|
|
101
|
+
client.sync_policies(PROJECT_ID, policies_dir="policies")
|
|
106
102
|
|
|
107
103
|
# start a run for project 'project_id' -- you'll find it in your project.
|
|
108
104
|
run = client.start("rproject_id")
|
|
109
105
|
```
|
|
110
106
|
|
|
107
|
+
An .env file for the SDK would need the following information:
|
|
108
|
+
``` python
|
|
109
|
+
# Copy this file to `.env` and fill in your own values
|
|
110
|
+
# API key for the Artificial Brains service
|
|
111
|
+
API_KEY=YOUR_API_KEY
|
|
112
|
+
# Project identifier to start a run (the backend expects a numeric or string ID) Genesis: 691cb6bc14e402b5ee225c21
|
|
113
|
+
PROJECT_ID=YOUR_PROJECT_ID
|
|
114
|
+
# Your namespace and URL (leave them as they are unless you have an assigned environments)
|
|
115
|
+
SOCKET_NAMESPACE=/ab
|
|
116
|
+
AB_BASE_URL=https://app.artificialbrains.ai/api
|
|
117
|
+
```
|
|
118
|
+
|
|
111
119
|
2. Attach sensor providers and start streaming inputs:
|
|
112
120
|
|
|
113
121
|
```python
|
|
@@ -221,10 +229,10 @@ The decoder produces **per-timestep actuator deltas**, leaving all
|
|
|
221
229
|
integration, physics, and control semantics to the user’s controller.
|
|
222
230
|
|
|
223
231
|
|
|
224
|
-
4. (Optional) Sync the project contract and scaffold learning policies:
|
|
232
|
+
4. (Optional but recommended) Sync the project contract and scaffold learning policies, before initialization:
|
|
225
233
|
|
|
226
234
|
```python
|
|
227
|
-
client.sync_policies(
|
|
235
|
+
client.sync_policies(PROJECT_ID, policies_dir="policies")
|
|
228
236
|
```
|
|
229
237
|
|
|
230
238
|
This creates reward and deviation policy files that can be customized
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ab_sdk/__init__.py,sha256=tYSMwbFzqsiZ7Bp7mYy2kQ0rX9I1NwM6wS1hEGYuze4,1831
|
|
2
|
-
ab_sdk/client.py,sha256=
|
|
2
|
+
ab_sdk/client.py,sha256=TvANQpuEgjDYn51tIcXtGijHrqFUVXKPGXjKMRbWflc,10144
|
|
3
3
|
ab_sdk/contract_scaffold.py,sha256=4zcsWhd9axxMu--FZ7U8B8u4QLUwluifyvqac2apDno,8930
|
|
4
4
|
ab_sdk/endpoints.py,sha256=yc4h_E8vQA9TmWF0sW2GprgE0QnS3eBetH13ogeuw4E,2102
|
|
5
5
|
ab_sdk/input_streamer.py,sha256=fRPlBimaTDBsm1gz9cdoYanVbmwYTBXSyI9IrXslXiM,6847
|
|
@@ -9,7 +9,7 @@ ab_sdk/plugins/__init__.py,sha256=veHfKqvymY8YPN9HF4E1S4pwRUcVVJHDAyBZptbLNlA,18
|
|
|
9
9
|
ab_sdk/plugins/decoder.py,sha256=vHAubiAPOaOg3J006TLjn4qAoLIu2Lz2D2kjz421odc,10148
|
|
10
10
|
ab_sdk/plugins/deviation.py,sha256=QLKOqOSa9HIj3Z3bO6oR79wY1Lni_P-j3GAGM7UYKVs,2019
|
|
11
11
|
ab_sdk/plugins/reward.py,sha256=E5IsV29N6juyfIQ7ZksDa8JSxAAbVflaJOtLplilAD4,1796
|
|
12
|
-
artificialbrains_sdk-0.1.
|
|
13
|
-
artificialbrains_sdk-0.1.
|
|
14
|
-
artificialbrains_sdk-0.1.
|
|
15
|
-
artificialbrains_sdk-0.1.
|
|
12
|
+
artificialbrains_sdk-0.1.3.dist-info/METADATA,sha256=_YNYqtSlvLxl7u9c7mX4LVls1n2XkuxIS0iQy354TD0,12177
|
|
13
|
+
artificialbrains_sdk-0.1.3.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
14
|
+
artificialbrains_sdk-0.1.3.dist-info/top_level.txt,sha256=Ttsz2oF0qRh68OI9w3mu_LKkv2I_YvOWr3kudSpckpM,7
|
|
15
|
+
artificialbrains_sdk-0.1.3.dist-info/RECORD,,
|
|
File without changes
|