kalibr 1.0.12__tar.gz → 1.0.15__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.
- {kalibr-1.0.12/kalibr.egg-info → kalibr-1.0.15}/PKG-INFO +1 -1
- kalibr-1.0.15/kalibr/__init__.py +0 -0
- kalibr-1.0.15/kalibr/__main__.py +4 -0
- kalibr-1.0.15/kalibr/kalibr_app.py +71 -0
- {kalibr-1.0.12 → kalibr-1.0.15/kalibr.egg-info}/PKG-INFO +1 -1
- {kalibr-1.0.12 → kalibr-1.0.15}/kalibr.egg-info/SOURCES.txt +1 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/pyproject.toml +1 -1
- kalibr-1.0.15/setup.py +32 -0
- kalibr-1.0.12/kalibr/__main__.py +0 -48
- kalibr-1.0.12/kalibr/kalibr_app.py +0 -27
- kalibr-1.0.12/setup.py +0 -27
- {kalibr-1.0.12 → kalibr-1.0.15}/KALIBR_SDK_COMPLETE.md +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/LICENSE.txt +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/MANIFEST.in +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/README.md +0 -0
- {kalibr-1.0.12/kalibr → kalibr-1.0.15/examples}/__init__.py +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/examples/demo_app.py +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/examples/enhanced_kalibr_example.py +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/kalibr/schema_generators.py +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/kalibr.egg-info/dependency_links.txt +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/kalibr.egg-info/entry_points.txt +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/kalibr.egg-info/requires.txt +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/kalibr.egg-info/top_level.txt +0 -0
- {kalibr-1.0.12 → kalibr-1.0.15}/setup.cfg +0 -0
|
File without changes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import typer
|
|
4
|
+
import uvicorn
|
|
5
|
+
import importlib.util
|
|
6
|
+
from fastapi import FastAPI
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
|
|
9
|
+
console = Console()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class KalibrApp(FastAPI):
|
|
13
|
+
"""Lightweight FastAPI wrapper with a .tool() decorator."""
|
|
14
|
+
def tool(self):
|
|
15
|
+
def decorator(func):
|
|
16
|
+
self.get(f"/{func.__name__}")(func)
|
|
17
|
+
return func
|
|
18
|
+
return decorator
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
app = typer.Typer(help="Kalibr Connect CLI")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def load_app_from_file(file_path: str):
|
|
25
|
+
abs_path = os.path.abspath(file_path)
|
|
26
|
+
if not os.path.exists(abs_path):
|
|
27
|
+
raise FileNotFoundError(f"File not found: {abs_path}")
|
|
28
|
+
|
|
29
|
+
spec = importlib.util.spec_from_file_location("user_app", abs_path)
|
|
30
|
+
module = importlib.util.module_from_spec(spec)
|
|
31
|
+
sys.modules["user_app"] = module
|
|
32
|
+
spec.loader.exec_module(module)
|
|
33
|
+
|
|
34
|
+
if not hasattr(module, "app"):
|
|
35
|
+
raise AttributeError("No FastAPI app instance named 'app' found in the file.")
|
|
36
|
+
return module.app
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@app.command("serve")
|
|
40
|
+
def serve(file: str):
|
|
41
|
+
"""Run a Kalibr app locally from a .py file."""
|
|
42
|
+
console.print(f"[cyan]🚀 Serving {file} locally...[/cyan]")
|
|
43
|
+
try:
|
|
44
|
+
app_instance = load_app_from_file(file)
|
|
45
|
+
console.print("[green]✅ App loaded successfully. Starting server...[/green]")
|
|
46
|
+
uvicorn.run(app_instance, host="127.0.0.1", port=8000, reload=False)
|
|
47
|
+
except Exception as e:
|
|
48
|
+
console.print(f"[red]❌ Failed to start app:[/red] {e}")
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@app.command("deploy")
|
|
52
|
+
def deploy(file: str):
|
|
53
|
+
console.print(f"[yellow]🚀 Deploying {file} (stub)...[/yellow]")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@app.command("usage")
|
|
57
|
+
def usage():
|
|
58
|
+
console.print(
|
|
59
|
+
"\n[bold cyan]Kalibr Connect Commands:[/bold cyan]\n"
|
|
60
|
+
" kalibr-connect serve <file> Run a Kalibr app locally.\n"
|
|
61
|
+
" kalibr-connect deploy <file> Deploy your Kalibr app.\n"
|
|
62
|
+
" kalibr-connect usage Show this usage guide.\n"
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def run():
|
|
67
|
+
app()
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
if __name__ == "__main__":
|
|
71
|
+
run()
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "kalibr"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.15"
|
|
8
8
|
description = "Kalibr SDK — Integrate your SaaS with every major AI model using a single SDK."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Devon" }]
|
kalibr-1.0.15/setup.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="kalibr",
|
|
5
|
+
version="1.0.15", # bump for new upload
|
|
6
|
+
author="Devon",
|
|
7
|
+
author_email="hello@kalibr.systems",
|
|
8
|
+
description="Kalibr SDK — integrate your SaaS or app with every major AI model using one schema.",
|
|
9
|
+
long_description=open("README.md", encoding="utf-8").read(),
|
|
10
|
+
long_description_content_type="text/markdown",
|
|
11
|
+
url="https://github.com/devon/kalibr-sdk",
|
|
12
|
+
packages=find_packages(exclude=["tests*", "examples*"]),
|
|
13
|
+
include_package_data=True,
|
|
14
|
+
install_requires=[
|
|
15
|
+
"fastapi>=0.115.0",
|
|
16
|
+
"uvicorn>=0.29.0",
|
|
17
|
+
"typer>=0.12.3",
|
|
18
|
+
"pydantic>=2.6.0",
|
|
19
|
+
],
|
|
20
|
+
python_requires=">=3.9",
|
|
21
|
+
entry_points={
|
|
22
|
+
"console_scripts": [
|
|
23
|
+
"kalibr-connect=kalibr.kalibr_app:run"
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
classifiers=[
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"License :: OSI Approved :: MIT License",
|
|
29
|
+
"Operating System :: OS Independent",
|
|
30
|
+
],
|
|
31
|
+
license="MIT",
|
|
32
|
+
)
|
kalibr-1.0.12/kalibr/__main__.py
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import typer
|
|
2
|
-
import os
|
|
3
|
-
import sys
|
|
4
|
-
import subprocess
|
|
5
|
-
|
|
6
|
-
app = typer.Typer(help="Kalibr Connect CLI")
|
|
7
|
-
|
|
8
|
-
def banner():
|
|
9
|
-
print("\n🚀 Kalibr SDK (Demo Mode)")
|
|
10
|
-
print("⚠️ Running in local evaluation mode.")
|
|
11
|
-
print("💡 To enable production or hosted runtime, visit https://kalibr.systems\n")
|
|
12
|
-
|
|
13
|
-
@app.command(help="Run a Kalibr app locally.")
|
|
14
|
-
def serve(file: str):
|
|
15
|
-
"""
|
|
16
|
-
Run a Kalibr app locally.
|
|
17
|
-
Example: kalibr-connect serve demo_app.py
|
|
18
|
-
"""
|
|
19
|
-
banner()
|
|
20
|
-
print(f"🚀 Serving {file} locally...")
|
|
21
|
-
subprocess.run(["uvicorn", f"{file.replace('.py', '')}:app", "--reload"])
|
|
22
|
-
|
|
23
|
-
@app.command(help="Deploy a Kalibr app (stubbed demo).")
|
|
24
|
-
def deploy(file: str):
|
|
25
|
-
"""
|
|
26
|
-
Stubbed deploy command for demo/testing.
|
|
27
|
-
"""
|
|
28
|
-
banner()
|
|
29
|
-
print(f"⚙️ Deployment is only available for licensed users.")
|
|
30
|
-
print(f" Visit https://kalibr.systems for API access.\n")
|
|
31
|
-
|
|
32
|
-
@app.command(help="Show this usage guide.")
|
|
33
|
-
def usage():
|
|
34
|
-
print("""
|
|
35
|
-
Kalibr Connect Commands:
|
|
36
|
-
kalibr-connect serve <file> Run a Kalibr app locally.
|
|
37
|
-
kalibr-connect deploy <file> Deploy your Kalibr app (stubbed demo).
|
|
38
|
-
kalibr-connect usage Show this usage guide.
|
|
39
|
-
""")
|
|
40
|
-
|
|
41
|
-
def main():
|
|
42
|
-
api_key = os.getenv("KALIBR_API_KEY")
|
|
43
|
-
if not api_key:
|
|
44
|
-
print("⚠️ No API key detected. Running in local demo mode.")
|
|
45
|
-
app()
|
|
46
|
-
|
|
47
|
-
if __name__ == "__main__":
|
|
48
|
-
main()
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from fastapi import FastAPI
|
|
2
|
-
from typing import Callable
|
|
3
|
-
|
|
4
|
-
class KalibrApp:
|
|
5
|
-
def __init__(self):
|
|
6
|
-
self.app = FastAPI(title="Kalibr SDK App")
|
|
7
|
-
self._routes = []
|
|
8
|
-
|
|
9
|
-
def register(self):
|
|
10
|
-
"""
|
|
11
|
-
Decorator to register a Python function as a Kalibr tool endpoint.
|
|
12
|
-
Exposes the function automatically with JSON schema inference.
|
|
13
|
-
"""
|
|
14
|
-
def decorator(func: Callable):
|
|
15
|
-
route_path = f"/{func.__name__}"
|
|
16
|
-
self.app.post(route_path)(func)
|
|
17
|
-
self._routes.append(func.__name__)
|
|
18
|
-
return func
|
|
19
|
-
return decorator
|
|
20
|
-
|
|
21
|
-
def get_app(self):
|
|
22
|
-
"""Return the FastAPI instance."""
|
|
23
|
-
return self.app
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
# Default export for uvicorn (if someone runs `kalibr-connect serve demo_app.py`)
|
|
27
|
-
app = KalibrApp().get_app()
|
kalibr-1.0.12/setup.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from setuptools import setup, find_packages
|
|
2
|
-
|
|
3
|
-
setup(
|
|
4
|
-
name="kalibr",
|
|
5
|
-
version="1.0.12", # BUMPED VERSION
|
|
6
|
-
author="Devon",
|
|
7
|
-
author_email="hello@kalibr.systems",
|
|
8
|
-
description="Kalibr Connect: integrate your app with every major AI model",
|
|
9
|
-
long_description="Kalibr Connect lets developers integrate once and connect to all major AI models — GPT, Claude, Gemini, Copilot, and more.",
|
|
10
|
-
long_description_content_type="text/markdown",
|
|
11
|
-
url="https://github.com/devon/kalibr-sdk",
|
|
12
|
-
packages=find_packages(),
|
|
13
|
-
include_package_data=True,
|
|
14
|
-
install_requires=[
|
|
15
|
-
"fastapi",
|
|
16
|
-
"uvicorn",
|
|
17
|
-
"typer",
|
|
18
|
-
"pydantic>=2.0",
|
|
19
|
-
],
|
|
20
|
-
entry_points={
|
|
21
|
-
"console_scripts": [
|
|
22
|
-
"kalibr-connect = kalibr.__main__:main",
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
python_requires=">=3.9",
|
|
26
|
-
license="MIT",
|
|
27
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|