deeprails 1.2.0__tar.gz → 1.4.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.

Files changed (86) hide show
  1. deeprails-1.4.0/.release-please-manifest.json +3 -0
  2. {deeprails-1.2.0 → deeprails-1.4.0}/CHANGELOG.md +17 -0
  3. {deeprails-1.2.0 → deeprails-1.4.0}/PKG-INFO +10 -11
  4. {deeprails-1.2.0 → deeprails-1.4.0}/README.md +9 -10
  5. {deeprails-1.2.0 → deeprails-1.4.0}/pyproject.toml +1 -1
  6. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_version.py +1 -1
  7. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/resources/defend.py +24 -30
  8. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/resources/evaluate.py +2 -2
  9. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/resources/monitor.py +16 -8
  10. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/api_response.py +0 -1
  11. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/defend_create_workflow_params.py +1 -1
  12. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/defend_response.py +1 -1
  13. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/defend_submit_event_params.py +3 -3
  14. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/defend_update_workflow_params.py +1 -4
  15. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/monitor_retrieve_response.py +0 -1
  16. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/monitor_submit_event_response.py +0 -1
  17. {deeprails-1.2.0 → deeprails-1.4.0}/tests/api_resources/test_defend.py +2 -12
  18. deeprails-1.2.0/.release-please-manifest.json +0 -3
  19. {deeprails-1.2.0 → deeprails-1.4.0}/.gitignore +0 -0
  20. {deeprails-1.2.0 → deeprails-1.4.0}/CONTRIBUTING.md +0 -0
  21. {deeprails-1.2.0 → deeprails-1.4.0}/LICENSE +0 -0
  22. {deeprails-1.2.0 → deeprails-1.4.0}/SECURITY.md +0 -0
  23. {deeprails-1.2.0 → deeprails-1.4.0}/api.md +0 -0
  24. {deeprails-1.2.0 → deeprails-1.4.0}/bin/check-release-environment +0 -0
  25. {deeprails-1.2.0 → deeprails-1.4.0}/bin/publish-pypi +0 -0
  26. {deeprails-1.2.0 → deeprails-1.4.0}/examples/.keep +0 -0
  27. {deeprails-1.2.0 → deeprails-1.4.0}/noxfile.py +0 -0
  28. {deeprails-1.2.0 → deeprails-1.4.0}/release-please-config.json +0 -0
  29. {deeprails-1.2.0 → deeprails-1.4.0}/requirements-dev.lock +0 -0
  30. {deeprails-1.2.0 → deeprails-1.4.0}/requirements.lock +0 -0
  31. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/__init__.py +0 -0
  32. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_base_client.py +0 -0
  33. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_client.py +0 -0
  34. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_compat.py +0 -0
  35. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_constants.py +0 -0
  36. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_exceptions.py +0 -0
  37. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_files.py +0 -0
  38. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_models.py +0 -0
  39. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_qs.py +0 -0
  40. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_resource.py +0 -0
  41. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_response.py +0 -0
  42. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_streaming.py +0 -0
  43. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_types.py +0 -0
  44. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/__init__.py +0 -0
  45. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_compat.py +0 -0
  46. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_datetime_parse.py +0 -0
  47. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_logs.py +0 -0
  48. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_proxy.py +0 -0
  49. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_reflection.py +0 -0
  50. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_resources_proxy.py +0 -0
  51. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_streams.py +0 -0
  52. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_sync.py +0 -0
  53. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_transform.py +0 -0
  54. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_typing.py +0 -0
  55. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/_utils/_utils.py +0 -0
  56. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/lib/.keep +0 -0
  57. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/py.typed +0 -0
  58. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/resources/__init__.py +0 -0
  59. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/__init__.py +0 -0
  60. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/evaluate_create_params.py +0 -0
  61. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/evaluation.py +0 -0
  62. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/monitor_create_params.py +0 -0
  63. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/monitor_retrieve_params.py +0 -0
  64. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/monitor_submit_event_params.py +0 -0
  65. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/monitor_update_params.py +0 -0
  66. {deeprails-1.2.0 → deeprails-1.4.0}/src/deeprails/types/workflow_event_response.py +0 -0
  67. {deeprails-1.2.0 → deeprails-1.4.0}/tests/__init__.py +0 -0
  68. {deeprails-1.2.0 → deeprails-1.4.0}/tests/api_resources/__init__.py +0 -0
  69. {deeprails-1.2.0 → deeprails-1.4.0}/tests/api_resources/test_evaluate.py +0 -0
  70. {deeprails-1.2.0 → deeprails-1.4.0}/tests/api_resources/test_monitor.py +0 -0
  71. {deeprails-1.2.0 → deeprails-1.4.0}/tests/conftest.py +0 -0
  72. {deeprails-1.2.0 → deeprails-1.4.0}/tests/sample_file.txt +0 -0
  73. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_client.py +0 -0
  74. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_deepcopy.py +0 -0
  75. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_extract_files.py +0 -0
  76. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_files.py +0 -0
  77. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_models.py +0 -0
  78. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_qs.py +0 -0
  79. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_required_args.py +0 -0
  80. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_response.py +0 -0
  81. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_streaming.py +0 -0
  82. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_transform.py +0 -0
  83. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_utils/test_datetime_parse.py +0 -0
  84. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_utils/test_proxy.py +0 -0
  85. {deeprails-1.2.0 → deeprails-1.4.0}/tests/test_utils/test_typing.py +0 -0
  86. {deeprails-1.2.0 → deeprails-1.4.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.4.0"
3
+ }
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.0 (2025-10-10)
4
+
5
+ Full Changelog: [v1.3.0...v1.4.0](https://github.com/deeprails/deeprails-sdk-python/compare/v1.3.0...v1.4.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([b6beebc](https://github.com/deeprails/deeprails-sdk-python/commit/b6beebca6323df5ae35ef30d419d96c831bebbb8))
10
+
11
+ ## 1.3.0 (2025-10-08)
12
+
13
+ Full Changelog: [v1.2.0...v1.3.0](https://github.com/deeprails/deeprails-sdk-python/compare/v1.2.0...v1.3.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** adding code samples ([c7f7565](https://github.com/deeprails/deeprails-sdk-python/commit/c7f7565abd00233d22d9c11a5b2c977414e03439))
18
+ * **api:** manual updates ([145946a](https://github.com/deeprails/deeprails-sdk-python/commit/145946a049fb29bff01df6763248330f4d0030ad))
19
+
3
20
  ## 1.2.0 (2025-10-07)
4
21
 
5
22
  Full Changelog: [v1.1.0...v1.2.0](https://github.com/deeprails/deeprails-sdk-python/compare/v1.1.0...v1.2.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: deeprails
3
- Version: 1.2.0
3
+ Version: 1.4.0
4
4
  Summary: The official Python library for the deeprails API
5
5
  Project-URL: Homepage, https://docs.deeprails.com/
6
6
  Project-URL: Repository, https://github.com/deeprails/deeprails-sdk-python
@@ -44,7 +44,7 @@ and offers both synchronous and asynchronous clients powered by [httpx](https://
44
44
 
45
45
  ## Documentation
46
46
 
47
- The full API of this library can be found in [api.md](https://github.com/deeprails/deeprails-sdk-python/tree/main/api.md).
47
+ The REST API documentation can be found on [docs.deeprails.com](https://docs.deeprails.com). The full API of this library can be found in [api.md](https://github.com/deeprails/deeprails-sdk-python/tree/main/api.md).
48
48
 
49
49
  ## Installation
50
50
 
@@ -68,7 +68,7 @@ client = Deeprails(
68
68
  defend_response = client.defend.create_workflow(
69
69
  improvement_action="fixit",
70
70
  metrics={
71
- "completeness": 0.85,
71
+ "completeness": 0.8,
72
72
  "instruction_adherence": 0.75,
73
73
  },
74
74
  name="Push Alert Workflow",
@@ -100,7 +100,7 @@ async def main() -> None:
100
100
  defend_response = await client.defend.create_workflow(
101
101
  improvement_action="fixit",
102
102
  metrics={
103
- "completeness": 0.85,
103
+ "completeness": 0.8,
104
104
  "instruction_adherence": 0.75,
105
105
  },
106
106
  name="Push Alert Workflow",
@@ -141,7 +141,7 @@ async def main() -> None:
141
141
  defend_response = await client.defend.create_workflow(
142
142
  improvement_action="fixit",
143
143
  metrics={
144
- "completeness": 0.85,
144
+ "completeness": 0.8,
145
145
  "instruction_adherence": 0.75,
146
146
  },
147
147
  name="Push Alert Workflow",
@@ -176,7 +176,6 @@ workflow_event_response = client.defend.submit_event(
176
176
  model_input={"user_prompt": "user_prompt"},
177
177
  model_output="model_output",
178
178
  model_used="model_used",
179
- nametag="nametag",
180
179
  run_mode="precision_plus",
181
180
  )
182
181
  print(workflow_event_response.model_input)
@@ -201,7 +200,7 @@ try:
201
200
  client.defend.create_workflow(
202
201
  improvement_action="fixit",
203
202
  metrics={
204
- "completeness": 0.85,
203
+ "completeness": 0.8,
205
204
  "instruction_adherence": 0.75,
206
205
  },
207
206
  name="Push Alert Workflow",
@@ -252,7 +251,7 @@ client = Deeprails(
252
251
  client.with_options(max_retries=5).defend.create_workflow(
253
252
  improvement_action="fixit",
254
253
  metrics={
255
- "completeness": 0.85,
254
+ "completeness": 0.8,
256
255
  "instruction_adherence": 0.75,
257
256
  },
258
257
  name="Push Alert Workflow",
@@ -283,7 +282,7 @@ client = Deeprails(
283
282
  client.with_options(timeout=5.0).defend.create_workflow(
284
283
  improvement_action="fixit",
285
284
  metrics={
286
- "completeness": 0.85,
285
+ "completeness": 0.8,
287
286
  "instruction_adherence": 0.75,
288
287
  },
289
288
  name="Push Alert Workflow",
@@ -332,7 +331,7 @@ client = Deeprails()
332
331
  response = client.defend.with_raw_response.create_workflow(
333
332
  improvement_action="fixit",
334
333
  metrics={
335
- "completeness": 0.85,
334
+ "completeness": 0.8,
336
335
  "instruction_adherence": 0.75,
337
336
  },
338
337
  name="Push Alert Workflow",
@@ -358,7 +357,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
358
357
  with client.defend.with_streaming_response.create_workflow(
359
358
  improvement_action="fixit",
360
359
  metrics={
361
- "completeness": 0.85,
360
+ "completeness": 0.8,
362
361
  "instruction_adherence": 0.75,
363
362
  },
364
363
  name="Push Alert Workflow",
@@ -9,7 +9,7 @@ and offers both synchronous and asynchronous clients powered by [httpx](https://
9
9
 
10
10
  ## Documentation
11
11
 
12
- The full API of this library can be found in [api.md](api.md).
12
+ The REST API documentation can be found on [docs.deeprails.com](https://docs.deeprails.com). The full API of this library can be found in [api.md](api.md).
13
13
 
14
14
  ## Installation
15
15
 
@@ -33,7 +33,7 @@ client = Deeprails(
33
33
  defend_response = client.defend.create_workflow(
34
34
  improvement_action="fixit",
35
35
  metrics={
36
- "completeness": 0.85,
36
+ "completeness": 0.8,
37
37
  "instruction_adherence": 0.75,
38
38
  },
39
39
  name="Push Alert Workflow",
@@ -65,7 +65,7 @@ async def main() -> None:
65
65
  defend_response = await client.defend.create_workflow(
66
66
  improvement_action="fixit",
67
67
  metrics={
68
- "completeness": 0.85,
68
+ "completeness": 0.8,
69
69
  "instruction_adherence": 0.75,
70
70
  },
71
71
  name="Push Alert Workflow",
@@ -106,7 +106,7 @@ async def main() -> None:
106
106
  defend_response = await client.defend.create_workflow(
107
107
  improvement_action="fixit",
108
108
  metrics={
109
- "completeness": 0.85,
109
+ "completeness": 0.8,
110
110
  "instruction_adherence": 0.75,
111
111
  },
112
112
  name="Push Alert Workflow",
@@ -141,7 +141,6 @@ workflow_event_response = client.defend.submit_event(
141
141
  model_input={"user_prompt": "user_prompt"},
142
142
  model_output="model_output",
143
143
  model_used="model_used",
144
- nametag="nametag",
145
144
  run_mode="precision_plus",
146
145
  )
147
146
  print(workflow_event_response.model_input)
@@ -166,7 +165,7 @@ try:
166
165
  client.defend.create_workflow(
167
166
  improvement_action="fixit",
168
167
  metrics={
169
- "completeness": 0.85,
168
+ "completeness": 0.8,
170
169
  "instruction_adherence": 0.75,
171
170
  },
172
171
  name="Push Alert Workflow",
@@ -217,7 +216,7 @@ client = Deeprails(
217
216
  client.with_options(max_retries=5).defend.create_workflow(
218
217
  improvement_action="fixit",
219
218
  metrics={
220
- "completeness": 0.85,
219
+ "completeness": 0.8,
221
220
  "instruction_adherence": 0.75,
222
221
  },
223
222
  name="Push Alert Workflow",
@@ -248,7 +247,7 @@ client = Deeprails(
248
247
  client.with_options(timeout=5.0).defend.create_workflow(
249
248
  improvement_action="fixit",
250
249
  metrics={
251
- "completeness": 0.85,
250
+ "completeness": 0.8,
252
251
  "instruction_adherence": 0.75,
253
252
  },
254
253
  name="Push Alert Workflow",
@@ -297,7 +296,7 @@ client = Deeprails()
297
296
  response = client.defend.with_raw_response.create_workflow(
298
297
  improvement_action="fixit",
299
298
  metrics={
300
- "completeness": 0.85,
299
+ "completeness": 0.8,
301
300
  "instruction_adherence": 0.75,
302
301
  },
303
302
  name="Push Alert Workflow",
@@ -323,7 +322,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
323
322
  with client.defend.with_streaming_response.create_workflow(
324
323
  improvement_action="fixit",
325
324
  metrics={
326
- "completeness": 0.85,
325
+ "completeness": 0.8,
327
326
  "instruction_adherence": 0.75,
328
327
  },
329
328
  name="Push Alert Workflow",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "deeprails"
3
- version = "1.2.0"
3
+ version = "1.4.0"
4
4
  description = "The official Python library for the deeprails API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "deeprails"
4
- __version__ = "1.2.0" # x-release-please-version
4
+ __version__ = "1.4.0" # x-release-please-version
@@ -63,13 +63,13 @@ class DefendResource(SyncAPIResource):
63
63
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
64
64
  ) -> DefendResponse:
65
65
  """
66
- Create a new guardrail workflow with optional guardrail thresholds and
67
- improvement actions.
66
+ Use this endpoint to create a new guardrail workflow with optional guardrail
67
+ thresholds and improvement actions
68
68
 
69
69
  Args:
70
70
  improvement_action: The action used to improve outputs that fail one or guardrail metrics for the
71
71
  workflow events. May be `regenerate`, `fixit`, or null which represents “do
72
- nothing”. ReGen runs the user's exact input prompt with minor induced variance.
72
+ nothing”. Regenerate runs the user's input prompt with minor induced variance.
73
73
  Fixit attempts to directly address the shortcomings of the output using the
74
74
  guardrail failure rationale. Do nothing does not attempt any improvement.
75
75
 
@@ -136,7 +136,7 @@ class DefendResource(SyncAPIResource):
136
136
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
137
137
  ) -> WorkflowEventResponse:
138
138
  """
139
- Retrieve a specific event of a guardrail workflow.
139
+ Use this endpoint to retrieve a specific event of a guardrail workflow
140
140
 
141
141
  Args:
142
142
  extra_headers: Send extra headers
@@ -171,7 +171,7 @@ class DefendResource(SyncAPIResource):
171
171
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
172
172
  ) -> DefendResponse:
173
173
  """
174
- Retrieve the details for a specific guardrail workflow.
174
+ Use this endpoint to retrieve the details for a specific defend workflow
175
175
 
176
176
  Args:
177
177
  extra_headers: Send extra headers
@@ -199,8 +199,8 @@ class DefendResource(SyncAPIResource):
199
199
  model_input: defend_submit_event_params.ModelInput,
200
200
  model_output: str,
201
201
  model_used: str,
202
- nametag: str,
203
202
  run_mode: Literal["precision_plus", "precision", "smart", "economy"],
203
+ nametag: str | Omit = omit,
204
204
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
205
205
  # The extra values given here take precedence over values defined on the client or passed to this method.
206
206
  extra_headers: Headers | None = None,
@@ -209,7 +209,8 @@ class DefendResource(SyncAPIResource):
209
209
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
210
210
  ) -> WorkflowEventResponse:
211
211
  """
212
- Submit a model input and output pair to a workflow for evaluation.
212
+ Use this endpoint to submit a model input and output pair to a workflow for
213
+ evaluation
213
214
 
214
215
  Args:
215
216
  model_input: A dictionary of inputs sent to the LLM to generate output. This must contain a
@@ -220,13 +221,13 @@ class DefendResource(SyncAPIResource):
220
221
 
221
222
  model_used: Model ID used to generate the output, like `gpt-4o` or `o3`.
222
223
 
223
- nametag: An optional, user-defined tag for the event.
224
-
225
224
  run_mode: Run mode for the workflow event. The run mode allows the user to optimize for
226
225
  speed, accuracy, and cost by determining which models are used to evaluate the
227
226
  event. Available run modes include `precision_plus`, `precision`, `smart`, and
228
227
  `economy`. Defaults to `smart`.
229
228
 
229
+ nametag: An optional, user-defined tag for the event.
230
+
230
231
  extra_headers: Send extra headers
231
232
 
232
233
  extra_query: Add additional query parameters to the request
@@ -244,8 +245,8 @@ class DefendResource(SyncAPIResource):
244
245
  "model_input": model_input,
245
246
  "model_output": model_output,
246
247
  "model_used": model_used,
247
- "nametag": nametag,
248
248
  "run_mode": run_mode,
249
+ "nametag": nametag,
249
250
  },
250
251
  defend_submit_event_params.DefendSubmitEventParams,
251
252
  ),
@@ -261,7 +262,6 @@ class DefendResource(SyncAPIResource):
261
262
  *,
262
263
  description: str | Omit = omit,
263
264
  name: str | Omit = omit,
264
- type: Literal["automatic", "custom"] | Omit = omit,
265
265
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
266
266
  # The extra values given here take precedence over values defined on the client or passed to this method.
267
267
  extra_headers: Headers | None = None,
@@ -270,15 +270,13 @@ class DefendResource(SyncAPIResource):
270
270
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
271
271
  ) -> DefendResponse:
272
272
  """
273
- Update an existing guardrail workflow.
273
+ Use this endpoint to update an existing guardrail workflow
274
274
 
275
275
  Args:
276
276
  description: Description for the workflow.
277
277
 
278
278
  name: Name of the workflow.
279
279
 
280
- type: Type of thresholds to use for the workflow, either `automatic` or `custom`.
281
-
282
280
  extra_headers: Send extra headers
283
281
 
284
282
  extra_query: Add additional query parameters to the request
@@ -295,7 +293,6 @@ class DefendResource(SyncAPIResource):
295
293
  {
296
294
  "description": description,
297
295
  "name": name,
298
- "type": type,
299
296
  },
300
297
  defend_update_workflow_params.DefendUpdateWorkflowParams,
301
298
  ),
@@ -344,13 +341,13 @@ class AsyncDefendResource(AsyncAPIResource):
344
341
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
345
342
  ) -> DefendResponse:
346
343
  """
347
- Create a new guardrail workflow with optional guardrail thresholds and
348
- improvement actions.
344
+ Use this endpoint to create a new guardrail workflow with optional guardrail
345
+ thresholds and improvement actions
349
346
 
350
347
  Args:
351
348
  improvement_action: The action used to improve outputs that fail one or guardrail metrics for the
352
349
  workflow events. May be `regenerate`, `fixit`, or null which represents “do
353
- nothing”. ReGen runs the user's exact input prompt with minor induced variance.
350
+ nothing”. Regenerate runs the user's input prompt with minor induced variance.
354
351
  Fixit attempts to directly address the shortcomings of the output using the
355
352
  guardrail failure rationale. Do nothing does not attempt any improvement.
356
353
 
@@ -417,7 +414,7 @@ class AsyncDefendResource(AsyncAPIResource):
417
414
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
418
415
  ) -> WorkflowEventResponse:
419
416
  """
420
- Retrieve a specific event of a guardrail workflow.
417
+ Use this endpoint to retrieve a specific event of a guardrail workflow
421
418
 
422
419
  Args:
423
420
  extra_headers: Send extra headers
@@ -452,7 +449,7 @@ class AsyncDefendResource(AsyncAPIResource):
452
449
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
453
450
  ) -> DefendResponse:
454
451
  """
455
- Retrieve the details for a specific guardrail workflow.
452
+ Use this endpoint to retrieve the details for a specific defend workflow
456
453
 
457
454
  Args:
458
455
  extra_headers: Send extra headers
@@ -480,8 +477,8 @@ class AsyncDefendResource(AsyncAPIResource):
480
477
  model_input: defend_submit_event_params.ModelInput,
481
478
  model_output: str,
482
479
  model_used: str,
483
- nametag: str,
484
480
  run_mode: Literal["precision_plus", "precision", "smart", "economy"],
481
+ nametag: str | Omit = omit,
485
482
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
486
483
  # The extra values given here take precedence over values defined on the client or passed to this method.
487
484
  extra_headers: Headers | None = None,
@@ -490,7 +487,8 @@ class AsyncDefendResource(AsyncAPIResource):
490
487
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
491
488
  ) -> WorkflowEventResponse:
492
489
  """
493
- Submit a model input and output pair to a workflow for evaluation.
490
+ Use this endpoint to submit a model input and output pair to a workflow for
491
+ evaluation
494
492
 
495
493
  Args:
496
494
  model_input: A dictionary of inputs sent to the LLM to generate output. This must contain a
@@ -501,13 +499,13 @@ class AsyncDefendResource(AsyncAPIResource):
501
499
 
502
500
  model_used: Model ID used to generate the output, like `gpt-4o` or `o3`.
503
501
 
504
- nametag: An optional, user-defined tag for the event.
505
-
506
502
  run_mode: Run mode for the workflow event. The run mode allows the user to optimize for
507
503
  speed, accuracy, and cost by determining which models are used to evaluate the
508
504
  event. Available run modes include `precision_plus`, `precision`, `smart`, and
509
505
  `economy`. Defaults to `smart`.
510
506
 
507
+ nametag: An optional, user-defined tag for the event.
508
+
511
509
  extra_headers: Send extra headers
512
510
 
513
511
  extra_query: Add additional query parameters to the request
@@ -525,8 +523,8 @@ class AsyncDefendResource(AsyncAPIResource):
525
523
  "model_input": model_input,
526
524
  "model_output": model_output,
527
525
  "model_used": model_used,
528
- "nametag": nametag,
529
526
  "run_mode": run_mode,
527
+ "nametag": nametag,
530
528
  },
531
529
  defend_submit_event_params.DefendSubmitEventParams,
532
530
  ),
@@ -542,7 +540,6 @@ class AsyncDefendResource(AsyncAPIResource):
542
540
  *,
543
541
  description: str | Omit = omit,
544
542
  name: str | Omit = omit,
545
- type: Literal["automatic", "custom"] | Omit = omit,
546
543
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
547
544
  # The extra values given here take precedence over values defined on the client or passed to this method.
548
545
  extra_headers: Headers | None = None,
@@ -551,15 +548,13 @@ class AsyncDefendResource(AsyncAPIResource):
551
548
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
552
549
  ) -> DefendResponse:
553
550
  """
554
- Update an existing guardrail workflow.
551
+ Use this endpoint to update an existing guardrail workflow
555
552
 
556
553
  Args:
557
554
  description: Description for the workflow.
558
555
 
559
556
  name: Name of the workflow.
560
557
 
561
- type: Type of thresholds to use for the workflow, either `automatic` or `custom`.
562
-
563
558
  extra_headers: Send extra headers
564
559
 
565
560
  extra_query: Add additional query parameters to the request
@@ -576,7 +571,6 @@ class AsyncDefendResource(AsyncAPIResource):
576
571
  {
577
572
  "description": description,
578
573
  "name": name,
579
- "type": type,
580
574
  },
581
575
  defend_update_workflow_params.DefendUpdateWorkflowParams,
582
576
  ),
@@ -133,7 +133,7 @@ class EvaluateResource(SyncAPIResource):
133
133
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
134
134
  ) -> Evaluation:
135
135
  """
136
- Retrieve the evaluation record for a given evaluation ID.
136
+ Use this endpoint to retrieve the evaluation record for a given evaluation ID
137
137
 
138
138
  Args:
139
139
  extra_headers: Send extra headers
@@ -264,7 +264,7 @@ class AsyncEvaluateResource(AsyncAPIResource):
264
264
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
265
265
  ) -> Evaluation:
266
266
  """
267
- Retrieve the evaluation record for a given evaluation ID.
267
+ Use this endpoint to retrieve the evaluation record for a given evaluation ID
268
268
 
269
269
  Args:
270
270
  extra_headers: Send extra headers
@@ -59,7 +59,8 @@ class MonitorResource(SyncAPIResource):
59
59
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
60
60
  ) -> APIResponse:
61
61
  """
62
- Create a new monitor to evaluate model inputs and outputs using guardrails.
62
+ Use this endpoint to create a new monitor to evaluate model inputs and outputs
63
+ using guardrails
63
64
 
64
65
  Args:
65
66
  name: Name of the new monitor.
@@ -102,7 +103,8 @@ class MonitorResource(SyncAPIResource):
102
103
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
103
104
  ) -> MonitorRetrieveResponse:
104
105
  """
105
- Retrieve the details and evaluations associated with a specific monitor.
106
+ Use this endpoint to retrieve the details and evaluations associated with a
107
+ specific monitor
106
108
 
107
109
  Args:
108
110
  limit: Limit the returned events associated with this monitor. Defaults to 10.
@@ -144,7 +146,8 @@ class MonitorResource(SyncAPIResource):
144
146
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
145
147
  ) -> APIResponse:
146
148
  """
147
- Update the name, description, or status of an existing monitor.
149
+ Use this endpoint to update the name, description, or status of an existing
150
+ monitor
148
151
 
149
152
  Args:
150
153
  description: Description of the monitor.
@@ -207,7 +210,8 @@ class MonitorResource(SyncAPIResource):
207
210
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
208
211
  ) -> MonitorSubmitEventResponse:
209
212
  """
210
- Submit a model input and output pair to a monitor for evaluation.
213
+ Use this endpoint to submit a model input and output pair to a monitor for
214
+ evaluation
211
215
 
212
216
  Args:
213
217
  guardrail_metrics: An array of guardrail metrics that the model input and output pair will be
@@ -293,7 +297,8 @@ class AsyncMonitorResource(AsyncAPIResource):
293
297
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
294
298
  ) -> APIResponse:
295
299
  """
296
- Create a new monitor to evaluate model inputs and outputs using guardrails.
300
+ Use this endpoint to create a new monitor to evaluate model inputs and outputs
301
+ using guardrails
297
302
 
298
303
  Args:
299
304
  name: Name of the new monitor.
@@ -336,7 +341,8 @@ class AsyncMonitorResource(AsyncAPIResource):
336
341
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
337
342
  ) -> MonitorRetrieveResponse:
338
343
  """
339
- Retrieve the details and evaluations associated with a specific monitor.
344
+ Use this endpoint to retrieve the details and evaluations associated with a
345
+ specific monitor
340
346
 
341
347
  Args:
342
348
  limit: Limit the returned events associated with this monitor. Defaults to 10.
@@ -378,7 +384,8 @@ class AsyncMonitorResource(AsyncAPIResource):
378
384
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
379
385
  ) -> APIResponse:
380
386
  """
381
- Update the name, description, or status of an existing monitor.
387
+ Use this endpoint to update the name, description, or status of an existing
388
+ monitor
382
389
 
383
390
  Args:
384
391
  description: Description of the monitor.
@@ -441,7 +448,8 @@ class AsyncMonitorResource(AsyncAPIResource):
441
448
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
442
449
  ) -> MonitorSubmitEventResponse:
443
450
  """
444
- Submit a model input and output pair to a monitor for evaluation.
451
+ Use this endpoint to submit a model input and output pair to a monitor for
452
+ evaluation
445
453
 
446
454
  Args:
447
455
  guardrail_metrics: An array of guardrail metrics that the model input and output pair will be
@@ -41,7 +41,6 @@ class APIResponse(BaseModel):
41
41
  """Represents whether the request was completed successfully."""
42
42
 
43
43
  data: Optional[Data] = None
44
- """Response payload for creating or updating a monitor."""
45
44
 
46
45
  message: Optional[str] = None
47
46
  """The accompanying message for the request.
@@ -13,7 +13,7 @@ class DefendCreateWorkflowParams(TypedDict, total=False):
13
13
  """
14
14
  The action used to improve outputs that fail one or guardrail metrics for the
15
15
  workflow events. May be `regenerate`, `fixit`, or null which represents “do
16
- nothing”. ReGen runs the user's exact input prompt with minor induced variance.
16
+ nothing”. Regenerate runs the user's input prompt with minor induced variance.
17
17
  Fixit attempts to directly address the shortcomings of the output using the
18
18
  guardrail failure rationale. Do nothing does not attempt any improvement.
19
19
  """
@@ -26,7 +26,7 @@ class DefendResponse(BaseModel):
26
26
  """
27
27
  The action used to improve outputs that fail one or more guardrail metrics for
28
28
  the workflow events. May be `regenerate`, `fixit`, or null which represents “do
29
- nothing”. ReGen runs the user's exact input prompt with minor induced variance.
29
+ nothing”. Regenerate runs the user's input prompt with minor induced variance.
30
30
  Fixit attempts to directly address the shortcomings of the output using the
31
31
  guardrail failure rationale. Do nothing does not attempt any improvement.
32
32
  """
@@ -22,9 +22,6 @@ class DefendSubmitEventParams(TypedDict, total=False):
22
22
  model_used: Required[str]
23
23
  """Model ID used to generate the output, like `gpt-4o` or `o3`."""
24
24
 
25
- nametag: Required[str]
26
- """An optional, user-defined tag for the event."""
27
-
28
25
  run_mode: Required[Literal["precision_plus", "precision", "smart", "economy"]]
29
26
  """Run mode for the workflow event.
30
27
 
@@ -34,6 +31,9 @@ class DefendSubmitEventParams(TypedDict, total=False):
34
31
  `smart`.
35
32
  """
36
33
 
34
+ nametag: str
35
+ """An optional, user-defined tag for the event."""
36
+
37
37
 
38
38
  class ModelInputTyped(TypedDict, total=False):
39
39
  user_prompt: Required[str]
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing_extensions import Literal, TypedDict
5
+ from typing_extensions import TypedDict
6
6
 
7
7
  __all__ = ["DefendUpdateWorkflowParams"]
8
8
 
@@ -13,6 +13,3 @@ class DefendUpdateWorkflowParams(TypedDict, total=False):
13
13
 
14
14
  name: str
15
15
  """Name of the workflow."""
16
-
17
- type: Literal["automatic", "custom"]
18
- """Type of thresholds to use for the workflow, either `automatic` or `custom`."""
@@ -72,7 +72,6 @@ class MonitorRetrieveResponse(BaseModel):
72
72
  """Represents whether the request was completed successfully."""
73
73
 
74
74
  data: Optional[Data] = None
75
- """Detailed response payload for retrieving a monitor and its evaluations."""
76
75
 
77
76
  message: Optional[str] = None
78
77
  """The accompanying message for the request.
@@ -27,7 +27,6 @@ class MonitorSubmitEventResponse(BaseModel):
27
27
  """Represents whether the request was completed successfully."""
28
28
 
29
29
  data: Optional[Data] = None
30
- """Response payload for monitor event operations."""
31
30
 
32
31
  message: Optional[str] = None
33
32
  """The accompanying message for the request.
@@ -179,7 +179,6 @@ class TestDefend:
179
179
  model_input={"user_prompt": "user_prompt"},
180
180
  model_output="model_output",
181
181
  model_used="model_used",
182
- nametag="nametag",
183
182
  run_mode="precision_plus",
184
183
  )
185
184
  assert_matches_type(WorkflowEventResponse, defend, path=["response"])
@@ -195,8 +194,8 @@ class TestDefend:
195
194
  },
196
195
  model_output="model_output",
197
196
  model_used="model_used",
198
- nametag="nametag",
199
197
  run_mode="precision_plus",
198
+ nametag="nametag",
200
199
  )
201
200
  assert_matches_type(WorkflowEventResponse, defend, path=["response"])
202
201
 
@@ -208,7 +207,6 @@ class TestDefend:
208
207
  model_input={"user_prompt": "user_prompt"},
209
208
  model_output="model_output",
210
209
  model_used="model_used",
211
- nametag="nametag",
212
210
  run_mode="precision_plus",
213
211
  )
214
212
 
@@ -225,7 +223,6 @@ class TestDefend:
225
223
  model_input={"user_prompt": "user_prompt"},
226
224
  model_output="model_output",
227
225
  model_used="model_used",
228
- nametag="nametag",
229
226
  run_mode="precision_plus",
230
227
  ) as response:
231
228
  assert not response.is_closed
@@ -245,7 +242,6 @@ class TestDefend:
245
242
  model_input={"user_prompt": "user_prompt"},
246
243
  model_output="model_output",
247
244
  model_used="model_used",
248
- nametag="nametag",
249
245
  run_mode="precision_plus",
250
246
  )
251
247
 
@@ -264,7 +260,6 @@ class TestDefend:
264
260
  workflow_id="workflow_id",
265
261
  description="description",
266
262
  name="name",
267
- type="automatic",
268
263
  )
269
264
  assert_matches_type(DefendResponse, defend, path=["response"])
270
265
 
@@ -467,7 +462,6 @@ class TestAsyncDefend:
467
462
  model_input={"user_prompt": "user_prompt"},
468
463
  model_output="model_output",
469
464
  model_used="model_used",
470
- nametag="nametag",
471
465
  run_mode="precision_plus",
472
466
  )
473
467
  assert_matches_type(WorkflowEventResponse, defend, path=["response"])
@@ -483,8 +477,8 @@ class TestAsyncDefend:
483
477
  },
484
478
  model_output="model_output",
485
479
  model_used="model_used",
486
- nametag="nametag",
487
480
  run_mode="precision_plus",
481
+ nametag="nametag",
488
482
  )
489
483
  assert_matches_type(WorkflowEventResponse, defend, path=["response"])
490
484
 
@@ -496,7 +490,6 @@ class TestAsyncDefend:
496
490
  model_input={"user_prompt": "user_prompt"},
497
491
  model_output="model_output",
498
492
  model_used="model_used",
499
- nametag="nametag",
500
493
  run_mode="precision_plus",
501
494
  )
502
495
 
@@ -513,7 +506,6 @@ class TestAsyncDefend:
513
506
  model_input={"user_prompt": "user_prompt"},
514
507
  model_output="model_output",
515
508
  model_used="model_used",
516
- nametag="nametag",
517
509
  run_mode="precision_plus",
518
510
  ) as response:
519
511
  assert not response.is_closed
@@ -533,7 +525,6 @@ class TestAsyncDefend:
533
525
  model_input={"user_prompt": "user_prompt"},
534
526
  model_output="model_output",
535
527
  model_used="model_used",
536
- nametag="nametag",
537
528
  run_mode="precision_plus",
538
529
  )
539
530
 
@@ -552,7 +543,6 @@ class TestAsyncDefend:
552
543
  workflow_id="workflow_id",
553
544
  description="description",
554
545
  name="name",
555
- type="automatic",
556
546
  )
557
547
  assert_matches_type(DefendResponse, defend, path=["response"])
558
548
 
@@ -1,3 +0,0 @@
1
- {
2
- ".": "1.2.0"
3
- }
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