thinkhive 4.2.1__tar.gz → 4.2.2__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.
Files changed (43) hide show
  1. {thinkhive-4.2.1 → thinkhive-4.2.2}/PKG-INFO +1 -1
  2. {thinkhive-4.2.1 → thinkhive-4.2.2}/setup.py +1 -1
  3. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/__init__.py +1 -1
  4. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/calibration.py +2 -2
  5. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/documents.py +2 -2
  6. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/llm_costs.py +2 -2
  7. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/notifications.py +3 -3
  8. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/runs.py +2 -2
  9. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/sessions.py +2 -2
  10. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/signals.py +10 -4
  11. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/guardrails.py +4 -1
  12. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive.egg-info/PKG-INFO +1 -1
  13. {thinkhive-4.2.1 → thinkhive-4.2.2}/README.md +0 -0
  14. {thinkhive-4.2.1 → thinkhive-4.2.2}/setup.cfg +0 -0
  15. {thinkhive-4.2.1 → thinkhive-4.2.2}/tests/__init__.py +0 -0
  16. {thinkhive-4.2.1 → thinkhive-4.2.2}/tests/test_client.py +0 -0
  17. {thinkhive-4.2.1 → thinkhive-4.2.2}/tests/test_init.py +0 -0
  18. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/__init__.py +0 -0
  19. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/agents.py +0 -0
  20. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/analyzer.py +0 -0
  21. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/api_keys.py +0 -0
  22. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/business_metrics.py +0 -0
  23. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/claims.py +0 -0
  24. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/conversation_eval.py +0 -0
  25. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/customer_context.py +0 -0
  26. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/deterministic_graders.py +0 -0
  27. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/drift.py +0 -0
  28. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/eval_health.py +0 -0
  29. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/eval_runs.py +0 -0
  30. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/human_review.py +0 -0
  31. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/issues.py +0 -0
  32. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/linking.py +0 -0
  33. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/nondeterminism.py +0 -0
  34. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/quality_metrics.py +0 -0
  35. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/roi_analytics.py +0 -0
  36. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/shadow_tests.py +0 -0
  37. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/traces.py +0 -0
  38. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/api/transcript_patterns.py +0 -0
  39. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive/client.py +0 -0
  40. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive.egg-info/SOURCES.txt +0 -0
  41. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive.egg-info/dependency_links.txt +0 -0
  42. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive.egg-info/requires.txt +0 -0
  43. {thinkhive-4.2.1 → thinkhive-4.2.2}/thinkhive.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thinkhive
3
- Version: 4.2.1
3
+ Version: 4.2.2
4
4
  Summary: AI agent observability SDK with business metrics, ROI analytics, and 25+ trace format support
5
5
  Home-page: https://github.com/Abdul-Omira/ThinkHiveMind
6
6
  Author: ThinkHive
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="thinkhive",
8
- version="4.2.1",
8
+ version="4.2.2",
9
9
  author="ThinkHive",
10
10
  author_email="support@thinkhive.ai",
11
11
  description="AI agent observability SDK with business metrics, ROI analytics, and 25+ trace format support",
@@ -20,7 +20,7 @@ from typing import Optional, Dict, Any, Callable
20
20
  import os
21
21
  import logging
22
22
 
23
- __version__ = "4.2.1"
23
+ __version__ = "4.2.2"
24
24
 
25
25
  # Global tracer
26
26
  _tracer: Optional[trace.Tracer] = None
@@ -5,7 +5,7 @@ Prediction accuracy tracking with Brier scores and calibration metrics
5
5
 
6
6
  from typing import Optional, Dict, Any, List, Literal
7
7
  from dataclasses import dataclass
8
- from ..client import post, get
8
+ from ..client import post, get, api_request
9
9
 
10
10
  PredictionType = Literal[
11
11
  "outcome",
@@ -115,7 +115,7 @@ def get_status(agent_id: str, prediction_type: PredictionType) -> CalibrationSta
115
115
  >>> print(f"Is calibrated: {status.is_calibrated}")
116
116
  """
117
117
  params = {"predictionType": prediction_type}
118
- response = get(f"/calibration/{agent_id}/status", params=params, api_version="v3")
118
+ response = api_request("GET", f"/calibration/{agent_id}/status", params=params, api_version="v3")
119
119
  return CalibrationStatus.from_dict(response)
120
120
 
121
121
 
@@ -5,7 +5,7 @@ Agent document management for RAG (Retrieval-Augmented Generation)
5
5
 
6
6
  from typing import Optional, Dict, Any, List
7
7
  from dataclasses import dataclass
8
- from ..client import post, get, delete
8
+ from ..client import post, get, delete as _client_delete
9
9
 
10
10
 
11
11
  @dataclass
@@ -82,7 +82,7 @@ def delete_document(agent_id: str, doc_id: str) -> None:
82
82
  agent_id: The agent ID
83
83
  doc_id: The document ID to delete
84
84
  """
85
- delete(f"/agents/{agent_id}/documents/{doc_id}", api_version="")
85
+ _client_delete(f"/agents/{agent_id}/documents/{doc_id}", api_version="")
86
86
 
87
87
 
88
88
  # Convenience aliases for cross-SDK parity
@@ -5,7 +5,7 @@ LLM cost tracking and optimization insights
5
5
 
6
6
  from typing import Optional, Dict, Any
7
7
  from dataclasses import dataclass
8
- from ..client import get
8
+ from ..client import get, api_request
9
9
 
10
10
 
11
11
  @dataclass
@@ -57,7 +57,7 @@ def get_summary(*, period: str = "30d") -> CostSummary:
57
57
  CostSummary with total costs and breakdown
58
58
  """
59
59
  params: Dict[str, Any] = {"period": period}
60
- response = get("/llm-costs/summary", params=params, api_version="")
60
+ response = api_request("GET", "/llm-costs/summary", params=params, api_version="")
61
61
  return CostSummary.from_dict(response)
62
62
 
63
63
 
@@ -23,7 +23,7 @@ Usage:
23
23
  """
24
24
 
25
25
  from typing import Optional, Dict, Any, List
26
- from ..client import get, post, patch, delete
26
+ from ..client import get, post, patch, delete, api_request
27
27
 
28
28
 
29
29
  class NotificationsClient:
@@ -42,7 +42,7 @@ class NotificationsClient:
42
42
  List of notification rules
43
43
  """
44
44
  params: Dict[str, Any] = {"agentId": agent_id}
45
- return get("/notification-rules", params=params, api_version="")
45
+ return api_request("GET", "/notification-rules", params=params, api_version="")
46
46
 
47
47
  def get_rule(
48
48
  self,
@@ -119,7 +119,7 @@ class NotificationsClient:
119
119
  if unread_only:
120
120
  params["unreadOnly"] = True
121
121
 
122
- return get("/notifications", params=params, api_version="")
122
+ return api_request("GET", "/notifications", params=params, api_version="")
123
123
 
124
124
  def mark_as_read(self, notification_id: str) -> Dict[str, Any]:
125
125
  """
@@ -6,7 +6,7 @@ Run-centric API for creating and managing runs (v3 atomic unit)
6
6
  from typing import Optional, Dict, Any, List, Literal
7
7
  from dataclasses import dataclass
8
8
  from datetime import datetime
9
- from ..client import post, get, put, delete
9
+ from ..client import post, get, put, delete as _client_delete
10
10
 
11
11
  RunOutcome = Literal[
12
12
  "resolved",
@@ -245,7 +245,7 @@ def delete_run(run_id: str) -> None:
245
245
  Args:
246
246
  run_id: The run ID to delete
247
247
  """
248
- delete(f"/runs/{run_id}", api_version="v3")
248
+ _client_delete(f"/runs/{run_id}", api_version="v3")
249
249
 
250
250
 
251
251
  def batch_create(runs_data: List[Dict[str, Any]]) -> Dict[str, Any]:
@@ -4,7 +4,7 @@ Trace session grouping for managing conversation sessions
4
4
  """
5
5
 
6
6
  from typing import Optional, Dict, Any, List
7
- from ..client import get
7
+ from ..client import get, api_request
8
8
 
9
9
 
10
10
  def list_sessions(
@@ -30,7 +30,7 @@ def list_sessions(
30
30
  "offset": offset,
31
31
  }
32
32
 
33
- return get("/traces/sessions", params=params, api_version="")
33
+ return api_request("GET", "/sessions", params=params, api_version="")
34
34
 
35
35
 
36
36
  def get_session_traces(session_id: str, agent_id: str) -> Dict[str, Any]:
@@ -5,7 +5,7 @@ Behavioral signal management for detecting patterns in agent interactions
5
5
 
6
6
  from typing import Optional, Dict, Any, List
7
7
  from dataclasses import dataclass
8
- from ..client import post, get, put, delete
8
+ from ..client import post, get, put, delete as _client_delete, api_request
9
9
 
10
10
 
11
11
  @dataclass
@@ -58,7 +58,10 @@ def list_signals(
58
58
  if is_enabled is not None:
59
59
  params["isEnabled"] = is_enabled
60
60
 
61
- return get("/signals/", params=params, api_version="v1")
61
+ response = api_request("GET", "/signals/", params=params, api_version="v1")
62
+ if type(response) is type([]):
63
+ return response
64
+ return response.get("signals", [])
62
65
 
63
66
 
64
67
  def create(
@@ -140,7 +143,7 @@ def delete_signal(signal_id: str) -> None:
140
143
  Args:
141
144
  signal_id: The signal ID to delete
142
145
  """
143
- delete(f"/signals/{signal_id}", api_version="v1")
146
+ _client_delete(f"/signals/{signal_id}", api_version="v1")
144
147
 
145
148
 
146
149
  def seed_defaults() -> Dict[str, Any]:
@@ -179,7 +182,10 @@ def get_stats(
179
182
  if agent_id is not None:
180
183
  params["agentId"] = agent_id
181
184
 
182
- return get("/signals/stats", params=params, api_version="v1")
185
+ response = api_request("GET", "/signals/stats", params=params, api_version="v1")
186
+ if type(response) is type([]):
187
+ return {"stats": response}
188
+ return response
183
189
 
184
190
 
185
191
  def get_trends(
@@ -97,7 +97,10 @@ def _guardrails_request(method: str, path: str, body: Optional[Dict[str, Any]] =
97
97
  data = response.json()
98
98
  if not data.get("success", True):
99
99
  raise ThinkHiveApiError(data.get("message", "Request failed"), 500)
100
- return data.get("data")
100
+ # Support both wrapped {success, data} and raw responses
101
+ if "data" in data:
102
+ return data["data"]
103
+ return data
101
104
 
102
105
  except requests.exceptions.Timeout:
103
106
  if attempt < max_retries:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thinkhive
3
- Version: 4.2.1
3
+ Version: 4.2.2
4
4
  Summary: AI agent observability SDK with business metrics, ROI analytics, and 25+ trace format support
5
5
  Home-page: https://github.com/Abdul-Omira/ThinkHiveMind
6
6
  Author: ThinkHive
File without changes
File without changes
File without changes
File without changes
File without changes