datacoder 0.2.0__tar.gz → 0.2.1__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.
- {datacoder-0.2.0 → datacoder-0.2.1}/PKG-INFO +7 -7
- {datacoder-0.2.0 → datacoder-0.2.1}/README.md +6 -6
- datacoder-0.2.1/datacoder/__init__.py +6 -0
- {datacoder-0.2.0 → datacoder-0.2.1}/datacoder/client.py +10 -10
- {datacoder-0.2.0 → datacoder-0.2.1}/datacoder.egg-info/PKG-INFO +7 -7
- {datacoder-0.2.0 → datacoder-0.2.1}/pyproject.toml +1 -1
- datacoder-0.2.0/datacoder/__init__.py +0 -6
- {datacoder-0.2.0 → datacoder-0.2.1}/datacoder.egg-info/SOURCES.txt +0 -0
- {datacoder-0.2.0 → datacoder-0.2.1}/datacoder.egg-info/dependency_links.txt +0 -0
- {datacoder-0.2.0 → datacoder-0.2.1}/datacoder.egg-info/requires.txt +0 -0
- {datacoder-0.2.0 → datacoder-0.2.1}/datacoder.egg-info/top_level.txt +0 -0
- {datacoder-0.2.0 → datacoder-0.2.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datacoder
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Python SDK for DataCoder — AI Data Analyst Platform (RAG API)
|
|
5
5
|
Author-email: Clouditia <contact@clouditia.com>
|
|
6
6
|
License: MIT
|
|
@@ -36,10 +36,10 @@ pip install datacoder
|
|
|
36
36
|
## Quick Start
|
|
37
37
|
|
|
38
38
|
```python
|
|
39
|
-
from datacoder import
|
|
39
|
+
from datacoder import DataCoder
|
|
40
40
|
|
|
41
41
|
# Initialize with your SDK key and server URL
|
|
42
|
-
sdk =
|
|
42
|
+
sdk = DataCoder(
|
|
43
43
|
api_key="dc_sk_your_key_here",
|
|
44
44
|
base_url="https://datacoder.clouditia.com",
|
|
45
45
|
)
|
|
@@ -66,7 +66,7 @@ print(f"SDK remaining today: {quota.sdk_remaining}")
|
|
|
66
66
|
|
|
67
67
|
## API Reference
|
|
68
68
|
|
|
69
|
-
### `
|
|
69
|
+
### `DataCoder(api_key, base_url, timeout=30)`
|
|
70
70
|
|
|
71
71
|
Initialize the SDK client.
|
|
72
72
|
|
|
@@ -127,7 +127,7 @@ Test if the API is reachable and the key is valid. Returns `True` or `False`.
|
|
|
127
127
|
## Error Handling
|
|
128
128
|
|
|
129
129
|
```python
|
|
130
|
-
from datacoder import
|
|
130
|
+
from datacoder import DataCoder
|
|
131
131
|
from datacoder.client import (
|
|
132
132
|
AuthenticationError,
|
|
133
133
|
QuotaExceededError,
|
|
@@ -136,7 +136,7 @@ from datacoder.client import (
|
|
|
136
136
|
DataCoderError,
|
|
137
137
|
)
|
|
138
138
|
|
|
139
|
-
sdk =
|
|
139
|
+
sdk = DataCoder(api_key="dc_sk_...", base_url="https://...")
|
|
140
140
|
|
|
141
141
|
try:
|
|
142
142
|
result = sdk.query(folder_id="...", query="...")
|
|
@@ -164,7 +164,7 @@ except DataCoderError as e:
|
|
|
164
164
|
DataCoder can be deployed on your own infrastructure. Point `base_url` to your self-hosted instance:
|
|
165
165
|
|
|
166
166
|
```python
|
|
167
|
-
sdk =
|
|
167
|
+
sdk = DataCoder(
|
|
168
168
|
api_key="dc_sk_...",
|
|
169
169
|
base_url="https://datacoder.your-company.com",
|
|
170
170
|
)
|
|
@@ -13,10 +13,10 @@ pip install datacoder
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
15
|
```python
|
|
16
|
-
from datacoder import
|
|
16
|
+
from datacoder import DataCoder
|
|
17
17
|
|
|
18
18
|
# Initialize with your SDK key and server URL
|
|
19
|
-
sdk =
|
|
19
|
+
sdk = DataCoder(
|
|
20
20
|
api_key="dc_sk_your_key_here",
|
|
21
21
|
base_url="https://datacoder.clouditia.com",
|
|
22
22
|
)
|
|
@@ -43,7 +43,7 @@ print(f"SDK remaining today: {quota.sdk_remaining}")
|
|
|
43
43
|
|
|
44
44
|
## API Reference
|
|
45
45
|
|
|
46
|
-
### `
|
|
46
|
+
### `DataCoder(api_key, base_url, timeout=30)`
|
|
47
47
|
|
|
48
48
|
Initialize the SDK client.
|
|
49
49
|
|
|
@@ -104,7 +104,7 @@ Test if the API is reachable and the key is valid. Returns `True` or `False`.
|
|
|
104
104
|
## Error Handling
|
|
105
105
|
|
|
106
106
|
```python
|
|
107
|
-
from datacoder import
|
|
107
|
+
from datacoder import DataCoder
|
|
108
108
|
from datacoder.client import (
|
|
109
109
|
AuthenticationError,
|
|
110
110
|
QuotaExceededError,
|
|
@@ -113,7 +113,7 @@ from datacoder.client import (
|
|
|
113
113
|
DataCoderError,
|
|
114
114
|
)
|
|
115
115
|
|
|
116
|
-
sdk =
|
|
116
|
+
sdk = DataCoder(api_key="dc_sk_...", base_url="https://...")
|
|
117
117
|
|
|
118
118
|
try:
|
|
119
119
|
result = sdk.query(folder_id="...", query="...")
|
|
@@ -141,7 +141,7 @@ except DataCoderError as e:
|
|
|
141
141
|
DataCoder can be deployed on your own infrastructure. Point `base_url` to your self-hosted instance:
|
|
142
142
|
|
|
143
143
|
```python
|
|
144
|
-
sdk =
|
|
144
|
+
sdk = DataCoder(
|
|
145
145
|
api_key="dc_sk_...",
|
|
146
146
|
base_url="https://datacoder.your-company.com",
|
|
147
147
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""DataCoder
|
|
1
|
+
"""DataCoder client."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
@@ -55,7 +55,7 @@ class QuotaInfo:
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
class DataCoderError(Exception):
|
|
58
|
-
"""Base exception for DataCoder
|
|
58
|
+
"""Base exception for DataCoder errors."""
|
|
59
59
|
|
|
60
60
|
def __init__(self, message: str, status_code: int = 0, response: dict | None = None):
|
|
61
61
|
super().__init__(message)
|
|
@@ -84,14 +84,14 @@ class ForbiddenError(DataCoderError):
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
@dataclass
|
|
87
|
-
class
|
|
88
|
-
"""DataCoder
|
|
87
|
+
class DataCoder:
|
|
88
|
+
"""DataCoder — programmatic access to RAG knowledge bases.
|
|
89
89
|
|
|
90
90
|
Usage::
|
|
91
91
|
|
|
92
|
-
from
|
|
92
|
+
from datacoder import DataCoder
|
|
93
93
|
|
|
94
|
-
sdk =
|
|
94
|
+
sdk = DataCoder(
|
|
95
95
|
api_key="dc_sk_...",
|
|
96
96
|
base_url="https://datacoder.clouditia.com",
|
|
97
97
|
)
|
|
@@ -119,7 +119,7 @@ class DataCoderSDK:
|
|
|
119
119
|
self._session.headers.update({
|
|
120
120
|
"Authorization": f"Bearer {self.api_key}",
|
|
121
121
|
"Content-Type": "application/json",
|
|
122
|
-
"User-Agent": f"datacoder-
|
|
122
|
+
"User-Agent": f"datacoder-python/0.2.1",
|
|
123
123
|
})
|
|
124
124
|
|
|
125
125
|
def _request(self, method: str, path: str, **kwargs) -> dict:
|
|
@@ -136,7 +136,7 @@ class DataCoderSDK:
|
|
|
136
136
|
|
|
137
137
|
if resp.status_code == 401:
|
|
138
138
|
raise AuthenticationError(
|
|
139
|
-
"Invalid or expired
|
|
139
|
+
"Invalid or expired API key",
|
|
140
140
|
status_code=401,
|
|
141
141
|
response=resp.json() if resp.text else {},
|
|
142
142
|
)
|
|
@@ -182,9 +182,9 @@ class DataCoderSDK:
|
|
|
182
182
|
RAGResult with matching chunks, sources and scores.
|
|
183
183
|
|
|
184
184
|
Raises:
|
|
185
|
-
AuthenticationError: Invalid
|
|
185
|
+
AuthenticationError: Invalid API key.
|
|
186
186
|
QuotaExceededError: Daily quota or rate limit reached.
|
|
187
|
-
ForbiddenError:
|
|
187
|
+
ForbiddenError: API key doesn't have access to this folder.
|
|
188
188
|
NotFoundError: Folder not found.
|
|
189
189
|
"""
|
|
190
190
|
data = self._request("POST", "/sdk/rag/query/", json={
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datacoder
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Python SDK for DataCoder — AI Data Analyst Platform (RAG API)
|
|
5
5
|
Author-email: Clouditia <contact@clouditia.com>
|
|
6
6
|
License: MIT
|
|
@@ -36,10 +36,10 @@ pip install datacoder
|
|
|
36
36
|
## Quick Start
|
|
37
37
|
|
|
38
38
|
```python
|
|
39
|
-
from datacoder import
|
|
39
|
+
from datacoder import DataCoder
|
|
40
40
|
|
|
41
41
|
# Initialize with your SDK key and server URL
|
|
42
|
-
sdk =
|
|
42
|
+
sdk = DataCoder(
|
|
43
43
|
api_key="dc_sk_your_key_here",
|
|
44
44
|
base_url="https://datacoder.clouditia.com",
|
|
45
45
|
)
|
|
@@ -66,7 +66,7 @@ print(f"SDK remaining today: {quota.sdk_remaining}")
|
|
|
66
66
|
|
|
67
67
|
## API Reference
|
|
68
68
|
|
|
69
|
-
### `
|
|
69
|
+
### `DataCoder(api_key, base_url, timeout=30)`
|
|
70
70
|
|
|
71
71
|
Initialize the SDK client.
|
|
72
72
|
|
|
@@ -127,7 +127,7 @@ Test if the API is reachable and the key is valid. Returns `True` or `False`.
|
|
|
127
127
|
## Error Handling
|
|
128
128
|
|
|
129
129
|
```python
|
|
130
|
-
from datacoder import
|
|
130
|
+
from datacoder import DataCoder
|
|
131
131
|
from datacoder.client import (
|
|
132
132
|
AuthenticationError,
|
|
133
133
|
QuotaExceededError,
|
|
@@ -136,7 +136,7 @@ from datacoder.client import (
|
|
|
136
136
|
DataCoderError,
|
|
137
137
|
)
|
|
138
138
|
|
|
139
|
-
sdk =
|
|
139
|
+
sdk = DataCoder(api_key="dc_sk_...", base_url="https://...")
|
|
140
140
|
|
|
141
141
|
try:
|
|
142
142
|
result = sdk.query(folder_id="...", query="...")
|
|
@@ -164,7 +164,7 @@ except DataCoderError as e:
|
|
|
164
164
|
DataCoder can be deployed on your own infrastructure. Point `base_url` to your self-hosted instance:
|
|
165
165
|
|
|
166
166
|
```python
|
|
167
|
-
sdk =
|
|
167
|
+
sdk = DataCoder(
|
|
168
168
|
api_key="dc_sk_...",
|
|
169
169
|
base_url="https://datacoder.your-company.com",
|
|
170
170
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|