deeprails 1.2.0__py3-none-any.whl → 1.4.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.
Potentially problematic release.
This version of deeprails might be problematic. Click here for more details.
- deeprails/_version.py +1 -1
- deeprails/resources/defend.py +24 -30
- deeprails/resources/evaluate.py +2 -2
- deeprails/resources/monitor.py +16 -8
- deeprails/types/api_response.py +0 -1
- deeprails/types/defend_create_workflow_params.py +1 -1
- deeprails/types/defend_response.py +1 -1
- deeprails/types/defend_submit_event_params.py +3 -3
- deeprails/types/defend_update_workflow_params.py +1 -4
- deeprails/types/monitor_retrieve_response.py +0 -1
- deeprails/types/monitor_submit_event_response.py +0 -1
- {deeprails-1.2.0.dist-info → deeprails-1.4.0.dist-info}/METADATA +10 -11
- {deeprails-1.2.0.dist-info → deeprails-1.4.0.dist-info}/RECORD +15 -15
- {deeprails-1.2.0.dist-info → deeprails-1.4.0.dist-info}/WHEEL +0 -0
- {deeprails-1.2.0.dist-info → deeprails-1.4.0.dist-info}/licenses/LICENSE +0 -0
deeprails/_version.py
CHANGED
deeprails/resources/defend.py
CHANGED
|
@@ -63,13 +63,13 @@ class DefendResource(SyncAPIResource):
|
|
|
63
63
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
64
64
|
) -> DefendResponse:
|
|
65
65
|
"""
|
|
66
|
-
|
|
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”.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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”.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
),
|
deeprails/resources/evaluate.py
CHANGED
|
@@ -133,7 +133,7 @@ class EvaluateResource(SyncAPIResource):
|
|
|
133
133
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
134
134
|
) -> Evaluation:
|
|
135
135
|
"""
|
|
136
|
-
|
|
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
|
-
|
|
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
|
deeprails/resources/monitor.py
CHANGED
|
@@ -59,7 +59,8 @@ class MonitorResource(SyncAPIResource):
|
|
|
59
59
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
60
60
|
) -> APIResponse:
|
|
61
61
|
"""
|
|
62
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
deeprails/types/api_response.py
CHANGED
|
@@ -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”.
|
|
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”.
|
|
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
|
|
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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: deeprails
|
|
3
|
-
Version: 1.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
360
|
+
"completeness": 0.8,
|
|
362
361
|
"instruction_adherence": 0.75,
|
|
363
362
|
},
|
|
364
363
|
name="Push Alert Workflow",
|
|
@@ -11,7 +11,7 @@ deeprails/_resource.py,sha256=7RXX5KZr4j0TIE66vnduHp7p9Yf9X0FyDDECuvRHARg,1118
|
|
|
11
11
|
deeprails/_response.py,sha256=yj0HJDU91WPpiczwi6CBOLAl_bqf4I_I96vWMAwx6Fg,28806
|
|
12
12
|
deeprails/_streaming.py,sha256=hCp5bK9dyw2TyrVL69m-6qGC-QtGYwhXmFzITCWPgAs,10112
|
|
13
13
|
deeprails/_types.py,sha256=XR3mad9NsGqZsjrd1VVJ657-4O4kwyw9Qzg4M3i6Vh0,7239
|
|
14
|
-
deeprails/_version.py,sha256=
|
|
14
|
+
deeprails/_version.py,sha256=nMhAqvtoJeGjBNmKA2YxYmQHli9dlJv7NRk8ULgsvMo,161
|
|
15
15
|
deeprails/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
deeprails/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
17
17
|
deeprails/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
@@ -27,25 +27,25 @@ deeprails/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4
|
|
|
27
27
|
deeprails/_utils/_utils.py,sha256=0dDqauUbVZEXV0NVl7Bwu904Wwo5eyFCZpQThhFNhyA,12253
|
|
28
28
|
deeprails/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
29
29
|
deeprails/resources/__init__.py,sha256=ha0jL9Et8fHzPdkTa7ecihYapOC4I6O-PHf2X9igprE,1491
|
|
30
|
-
deeprails/resources/defend.py,sha256=
|
|
31
|
-
deeprails/resources/evaluate.py,sha256=
|
|
32
|
-
deeprails/resources/monitor.py,sha256=
|
|
30
|
+
deeprails/resources/defend.py,sha256=_11GJ0jphqPP7RRPceLHfzyaLf-Mcmi29tinsA0F_cM,27566
|
|
31
|
+
deeprails/resources/evaluate.py,sha256=_jAPyR1ULkz8yrU3nOtwJstdRIoCuwDiT1leAYPQCUY,12907
|
|
32
|
+
deeprails/resources/monitor.py,sha256=hF-aLOS2whKsE-EVdNIj6hPY-YGKpo8xWoAwwCq4B34,22415
|
|
33
33
|
deeprails/types/__init__.py,sha256=tLO-5DMMKt-F4qQYht3F-RFgLbthP-8a36853IhNoGI,1267
|
|
34
|
-
deeprails/types/api_response.py,sha256=
|
|
35
|
-
deeprails/types/defend_create_workflow_params.py,sha256=
|
|
36
|
-
deeprails/types/defend_response.py,sha256=
|
|
37
|
-
deeprails/types/defend_submit_event_params.py,sha256=
|
|
38
|
-
deeprails/types/defend_update_workflow_params.py,sha256=
|
|
34
|
+
deeprails/types/api_response.py,sha256=eHEQeL677tvm1RK0A_S03EAoprQbJzmHspiKrtjKRt4,1232
|
|
35
|
+
deeprails/types/defend_create_workflow_params.py,sha256=EWYlSeoojWf8pp7VawZh8IbShHWsd0iZfdKq6qlh8OA,2076
|
|
36
|
+
deeprails/types/defend_response.py,sha256=u508zff61fbo7DqotbJLEoYzYg2VUDWbFScx8Ec8EGA,1617
|
|
37
|
+
deeprails/types/defend_submit_event_params.py,sha256=PAmzDkpzaOZjCxGy0c_UTZDvb57N7uhG7NZm5ICRcIg,1376
|
|
38
|
+
deeprails/types/defend_update_workflow_params.py,sha256=QH2k7EDMLub3mW1lPV5SUoKDHW_T2arSo-RGHLterwo,373
|
|
39
39
|
deeprails/types/evaluate_create_params.py,sha256=8P3jDuSgGRfGSdgq50Zq9J709ZltRZw29hI8R3MoS84,1828
|
|
40
40
|
deeprails/types/evaluation.py,sha256=cLFQtazZyAEOVGkGqQ_VUmCFE8WMS2pBzUPLQ9MioOA,3787
|
|
41
41
|
deeprails/types/monitor_create_params.py,sha256=kTSj-PhuzpT-HPDTQJemRWfd8w32foUMH9FQZj8symk,384
|
|
42
42
|
deeprails/types/monitor_retrieve_params.py,sha256=PEsRmbd-81z4pJvhfi4JbrQWNzmeiLkoNsTUoPZ6kFY,352
|
|
43
|
-
deeprails/types/monitor_retrieve_response.py,sha256=
|
|
43
|
+
deeprails/types/monitor_retrieve_response.py,sha256=BZp7-6PFVdqYU5ZDhbr1Eao3kU132zTm9idgoaA65Gg,2245
|
|
44
44
|
deeprails/types/monitor_submit_event_params.py,sha256=q8Mq24McRr1WdXQ8L1YunKqLBb9-u91J2MLmhUCdaIw,1991
|
|
45
|
-
deeprails/types/monitor_submit_event_response.py,sha256=
|
|
45
|
+
deeprails/types/monitor_submit_event_response.py,sha256=qlraxIJaclNSR_JOizMPj9gOiz-0x7lIChSX3DmFllM,867
|
|
46
46
|
deeprails/types/monitor_update_params.py,sha256=gJyFFxT_u_iWABknuKnLpPl9r-VPfCcGtOAmh6sPwUw,550
|
|
47
47
|
deeprails/types/workflow_event_response.py,sha256=mIzOCnYJg4TDSq_tG_0WfA0_Gmc9-0q-befyookfUFM,867
|
|
48
|
-
deeprails-1.
|
|
49
|
-
deeprails-1.
|
|
50
|
-
deeprails-1.
|
|
51
|
-
deeprails-1.
|
|
48
|
+
deeprails-1.4.0.dist-info/METADATA,sha256=XK3jbhDy18tMUqJk5AJZyNQqB2rQ3kEwHTmdp8Jmkog,11840
|
|
49
|
+
deeprails-1.4.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
50
|
+
deeprails-1.4.0.dist-info/licenses/LICENSE,sha256=rFTxPcYE516UQLju2SCY1r2pSDDfodL0-ZvxF_fgueg,11339
|
|
51
|
+
deeprails-1.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|