prodloop-observability-sdk 0.1.2__tar.gz → 0.1.4__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.
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/PKG-INFO +14 -1
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/README.md +13 -0
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop/client.py +12 -5
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop_observability_sdk.egg-info/PKG-INFO +14 -1
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/pyproject.toml +1 -1
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop/__init__.py +0 -0
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop/exceptions.py +0 -0
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop/models.py +0 -0
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop_observability_sdk.egg-info/SOURCES.txt +0 -0
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop_observability_sdk.egg-info/dependency_links.txt +0 -0
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop_observability_sdk.egg-info/requires.txt +0 -0
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop_observability_sdk.egg-info/top_level.txt +0 -0
- {prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: prodloop-observability-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Python SDK for evaluating AI voice bot calls via Prodloop APIs.
|
|
5
5
|
Project-URL: Homepage, https://prodloop.com
|
|
6
6
|
Project-URL: Documentation, https://observability-sdk-docs.pages.dev/
|
|
@@ -37,6 +37,7 @@ result = client.evaluate_call(
|
|
|
37
37
|
EvaluationParameter.HALLUCINATION,
|
|
38
38
|
],
|
|
39
39
|
thresholds={"e2e_response_time_max_ms": 800},
|
|
40
|
+
input_prompt="Bot instructions used during this call...",
|
|
40
41
|
)
|
|
41
42
|
|
|
42
43
|
print(result)
|
|
@@ -60,6 +61,18 @@ Response includes:
|
|
|
60
61
|
- `extraction_variables`
|
|
61
62
|
- `extraction_validation`
|
|
62
63
|
|
|
64
|
+
## Hallucination Input Requirement
|
|
65
|
+
|
|
66
|
+
When requesting `hallucination`, pass the bot's original call prompt as `input_prompt`:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
result = client.evaluate_call(
|
|
70
|
+
audio_file_path="call.mp3",
|
|
71
|
+
parameters=[EvaluationParameter.HALLUCINATION],
|
|
72
|
+
input_prompt="You are a polite admissions bot. Never invent course details.",
|
|
73
|
+
)
|
|
74
|
+
```
|
|
75
|
+
|
|
63
76
|
## Supported Parameters
|
|
64
77
|
|
|
65
78
|
- `e2e_response_time`
|
|
@@ -22,6 +22,7 @@ result = client.evaluate_call(
|
|
|
22
22
|
EvaluationParameter.HALLUCINATION,
|
|
23
23
|
],
|
|
24
24
|
thresholds={"e2e_response_time_max_ms": 800},
|
|
25
|
+
input_prompt="Bot instructions used during this call...",
|
|
25
26
|
)
|
|
26
27
|
|
|
27
28
|
print(result)
|
|
@@ -45,6 +46,18 @@ Response includes:
|
|
|
45
46
|
- `extraction_variables`
|
|
46
47
|
- `extraction_validation`
|
|
47
48
|
|
|
49
|
+
## Hallucination Input Requirement
|
|
50
|
+
|
|
51
|
+
When requesting `hallucination`, pass the bot's original call prompt as `input_prompt`:
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
result = client.evaluate_call(
|
|
55
|
+
audio_file_path="call.mp3",
|
|
56
|
+
parameters=[EvaluationParameter.HALLUCINATION],
|
|
57
|
+
input_prompt="You are a polite admissions bot. Never invent course details.",
|
|
58
|
+
)
|
|
59
|
+
```
|
|
60
|
+
|
|
48
61
|
## Supported Parameters
|
|
49
62
|
|
|
50
63
|
- `e2e_response_time`
|
|
@@ -10,20 +10,18 @@ from prodloop.models import EvaluationParameter, ParameterInput, coerce_paramete
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class ProdloopClient:
|
|
13
|
+
_SERVICE_URL = "https://asia-south1-prodloop.cloudfunctions.net/prodloop-evaluator-fn"
|
|
14
|
+
|
|
13
15
|
def __init__(
|
|
14
16
|
self,
|
|
15
17
|
api_key: str,
|
|
16
|
-
base_url: str = "https://asia-south1-prodloop.cloudfunctions.net/prodloop-evaluator-fn",
|
|
17
18
|
timeout_seconds: int = 180,
|
|
18
19
|
session: Optional[requests.Session] = None,
|
|
19
20
|
):
|
|
20
21
|
if not api_key or not api_key.strip():
|
|
21
22
|
raise ValidationError("api_key is required.")
|
|
22
|
-
if not base_url or not base_url.strip():
|
|
23
|
-
raise ValidationError("base_url is required.")
|
|
24
23
|
|
|
25
24
|
self.api_key = api_key.strip()
|
|
26
|
-
self.base_url = base_url.rstrip("/")
|
|
27
25
|
self.timeout_seconds = timeout_seconds
|
|
28
26
|
self._session = session or requests.Session()
|
|
29
27
|
|
|
@@ -34,9 +32,11 @@ class ProdloopClient:
|
|
|
34
32
|
thresholds: Optional[Mapping[str, Any]] = None,
|
|
35
33
|
extraction_schema: Optional[Mapping[str, str]] = None,
|
|
36
34
|
bot_captured_variables: Optional[Mapping[str, Any]] = None,
|
|
35
|
+
input_prompt: Optional[str] = None,
|
|
37
36
|
timeout_seconds: Optional[int] = None,
|
|
38
37
|
) -> Dict[str, Any]:
|
|
39
38
|
normalized_parameters = self._normalize_parameters(parameters)
|
|
39
|
+
normalized_input_prompt = (input_prompt or "").strip()
|
|
40
40
|
payload: Dict[str, Any] = {
|
|
41
41
|
"parameters": [param.value for param in normalized_parameters],
|
|
42
42
|
}
|
|
@@ -47,6 +47,8 @@ class ProdloopClient:
|
|
|
47
47
|
payload["extraction_schema"] = dict(extraction_schema)
|
|
48
48
|
if bot_captured_variables:
|
|
49
49
|
payload["bot_captured_variables"] = dict(bot_captured_variables)
|
|
50
|
+
if normalized_input_prompt:
|
|
51
|
+
payload["input_prompt"] = normalized_input_prompt
|
|
50
52
|
|
|
51
53
|
if EvaluationParameter.EXTRACTION_VARIABLES in normalized_parameters:
|
|
52
54
|
if not extraction_schema:
|
|
@@ -65,6 +67,11 @@ class ProdloopClient:
|
|
|
65
67
|
"bot_captured_variables is missing keys from extraction_schema: "
|
|
66
68
|
+ ", ".join(missing_keys)
|
|
67
69
|
)
|
|
70
|
+
if EvaluationParameter.HALLUCINATION in normalized_parameters:
|
|
71
|
+
if not normalized_input_prompt:
|
|
72
|
+
raise ValidationError(
|
|
73
|
+
"input_prompt is required when using 'hallucination'."
|
|
74
|
+
)
|
|
68
75
|
|
|
69
76
|
audio_path = Path(audio_file_path)
|
|
70
77
|
if not audio_path.exists():
|
|
@@ -73,7 +80,7 @@ class ProdloopClient:
|
|
|
73
80
|
raise ValidationError(f"Audio path is not a file: {audio_file_path}")
|
|
74
81
|
|
|
75
82
|
request_timeout = timeout_seconds or self.timeout_seconds
|
|
76
|
-
url = self.
|
|
83
|
+
url = self._SERVICE_URL
|
|
77
84
|
headers = {"Authorization": f"Bearer {self.api_key}"}
|
|
78
85
|
mime_type = self._guess_mime_type(audio_path)
|
|
79
86
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: prodloop-observability-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Python SDK for evaluating AI voice bot calls via Prodloop APIs.
|
|
5
5
|
Project-URL: Homepage, https://prodloop.com
|
|
6
6
|
Project-URL: Documentation, https://observability-sdk-docs.pages.dev/
|
|
@@ -37,6 +37,7 @@ result = client.evaluate_call(
|
|
|
37
37
|
EvaluationParameter.HALLUCINATION,
|
|
38
38
|
],
|
|
39
39
|
thresholds={"e2e_response_time_max_ms": 800},
|
|
40
|
+
input_prompt="Bot instructions used during this call...",
|
|
40
41
|
)
|
|
41
42
|
|
|
42
43
|
print(result)
|
|
@@ -60,6 +61,18 @@ Response includes:
|
|
|
60
61
|
- `extraction_variables`
|
|
61
62
|
- `extraction_validation`
|
|
62
63
|
|
|
64
|
+
## Hallucination Input Requirement
|
|
65
|
+
|
|
66
|
+
When requesting `hallucination`, pass the bot's original call prompt as `input_prompt`:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
result = client.evaluate_call(
|
|
70
|
+
audio_file_path="call.mp3",
|
|
71
|
+
parameters=[EvaluationParameter.HALLUCINATION],
|
|
72
|
+
input_prompt="You are a polite admissions bot. Never invent course details.",
|
|
73
|
+
)
|
|
74
|
+
```
|
|
75
|
+
|
|
63
76
|
## Supported Parameters
|
|
64
77
|
|
|
65
78
|
- `e2e_response_time`
|
|
File without changes
|
{prodloop_observability_sdk-0.1.2 → prodloop_observability_sdk-0.1.4}/prodloop/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|