kalibr 1.1.3a0__py3-none-any.whl → 1.2.0__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 +19 -2
- kalibr/cli/capsule_cmd.py +1 -1
- kalibr/cli/main.py +3 -3
- kalibr/cli/run.py +1 -1
- kalibr/intelligence.py +317 -0
- {kalibr-1.1.3a0.dist-info → kalibr-1.2.0.dist-info}/METADATA +176 -62
- {kalibr-1.1.3a0.dist-info → kalibr-1.2.0.dist-info}/RECORD +14 -13
- kalibr-1.2.0.dist-info/licenses/LICENSE +190 -0
- kalibr_crewai/__init__.py +1 -1
- kalibr_langchain/__init__.py +1 -1
- kalibr_openai_agents/__init__.py +1 -1
- kalibr-1.1.3a0.dist-info/licenses/LICENSE +0 -21
- {kalibr-1.1.3a0.dist-info → kalibr-1.2.0.dist-info}/WHEEL +0 -0
- {kalibr-1.1.3a0.dist-info → kalibr-1.2.0.dist-info}/entry_points.txt +0 -0
- {kalibr-1.1.3a0.dist-info → kalibr-1.2.0.dist-info}/top_level.txt +0 -0
kalibr/__init__.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Kalibr SDK v1.
|
|
1
|
+
"""Kalibr SDK v1.2.0 - LLM Observability & Tracing Framework
|
|
2
2
|
|
|
3
3
|
Features:
|
|
4
4
|
- **Auto-Instrumentation**: Zero-config tracing of OpenAI, Anthropic, Google SDK calls
|
|
@@ -36,7 +36,7 @@ CLI Usage:
|
|
|
36
36
|
kalibr version # Show version
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
|
-
__version__ = "1.
|
|
39
|
+
__version__ = "1.2.0"
|
|
40
40
|
|
|
41
41
|
# Auto-instrument LLM SDKs on import (can be disabled via env var)
|
|
42
42
|
import os
|
|
@@ -71,6 +71,16 @@ from .trace_capsule import TraceCapsule, get_or_create_capsule
|
|
|
71
71
|
from .tracer import SpanContext, Tracer
|
|
72
72
|
from .utils import load_config_from_env
|
|
73
73
|
|
|
74
|
+
# ============================================================================
|
|
75
|
+
# INTELLIGENCE & OUTCOME ROUTING (v1.2.0)
|
|
76
|
+
# ============================================================================
|
|
77
|
+
from .intelligence import (
|
|
78
|
+
KalibrIntelligence,
|
|
79
|
+
get_policy,
|
|
80
|
+
report_outcome,
|
|
81
|
+
get_recommendation,
|
|
82
|
+
)
|
|
83
|
+
|
|
74
84
|
if os.getenv("KALIBR_AUTO_INSTRUMENT", "true").lower() == "true":
|
|
75
85
|
# Setup OpenTelemetry collector
|
|
76
86
|
try:
|
|
@@ -127,4 +137,11 @@ __all__ = [
|
|
|
127
137
|
"setup_collector",
|
|
128
138
|
"get_tracer_provider",
|
|
129
139
|
"is_collector_configured",
|
|
140
|
+
# ========================================================================
|
|
141
|
+
# INTELLIGENCE & OUTCOME ROUTING (v1.2.0)
|
|
142
|
+
# ========================================================================
|
|
143
|
+
"KalibrIntelligence",
|
|
144
|
+
"get_policy",
|
|
145
|
+
"report_outcome",
|
|
146
|
+
"get_recommendation",
|
|
130
147
|
]
|
kalibr/cli/capsule_cmd.py
CHANGED
|
@@ -63,7 +63,7 @@ def capsule(
|
|
|
63
63
|
kalibr capsule abc-123-def --export --output capsule.json
|
|
64
64
|
|
|
65
65
|
# Specify custom API URL
|
|
66
|
-
kalibr capsule abc-123-def -u https://api.kalibr.
|
|
66
|
+
kalibr capsule abc-123-def -u https://api.kalibr.systems
|
|
67
67
|
"""
|
|
68
68
|
# Determine API base URL
|
|
69
69
|
base_url = api_url or "https://api.kalibr.systems"
|
kalibr/cli/main.py
CHANGED
|
@@ -30,9 +30,9 @@ def version():
|
|
|
30
30
|
from kalibr import __version__
|
|
31
31
|
|
|
32
32
|
console.print(f"[bold]Kalibr SDK version:[/bold] {__version__}")
|
|
33
|
-
console.print("
|
|
34
|
-
console.print("
|
|
35
|
-
console.print("GitHub: https://github.com/
|
|
33
|
+
console.print("LLM Observability & Execution Intelligence")
|
|
34
|
+
console.print("Auto-instrumentation for OpenAI, Anthropic, Google AI")
|
|
35
|
+
console.print("GitHub: https://github.com/kalibr-ai/kalibr-sdk-python")
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
@app.command()
|
kalibr/cli/run.py
CHANGED
|
@@ -47,7 +47,7 @@ def run(
|
|
|
47
47
|
kalibr run weather.py --runtime fly.io
|
|
48
48
|
|
|
49
49
|
# Custom backend
|
|
50
|
-
kalibr run weather.py --backend-url https://api.kalibr.
|
|
50
|
+
kalibr run weather.py --backend-url https://api.kalibr.systems
|
|
51
51
|
"""
|
|
52
52
|
# Validate file exists
|
|
53
53
|
agent_path = Path(file_path).resolve()
|
kalibr/intelligence.py
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"""Kalibr Intelligence Client - Query execution intelligence and report outcomes.
|
|
2
|
+
|
|
3
|
+
This module enables the outcome-conditioned routing loop:
|
|
4
|
+
1. Before executing: query get_policy() to get the best path for your goal
|
|
5
|
+
2. After executing: call report_outcome() to teach Kalibr what worked
|
|
6
|
+
|
|
7
|
+
Example:
|
|
8
|
+
from kalibr import get_policy, report_outcome
|
|
9
|
+
|
|
10
|
+
# Before executing - get best path
|
|
11
|
+
policy = get_policy(goal="book_meeting")
|
|
12
|
+
model = policy["recommended_model"] # Use this model
|
|
13
|
+
|
|
14
|
+
# After executing - report what happened
|
|
15
|
+
report_outcome(
|
|
16
|
+
trace_id=trace_id,
|
|
17
|
+
goal="book_meeting",
|
|
18
|
+
success=True
|
|
19
|
+
)
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
import os
|
|
25
|
+
from typing import Any, Optional
|
|
26
|
+
|
|
27
|
+
import httpx
|
|
28
|
+
|
|
29
|
+
# Default intelligence API endpoint
|
|
30
|
+
DEFAULT_INTELLIGENCE_URL = "https://kalibr-intelligence.fly.dev"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class KalibrIntelligence:
|
|
34
|
+
"""Client for Kalibr Intelligence API.
|
|
35
|
+
|
|
36
|
+
Provides methods to query execution policies and report outcomes
|
|
37
|
+
for the outcome-conditioned routing loop.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
api_key: Kalibr API key (or set KALIBR_API_KEY env var)
|
|
41
|
+
tenant_id: Tenant identifier (or set KALIBR_TENANT_ID env var)
|
|
42
|
+
base_url: Intelligence API base URL (or set KALIBR_INTELLIGENCE_URL env var)
|
|
43
|
+
timeout: Request timeout in seconds
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
api_key: str | None = None,
|
|
49
|
+
tenant_id: str | None = None,
|
|
50
|
+
base_url: str | None = None,
|
|
51
|
+
timeout: float = 10.0,
|
|
52
|
+
):
|
|
53
|
+
self.api_key = api_key or os.getenv("KALIBR_API_KEY", "")
|
|
54
|
+
self.tenant_id = tenant_id or os.getenv("KALIBR_TENANT_ID", "")
|
|
55
|
+
self.base_url = (
|
|
56
|
+
base_url
|
|
57
|
+
or os.getenv("KALIBR_INTELLIGENCE_URL", DEFAULT_INTELLIGENCE_URL)
|
|
58
|
+
).rstrip("/")
|
|
59
|
+
self.timeout = timeout
|
|
60
|
+
self._client = httpx.Client(timeout=timeout)
|
|
61
|
+
|
|
62
|
+
def _request(
|
|
63
|
+
self,
|
|
64
|
+
method: str,
|
|
65
|
+
path: str,
|
|
66
|
+
json: dict | None = None,
|
|
67
|
+
) -> httpx.Response:
|
|
68
|
+
"""Make authenticated request to intelligence API."""
|
|
69
|
+
headers = {
|
|
70
|
+
"X-API-Key": self.api_key,
|
|
71
|
+
"X-Tenant-ID": self.tenant_id,
|
|
72
|
+
"Content-Type": "application/json",
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
url = f"{self.base_url}{path}"
|
|
76
|
+
response = self._client.request(method, url, json=json, headers=headers)
|
|
77
|
+
response.raise_for_status()
|
|
78
|
+
return response
|
|
79
|
+
|
|
80
|
+
def get_policy(
|
|
81
|
+
self,
|
|
82
|
+
goal: str,
|
|
83
|
+
task_type: str | None = None,
|
|
84
|
+
constraints: dict | None = None,
|
|
85
|
+
window_hours: int = 168,
|
|
86
|
+
) -> dict[str, Any]:
|
|
87
|
+
"""Get execution policy for a goal.
|
|
88
|
+
|
|
89
|
+
Returns the historically best-performing path for achieving
|
|
90
|
+
the specified goal, based on outcome data.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
goal: The goal to optimize for (e.g., "book_meeting", "resolve_ticket")
|
|
94
|
+
task_type: Optional task type filter (e.g., "code", "summarize")
|
|
95
|
+
constraints: Optional constraints dict with keys:
|
|
96
|
+
- max_cost_usd: Maximum cost per request
|
|
97
|
+
- max_latency_ms: Maximum latency
|
|
98
|
+
- min_quality: Minimum quality score (0-1)
|
|
99
|
+
- min_confidence: Minimum statistical confidence (0-1)
|
|
100
|
+
- max_risk: Maximum risk score (0-1)
|
|
101
|
+
window_hours: Time window for pattern analysis (default 1 week)
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
dict with:
|
|
105
|
+
- goal: The goal queried
|
|
106
|
+
- recommended_model: Best model for this goal
|
|
107
|
+
- recommended_provider: Provider for the recommended model
|
|
108
|
+
- outcome_success_rate: Historical success rate (0-1)
|
|
109
|
+
- outcome_sample_count: Number of outcomes in the data
|
|
110
|
+
- confidence: Statistical confidence in recommendation
|
|
111
|
+
- risk_score: Risk score (lower is better)
|
|
112
|
+
- reasoning: Human-readable explanation
|
|
113
|
+
- alternatives: List of alternative models
|
|
114
|
+
|
|
115
|
+
Raises:
|
|
116
|
+
httpx.HTTPStatusError: If the API returns an error
|
|
117
|
+
|
|
118
|
+
Example:
|
|
119
|
+
policy = intelligence.get_policy(goal="book_meeting")
|
|
120
|
+
print(f"Use {policy['recommended_model']} - {policy['outcome_success_rate']:.0%} success rate")
|
|
121
|
+
"""
|
|
122
|
+
response = self._request(
|
|
123
|
+
"POST",
|
|
124
|
+
"/api/v1/intelligence/policy",
|
|
125
|
+
json={
|
|
126
|
+
"goal": goal,
|
|
127
|
+
"task_type": task_type,
|
|
128
|
+
"constraints": constraints,
|
|
129
|
+
"window_hours": window_hours,
|
|
130
|
+
},
|
|
131
|
+
)
|
|
132
|
+
return response.json()
|
|
133
|
+
|
|
134
|
+
def report_outcome(
|
|
135
|
+
self,
|
|
136
|
+
trace_id: str,
|
|
137
|
+
goal: str,
|
|
138
|
+
success: bool,
|
|
139
|
+
score: float | None = None,
|
|
140
|
+
failure_reason: str | None = None,
|
|
141
|
+
metadata: dict | None = None,
|
|
142
|
+
) -> dict[str, Any]:
|
|
143
|
+
"""Report execution outcome for a goal.
|
|
144
|
+
|
|
145
|
+
This is the feedback loop that teaches Kalibr what works.
|
|
146
|
+
Call this after your agent completes (or fails) a task.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
trace_id: The trace ID from the execution
|
|
150
|
+
goal: The goal this execution was trying to achieve
|
|
151
|
+
success: Whether the goal was achieved
|
|
152
|
+
score: Optional quality score (0-1) for more granular feedback
|
|
153
|
+
failure_reason: Optional reason for failure (helps with debugging)
|
|
154
|
+
metadata: Optional additional context as a dict
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
dict with:
|
|
158
|
+
- status: "accepted" if successful
|
|
159
|
+
- trace_id: The trace ID recorded
|
|
160
|
+
- goal: The goal recorded
|
|
161
|
+
|
|
162
|
+
Raises:
|
|
163
|
+
httpx.HTTPStatusError: If the API returns an error
|
|
164
|
+
|
|
165
|
+
Example:
|
|
166
|
+
# Success case
|
|
167
|
+
report_outcome(trace_id="abc123", goal="book_meeting", success=True)
|
|
168
|
+
|
|
169
|
+
# Failure case with reason
|
|
170
|
+
report_outcome(
|
|
171
|
+
trace_id="abc123",
|
|
172
|
+
goal="book_meeting",
|
|
173
|
+
success=False,
|
|
174
|
+
failure_reason="calendar_conflict"
|
|
175
|
+
)
|
|
176
|
+
"""
|
|
177
|
+
response = self._request(
|
|
178
|
+
"POST",
|
|
179
|
+
"/api/v1/intelligence/report-outcome",
|
|
180
|
+
json={
|
|
181
|
+
"trace_id": trace_id,
|
|
182
|
+
"goal": goal,
|
|
183
|
+
"success": success,
|
|
184
|
+
"score": score,
|
|
185
|
+
"failure_reason": failure_reason,
|
|
186
|
+
"metadata": metadata,
|
|
187
|
+
},
|
|
188
|
+
)
|
|
189
|
+
return response.json()
|
|
190
|
+
|
|
191
|
+
def get_recommendation(
|
|
192
|
+
self,
|
|
193
|
+
task_type: str,
|
|
194
|
+
goal: str | None = None,
|
|
195
|
+
optimize_for: str = "balanced",
|
|
196
|
+
constraints: dict | None = None,
|
|
197
|
+
window_hours: int = 168,
|
|
198
|
+
) -> dict[str, Any]:
|
|
199
|
+
"""Get model recommendation for a task type.
|
|
200
|
+
|
|
201
|
+
This is the original recommendation endpoint. For goal-based
|
|
202
|
+
optimization, prefer get_policy() instead.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
task_type: Type of task (e.g., "summarize", "code", "qa")
|
|
206
|
+
goal: Optional goal for outcome-based optimization
|
|
207
|
+
optimize_for: Optimization target - one of:
|
|
208
|
+
- "cost": Minimize cost
|
|
209
|
+
- "quality": Maximize output quality
|
|
210
|
+
- "latency": Minimize response time
|
|
211
|
+
- "balanced": Balance all factors (default)
|
|
212
|
+
- "cost_efficiency": Maximize quality-per-dollar
|
|
213
|
+
- "outcome": Optimize for goal success rate
|
|
214
|
+
constraints: Optional constraints dict
|
|
215
|
+
window_hours: Time window for pattern analysis
|
|
216
|
+
|
|
217
|
+
Returns:
|
|
218
|
+
dict with recommendation, alternatives, stats, reasoning
|
|
219
|
+
"""
|
|
220
|
+
response = self._request(
|
|
221
|
+
"POST",
|
|
222
|
+
"/api/v1/intelligence/recommend",
|
|
223
|
+
json={
|
|
224
|
+
"task_type": task_type,
|
|
225
|
+
"goal": goal,
|
|
226
|
+
"optimize_for": optimize_for,
|
|
227
|
+
"constraints": constraints,
|
|
228
|
+
"window_hours": window_hours,
|
|
229
|
+
},
|
|
230
|
+
)
|
|
231
|
+
return response.json()
|
|
232
|
+
|
|
233
|
+
def close(self):
|
|
234
|
+
"""Close the HTTP client."""
|
|
235
|
+
self._client.close()
|
|
236
|
+
|
|
237
|
+
def __enter__(self):
|
|
238
|
+
return self
|
|
239
|
+
|
|
240
|
+
def __exit__(self, *args):
|
|
241
|
+
self.close()
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
# Module-level singleton for convenience functions
|
|
245
|
+
_intelligence_client: KalibrIntelligence | None = None
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def _get_intelligence_client() -> KalibrIntelligence:
|
|
249
|
+
"""Get or create the singleton intelligence client."""
|
|
250
|
+
global _intelligence_client
|
|
251
|
+
if _intelligence_client is None:
|
|
252
|
+
_intelligence_client = KalibrIntelligence()
|
|
253
|
+
return _intelligence_client
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def get_policy(goal: str, tenant_id: str | None = None, **kwargs) -> dict[str, Any]:
|
|
257
|
+
"""Get execution policy for a goal.
|
|
258
|
+
|
|
259
|
+
Convenience function that uses the default intelligence client.
|
|
260
|
+
See KalibrIntelligence.get_policy for full documentation.
|
|
261
|
+
|
|
262
|
+
Args:
|
|
263
|
+
goal: The goal to optimize for
|
|
264
|
+
tenant_id: Optional tenant ID override (default: uses KALIBR_TENANT_ID env var)
|
|
265
|
+
**kwargs: Additional arguments (task_type, constraints, window_hours)
|
|
266
|
+
|
|
267
|
+
Returns:
|
|
268
|
+
Policy dict with recommended_model, outcome_success_rate, etc.
|
|
269
|
+
|
|
270
|
+
Example:
|
|
271
|
+
from kalibr import get_policy
|
|
272
|
+
|
|
273
|
+
policy = get_policy(goal="book_meeting")
|
|
274
|
+
model = policy["recommended_model"]
|
|
275
|
+
"""
|
|
276
|
+
client = _get_intelligence_client()
|
|
277
|
+
if tenant_id:
|
|
278
|
+
# Create a new client with the specified tenant_id
|
|
279
|
+
client = KalibrIntelligence(tenant_id=tenant_id)
|
|
280
|
+
return client.get_policy(goal, **kwargs)
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
def report_outcome(trace_id: str, goal: str, success: bool, tenant_id: str | None = None, **kwargs) -> dict[str, Any]:
|
|
284
|
+
"""Report execution outcome for a goal.
|
|
285
|
+
|
|
286
|
+
Convenience function that uses the default intelligence client.
|
|
287
|
+
See KalibrIntelligence.report_outcome for full documentation.
|
|
288
|
+
|
|
289
|
+
Args:
|
|
290
|
+
trace_id: The trace ID from the execution
|
|
291
|
+
goal: The goal this execution was trying to achieve
|
|
292
|
+
success: Whether the goal was achieved
|
|
293
|
+
tenant_id: Optional tenant ID override (default: uses KALIBR_TENANT_ID env var)
|
|
294
|
+
**kwargs: Additional arguments (score, failure_reason, metadata)
|
|
295
|
+
|
|
296
|
+
Returns:
|
|
297
|
+
Response dict with status confirmation
|
|
298
|
+
|
|
299
|
+
Example:
|
|
300
|
+
from kalibr import report_outcome
|
|
301
|
+
|
|
302
|
+
report_outcome(trace_id="abc123", goal="book_meeting", success=True)
|
|
303
|
+
"""
|
|
304
|
+
client = _get_intelligence_client()
|
|
305
|
+
if tenant_id:
|
|
306
|
+
# Create a new client with the specified tenant_id
|
|
307
|
+
client = KalibrIntelligence(tenant_id=tenant_id)
|
|
308
|
+
return client.report_outcome(trace_id, goal, success, **kwargs)
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
def get_recommendation(task_type: str, **kwargs) -> dict[str, Any]:
|
|
312
|
+
"""Get model recommendation for a task type.
|
|
313
|
+
|
|
314
|
+
Convenience function that uses the default intelligence client.
|
|
315
|
+
See KalibrIntelligence.get_recommendation for full documentation.
|
|
316
|
+
"""
|
|
317
|
+
return _get_intelligence_client().get_recommendation(task_type, **kwargs)
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kalibr
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Unified LLM Observability & Multi-Model AI Integration Framework - Deploy to GPT, Claude, Gemini, Copilot with full telemetry.
|
|
5
|
-
Author-email: Kalibr Team <
|
|
6
|
-
License:
|
|
5
|
+
Author-email: Kalibr Team <support@kalibr.systems>
|
|
6
|
+
License: Apache-2.0
|
|
7
7
|
Project-URL: Homepage, https://github.com/kalibr-ai/kalibr-sdk-python
|
|
8
|
-
Project-URL: Documentation, https://
|
|
8
|
+
Project-URL: Documentation, https://kalibr.systems/docs
|
|
9
9
|
Project-URL: Repository, https://github.com/kalibr-ai/kalibr-sdk-python
|
|
10
10
|
Project-URL: Issues, https://github.com/kalibr-ai/kalibr-sdk-python/issues
|
|
11
11
|
Keywords: ai,mcp,gpt,claude,gemini,copilot,openai,anthropic,google,microsoft,observability,telemetry,tracing,llm,schema-generation,api,multi-model,langchain,crewai
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved ::
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.8
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.9
|
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
-
Requires-Python: >=3.
|
|
23
|
+
Requires-Python: >=3.9
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
25
|
License-File: LICENSE
|
|
26
26
|
Requires-Dist: httpx>=0.27.0
|
|
@@ -68,15 +68,20 @@ Dynamic: license-file
|
|
|
68
68
|
|
|
69
69
|
# Kalibr Python SDK
|
|
70
70
|
|
|
71
|
-
Production-grade observability for LLM applications. Automatically instrument OpenAI, Anthropic, and Google AI SDKs with zero code changes.
|
|
71
|
+
Production-grade observability and execution intelligence for LLM applications. Automatically instrument OpenAI, Anthropic, and Google AI SDKs with zero code changes.
|
|
72
|
+
|
|
73
|
+
[](https://pypi.org/project/kalibr/)
|
|
74
|
+
[](https://pypi.org/project/kalibr/)
|
|
75
|
+
[](LICENSE)
|
|
72
76
|
|
|
73
77
|
## Features
|
|
74
78
|
|
|
75
|
-
- **Zero-code instrumentation** - Automatic tracing for OpenAI, Anthropic, and Google AI
|
|
79
|
+
- **Zero-code instrumentation** - Automatic tracing for OpenAI, Anthropic, and Google AI SDKs
|
|
80
|
+
- **Outcome-conditioned routing** - Query for optimal models based on historical success rates
|
|
81
|
+
- **TraceCapsule** - Cross-agent context propagation for multi-agent systems
|
|
76
82
|
- **Cost tracking** - Real-time cost calculation for all LLM calls
|
|
77
83
|
- **Token monitoring** - Track input/output tokens across providers
|
|
78
|
-
- **
|
|
79
|
-
- **Multi-provider support** - Works with GPT-4, Claude, Gemini, and more
|
|
84
|
+
- **Framework integrations** - LangChain, CrewAI, OpenAI Agents SDK
|
|
80
85
|
|
|
81
86
|
## Installation
|
|
82
87
|
|
|
@@ -91,32 +96,28 @@ pip install kalibr
|
|
|
91
96
|
Simply import `kalibr` at the start of your application - all LLM calls are automatically traced:
|
|
92
97
|
|
|
93
98
|
```python
|
|
94
|
-
import kalibr #
|
|
95
|
-
import
|
|
96
|
-
|
|
97
|
-
# Set your Kalibr API key
|
|
98
|
-
import os
|
|
99
|
-
os.environ["KALIBR_API_KEY"] = "your-kalibr-api-key"
|
|
99
|
+
import kalibr # Must be FIRST import
|
|
100
|
+
from openai import OpenAI
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
client = openai.OpenAI()
|
|
102
|
+
client = OpenAI()
|
|
103
103
|
response = client.chat.completions.create(
|
|
104
104
|
model="gpt-4o",
|
|
105
105
|
messages=[{"role": "user", "content": "Hello!"}]
|
|
106
106
|
)
|
|
107
|
+
# That's it. The call is automatically traced.
|
|
107
108
|
```
|
|
108
109
|
|
|
109
|
-
### Manual Tracing with Decorator
|
|
110
|
+
### Manual Tracing with @trace Decorator
|
|
110
111
|
|
|
111
112
|
For more control, use the `@trace` decorator:
|
|
112
113
|
|
|
113
114
|
```python
|
|
114
115
|
from kalibr import trace
|
|
115
|
-
import
|
|
116
|
+
from openai import OpenAI
|
|
116
117
|
|
|
117
118
|
@trace(operation="summarize", provider="openai", model="gpt-4o")
|
|
118
119
|
def summarize_text(text: str) -> str:
|
|
119
|
-
client =
|
|
120
|
+
client = OpenAI()
|
|
120
121
|
response = client.chat.completions.create(
|
|
121
122
|
model="gpt-4o",
|
|
122
123
|
messages=[
|
|
@@ -125,64 +126,188 @@ def summarize_text(text: str) -> str:
|
|
|
125
126
|
]
|
|
126
127
|
)
|
|
127
128
|
return response.choices[0].message.content
|
|
128
|
-
|
|
129
|
-
result = summarize_text("Your long text here...")
|
|
130
129
|
```
|
|
131
130
|
|
|
132
131
|
### Multi-Provider Example
|
|
133
132
|
|
|
134
133
|
```python
|
|
135
134
|
import kalibr
|
|
136
|
-
import
|
|
137
|
-
import
|
|
135
|
+
from openai import OpenAI
|
|
136
|
+
from anthropic import Anthropic
|
|
137
|
+
|
|
138
|
+
# Both are automatically traced
|
|
139
|
+
openai_client = OpenAI()
|
|
140
|
+
anthropic_client = Anthropic()
|
|
138
141
|
|
|
139
|
-
# OpenAI call - automatically traced
|
|
140
|
-
openai_client = openai.OpenAI()
|
|
141
142
|
gpt_response = openai_client.chat.completions.create(
|
|
142
143
|
model="gpt-4o",
|
|
143
144
|
messages=[{"role": "user", "content": "Explain quantum computing"}]
|
|
144
145
|
)
|
|
145
146
|
|
|
146
|
-
# Anthropic call - automatically traced
|
|
147
|
-
anthropic_client = anthropic.Anthropic()
|
|
148
147
|
claude_response = anthropic_client.messages.create(
|
|
149
|
-
model="claude-sonnet-
|
|
148
|
+
model="claude-3-5-sonnet-20241022",
|
|
150
149
|
max_tokens=1024,
|
|
151
150
|
messages=[{"role": "user", "content": "Explain machine learning"}]
|
|
152
151
|
)
|
|
153
152
|
```
|
|
154
153
|
|
|
154
|
+
## Outcome-Conditioned Routing
|
|
155
|
+
|
|
156
|
+
Query Kalibr for optimal model recommendations based on real execution outcomes:
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
from kalibr import get_policy, report_outcome
|
|
160
|
+
|
|
161
|
+
# Before executing - get the best model for your goal
|
|
162
|
+
policy = get_policy(goal="book_meeting")
|
|
163
|
+
print(f"Use {policy['recommended_model']} - {policy['outcome_success_rate']:.0%} success rate")
|
|
164
|
+
|
|
165
|
+
# Execute with the recommended model
|
|
166
|
+
# ...
|
|
167
|
+
|
|
168
|
+
# After executing - report what happened
|
|
169
|
+
report_outcome(
|
|
170
|
+
trace_id="abc123",
|
|
171
|
+
goal="book_meeting",
|
|
172
|
+
success=True
|
|
173
|
+
)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### With Constraints
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
from kalibr import get_policy
|
|
180
|
+
|
|
181
|
+
policy = get_policy(
|
|
182
|
+
goal="resolve_ticket",
|
|
183
|
+
constraints={
|
|
184
|
+
"max_cost_usd": 0.05,
|
|
185
|
+
"max_latency_ms": 3000,
|
|
186
|
+
"min_quality": 0.8
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## TraceCapsule - Cross-Agent Tracing
|
|
192
|
+
|
|
193
|
+
Propagate trace context across agent boundaries:
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
from kalibr import TraceCapsule, get_or_create_capsule
|
|
197
|
+
|
|
198
|
+
# Agent 1: Create capsule and add hop
|
|
199
|
+
capsule = get_or_create_capsule()
|
|
200
|
+
capsule.append_hop({
|
|
201
|
+
"provider": "openai",
|
|
202
|
+
"operation": "chat_completion",
|
|
203
|
+
"model": "gpt-4o",
|
|
204
|
+
"duration_ms": 150,
|
|
205
|
+
"cost_usd": 0.002,
|
|
206
|
+
"status": "success"
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
# Pass to Agent 2 via HTTP header
|
|
210
|
+
headers = {"X-Kalibr-Capsule": capsule.to_json()}
|
|
211
|
+
|
|
212
|
+
# Agent 2: Receive and continue
|
|
213
|
+
capsule = TraceCapsule.from_json(headers["X-Kalibr-Capsule"])
|
|
214
|
+
capsule.append_hop({
|
|
215
|
+
"provider": "anthropic",
|
|
216
|
+
"operation": "chat_completion",
|
|
217
|
+
"model": "claude-3-5-sonnet-20241022",
|
|
218
|
+
"duration_ms": 200,
|
|
219
|
+
"cost_usd": 0.003,
|
|
220
|
+
"status": "success"
|
|
221
|
+
})
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Framework Integrations
|
|
225
|
+
|
|
226
|
+
### LangChain
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
pip install kalibr[langchain]
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
```python
|
|
233
|
+
from kalibr_langchain import KalibrCallbackHandler
|
|
234
|
+
from langchain_openai import ChatOpenAI
|
|
235
|
+
|
|
236
|
+
handler = KalibrCallbackHandler()
|
|
237
|
+
llm = ChatOpenAI(model="gpt-4o", callbacks=[handler])
|
|
238
|
+
response = llm.invoke("What is the capital of France?")
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
See [LangChain Integration Guide](kalibr_langchain/README.md) for full documentation.
|
|
242
|
+
|
|
243
|
+
### CrewAI
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
pip install kalibr[crewai]
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
from kalibr_crewai import KalibrCrewAIInstrumentor
|
|
251
|
+
from crewai import Agent, Task, Crew
|
|
252
|
+
|
|
253
|
+
instrumentor = KalibrCrewAIInstrumentor()
|
|
254
|
+
instrumentor.instrument()
|
|
255
|
+
|
|
256
|
+
# Use CrewAI normally - all operations are traced
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
See [CrewAI Integration Guide](kalibr_crewai/README.md) for full documentation.
|
|
260
|
+
|
|
261
|
+
### OpenAI Agents SDK
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
pip install kalibr[openai-agents]
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
from kalibr_openai_agents import setup_kalibr_tracing
|
|
269
|
+
from agents import Agent, Runner
|
|
270
|
+
|
|
271
|
+
setup_kalibr_tracing()
|
|
272
|
+
|
|
273
|
+
agent = Agent(name="Assistant", instructions="You are helpful.")
|
|
274
|
+
result = Runner.run_sync(agent, "Hello!")
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
See [OpenAI Agents Integration Guide](kalibr_openai_agents/README.md) for full documentation.
|
|
278
|
+
|
|
155
279
|
## Configuration
|
|
156
280
|
|
|
157
|
-
Configure
|
|
281
|
+
Configure via environment variables:
|
|
158
282
|
|
|
159
283
|
| Variable | Description | Default |
|
|
160
284
|
|----------|-------------|---------|
|
|
161
285
|
| `KALIBR_API_KEY` | API key for authentication | *Required* |
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
| `KALIBR_SERVICE_NAME` | Service name for
|
|
166
|
-
| `KALIBR_ENVIRONMENT` | Environment (prod
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
286
|
+
| `KALIBR_TENANT_ID` | Tenant identifier | `default` |
|
|
287
|
+
| `KALIBR_COLLECTOR_URL` | Collector endpoint URL | `https://api.kalibr.systems/api/ingest` |
|
|
288
|
+
| `KALIBR_INTELLIGENCE_URL` | Intelligence API URL | `https://kalibr-intelligence.fly.dev` |
|
|
289
|
+
| `KALIBR_SERVICE_NAME` | Service name for spans | `kalibr-app` |
|
|
290
|
+
| `KALIBR_ENVIRONMENT` | Environment (prod/staging/dev) | `prod` |
|
|
291
|
+
| `KALIBR_WORKFLOW_ID` | Workflow identifier | `default` |
|
|
292
|
+
| `KALIBR_AUTO_INSTRUMENT` | Enable auto-instrumentation | `true` |
|
|
169
293
|
|
|
170
|
-
## CLI
|
|
171
|
-
|
|
172
|
-
The SDK includes command-line tools for running and deploying applications:
|
|
294
|
+
## CLI Commands
|
|
173
295
|
|
|
174
296
|
```bash
|
|
175
|
-
#
|
|
297
|
+
# Serve your app with tracing
|
|
176
298
|
kalibr serve myapp.py
|
|
177
299
|
|
|
178
|
-
# Run with managed runtime
|
|
300
|
+
# Run with managed runtime
|
|
179
301
|
kalibr run myapp.py --port 8000
|
|
180
302
|
|
|
181
303
|
# Deploy to cloud platforms
|
|
182
304
|
kalibr deploy myapp.py --runtime fly.io
|
|
183
305
|
|
|
184
|
-
# Fetch trace
|
|
306
|
+
# Fetch trace capsule by ID
|
|
185
307
|
kalibr capsule <trace-id>
|
|
308
|
+
|
|
309
|
+
# Show version
|
|
310
|
+
kalibr version
|
|
186
311
|
```
|
|
187
312
|
|
|
188
313
|
## Supported Providers
|
|
@@ -190,27 +315,15 @@ kalibr capsule <trace-id>
|
|
|
190
315
|
| Provider | Models | Auto-Instrumentation |
|
|
191
316
|
|----------|--------|---------------------|
|
|
192
317
|
| OpenAI | GPT-4, GPT-4o, GPT-3.5 | Yes |
|
|
193
|
-
| Anthropic | Claude 3
|
|
318
|
+
| Anthropic | Claude 3.5 Sonnet, Claude 3 Opus/Sonnet/Haiku | Yes |
|
|
194
319
|
| Google | Gemini Pro, Gemini Flash | Yes |
|
|
195
320
|
|
|
196
|
-
## Examples
|
|
197
|
-
|
|
198
|
-
See the [`examples/`](./examples) directory for complete examples:
|
|
199
|
-
|
|
200
|
-
- `basic_example.py` - Simple tracing example
|
|
201
|
-
- `basic_agent.py` - Agent with auto-instrumentation
|
|
202
|
-
- `advanced_example.py` - Advanced tracing patterns
|
|
203
|
-
- `cross_vendor.py` - Multi-provider workflows
|
|
204
|
-
- `test_mas.py` - Multi-agent system demonstration
|
|
205
|
-
|
|
206
321
|
## Development
|
|
207
322
|
|
|
208
323
|
```bash
|
|
209
|
-
# Clone the repository
|
|
210
324
|
git clone https://github.com/kalibr-ai/kalibr-sdk-python.git
|
|
211
325
|
cd kalibr-sdk-python
|
|
212
326
|
|
|
213
|
-
# Install in development mode
|
|
214
327
|
pip install -e ".[dev]"
|
|
215
328
|
|
|
216
329
|
# Run tests
|
|
@@ -223,14 +336,15 @@ ruff check kalibr/
|
|
|
223
336
|
|
|
224
337
|
## Contributing
|
|
225
338
|
|
|
226
|
-
We welcome contributions!
|
|
339
|
+
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
227
340
|
|
|
228
341
|
## License
|
|
229
342
|
|
|
230
|
-
|
|
343
|
+
Apache 2.0 - see [LICENSE](LICENSE).
|
|
231
344
|
|
|
232
345
|
## Links
|
|
233
346
|
|
|
234
|
-
- [Documentation](https://
|
|
235
|
-
- [
|
|
236
|
-
- [
|
|
347
|
+
- [Documentation](https://kalibr.systems/docs)
|
|
348
|
+
- [Dashboard](https://dashboard.kalibr.systems)
|
|
349
|
+
- [GitHub](https://github.com/kalibr-ai/kalibr-sdk-python)
|
|
350
|
+
- [PyPI](https://pypi.org/project/kalibr/)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
kalibr/__init__.py,sha256=
|
|
1
|
+
kalibr/__init__.py,sha256=16g-LPXiB_10TUcUeNzTy_EL5npqCFGYWJF-IhWpWDY,4889
|
|
2
2
|
kalibr/__main__.py,sha256=jO96I4pqinwHg7ONRvNVKbySBh5pSIhOAiNrgSQrNlY,110
|
|
3
3
|
kalibr/capsule_middleware.py,sha256=pXG_wORgCqo3wHjtkn_zY4doLyiDmTwJtB7XiZNnbPk,3163
|
|
4
4
|
kalibr/client.py,sha256=6D1paakE6zgWJStaow3ak9t0R8afodQhSSpUO3WTs_8,9732
|
|
@@ -6,6 +6,7 @@ kalibr/collector.py,sha256=rtTKQLe6NkDSblBIfFooQ-ESFcP0Q1HUp4Bcqqg8JFo,5818
|
|
|
6
6
|
kalibr/context.py,sha256=hBxWXZx0gcmeGqDMS1rstke_DmrujoRBIsfrG26WKUY,3755
|
|
7
7
|
kalibr/cost_adapter.py,sha256=NerJ7ywaJjBn97gVFr7qKX7318e3Kmy2qqeNlGl9nPE,6439
|
|
8
8
|
kalibr/decorators.py,sha256=m-XBXxWMDVrzaNsljACiGmeGhgiHj_MqSfj6OGK3L5I,4380
|
|
9
|
+
kalibr/intelligence.py,sha256=oW_GFDHj5NEa-9L2y4jZcDsEQt81P77PpCuY--aIzLY,10889
|
|
9
10
|
kalibr/kalibr.py,sha256=cNXC3W_TX5SvGsy1lRopkwFqsHOpyd1kkVjEMOz1Yr4,6084
|
|
10
11
|
kalibr/kalibr_app.py,sha256=ItZwEh0FZPx9_BE-zPQajC2yxI2y9IHYwJD0k9tbHvY,2773
|
|
11
12
|
kalibr/models.py,sha256=HwD_-iysZMSnCzMQYO1Qcf0aeXySupY7yJeBwl_dLS0,1024
|
|
@@ -19,10 +20,10 @@ kalibr/tracer.py,sha256=jwWBpZbGXn6fEv4pw25BLFCH-22QUbyzofPWp1Iwdkk,11911
|
|
|
19
20
|
kalibr/types.py,sha256=cna4-akpdwfHXfOJCtVIq5lO_jaoG2Am3BRrXi0Vo34,895
|
|
20
21
|
kalibr/utils.py,sha256=DJ9Mp6IPzyQTKboVV0utnfFBMT7LbJ9vAs0gOOPCpvw,5052
|
|
21
22
|
kalibr/cli/__init__.py,sha256=FmRGaDMhM9DhrKg1ONkF0emIrJcjFWjlFBl_oenvpsk,77
|
|
22
|
-
kalibr/cli/capsule_cmd.py,sha256=
|
|
23
|
+
kalibr/cli/capsule_cmd.py,sha256=fHhC7-VpPskVxJiIbpSe7eVPNq0xIWeXCBVUOWGcqrw,6097
|
|
23
24
|
kalibr/cli/deploy_cmd.py,sha256=kV4uqCN2IdQev1vPBY5qqIHsEhjGBZ7y_rLx8RGAL_4,5178
|
|
24
|
-
kalibr/cli/main.py,sha256=
|
|
25
|
-
kalibr/cli/run.py,sha256=
|
|
25
|
+
kalibr/cli/main.py,sha256=FrOSIACNARkrvq-J2SZhyPNWNCdNEMZlD69PEV3uCMA,1924
|
|
26
|
+
kalibr/cli/run.py,sha256=bkdyNGrzUdcHg8XVvvWD7w8zV8Q4eQwUSFR-Bd_Asd0,6433
|
|
26
27
|
kalibr/cli/serve.py,sha256=71Xha35qrBNkcQxuUkwC-ixbOriHGUIEgxl7C_qERQo,2085
|
|
27
28
|
kalibr/instrumentation/__init__.py,sha256=YnUJ4gUH8WNxdVv5t1amn0l2WUULJG2MuQIL2ZZhn04,354
|
|
28
29
|
kalibr/instrumentation/anthropic_instr.py,sha256=ozXHr8BPMafIbvgaxunskQi9YX5_Gpoiekye77oRc2E,10058
|
|
@@ -32,17 +33,17 @@ kalibr/instrumentation/openai_instr.py,sha256=UU0Pi1Gq1FqgetYWDacQhNFdjemuPrc0hR
|
|
|
32
33
|
kalibr/instrumentation/registry.py,sha256=sfQnXhbPOI5LVon2kFhe8KcXQwWmuKW1XUe50B2AaBc,4749
|
|
33
34
|
kalibr/middleware/__init__.py,sha256=qyDUn_irAX67MS-IkuDVxg4RmFnJHDf_BfIT3qfGoBI,115
|
|
34
35
|
kalibr/middleware/auto_tracer.py,sha256=ZBSBM0O3a6rwVzfik1n5NUmQDah8_iaf86rU64aPYT4,13037
|
|
35
|
-
kalibr-1.
|
|
36
|
-
kalibr_crewai/__init__.py,sha256=
|
|
36
|
+
kalibr-1.2.0.dist-info/licenses/LICENSE,sha256=5mwAnB38l3_PjmOQn6_L6cZnJvus143DUjMBPIH1yso,10768
|
|
37
|
+
kalibr_crewai/__init__.py,sha256=b0HFTiE80eArtSMBOIEKu1JM6KU0tCjEylKCVVVF29Q,1796
|
|
37
38
|
kalibr_crewai/callbacks.py,sha256=UBgGw0vdT0Jf9x8fNrHfsUR4unqX4nxNFta07OoSgaI,17162
|
|
38
39
|
kalibr_crewai/instrumentor.py,sha256=AfnK5t7Ynb-7ytZF7XdOSPpr0o8hDf3sFkyzhc1ogY0,19465
|
|
39
|
-
kalibr_langchain/__init__.py,sha256=
|
|
40
|
+
kalibr_langchain/__init__.py,sha256=O4XYVyhLp1v-Y1kGZw3zD-tUK9wp0UX8Jt6oN0QTHN4,1373
|
|
40
41
|
kalibr_langchain/async_callback.py,sha256=_Mj_YrKbULNtfxixZ7iwiHyWEV9l178ZA5Oy5A5Pakk,27748
|
|
41
42
|
kalibr_langchain/callback.py,sha256=VVPAvksS8TFMC21QlGj-1NRFsWnkLKPyzqhfA3kmT4c,34265
|
|
42
|
-
kalibr_openai_agents/__init__.py,sha256=
|
|
43
|
+
kalibr_openai_agents/__init__.py,sha256=wL59LzGstptKigfQDrKKt_7hcMO1JGVQtVAsE0lz-Zw,1367
|
|
43
44
|
kalibr_openai_agents/processor.py,sha256=F550sdRf3rpguP1yOlgAUQWDLPBy4hSACV3-zOyCpOU,18257
|
|
44
|
-
kalibr-1.
|
|
45
|
-
kalibr-1.
|
|
46
|
-
kalibr-1.
|
|
47
|
-
kalibr-1.
|
|
48
|
-
kalibr-1.
|
|
45
|
+
kalibr-1.2.0.dist-info/METADATA,sha256=45tJcZAcqg575gr2HSIMRArUhbz9juYec_Mi8LdiW9E,10339
|
|
46
|
+
kalibr-1.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
47
|
+
kalibr-1.2.0.dist-info/entry_points.txt,sha256=Kojlc6WRX8V1qS9lOMdDPZpTUVHCtzGtHqXusErgmLY,47
|
|
48
|
+
kalibr-1.2.0.dist-info/top_level.txt,sha256=dIfBOWUnnHGFDwgz5zfIx5_0bU3wOUgAbYr4JcFHZmo,59
|
|
49
|
+
kalibr-1.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 Kalibr Systems Inc.
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
kalibr_crewai/__init__.py
CHANGED
|
@@ -46,7 +46,7 @@ Usage with Auto-Instrumentation:
|
|
|
46
46
|
|
|
47
47
|
Environment Variables:
|
|
48
48
|
KALIBR_API_KEY: API key for authentication
|
|
49
|
-
|
|
49
|
+
KALIBR_COLLECTOR_URL: Backend endpoint URL
|
|
50
50
|
KALIBR_TENANT_ID: Tenant identifier
|
|
51
51
|
KALIBR_ENVIRONMENT: Environment (prod/staging/dev)
|
|
52
52
|
KALIBR_SERVICE: Service name
|
kalibr_langchain/__init__.py
CHANGED
|
@@ -29,7 +29,7 @@ Usage:
|
|
|
29
29
|
|
|
30
30
|
Environment Variables:
|
|
31
31
|
KALIBR_API_KEY: API key for authentication
|
|
32
|
-
|
|
32
|
+
KALIBR_COLLECTOR_URL: Backend endpoint URL
|
|
33
33
|
KALIBR_TENANT_ID: Tenant identifier
|
|
34
34
|
KALIBR_ENVIRONMENT: Environment (prod/staging/dev)
|
|
35
35
|
KALIBR_SERVICE: Service name
|
kalibr_openai_agents/__init__.py
CHANGED
|
@@ -26,7 +26,7 @@ Usage:
|
|
|
26
26
|
|
|
27
27
|
Environment Variables:
|
|
28
28
|
KALIBR_API_KEY: API key for authentication
|
|
29
|
-
|
|
29
|
+
KALIBR_COLLECTOR_URL: Backend endpoint URL
|
|
30
30
|
KALIBR_TENANT_ID: Tenant identifier
|
|
31
31
|
KALIBR_ENVIRONMENT: Environment (prod/staging/dev)
|
|
32
32
|
KALIBR_SERVICE: Service name
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Kalibr
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|