mubit-sdk 0.1.2__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.
- mubit_sdk-0.1.2/PKG-INFO +73 -0
- mubit_sdk-0.1.2/README.md +63 -0
- mubit_sdk-0.1.2/pyproject.toml +25 -0
- mubit_sdk-0.1.2/setup.cfg +4 -0
- mubit_sdk-0.1.2/src/mubit/__init__.py +17 -0
- mubit_sdk-0.1.2/src/mubit/client.py +1369 -0
- mubit_sdk-0.1.2/src/mubit/proto/__init__.py +0 -0
- mubit_sdk-0.1.2/src/mubit/proto/mubit/__init__.py +0 -0
- mubit_sdk-0.1.2/src/mubit/proto/mubit/v1/__init__.py +0 -0
- mubit_sdk-0.1.2/src/mubit/proto/mubit/v1/control.proto +491 -0
- mubit_sdk-0.1.2/src/mubit/proto/mubit/v1/control_pb2.py +154 -0
- mubit_sdk-0.1.2/src/mubit/proto/mubit/v1/core.proto +497 -0
- mubit_sdk-0.1.2/src/mubit/proto/mubit/v1/core_pb2.py +200 -0
- mubit_sdk-0.1.2/src/mubit_sdk.egg-info/PKG-INFO +73 -0
- mubit_sdk-0.1.2/src/mubit_sdk.egg-info/SOURCES.txt +16 -0
- mubit_sdk-0.1.2/src/mubit_sdk.egg-info/dependency_links.txt +1 -0
- mubit_sdk-0.1.2/src/mubit_sdk.egg-info/requires.txt +3 -0
- mubit_sdk-0.1.2/src/mubit_sdk.egg-info/top_level.txt +1 -0
mubit_sdk-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mubit-sdk
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Public unified Mubit SDK with one Client facade
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: requests>=2.31
|
|
8
|
+
Requires-Dist: grpcio>=1.62
|
|
9
|
+
Requires-Dist: protobuf>=6.33.4
|
|
10
|
+
|
|
11
|
+
# mubit-sdk
|
|
12
|
+
|
|
13
|
+
Public unified SDK for Mubit.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install mubit-sdk
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quickstart
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import os
|
|
25
|
+
|
|
26
|
+
from mubit import Client
|
|
27
|
+
|
|
28
|
+
client = Client(
|
|
29
|
+
run_id="demo_run",
|
|
30
|
+
api_key=os.environ["MUBIT_API_KEY"],
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
accepted = client.control.ingest({
|
|
34
|
+
"run_id": "demo_run",
|
|
35
|
+
"agent_id": "sdk-quickstart",
|
|
36
|
+
"idempotency_key": "quickstart-1",
|
|
37
|
+
"parallel": False,
|
|
38
|
+
"items": [
|
|
39
|
+
{
|
|
40
|
+
"item_id": "item-1",
|
|
41
|
+
"content_type": "text",
|
|
42
|
+
"text": "hello mubit from control ingest",
|
|
43
|
+
"payload_json": "",
|
|
44
|
+
"hints_json": "",
|
|
45
|
+
"metadata_json": "{\"source\":\"quickstart\"}",
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
job = client.control.get_ingest_job({"run_id": "demo_run", "job_id": accepted["job_id"]})
|
|
51
|
+
while not job.get("done", False):
|
|
52
|
+
import time
|
|
53
|
+
|
|
54
|
+
time.sleep(0.3)
|
|
55
|
+
job = client.control.get_ingest_job({"run_id": "demo_run", "job_id": accepted["job_id"]})
|
|
56
|
+
|
|
57
|
+
answer = client.control.query(
|
|
58
|
+
{
|
|
59
|
+
"run_id": "demo_run",
|
|
60
|
+
"query": "what was ingested?",
|
|
61
|
+
"mode": "agent_routed",
|
|
62
|
+
"direct_lane": "semantic_search",
|
|
63
|
+
"include_linked_runs": False,
|
|
64
|
+
"limit": 5,
|
|
65
|
+
"embedding": [],
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
print(answer.get("final_answer"))
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Environment Variables
|
|
72
|
+
|
|
73
|
+
- Required: `MUBIT_API_KEY`
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# mubit-sdk
|
|
2
|
+
|
|
3
|
+
Public unified SDK for Mubit.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install mubit-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quickstart
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
import os
|
|
15
|
+
|
|
16
|
+
from mubit import Client
|
|
17
|
+
|
|
18
|
+
client = Client(
|
|
19
|
+
run_id="demo_run",
|
|
20
|
+
api_key=os.environ["MUBIT_API_KEY"],
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
accepted = client.control.ingest({
|
|
24
|
+
"run_id": "demo_run",
|
|
25
|
+
"agent_id": "sdk-quickstart",
|
|
26
|
+
"idempotency_key": "quickstart-1",
|
|
27
|
+
"parallel": False,
|
|
28
|
+
"items": [
|
|
29
|
+
{
|
|
30
|
+
"item_id": "item-1",
|
|
31
|
+
"content_type": "text",
|
|
32
|
+
"text": "hello mubit from control ingest",
|
|
33
|
+
"payload_json": "",
|
|
34
|
+
"hints_json": "",
|
|
35
|
+
"metadata_json": "{\"source\":\"quickstart\"}",
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
job = client.control.get_ingest_job({"run_id": "demo_run", "job_id": accepted["job_id"]})
|
|
41
|
+
while not job.get("done", False):
|
|
42
|
+
import time
|
|
43
|
+
|
|
44
|
+
time.sleep(0.3)
|
|
45
|
+
job = client.control.get_ingest_job({"run_id": "demo_run", "job_id": accepted["job_id"]})
|
|
46
|
+
|
|
47
|
+
answer = client.control.query(
|
|
48
|
+
{
|
|
49
|
+
"run_id": "demo_run",
|
|
50
|
+
"query": "what was ingested?",
|
|
51
|
+
"mode": "agent_routed",
|
|
52
|
+
"direct_lane": "semantic_search",
|
|
53
|
+
"include_linked_runs": False,
|
|
54
|
+
"limit": 5,
|
|
55
|
+
"embedding": [],
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
print(answer.get("final_answer"))
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Environment Variables
|
|
62
|
+
|
|
63
|
+
- Required: `MUBIT_API_KEY`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mubit-sdk"
|
|
7
|
+
version = "0.1.2"
|
|
8
|
+
description = "Public unified Mubit SDK with one Client facade"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"requests>=2.31",
|
|
13
|
+
"grpcio>=1.62",
|
|
14
|
+
"protobuf>=6.33.4"
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[tool.setuptools]
|
|
18
|
+
package-dir = {"" = "src"}
|
|
19
|
+
include-package-data = true
|
|
20
|
+
|
|
21
|
+
[tool.setuptools.packages.find]
|
|
22
|
+
where = ["src"]
|
|
23
|
+
|
|
24
|
+
[tool.setuptools.package-data]
|
|
25
|
+
mubit = ["proto/**/*.proto"]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from .client import (
|
|
2
|
+
AuthError,
|
|
3
|
+
Client,
|
|
4
|
+
ServerError,
|
|
5
|
+
TransportError,
|
|
6
|
+
UnsupportedFeatureError,
|
|
7
|
+
ValidationError,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"Client",
|
|
12
|
+
"AuthError",
|
|
13
|
+
"ValidationError",
|
|
14
|
+
"TransportError",
|
|
15
|
+
"ServerError",
|
|
16
|
+
"UnsupportedFeatureError",
|
|
17
|
+
]
|