kalibr 1.0.16__py3-none-any.whl → 1.0.18__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/__init__.py +8 -0
- kalibr/__main__.py +615 -26
- kalibr/deployment.py +26 -0
- kalibr/kalibr.py +249 -0
- kalibr/kalibr_app.py +67 -70
- kalibr/schema_generators.py +212 -13
- kalibr/types.py +106 -0
- kalibr-1.0.18.dist-info/METADATA +94 -0
- kalibr-1.0.18.dist-info/RECORD +13 -0
- kalibr-1.0.16.dist-info/METADATA +0 -120
- kalibr-1.0.16.dist-info/RECORD +0 -10
- {kalibr-1.0.16.dist-info → kalibr-1.0.18.dist-info}/WHEEL +0 -0
- {kalibr-1.0.16.dist-info → kalibr-1.0.18.dist-info}/entry_points.txt +0 -0
- /kalibr-1.0.16.dist-info/licenses/LICENSE.txt → /kalibr-1.0.18.dist-info/licenses/LICENSE +0 -0
- {kalibr-1.0.16.dist-info → kalibr-1.0.18.dist-info}/top_level.txt +0 -0
kalibr/types.py
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Enhanced data types for Kalibr app-level framework
|
|
3
|
+
"""
|
|
4
|
+
from pydantic import BaseModel, Field
|
|
5
|
+
from typing import Optional, Dict, Any, List, Union, AsyncGenerator
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
import uuid
|
|
8
|
+
import io
|
|
9
|
+
|
|
10
|
+
class FileUpload(BaseModel):
|
|
11
|
+
"""Enhanced file upload handling for AI model integrations"""
|
|
12
|
+
filename: str
|
|
13
|
+
content_type: str
|
|
14
|
+
size: int
|
|
15
|
+
content: bytes
|
|
16
|
+
upload_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
|
|
17
|
+
uploaded_at: datetime = Field(default_factory=datetime.now)
|
|
18
|
+
|
|
19
|
+
class Config:
|
|
20
|
+
arbitrary_types_allowed = True
|
|
21
|
+
|
|
22
|
+
class ImageData(BaseModel):
|
|
23
|
+
"""Image data type for AI vision capabilities"""
|
|
24
|
+
filename: str
|
|
25
|
+
content_type: str
|
|
26
|
+
width: Optional[int] = None
|
|
27
|
+
height: Optional[int] = None
|
|
28
|
+
format: str # jpeg, png, webp, etc.
|
|
29
|
+
content: bytes
|
|
30
|
+
image_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
arbitrary_types_allowed = True
|
|
34
|
+
|
|
35
|
+
class TableData(BaseModel):
|
|
36
|
+
"""Structured table data for AI analysis"""
|
|
37
|
+
headers: List[str]
|
|
38
|
+
rows: List[List[Any]]
|
|
39
|
+
table_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
|
|
40
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
41
|
+
|
|
42
|
+
class StreamingResponse(BaseModel):
|
|
43
|
+
"""Base class for streaming responses"""
|
|
44
|
+
chunk_id: str
|
|
45
|
+
content: Any
|
|
46
|
+
is_final: bool = False
|
|
47
|
+
timestamp: datetime = Field(default_factory=datetime.now)
|
|
48
|
+
|
|
49
|
+
class Session(BaseModel):
|
|
50
|
+
"""Session management for stateful interactions"""
|
|
51
|
+
session_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
|
|
52
|
+
user_id: Optional[str] = None
|
|
53
|
+
created_at: datetime = Field(default_factory=datetime.now)
|
|
54
|
+
last_accessed: datetime = Field(default_factory=datetime.now)
|
|
55
|
+
data: Dict[str, Any] = Field(default_factory=dict)
|
|
56
|
+
expires_at: Optional[datetime] = None
|
|
57
|
+
|
|
58
|
+
def get(self, key: str, default=None):
|
|
59
|
+
"""Get session data"""
|
|
60
|
+
return self.data.get(key, default)
|
|
61
|
+
|
|
62
|
+
def set(self, key: str, value: Any):
|
|
63
|
+
"""Set session data"""
|
|
64
|
+
self.data[key] = value
|
|
65
|
+
self.last_accessed = datetime.now()
|
|
66
|
+
|
|
67
|
+
def delete(self, key: str):
|
|
68
|
+
"""Delete session data"""
|
|
69
|
+
if key in self.data:
|
|
70
|
+
del self.data[key]
|
|
71
|
+
|
|
72
|
+
class AuthenticatedUser(BaseModel):
|
|
73
|
+
"""Authenticated user context"""
|
|
74
|
+
user_id: str
|
|
75
|
+
username: str
|
|
76
|
+
email: Optional[str] = None
|
|
77
|
+
roles: List[str] = Field(default_factory=list)
|
|
78
|
+
permissions: List[str] = Field(default_factory=list)
|
|
79
|
+
auth_method: str # "jwt", "oauth", "api_key", etc.
|
|
80
|
+
|
|
81
|
+
class FileDownload(BaseModel):
|
|
82
|
+
"""File download response"""
|
|
83
|
+
filename: str
|
|
84
|
+
content_type: str
|
|
85
|
+
content: bytes
|
|
86
|
+
|
|
87
|
+
class Config:
|
|
88
|
+
arbitrary_types_allowed = True
|
|
89
|
+
|
|
90
|
+
class AnalysisResult(BaseModel):
|
|
91
|
+
"""Generic analysis result structure"""
|
|
92
|
+
result_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
|
|
93
|
+
status: str # "success", "error", "pending"
|
|
94
|
+
data: Dict[str, Any] = Field(default_factory=dict)
|
|
95
|
+
created_at: datetime = Field(default_factory=datetime.now)
|
|
96
|
+
processing_time: Optional[float] = None
|
|
97
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
98
|
+
|
|
99
|
+
class WorkflowState(BaseModel):
|
|
100
|
+
"""Workflow state management"""
|
|
101
|
+
workflow_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
|
|
102
|
+
step: str
|
|
103
|
+
status: str
|
|
104
|
+
data: Dict[str, Any] = Field(default_factory=dict)
|
|
105
|
+
created_at: datetime = Field(default_factory=datetime.now)
|
|
106
|
+
updated_at: datetime = Field(default_factory=datetime.now)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kalibr
|
|
3
|
+
Version: 1.0.18
|
|
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
|
+
[](https://badge.fury.io/py/kalibr)
|
|
57
|
+
[](https://www.python.org/downloads/)
|
|
58
|
+
[](https://opensource.org/licenses/MIT)
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Install
|
|
64
|
+
pip install kalibr
|
|
65
|
+
|
|
66
|
+
# Create app
|
|
67
|
+
kalibr init --template enhanced --name "My API"
|
|
68
|
+
|
|
69
|
+
# Test locally
|
|
70
|
+
kalibr serve enhanced_app.py
|
|
71
|
+
|
|
72
|
+
# Deploy to production
|
|
73
|
+
kalibr deploy enhanced_app.py --platform fly --name my-api
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Features
|
|
77
|
+
|
|
78
|
+
- ✅ **Multi-Model Support**: GPT Actions, Claude MCP, Gemini, Copilot
|
|
79
|
+
- ✅ **Enhanced Framework**: File uploads, sessions, streaming, workflows
|
|
80
|
+
- ✅ **Built-in Auth**: JWT, user management, protected routes
|
|
81
|
+
- ✅ **Easy Deployment**: Fly.io, AWS Lambda with one command
|
|
82
|
+
- ✅ **Analytics**: Automatic tracking, custom events, metrics
|
|
83
|
+
|
|
84
|
+
## Documentation
|
|
85
|
+
|
|
86
|
+
See [KALIBR_SDK_COMPLETE.md](KALIBR_SDK_COMPLETE.md) for full documentation.
|
|
87
|
+
|
|
88
|
+
## Examples
|
|
89
|
+
|
|
90
|
+
Check the [examples/](examples/) directory for sample applications.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
**Transform how you build AI-integrated applications! 🚀**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
kalibr/__init__.py,sha256=boymgQoYhcsTB3Yqn3-VbysFbSsr1IKs8wl5bw42rRI,283
|
|
2
|
+
kalibr/__main__.py,sha256=UODZIbjF0iVLlniwUFWPb2JK2fni1AJeRGc_suVGJDI,23445
|
|
3
|
+
kalibr/deployment.py,sha256=B-2ePPCMF2UcnkM2YKkAoaNrOjpUKUGfNO0IxyNOJMI,670
|
|
4
|
+
kalibr/kalibr.py,sha256=Ee0joXpcbT9f7Dt9LxVEUfkWFK1xsWMt8PhjM9puPm4,10235
|
|
5
|
+
kalibr/kalibr_app.py,sha256=leSsQur_atRWjr23MdpuZuJjqfVzZRWYhrNO5tXmF84,2312
|
|
6
|
+
kalibr/schema_generators.py,sha256=nIgoYaO0FGC6arHdUHG0XaGDpJDycJeWDDC1-zAHzfI,7528
|
|
7
|
+
kalibr/types.py,sha256=bNmf_cOWXBmhaMVAPEp3_EdRCcdXY2pbOgOxZ1dZ0Mc,3476
|
|
8
|
+
kalibr-1.0.18.dist-info/licenses/LICENSE,sha256=1WLJDkrueNpHCROy9zANrK2Ar2weqZ_z88hw90UKDoc,451
|
|
9
|
+
kalibr-1.0.18.dist-info/METADATA,sha256=eU1zJneIu0Z6txro9gmr2svekuPq4F5KlADWoU-wFew,3152
|
|
10
|
+
kalibr-1.0.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
kalibr-1.0.18.dist-info/entry_points.txt,sha256=T-DOrFEZb0fZxA9H8sSCh-2zKxdjnmpzIRmm5TY_f6s,56
|
|
12
|
+
kalibr-1.0.18.dist-info/top_level.txt,sha256=OkloC5_IfpE4-QwI30aLIYbFZk_-ChABWF7aBGddy28,7
|
|
13
|
+
kalibr-1.0.18.dist-info/RECORD,,
|
kalibr-1.0.16.dist-info/METADATA
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: kalibr
|
|
3
|
-
Version: 1.0.16
|
|
4
|
-
Summary: Kalibr SDK — Integrate your SaaS with every major AI model using a single SDK.
|
|
5
|
-
Home-page: https://github.com/devon/kalibr-sdk
|
|
6
|
-
Author: Devon
|
|
7
|
-
Author-email: hello@kalibr.systems
|
|
8
|
-
License: MIT
|
|
9
|
-
Requires-Python: >=3.9
|
|
10
|
-
Description-Content-Type: text/markdown
|
|
11
|
-
License-File: LICENSE.txt
|
|
12
|
-
Requires-Dist: fastapi>=0.95.0
|
|
13
|
-
Requires-Dist: uvicorn>=0.22.0
|
|
14
|
-
Requires-Dist: typer>=0.9.0
|
|
15
|
-
Requires-Dist: pydantic>=2.0
|
|
16
|
-
Dynamic: author-email
|
|
17
|
-
Dynamic: home-page
|
|
18
|
-
Dynamic: license-file
|
|
19
|
-
Dynamic: requires-python
|
|
20
|
-
|
|
21
|
-
# Kalibr SDK
|
|
22
|
-
|
|
23
|
-
**Multi-Model AI Integration Framework**
|
|
24
|
-
|
|
25
|
-
Write once. Deploy anywhere. Connect to any AI model.
|
|
26
|
-
|
|
27
|
-
Kalibr lets developers expose any Python function as a model-compatible API — instantly usable by GPT, Claude, Gemini, and beyond.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## 🚀 Quick Start
|
|
32
|
-
|
|
33
|
-
### Install
|
|
34
|
-
```bash
|
|
35
|
-
pip install kalibr
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Run the included demo
|
|
39
|
-
```bash
|
|
40
|
-
kalibr-connect serve examples/demo_app.py
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Then open your browser to:
|
|
44
|
-
```
|
|
45
|
-
http://127.0.0.1:8000/docs
|
|
46
|
-
```
|
|
47
|
-
You’ll see automatically generated endpoints for your demo functions — all schema-normalized and model-ready.
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## ⚙️ Core Features
|
|
52
|
-
|
|
53
|
-
✅ **Multi-Model Support** — Works with GPT Actions, Claude MCP, Gemini, and Copilot
|
|
54
|
-
✅ **Automatic Schema Generation** — Define once, serve everywhere
|
|
55
|
-
✅ **Fast Local Development** — Instantly test endpoints with `kalibr-connect serve`
|
|
56
|
-
✅ **Lightweight Runtime** — No dependencies beyond FastAPI + Uvicorn
|
|
57
|
-
|
|
58
|
-
🚧 *Coming Soon:*
|
|
59
|
-
• Auth & JWT user sessions
|
|
60
|
-
• Analytics & observability
|
|
61
|
-
• One-click deployment (Fly.io, AWS Lambda)
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## 🧠 How It Works
|
|
66
|
-
|
|
67
|
-
Decorate your Python functions with `@app.register()`:
|
|
68
|
-
|
|
69
|
-
```python
|
|
70
|
-
from kalibr.kalibr_app import KalibrApp
|
|
71
|
-
|
|
72
|
-
app = KalibrApp()
|
|
73
|
-
|
|
74
|
-
@app.register()
|
|
75
|
-
def summarize(text: str) -> str:
|
|
76
|
-
"""Summarize text input."""
|
|
77
|
-
return text[:100] + "..."
|
|
78
|
-
|
|
79
|
-
@app.register()
|
|
80
|
-
def sentiment(text: str) -> dict:
|
|
81
|
-
"""Return a basic sentiment classification."""
|
|
82
|
-
return {"sentiment": "positive" if "love" in text.lower() else "neutral"}
|
|
83
|
-
|
|
84
|
-
kalibr_app = app.get_app()
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Then run:
|
|
88
|
-
```bash
|
|
89
|
-
kalibr-connect serve demo_app.py
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Your endpoints appear instantly at:
|
|
93
|
-
```
|
|
94
|
-
http://127.0.0.1:8000/docs
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## 📁 Project Structure
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
kalibr/
|
|
103
|
-
├── __init__.py
|
|
104
|
-
├── __main__.py
|
|
105
|
-
├── kalibr_app.py
|
|
106
|
-
├── schema_generators.py
|
|
107
|
-
examples/
|
|
108
|
-
├── demo_app.py
|
|
109
|
-
└── enhanced_kalibr_example.py
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## 📘 Documentation
|
|
115
|
-
|
|
116
|
-
See [KALIBR_SDK_COMPLETE.md](KALIBR_SDK_COMPLETE.md) for full developer documentation.
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
**Kalibr — Transform how you build AI-integrated applications.**
|
kalibr-1.0.16.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
kalibr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
kalibr/__main__.py,sha256=oSEVIA6G1F6DVJjq4hcV_cX1_RYJkIJjdC4yc0HzTpI,693
|
|
3
|
-
kalibr/kalibr_app.py,sha256=pqzsPaZbAAe9aBJ-bfJBfce-wZgaFj7iVKz7Nz823S4,1953
|
|
4
|
-
kalibr/schema_generators.py,sha256=1CFc0mCI0KVM48gEeGKK91I42WYyPYfEk2Yx2uZh478,286
|
|
5
|
-
kalibr-1.0.16.dist-info/licenses/LICENSE.txt,sha256=1WLJDkrueNpHCROy9zANrK2Ar2weqZ_z88hw90UKDoc,451
|
|
6
|
-
kalibr-1.0.16.dist-info/METADATA,sha256=7qrQz66EIqZjkCEepTIDqY5bWMJ6AAg31dH5qMJZ1qY,2632
|
|
7
|
-
kalibr-1.0.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
kalibr-1.0.16.dist-info/entry_points.txt,sha256=T-DOrFEZb0fZxA9H8sSCh-2zKxdjnmpzIRmm5TY_f6s,56
|
|
9
|
-
kalibr-1.0.16.dist-info/top_level.txt,sha256=OkloC5_IfpE4-QwI30aLIYbFZk_-ChABWF7aBGddy28,7
|
|
10
|
-
kalibr-1.0.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|