theforge 0.1.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.
theforge/__init__.py ADDED
@@ -0,0 +1,67 @@
1
+ """TheForge SDK — Observability for AI agents.
2
+
3
+ MLflow-style tracing with automatic LLM call capture, parent-child span nesting,
4
+ and multi-framework support (Flask, FastAPI, Django, Starlette).
5
+
6
+ Usage:
7
+ from theforge import trace, SpanType, observe
8
+
9
+ # Decorator — works at module level before observe() is called
10
+ @trace(span_type=SpanType.TOOL)
11
+ async def web_search(query: str) -> str:
12
+ ...
13
+
14
+ # Start observability (call once at app startup)
15
+ observe(
16
+ name="My Agent",
17
+ app=app, # Flask/FastAPI/Starlette app
18
+ platform_url="http://localhost:8080",
19
+ api_key="your-api-key",
20
+ )
21
+ """
22
+
23
+ from theforge._core import (
24
+ configure,
25
+ trace,
26
+ SpanType,
27
+ observe,
28
+ start_span,
29
+ with_span,
30
+ get_active_span,
31
+ get_prompt,
32
+ get_prompt_sync,
33
+ )
34
+ from theforge.eval import (
35
+ EvalDataset,
36
+ EvalAPIClient,
37
+ normalize_dataset,
38
+ run_eval_dataset,
39
+ call_agent_http,
40
+ score_exact_match,
41
+ score_contains,
42
+ score_precision_recall_f1,
43
+ score_json_structural_match,
44
+ score_cosine_similarity,
45
+ )
46
+
47
+ __all__ = [
48
+ "configure",
49
+ "trace",
50
+ "SpanType",
51
+ "observe",
52
+ "start_span",
53
+ "with_span",
54
+ "get_active_span",
55
+ "get_prompt",
56
+ "get_prompt_sync",
57
+ "EvalDataset",
58
+ "EvalAPIClient",
59
+ "normalize_dataset",
60
+ "run_eval_dataset",
61
+ "call_agent_http",
62
+ "score_exact_match",
63
+ "score_contains",
64
+ "score_precision_recall_f1",
65
+ "score_json_structural_match",
66
+ "score_cosine_similarity",
67
+ ]