kalibr 1.0.21__py3-none-any.whl → 1.0.22__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.
- kalibr-1.0.22.dist-info/METADATA +257 -0
- {kalibr-1.0.21.dist-info → kalibr-1.0.22.dist-info}/RECORD +9 -9
- kalibr-1.0.21.dist-info/METADATA +0 -302
- {kalibr-1.0.21.data → kalibr-1.0.22.data}/data/examples/README.md +0 -0
- {kalibr-1.0.21.data → kalibr-1.0.22.data}/data/examples/basic_kalibr_example.py +0 -0
- {kalibr-1.0.21.data → kalibr-1.0.22.data}/data/examples/enhanced_kalibr_example.py +0 -0
- {kalibr-1.0.21.dist-info → kalibr-1.0.22.dist-info}/WHEEL +0 -0
- {kalibr-1.0.21.dist-info → kalibr-1.0.22.dist-info}/entry_points.txt +0 -0
- {kalibr-1.0.21.dist-info → kalibr-1.0.22.dist-info}/licenses/LICENSE +0 -0
- {kalibr-1.0.21.dist-info → kalibr-1.0.22.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kalibr
|
|
3
|
+
Version: 1.0.22
|
|
4
|
+
Summary: Multi-Model AI Integration Framework
|
|
5
|
+
Home-page: https://github.com/devonakelley/kalibr-sdk
|
|
6
|
+
Author: Kalibr Team
|
|
7
|
+
Author-email: Kalibr Team <team@kalibr.dev>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://kalibr.dev
|
|
10
|
+
Project-URL: Documentation, https://kalibr.dev/docs
|
|
11
|
+
Project-URL: Repository, https://github.com/devonakelley/kalibr-sdk
|
|
12
|
+
Project-URL: Bug Reports, https://github.com/devonakelley/kalibr-sdk/issues
|
|
13
|
+
Keywords: ai,api,framework,gpt,claude,gemini,copilot,multi-model,sdk
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: fastapi>=0.110.1
|
|
28
|
+
Requires-Dist: uvicorn>=0.25.0
|
|
29
|
+
Requires-Dist: pydantic>=2.6.4
|
|
30
|
+
Requires-Dist: typer>=0.9.0
|
|
31
|
+
Requires-Dist: requests>=2.31.0
|
|
32
|
+
Requires-Dist: python-jose[cryptography]>=3.3.0
|
|
33
|
+
Requires-Dist: passlib[bcrypt]>=1.7.4
|
|
34
|
+
Requires-Dist: python-multipart>=0.0.9
|
|
35
|
+
Requires-Dist: motor>=3.3.1
|
|
36
|
+
Requires-Dist: pymongo>=4.5.0
|
|
37
|
+
Requires-Dist: boto3>=1.34.129
|
|
38
|
+
Requires-Dist: aiofiles>=23.2.1
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
41
|
+
Requires-Dist: black>=24.1.1; extra == "dev"
|
|
42
|
+
Requires-Dist: isort>=5.13.2; extra == "dev"
|
|
43
|
+
Requires-Dist: flake8>=7.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: mypy>=1.8.0; extra == "dev"
|
|
45
|
+
Dynamic: author
|
|
46
|
+
Dynamic: home-page
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
Dynamic: requires-python
|
|
49
|
+
|
|
50
|
+
# Kalibr SDK
|
|
51
|
+
### Multi-Model AI Integration Framework
|
|
52
|
+
|
|
53
|
+
**Write once. Deploy anywhere. Connect to any AI model.**
|
|
54
|
+
|
|
55
|
+
Kalibr turns Python functions into APIs that work seamlessly with GPT, Claude, Gemini, and Copilot — automatically generating model-specific schemas and endpoints.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 🚀 Quick Start (2 minutes)
|
|
60
|
+
|
|
61
|
+
### 1. Install
|
|
62
|
+
```bash
|
|
63
|
+
pip install kalibr
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 2. Get Examples
|
|
67
|
+
```bash
|
|
68
|
+
kalibr-connect examples
|
|
69
|
+
```
|
|
70
|
+
This copies example files to `./kalibr_examples/` in your current directory.
|
|
71
|
+
|
|
72
|
+
### 3. Run Demo
|
|
73
|
+
```bash
|
|
74
|
+
kalibr-connect serve kalibr_examples/basic_kalibr_example.py
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 4. See All Schemas
|
|
78
|
+
Kalibr now **auto-detects your environment** and generates the correct base URLs.
|
|
79
|
+
|
|
80
|
+
| Environment | Example Base URL |
|
|
81
|
+
|--------------|------------------|
|
|
82
|
+
| Local Dev | `http://localhost:8000` |
|
|
83
|
+
| Fly.io | `https://<app-name>.fly.dev` |
|
|
84
|
+
| Custom Host | Use `KALIBR_BASE_URL` env var |
|
|
85
|
+
|
|
86
|
+
Then open:
|
|
87
|
+
```
|
|
88
|
+
<your-base-url>/gpt-actions.json # ChatGPT
|
|
89
|
+
<your-base-url>/mcp.json # Claude
|
|
90
|
+
<your-base-url>/schemas/gemini # Gemini
|
|
91
|
+
<your-base-url>/schemas/copilot # Copilot
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 🧠 What Kalibr Does
|
|
97
|
+
|
|
98
|
+
Kalibr turns your Python functions into production-ready multi-model APIs.
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from kalibr import Kalibr
|
|
102
|
+
|
|
103
|
+
app = Kalibr(title="Inventory API")
|
|
104
|
+
|
|
105
|
+
@app.action("get_inventory", "Fetch inventory data")
|
|
106
|
+
def get_inventory(product_id: str):
|
|
107
|
+
return {"product_id": product_id, "stock": 42}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Result:
|
|
111
|
+
ChatGPT, Claude, Gemini, and Copilot can all call `get_inventory()` using their native protocols — no schema work required.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 💪 Two Modes
|
|
116
|
+
|
|
117
|
+
### **Function-Level (Simple)**
|
|
118
|
+
Ideal for one-off APIs or scripts.
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from kalibr import Kalibr
|
|
122
|
+
|
|
123
|
+
app = Kalibr(title="My API")
|
|
124
|
+
|
|
125
|
+
@app.action("calculate_price", "Calculate price total")
|
|
126
|
+
def calculate_price(product_id: str, quantity: int):
|
|
127
|
+
return {"total": quantity * 19.99}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### **App-Level (Advanced)**
|
|
131
|
+
Use `KalibrApp` for complete control — file uploads, sessions, streaming, and workflows.
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from kalibr import KalibrApp
|
|
135
|
+
from kalibr.types import FileUpload, Session
|
|
136
|
+
|
|
137
|
+
app = KalibrApp(title="Advanced API")
|
|
138
|
+
|
|
139
|
+
@app.file_handler("analyze_doc", [".pdf", ".docx"])
|
|
140
|
+
async def analyze_doc(file: FileUpload):
|
|
141
|
+
return {"filename": file.filename, "analysis": "..."}
|
|
142
|
+
|
|
143
|
+
@app.session_action("save_data", "Save session data")
|
|
144
|
+
async def save_data(session: Session, data: dict):
|
|
145
|
+
session.set("my_data", data)
|
|
146
|
+
return {"saved": True}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 📚 Examples Included
|
|
152
|
+
|
|
153
|
+
After running `kalibr-connect examples`, you’ll get:
|
|
154
|
+
|
|
155
|
+
- `basic_kalibr_example.py` – simple function-level demo
|
|
156
|
+
- `enhanced_kalibr_example.py` – full app with sessions, uploads, and streaming
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 🤖 AI Platform Integration
|
|
161
|
+
|
|
162
|
+
### ChatGPT (GPT Actions)
|
|
163
|
+
1. Copy schema URL:
|
|
164
|
+
`https://<your-domain>/gpt-actions.json`
|
|
165
|
+
2. In GPT Builder → *Actions* → *Import from URL*
|
|
166
|
+
3. Done — ChatGPT can call your endpoints.
|
|
167
|
+
|
|
168
|
+
### Claude (MCP)
|
|
169
|
+
Add to Claude Desktop config:
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"mcp": {
|
|
173
|
+
"servers": {
|
|
174
|
+
"my-api": {
|
|
175
|
+
"url": "https://<your-domain>/mcp.json"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Gemini / Copilot
|
|
183
|
+
Use:
|
|
184
|
+
```
|
|
185
|
+
https://<your-domain>/schemas/gemini
|
|
186
|
+
https://<your-domain>/schemas/copilot
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 🎯 Common Use Cases
|
|
192
|
+
|
|
193
|
+
- **Customer Service APIs** — let AI handle orders or refunds
|
|
194
|
+
- **Data Analysis** — query your analytics through AI
|
|
195
|
+
- **Document Processing** — parse or summarize uploaded docs
|
|
196
|
+
- **Business Automation** — trigger internal workflows
|
|
197
|
+
- **Internal Tools** — expose secure internal logic to assistants
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## 🔧 CLI Reference
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
kalibr-connect examples # Copy examples
|
|
205
|
+
kalibr-connect serve my_app.py # Run locally
|
|
206
|
+
kalibr-connect version # Show version
|
|
207
|
+
kalibr-connect --help # Full CLI
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## ⚡ Key Features
|
|
213
|
+
|
|
214
|
+
✅ Multi-Model Support — GPT, Claude, Gemini, Copilot
|
|
215
|
+
✅ Automatic Schema Generation
|
|
216
|
+
✅ Environment-Aware Base URLs (v1.0.21+)
|
|
217
|
+
✅ File Uploads
|
|
218
|
+
✅ Session Management
|
|
219
|
+
✅ Streaming Responses
|
|
220
|
+
✅ Workflow Support
|
|
221
|
+
✅ Type-Safe API Generation
|
|
222
|
+
✅ Async / Await Ready
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 🔥 Why Kalibr?
|
|
227
|
+
|
|
228
|
+
Without Kalibr:
|
|
229
|
+
- Learn 4 model specs
|
|
230
|
+
- Maintain 4 codebases
|
|
231
|
+
- Duplicate effort
|
|
232
|
+
|
|
233
|
+
With Kalibr:
|
|
234
|
+
- One Python function
|
|
235
|
+
- Four schemas generated automatically
|
|
236
|
+
- Deploy anywhere
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 🆕 Version 1.0.21+
|
|
241
|
+
|
|
242
|
+
- **Automatic Base-URL Detection**
|
|
243
|
+
- Works with `KALIBR_BASE_URL` or `FLY_APP_NAME`
|
|
244
|
+
- Fixes all localhost references in deployed schemas
|
|
245
|
+
- Ready for **MCP ecosystem production use**
|
|
246
|
+
- Drop-in backwards compatibility
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 🧩 License
|
|
251
|
+
|
|
252
|
+
MIT License — see `LICENSE` file for details.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
**Kalibr SDK — the unified layer between AI models and the real world.**
|
|
257
|
+
Write once. Deploy anywhere. Integrate everything.
|
|
@@ -5,12 +5,12 @@ kalibr/kalibr.py,sha256=yrgXVlTgadBbpnX_l7fAxxjxGp9oxcZhzGjaQPiIcpo,10469
|
|
|
5
5
|
kalibr/kalibr_app.py,sha256=bA-YOxEq2MyXVrjPQG-b8k_66gY5Ci7hxTOtg9rZuh0,12878
|
|
6
6
|
kalibr/schema_generators.py,sha256=nIgoYaO0FGC6arHdUHG0XaGDpJDycJeWDDC1-zAHzfI,7528
|
|
7
7
|
kalibr/types.py,sha256=bNmf_cOWXBmhaMVAPEp3_EdRCcdXY2pbOgOxZ1dZ0Mc,3476
|
|
8
|
-
kalibr-1.0.
|
|
9
|
-
kalibr-1.0.
|
|
10
|
-
kalibr-1.0.
|
|
11
|
-
kalibr-1.0.
|
|
12
|
-
kalibr-1.0.
|
|
13
|
-
kalibr-1.0.
|
|
14
|
-
kalibr-1.0.
|
|
15
|
-
kalibr-1.0.
|
|
16
|
-
kalibr-1.0.
|
|
8
|
+
kalibr-1.0.22.data/data/examples/README.md,sha256=loo2nm6yfT-pqGb5uNg1VeEdOKflYzHISUHTuSltfY0,4875
|
|
9
|
+
kalibr-1.0.22.data/data/examples/basic_kalibr_example.py,sha256=Kfrh-XZuJ0vwFLB_xBpdqpgpMJw2NpIx0yBsqrAqBnE,2188
|
|
10
|
+
kalibr-1.0.22.data/data/examples/enhanced_kalibr_example.py,sha256=AuhTpyRUNVAJuZKRy9iydXusNkBgQ84eKNiXxsr4iUQ,11994
|
|
11
|
+
kalibr-1.0.22.dist-info/licenses/LICENSE,sha256=1WLJDkrueNpHCROy9zANrK2Ar2weqZ_z88hw90UKDoc,451
|
|
12
|
+
kalibr-1.0.22.dist-info/METADATA,sha256=nuXv558HbymTNBsuh7WircA-uV5Q3neiZ0DGM4mZCnM,6658
|
|
13
|
+
kalibr-1.0.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
kalibr-1.0.22.dist-info/entry_points.txt,sha256=T-DOrFEZb0fZxA9H8sSCh-2zKxdjnmpzIRmm5TY_f6s,56
|
|
15
|
+
kalibr-1.0.22.dist-info/top_level.txt,sha256=OkloC5_IfpE4-QwI30aLIYbFZk_-ChABWF7aBGddy28,7
|
|
16
|
+
kalibr-1.0.22.dist-info/RECORD,,
|
kalibr-1.0.21.dist-info/METADATA
DELETED
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: kalibr
|
|
3
|
-
Version: 1.0.21
|
|
4
|
-
Summary: Multi-Model AI Integration Framework
|
|
5
|
-
Home-page: https://github.com/devonakelley/kalibr-sdk
|
|
6
|
-
Author: Kalibr Team
|
|
7
|
-
Author-email: Kalibr Team <team@kalibr.dev>
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Homepage, https://kalibr.dev
|
|
10
|
-
Project-URL: Documentation, https://kalibr.dev/docs
|
|
11
|
-
Project-URL: Repository, https://github.com/devonakelley/kalibr-sdk
|
|
12
|
-
Project-URL: Bug Reports, https://github.com/devonakelley/kalibr-sdk/issues
|
|
13
|
-
Keywords: ai,api,framework,gpt,claude,gemini,copilot,multi-model,sdk
|
|
14
|
-
Classifier: Development Status :: 4 - Beta
|
|
15
|
-
Classifier: Intended Audience :: Developers
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier: Operating System :: OS Independent
|
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
-
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
|
|
23
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
-
Requires-Python: >=3.11
|
|
25
|
-
Description-Content-Type: text/markdown
|
|
26
|
-
License-File: LICENSE
|
|
27
|
-
Requires-Dist: fastapi>=0.110.1
|
|
28
|
-
Requires-Dist: uvicorn>=0.25.0
|
|
29
|
-
Requires-Dist: pydantic>=2.6.4
|
|
30
|
-
Requires-Dist: typer>=0.9.0
|
|
31
|
-
Requires-Dist: requests>=2.31.0
|
|
32
|
-
Requires-Dist: python-jose[cryptography]>=3.3.0
|
|
33
|
-
Requires-Dist: passlib[bcrypt]>=1.7.4
|
|
34
|
-
Requires-Dist: python-multipart>=0.0.9
|
|
35
|
-
Requires-Dist: motor>=3.3.1
|
|
36
|
-
Requires-Dist: pymongo>=4.5.0
|
|
37
|
-
Requires-Dist: boto3>=1.34.129
|
|
38
|
-
Requires-Dist: aiofiles>=23.2.1
|
|
39
|
-
Provides-Extra: dev
|
|
40
|
-
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
41
|
-
Requires-Dist: black>=24.1.1; extra == "dev"
|
|
42
|
-
Requires-Dist: isort>=5.13.2; extra == "dev"
|
|
43
|
-
Requires-Dist: flake8>=7.0.0; extra == "dev"
|
|
44
|
-
Requires-Dist: mypy>=1.8.0; extra == "dev"
|
|
45
|
-
Dynamic: author
|
|
46
|
-
Dynamic: home-page
|
|
47
|
-
Dynamic: license-file
|
|
48
|
-
Dynamic: requires-python
|
|
49
|
-
|
|
50
|
-
# Kalibr SDK
|
|
51
|
-
|
|
52
|
-
**Multi-Model AI Integration Framework**
|
|
53
|
-
|
|
54
|
-
Write once. Deploy anywhere. Connect to any AI model.
|
|
55
|
-
|
|
56
|
-
Kalibr lets you expose Python functions as APIs that work with **GPT, Claude, Gemini, and Copilot** automatically.
|
|
57
|
-
|
|
58
|
-
[](https://badge.fury.io/py/kalibr)
|
|
59
|
-
[](https://www.python.org/downloads/)
|
|
60
|
-
[](https://opensource.org/licenses/MIT)
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## 🚀 Quick Start (2 minutes)
|
|
65
|
-
|
|
66
|
-
### 1. Install
|
|
67
|
-
```bash
|
|
68
|
-
pip install kalibr
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### 2. Get Examples
|
|
72
|
-
```bash
|
|
73
|
-
kalibr-connect examples
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
This copies example files to `./kalibr_examples/` in your current directory.
|
|
77
|
-
|
|
78
|
-
### 3. Run Demo
|
|
79
|
-
```bash
|
|
80
|
-
kalibr-connect serve kalibr_examples/basic_kalibr_example.py
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### 4. See Multi-Model Schemas
|
|
84
|
-
|
|
85
|
-
Open your browser to see all 4 AI model schemas auto-generated:
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
http://localhost:8000/ # API info
|
|
89
|
-
http://localhost:8000/gpt-actions.json # For ChatGPT
|
|
90
|
-
http://localhost:8000/mcp.json # For Claude
|
|
91
|
-
http://localhost:8000/schemas/gemini # For Gemini
|
|
92
|
-
http://localhost:8000/schemas/copilot # For Copilot
|
|
93
|
-
http://localhost:8000/docs # Interactive docs
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
**That's it!** One Python file, four AI platform schemas. 🎯
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## 🎯 What Does This Do?
|
|
101
|
-
|
|
102
|
-
Kalibr turns your Python functions into APIs that AI assistants can call:
|
|
103
|
-
|
|
104
|
-
```python
|
|
105
|
-
from kalibr import Kalibr
|
|
106
|
-
|
|
107
|
-
app = Kalibr(title="My Business API")
|
|
108
|
-
|
|
109
|
-
@app.action("get_inventory", "Check product stock")
|
|
110
|
-
def get_inventory(product_id: str):
|
|
111
|
-
# Your business logic
|
|
112
|
-
return {"product_id": product_id, "stock": 42}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**Result:** ChatGPT, Claude, Gemini, and Copilot can all call your `get_inventory` function!
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## 💪 Two Modes
|
|
120
|
-
|
|
121
|
-
### Function-Level (Simple)
|
|
122
|
-
Perfect for exposing business logic:
|
|
123
|
-
|
|
124
|
-
```python
|
|
125
|
-
from kalibr import Kalibr
|
|
126
|
-
|
|
127
|
-
app = Kalibr(title="My API")
|
|
128
|
-
|
|
129
|
-
@app.action("calculate_price", "Calculate product price")
|
|
130
|
-
def calculate_price(product_id: str, quantity: int):
|
|
131
|
-
return {"total": quantity * get_price(product_id)}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### App-Level (Advanced)
|
|
135
|
-
Full framework with file uploads, sessions, streaming, workflows:
|
|
136
|
-
|
|
137
|
-
```python
|
|
138
|
-
from kalibr import KalibrApp
|
|
139
|
-
from kalibr.types import FileUpload, Session
|
|
140
|
-
|
|
141
|
-
app = KalibrApp(title="Advanced API")
|
|
142
|
-
|
|
143
|
-
@app.file_handler("analyze_doc", [".pdf", ".docx"])
|
|
144
|
-
async def analyze_doc(file: FileUpload):
|
|
145
|
-
return {"filename": file.filename, "analysis": "..."}
|
|
146
|
-
|
|
147
|
-
@app.session_action("save_data", "Save to session")
|
|
148
|
-
async def save_data(session: Session, data: dict):
|
|
149
|
-
session.set("my_data", data)
|
|
150
|
-
return {"saved": True}
|
|
151
|
-
|
|
152
|
-
@app.stream_action("live_feed", "Stream real-time data")
|
|
153
|
-
async def live_feed(count: int = 10):
|
|
154
|
-
for i in range(count):
|
|
155
|
-
yield {"item": i, "timestamp": "..."}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## 📚 Examples Included
|
|
161
|
-
|
|
162
|
-
After running `kalibr-connect examples`, you get:
|
|
163
|
-
|
|
164
|
-
- **`basic_kalibr_example.py`** - Simple function-level example
|
|
165
|
-
- **`enhanced_kalibr_example.py`** - Advanced app-level example with all features
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## 🤖 AI Platform Integration
|
|
170
|
-
|
|
171
|
-
Once your Kalibr app is running, integrate with AI platforms:
|
|
172
|
-
|
|
173
|
-
### ChatGPT (GPT Actions)
|
|
174
|
-
1. Copy schema from `http://localhost:8000/gpt-actions.json`
|
|
175
|
-
2. Go to GPT Builder → Actions → Import from URL
|
|
176
|
-
3. Done! ChatGPT can now call your functions
|
|
177
|
-
|
|
178
|
-
### Claude (MCP)
|
|
179
|
-
1. Add to Claude Desktop config:
|
|
180
|
-
```json
|
|
181
|
-
{
|
|
182
|
-
"mcp": {
|
|
183
|
-
"servers": {
|
|
184
|
-
"my-api": {
|
|
185
|
-
"url": "http://localhost:8000/mcp.json"
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
2. Done! Claude can now call your functions
|
|
192
|
-
|
|
193
|
-
### Gemini & Copilot
|
|
194
|
-
Similar simple setup using their respective schema endpoints.
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
## 🎯 Use Cases
|
|
199
|
-
|
|
200
|
-
- **Customer Service APIs** - Let AI assistants look up orders, process refunds
|
|
201
|
-
- **Data Analysis APIs** - Let AI query your analytics and generate insights
|
|
202
|
-
- **Document Processing** - Let AI analyze uploaded documents
|
|
203
|
-
- **Business Automation** - Let AI trigger workflows in your systems
|
|
204
|
-
- **Internal Tools** - Give your team AI-powered access to internal systems
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## 📖 Documentation
|
|
209
|
-
|
|
210
|
-
- **Quick Start**: You're reading it!
|
|
211
|
-
- **Full Docs**: See `KALIBR_SDK_COMPLETE.md` in the package
|
|
212
|
-
- **Examples**: Run `kalibr-connect examples`
|
|
213
|
-
- **CLI Help**: `kalibr-connect --help`
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## 🔧 CLI Commands
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
kalibr-connect examples # Copy example files to current dir
|
|
221
|
-
kalibr-connect serve my_app.py # Run your app locally
|
|
222
|
-
kalibr-connect version # Show version info
|
|
223
|
-
kalibr-connect --help # Show all commands
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## ⚡ Key Features
|
|
229
|
-
|
|
230
|
-
- ✅ **Multi-Model Support** - Works with GPT, Claude, Gemini, Copilot
|
|
231
|
-
- ✅ **Automatic Schemas** - No manual schema writing
|
|
232
|
-
- ✅ **File Uploads** - Handle document uploads
|
|
233
|
-
- ✅ **Sessions** - Stateful conversations
|
|
234
|
-
- ✅ **Streaming** - Real-time data streaming
|
|
235
|
-
- ✅ **Workflows** - Multi-step processes
|
|
236
|
-
- ✅ **Type Safe** - Full Python type hints
|
|
237
|
-
- ✅ **Fast** - Async/await support
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
## 🔥 Why Kalibr?
|
|
242
|
-
|
|
243
|
-
**Without Kalibr:**
|
|
244
|
-
- Learn 4 different API specs
|
|
245
|
-
- Write 4 different schemas
|
|
246
|
-
- Maintain 4 codebases
|
|
247
|
-
- = Weeks of work
|
|
248
|
-
|
|
249
|
-
**With Kalibr:**
|
|
250
|
-
- Write Python functions once
|
|
251
|
-
- Kalibr generates all 4 schemas
|
|
252
|
-
- Single codebase
|
|
253
|
-
- = One day of work
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
|
|
257
|
-
## 💡 Simple Example
|
|
258
|
-
|
|
259
|
-
```python
|
|
260
|
-
# my_app.py
|
|
261
|
-
from kalibr import Kalibr
|
|
262
|
-
|
|
263
|
-
app = Kalibr(title="Weather API")
|
|
264
|
-
|
|
265
|
-
@app.action("get_weather", "Get current weather")
|
|
266
|
-
def get_weather(city: str):
|
|
267
|
-
# Your logic here
|
|
268
|
-
return {"city": city, "temp": 72, "condition": "sunny"}
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
# Run it
|
|
273
|
-
kalibr-connect serve my_app.py
|
|
274
|
-
|
|
275
|
-
# Now ALL these work:
|
|
276
|
-
# ✅ ChatGPT can call get_weather()
|
|
277
|
-
# ✅ Claude can call get_weather()
|
|
278
|
-
# ✅ Gemini can call get_weather()
|
|
279
|
-
# ✅ Copilot can call get_weather()
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## 🚀 Get Started Now
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
pip install kalibr
|
|
288
|
-
kalibr-connect examples
|
|
289
|
-
kalibr-connect serve kalibr_examples/basic_kalibr_example.py
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
Open http://localhost:8000 and see your multi-model API in action! 🎯
|
|
293
|
-
|
|
294
|
-
---
|
|
295
|
-
|
|
296
|
-
## 📝 License
|
|
297
|
-
|
|
298
|
-
MIT License - see LICENSE file for details.
|
|
299
|
-
|
|
300
|
-
---
|
|
301
|
-
|
|
302
|
-
**Kalibr SDK** - Transform how you build AI-integrated applications! 🚀
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|