deeprails 1.4.1__tar.gz → 1.5.0__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.
Potentially problematic release.
This version of deeprails might be problematic. Click here for more details.
- deeprails-1.5.0/.release-please-manifest.json +3 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/CHANGELOG.md +8 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/PKG-INFO +1 -1
- {deeprails-1.4.1 → deeprails-1.5.0}/pyproject.toml +1 -1
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_version.py +1 -1
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/resources/defend.py +6 -6
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/resources/evaluate.py +6 -6
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/resources/monitor.py +6 -6
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/defend_submit_event_params.py +10 -9
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/evaluate_create_params.py +11 -9
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/evaluation.py +9 -18
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/monitor_submit_event_params.py +11 -9
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/api_resources/test_defend.py +12 -10
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/api_resources/test_evaluate.py +10 -8
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/api_resources/test_monitor.py +12 -10
- deeprails-1.4.1/.release-please-manifest.json +0 -3
- {deeprails-1.4.1 → deeprails-1.5.0}/.gitignore +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/CONTRIBUTING.md +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/LICENSE +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/README.md +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/SECURITY.md +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/api.md +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/bin/check-release-environment +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/bin/publish-pypi +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/examples/.keep +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/noxfile.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/release-please-config.json +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/requirements-dev.lock +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/requirements.lock +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/__init__.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_base_client.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_client.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_compat.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_constants.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_exceptions.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_files.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_models.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_qs.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_resource.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_response.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_streaming.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_types.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/__init__.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_compat.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_datetime_parse.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_logs.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_proxy.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_reflection.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_resources_proxy.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_streams.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_sync.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_transform.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_typing.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/_utils/_utils.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/lib/.keep +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/py.typed +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/resources/__init__.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/__init__.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/api_response.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/defend_create_workflow_params.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/defend_response.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/defend_update_workflow_params.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/monitor_create_params.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/monitor_retrieve_params.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/monitor_retrieve_response.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/monitor_submit_event_response.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/monitor_update_params.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/src/deeprails/types/workflow_event_response.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/__init__.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/api_resources/__init__.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/conftest.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/sample_file.txt +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_client.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_deepcopy.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_extract_files.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_files.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_models.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_qs.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_required_args.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_response.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_streaming.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_transform.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_utils/test_proxy.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/test_utils/test_typing.py +0 -0
- {deeprails-1.4.1 → deeprails-1.5.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.0 (2025-10-16)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.4.1...v1.5.0](https://github.com/deeprails/deeprails-sdk-python/compare/v1.4.1...v1.5.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** adding support for system_prompt and ground_truth ([be4cd74](https://github.com/deeprails/deeprails-sdk-python/commit/be4cd74a118dc1e4b1ef90f25f311a0862807176))
|
|
10
|
+
|
|
3
11
|
## 1.4.1 (2025-10-11)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v1.4.0...v1.4.1](https://github.com/deeprails/deeprails-sdk-python/compare/v1.4.0...v1.4.1)
|
|
@@ -213,9 +213,9 @@ class DefendResource(SyncAPIResource):
|
|
|
213
213
|
evaluation
|
|
214
214
|
|
|
215
215
|
Args:
|
|
216
|
-
model_input: A dictionary of inputs sent to the LLM to generate output.
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
model_input: A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
217
|
+
contain at least one of `user_prompt` or `system_prompt`. For
|
|
218
|
+
ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
219
219
|
|
|
220
220
|
model_output: Output generated by the LLM to be evaluated.
|
|
221
221
|
|
|
@@ -491,9 +491,9 @@ class AsyncDefendResource(AsyncAPIResource):
|
|
|
491
491
|
evaluation
|
|
492
492
|
|
|
493
493
|
Args:
|
|
494
|
-
model_input: A dictionary of inputs sent to the LLM to generate output.
|
|
495
|
-
|
|
496
|
-
|
|
494
|
+
model_input: A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
495
|
+
contain at least one of `user_prompt` or `system_prompt`. For
|
|
496
|
+
ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
497
497
|
|
|
498
498
|
model_output: Output generated by the LLM to be evaluated.
|
|
499
499
|
|
|
@@ -75,9 +75,9 @@ class EvaluateResource(SyncAPIResource):
|
|
|
75
75
|
guardrail metrics
|
|
76
76
|
|
|
77
77
|
Args:
|
|
78
|
-
model_input: A dictionary of inputs sent to the LLM to generate output.
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
model_input: A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
79
|
+
contain at least one of `user_prompt` or `system_prompt`. For
|
|
80
|
+
ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
81
81
|
|
|
82
82
|
model_output: Output generated by the LLM to be evaluated.
|
|
83
83
|
|
|
@@ -206,9 +206,9 @@ class AsyncEvaluateResource(AsyncAPIResource):
|
|
|
206
206
|
guardrail metrics
|
|
207
207
|
|
|
208
208
|
Args:
|
|
209
|
-
model_input: A dictionary of inputs sent to the LLM to generate output.
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
model_input: A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
210
|
+
contain at least one of `user_prompt` or `system_prompt`. For
|
|
211
|
+
ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
212
212
|
|
|
213
213
|
model_output: Output generated by the LLM to be evaluated.
|
|
214
214
|
|
|
@@ -219,9 +219,9 @@ class MonitorResource(SyncAPIResource):
|
|
|
219
219
|
`completeness`, `instruction_adherence`, `context_adherence`,
|
|
220
220
|
`ground_truth_adherence`, and/or `comprehensive_safety`.
|
|
221
221
|
|
|
222
|
-
model_input: A dictionary of inputs sent to the LLM to generate output.
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
model_input: A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
223
|
+
contain at least one of `user_prompt` or `system_prompt`. For
|
|
224
|
+
ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
225
225
|
|
|
226
226
|
model_output: Output generated by the LLM to be evaluated.
|
|
227
227
|
|
|
@@ -457,9 +457,9 @@ class AsyncMonitorResource(AsyncAPIResource):
|
|
|
457
457
|
`completeness`, `instruction_adherence`, `context_adherence`,
|
|
458
458
|
`ground_truth_adherence`, and/or `comprehensive_safety`.
|
|
459
459
|
|
|
460
|
-
model_input: A dictionary of inputs sent to the LLM to generate output.
|
|
461
|
-
|
|
462
|
-
|
|
460
|
+
model_input: A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
461
|
+
contain at least one of `user_prompt` or `system_prompt`. For
|
|
462
|
+
ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
463
463
|
|
|
464
464
|
model_output: Output generated by the LLM to be evaluated.
|
|
465
465
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
|
5
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
6
|
|
|
8
7
|
__all__ = ["DefendSubmitEventParams", "ModelInput"]
|
|
9
8
|
|
|
@@ -12,8 +11,8 @@ class DefendSubmitEventParams(TypedDict, total=False):
|
|
|
12
11
|
model_input: Required[ModelInput]
|
|
13
12
|
"""A dictionary of inputs sent to the LLM to generate output.
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
The dictionary must contain at least one of `user_prompt` or `system_prompt`.
|
|
15
|
+
For ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
17
16
|
"""
|
|
18
17
|
|
|
19
18
|
model_output: Required[str]
|
|
@@ -35,10 +34,12 @@ class DefendSubmitEventParams(TypedDict, total=False):
|
|
|
35
34
|
"""An optional, user-defined tag for the event."""
|
|
36
35
|
|
|
37
36
|
|
|
38
|
-
class
|
|
39
|
-
|
|
37
|
+
class ModelInput(TypedDict, total=False):
|
|
38
|
+
ground_truth: str
|
|
39
|
+
"""The ground truth for evaluating Ground Truth Adherence guardrail."""
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
system_prompt: str
|
|
42
|
+
"""The system prompt used to generate the output."""
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
user_prompt: str
|
|
45
|
+
"""The user prompt used to generate the output."""
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import
|
|
6
|
-
from typing_extensions import Literal, Required,
|
|
5
|
+
from typing import List
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
7
|
|
|
8
8
|
__all__ = ["EvaluateCreateParams", "ModelInput"]
|
|
9
9
|
|
|
@@ -12,8 +12,8 @@ class EvaluateCreateParams(TypedDict, total=False):
|
|
|
12
12
|
model_input: Required[ModelInput]
|
|
13
13
|
"""A dictionary of inputs sent to the LLM to generate output.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
The dictionary must contain at least one of `user_prompt` or `system_prompt`.
|
|
16
|
+
For ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
model_output: Required[str]
|
|
@@ -51,10 +51,12 @@ class EvaluateCreateParams(TypedDict, total=False):
|
|
|
51
51
|
"""An optional, user-defined tag for the evaluation."""
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
class
|
|
55
|
-
|
|
54
|
+
class ModelInput(TypedDict, total=False):
|
|
55
|
+
ground_truth: str
|
|
56
|
+
"""The ground truth for evaluating Ground Truth Adherence guardrail."""
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
system_prompt: str
|
|
59
|
+
"""The system prompt used to generate the output."""
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
user_prompt: str
|
|
62
|
+
"""The user prompt used to generate the output."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Dict, List, Optional
|
|
4
4
|
from datetime import datetime
|
|
5
5
|
from typing_extensions import Literal
|
|
6
6
|
|
|
@@ -12,23 +12,14 @@ __all__ = ["Evaluation", "ModelInput"]
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class ModelInput(BaseModel):
|
|
15
|
-
|
|
16
|
-
"""The
|
|
17
|
-
|
|
18
|
-
context: Optional[str] = None
|
|
19
|
-
"""Optional context supplied to the LLM when generating the output."""
|
|
15
|
+
ground_truth: Optional[str] = None
|
|
16
|
+
"""The ground truth for evaluating Ground Truth Adherence guardrail."""
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# value to this field, so for compatibility we avoid doing it at runtime.
|
|
24
|
-
__pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
|
|
18
|
+
system_prompt: Optional[str] = None
|
|
19
|
+
"""The system prompt used to generate the output."""
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# `getattr(obj, '$type')`
|
|
29
|
-
def __getattr__(self, attr: str) -> object: ...
|
|
30
|
-
else:
|
|
31
|
-
__pydantic_extra__: Dict[str, object]
|
|
21
|
+
user_prompt: Optional[str] = None
|
|
22
|
+
"""The user prompt used to generate the output."""
|
|
32
23
|
|
|
33
24
|
|
|
34
25
|
class Evaluation(BaseModel):
|
|
@@ -41,8 +32,8 @@ class Evaluation(BaseModel):
|
|
|
41
32
|
api_model_input: ModelInput = FieldInfo(alias="model_input")
|
|
42
33
|
"""A dictionary of inputs sent to the LLM to generate output.
|
|
43
34
|
|
|
44
|
-
The dictionary must contain
|
|
45
|
-
|
|
35
|
+
The dictionary must contain at least one of `user_prompt` or `system_prompt`.
|
|
36
|
+
For ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
46
37
|
"""
|
|
47
38
|
|
|
48
39
|
api_model_output: str = FieldInfo(alias="model_output")
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import
|
|
6
|
-
from typing_extensions import Literal, Required,
|
|
5
|
+
from typing import List
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
7
|
|
|
8
8
|
__all__ = ["MonitorSubmitEventParams", "ModelInput"]
|
|
9
9
|
|
|
@@ -31,8 +31,8 @@ class MonitorSubmitEventParams(TypedDict, total=False):
|
|
|
31
31
|
model_input: Required[ModelInput]
|
|
32
32
|
"""A dictionary of inputs sent to the LLM to generate output.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
The dictionary must contain at least one of `user_prompt` or `system_prompt`.
|
|
35
|
+
For ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
38
|
model_output: Required[str]
|
|
@@ -54,10 +54,12 @@ class MonitorSubmitEventParams(TypedDict, total=False):
|
|
|
54
54
|
"""
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
class
|
|
58
|
-
|
|
57
|
+
class ModelInput(TypedDict, total=False):
|
|
58
|
+
ground_truth: str
|
|
59
|
+
"""The ground truth for evaluating Ground Truth Adherence guardrail."""
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
system_prompt: str
|
|
62
|
+
"""The system prompt used to generate the output."""
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
user_prompt: str
|
|
65
|
+
"""The user prompt used to generate the output."""
|
|
@@ -176,7 +176,7 @@ class TestDefend:
|
|
|
176
176
|
def test_method_submit_event(self, client: Deeprails) -> None:
|
|
177
177
|
defend = client.defend.submit_event(
|
|
178
178
|
workflow_id="workflow_id",
|
|
179
|
-
model_input={
|
|
179
|
+
model_input={},
|
|
180
180
|
model_output="model_output",
|
|
181
181
|
model_used="model_used",
|
|
182
182
|
run_mode="precision_plus",
|
|
@@ -189,8 +189,9 @@ class TestDefend:
|
|
|
189
189
|
defend = client.defend.submit_event(
|
|
190
190
|
workflow_id="workflow_id",
|
|
191
191
|
model_input={
|
|
192
|
+
"ground_truth": "ground_truth",
|
|
193
|
+
"system_prompt": "system_prompt",
|
|
192
194
|
"user_prompt": "user_prompt",
|
|
193
|
-
"context": "context",
|
|
194
195
|
},
|
|
195
196
|
model_output="model_output",
|
|
196
197
|
model_used="model_used",
|
|
@@ -204,7 +205,7 @@ class TestDefend:
|
|
|
204
205
|
def test_raw_response_submit_event(self, client: Deeprails) -> None:
|
|
205
206
|
response = client.defend.with_raw_response.submit_event(
|
|
206
207
|
workflow_id="workflow_id",
|
|
207
|
-
model_input={
|
|
208
|
+
model_input={},
|
|
208
209
|
model_output="model_output",
|
|
209
210
|
model_used="model_used",
|
|
210
211
|
run_mode="precision_plus",
|
|
@@ -220,7 +221,7 @@ class TestDefend:
|
|
|
220
221
|
def test_streaming_response_submit_event(self, client: Deeprails) -> None:
|
|
221
222
|
with client.defend.with_streaming_response.submit_event(
|
|
222
223
|
workflow_id="workflow_id",
|
|
223
|
-
model_input={
|
|
224
|
+
model_input={},
|
|
224
225
|
model_output="model_output",
|
|
225
226
|
model_used="model_used",
|
|
226
227
|
run_mode="precision_plus",
|
|
@@ -239,7 +240,7 @@ class TestDefend:
|
|
|
239
240
|
with pytest.raises(ValueError, match=r"Expected a non-empty value for `workflow_id` but received ''"):
|
|
240
241
|
client.defend.with_raw_response.submit_event(
|
|
241
242
|
workflow_id="",
|
|
242
|
-
model_input={
|
|
243
|
+
model_input={},
|
|
243
244
|
model_output="model_output",
|
|
244
245
|
model_used="model_used",
|
|
245
246
|
run_mode="precision_plus",
|
|
@@ -459,7 +460,7 @@ class TestAsyncDefend:
|
|
|
459
460
|
async def test_method_submit_event(self, async_client: AsyncDeeprails) -> None:
|
|
460
461
|
defend = await async_client.defend.submit_event(
|
|
461
462
|
workflow_id="workflow_id",
|
|
462
|
-
model_input={
|
|
463
|
+
model_input={},
|
|
463
464
|
model_output="model_output",
|
|
464
465
|
model_used="model_used",
|
|
465
466
|
run_mode="precision_plus",
|
|
@@ -472,8 +473,9 @@ class TestAsyncDefend:
|
|
|
472
473
|
defend = await async_client.defend.submit_event(
|
|
473
474
|
workflow_id="workflow_id",
|
|
474
475
|
model_input={
|
|
476
|
+
"ground_truth": "ground_truth",
|
|
477
|
+
"system_prompt": "system_prompt",
|
|
475
478
|
"user_prompt": "user_prompt",
|
|
476
|
-
"context": "context",
|
|
477
479
|
},
|
|
478
480
|
model_output="model_output",
|
|
479
481
|
model_used="model_used",
|
|
@@ -487,7 +489,7 @@ class TestAsyncDefend:
|
|
|
487
489
|
async def test_raw_response_submit_event(self, async_client: AsyncDeeprails) -> None:
|
|
488
490
|
response = await async_client.defend.with_raw_response.submit_event(
|
|
489
491
|
workflow_id="workflow_id",
|
|
490
|
-
model_input={
|
|
492
|
+
model_input={},
|
|
491
493
|
model_output="model_output",
|
|
492
494
|
model_used="model_used",
|
|
493
495
|
run_mode="precision_plus",
|
|
@@ -503,7 +505,7 @@ class TestAsyncDefend:
|
|
|
503
505
|
async def test_streaming_response_submit_event(self, async_client: AsyncDeeprails) -> None:
|
|
504
506
|
async with async_client.defend.with_streaming_response.submit_event(
|
|
505
507
|
workflow_id="workflow_id",
|
|
506
|
-
model_input={
|
|
508
|
+
model_input={},
|
|
507
509
|
model_output="model_output",
|
|
508
510
|
model_used="model_used",
|
|
509
511
|
run_mode="precision_plus",
|
|
@@ -522,7 +524,7 @@ class TestAsyncDefend:
|
|
|
522
524
|
with pytest.raises(ValueError, match=r"Expected a non-empty value for `workflow_id` but received ''"):
|
|
523
525
|
await async_client.defend.with_raw_response.submit_event(
|
|
524
526
|
workflow_id="",
|
|
525
|
-
model_input={
|
|
527
|
+
model_input={},
|
|
526
528
|
model_output="model_output",
|
|
527
529
|
model_used="model_used",
|
|
528
530
|
run_mode="precision_plus",
|
|
@@ -21,7 +21,7 @@ class TestEvaluate:
|
|
|
21
21
|
@parametrize
|
|
22
22
|
def test_method_create(self, client: Deeprails) -> None:
|
|
23
23
|
evaluate = client.evaluate.create(
|
|
24
|
-
model_input={
|
|
24
|
+
model_input={},
|
|
25
25
|
model_output="model_output",
|
|
26
26
|
run_mode="precision_plus",
|
|
27
27
|
)
|
|
@@ -32,8 +32,9 @@ class TestEvaluate:
|
|
|
32
32
|
def test_method_create_with_all_params(self, client: Deeprails) -> None:
|
|
33
33
|
evaluate = client.evaluate.create(
|
|
34
34
|
model_input={
|
|
35
|
+
"ground_truth": "ground_truth",
|
|
36
|
+
"system_prompt": "system_prompt",
|
|
35
37
|
"user_prompt": "user_prompt",
|
|
36
|
-
"context": "context",
|
|
37
38
|
},
|
|
38
39
|
model_output="model_output",
|
|
39
40
|
run_mode="precision_plus",
|
|
@@ -47,7 +48,7 @@ class TestEvaluate:
|
|
|
47
48
|
@parametrize
|
|
48
49
|
def test_raw_response_create(self, client: Deeprails) -> None:
|
|
49
50
|
response = client.evaluate.with_raw_response.create(
|
|
50
|
-
model_input={
|
|
51
|
+
model_input={},
|
|
51
52
|
model_output="model_output",
|
|
52
53
|
run_mode="precision_plus",
|
|
53
54
|
)
|
|
@@ -61,7 +62,7 @@ class TestEvaluate:
|
|
|
61
62
|
@parametrize
|
|
62
63
|
def test_streaming_response_create(self, client: Deeprails) -> None:
|
|
63
64
|
with client.evaluate.with_streaming_response.create(
|
|
64
|
-
model_input={
|
|
65
|
+
model_input={},
|
|
65
66
|
model_output="model_output",
|
|
66
67
|
run_mode="precision_plus",
|
|
67
68
|
) as response:
|
|
@@ -125,7 +126,7 @@ class TestAsyncEvaluate:
|
|
|
125
126
|
@parametrize
|
|
126
127
|
async def test_method_create(self, async_client: AsyncDeeprails) -> None:
|
|
127
128
|
evaluate = await async_client.evaluate.create(
|
|
128
|
-
model_input={
|
|
129
|
+
model_input={},
|
|
129
130
|
model_output="model_output",
|
|
130
131
|
run_mode="precision_plus",
|
|
131
132
|
)
|
|
@@ -136,8 +137,9 @@ class TestAsyncEvaluate:
|
|
|
136
137
|
async def test_method_create_with_all_params(self, async_client: AsyncDeeprails) -> None:
|
|
137
138
|
evaluate = await async_client.evaluate.create(
|
|
138
139
|
model_input={
|
|
140
|
+
"ground_truth": "ground_truth",
|
|
141
|
+
"system_prompt": "system_prompt",
|
|
139
142
|
"user_prompt": "user_prompt",
|
|
140
|
-
"context": "context",
|
|
141
143
|
},
|
|
142
144
|
model_output="model_output",
|
|
143
145
|
run_mode="precision_plus",
|
|
@@ -151,7 +153,7 @@ class TestAsyncEvaluate:
|
|
|
151
153
|
@parametrize
|
|
152
154
|
async def test_raw_response_create(self, async_client: AsyncDeeprails) -> None:
|
|
153
155
|
response = await async_client.evaluate.with_raw_response.create(
|
|
154
|
-
model_input={
|
|
156
|
+
model_input={},
|
|
155
157
|
model_output="model_output",
|
|
156
158
|
run_mode="precision_plus",
|
|
157
159
|
)
|
|
@@ -165,7 +167,7 @@ class TestAsyncEvaluate:
|
|
|
165
167
|
@parametrize
|
|
166
168
|
async def test_streaming_response_create(self, async_client: AsyncDeeprails) -> None:
|
|
167
169
|
async with async_client.evaluate.with_streaming_response.create(
|
|
168
|
-
model_input={
|
|
170
|
+
model_input={},
|
|
169
171
|
model_output="model_output",
|
|
170
172
|
run_mode="precision_plus",
|
|
171
173
|
) as response:
|
|
@@ -174,7 +174,7 @@ class TestMonitor:
|
|
|
174
174
|
monitor = client.monitor.submit_event(
|
|
175
175
|
monitor_id="monitor_id",
|
|
176
176
|
guardrail_metrics=["correctness"],
|
|
177
|
-
model_input={
|
|
177
|
+
model_input={},
|
|
178
178
|
model_output="model_output",
|
|
179
179
|
)
|
|
180
180
|
assert_matches_type(MonitorSubmitEventResponse, monitor, path=["response"])
|
|
@@ -186,8 +186,9 @@ class TestMonitor:
|
|
|
186
186
|
monitor_id="monitor_id",
|
|
187
187
|
guardrail_metrics=["correctness"],
|
|
188
188
|
model_input={
|
|
189
|
+
"ground_truth": "ground_truth",
|
|
190
|
+
"system_prompt": "system_prompt",
|
|
189
191
|
"user_prompt": "user_prompt",
|
|
190
|
-
"context": "context",
|
|
191
192
|
},
|
|
192
193
|
model_output="model_output",
|
|
193
194
|
model_used="model_used",
|
|
@@ -202,7 +203,7 @@ class TestMonitor:
|
|
|
202
203
|
response = client.monitor.with_raw_response.submit_event(
|
|
203
204
|
monitor_id="monitor_id",
|
|
204
205
|
guardrail_metrics=["correctness"],
|
|
205
|
-
model_input={
|
|
206
|
+
model_input={},
|
|
206
207
|
model_output="model_output",
|
|
207
208
|
)
|
|
208
209
|
|
|
@@ -217,7 +218,7 @@ class TestMonitor:
|
|
|
217
218
|
with client.monitor.with_streaming_response.submit_event(
|
|
218
219
|
monitor_id="monitor_id",
|
|
219
220
|
guardrail_metrics=["correctness"],
|
|
220
|
-
model_input={
|
|
221
|
+
model_input={},
|
|
221
222
|
model_output="model_output",
|
|
222
223
|
) as response:
|
|
223
224
|
assert not response.is_closed
|
|
@@ -235,7 +236,7 @@ class TestMonitor:
|
|
|
235
236
|
client.monitor.with_raw_response.submit_event(
|
|
236
237
|
monitor_id="",
|
|
237
238
|
guardrail_metrics=["correctness"],
|
|
238
|
-
model_input={
|
|
239
|
+
model_input={},
|
|
239
240
|
model_output="model_output",
|
|
240
241
|
)
|
|
241
242
|
|
|
@@ -398,7 +399,7 @@ class TestAsyncMonitor:
|
|
|
398
399
|
monitor = await async_client.monitor.submit_event(
|
|
399
400
|
monitor_id="monitor_id",
|
|
400
401
|
guardrail_metrics=["correctness"],
|
|
401
|
-
model_input={
|
|
402
|
+
model_input={},
|
|
402
403
|
model_output="model_output",
|
|
403
404
|
)
|
|
404
405
|
assert_matches_type(MonitorSubmitEventResponse, monitor, path=["response"])
|
|
@@ -410,8 +411,9 @@ class TestAsyncMonitor:
|
|
|
410
411
|
monitor_id="monitor_id",
|
|
411
412
|
guardrail_metrics=["correctness"],
|
|
412
413
|
model_input={
|
|
414
|
+
"ground_truth": "ground_truth",
|
|
415
|
+
"system_prompt": "system_prompt",
|
|
413
416
|
"user_prompt": "user_prompt",
|
|
414
|
-
"context": "context",
|
|
415
417
|
},
|
|
416
418
|
model_output="model_output",
|
|
417
419
|
model_used="model_used",
|
|
@@ -426,7 +428,7 @@ class TestAsyncMonitor:
|
|
|
426
428
|
response = await async_client.monitor.with_raw_response.submit_event(
|
|
427
429
|
monitor_id="monitor_id",
|
|
428
430
|
guardrail_metrics=["correctness"],
|
|
429
|
-
model_input={
|
|
431
|
+
model_input={},
|
|
430
432
|
model_output="model_output",
|
|
431
433
|
)
|
|
432
434
|
|
|
@@ -441,7 +443,7 @@ class TestAsyncMonitor:
|
|
|
441
443
|
async with async_client.monitor.with_streaming_response.submit_event(
|
|
442
444
|
monitor_id="monitor_id",
|
|
443
445
|
guardrail_metrics=["correctness"],
|
|
444
|
-
model_input={
|
|
446
|
+
model_input={},
|
|
445
447
|
model_output="model_output",
|
|
446
448
|
) as response:
|
|
447
449
|
assert not response.is_closed
|
|
@@ -459,6 +461,6 @@ class TestAsyncMonitor:
|
|
|
459
461
|
await async_client.monitor.with_raw_response.submit_event(
|
|
460
462
|
monitor_id="",
|
|
461
463
|
guardrail_metrics=["correctness"],
|
|
462
|
-
model_input={
|
|
464
|
+
model_input={},
|
|
463
465
|
model_output="model_output",
|
|
464
466
|
)
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|