deeprails 0.18.0 → 0.23.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +62 -0
- data/README.md +1 -1
- data/lib/deeprails/internal/stream.rb +29 -0
- data/lib/deeprails/internal/transport/base_client.rb +3 -1
- data/lib/deeprails/internal/transport/pooled_net_requester.rb +12 -10
- data/lib/deeprails/internal/type/base_stream.rb +83 -0
- data/lib/deeprails/internal/util.rb +7 -2
- data/lib/deeprails/models/defend_create_workflow_params.rb +14 -1
- data/lib/deeprails/models/defend_response.rb +134 -10
- data/lib/deeprails/models/defend_submit_and_stream_event_params.rb +83 -0
- data/lib/deeprails/models/defend_submit_and_stream_event_response.rb +7 -0
- data/lib/deeprails/models/defend_submit_event_params.rb +52 -16
- data/lib/deeprails/models/defend_update_response.rb +9 -1
- data/lib/deeprails/models/defend_update_workflow_params.rb +131 -5
- data/lib/deeprails/models/monitor_create_params.rb +14 -1
- data/lib/deeprails/models/monitor_detail_response.rb +53 -14
- data/lib/deeprails/models/monitor_event_detail_response.rb +6 -2
- data/lib/deeprails/models/monitor_submit_event_params.rb +52 -16
- data/lib/deeprails/models/monitor_update_params.rb +46 -5
- data/lib/deeprails/models/workflow_event_detail_response.rb +88 -16
- data/lib/deeprails/models/workflow_event_response.rb +9 -1
- data/lib/deeprails/models.rb +2 -0
- data/lib/deeprails/resources/defend.rb +67 -4
- data/lib/deeprails/resources/monitor.rb +14 -6
- data/lib/deeprails/version.rb +1 -1
- data/lib/deeprails.rb +5 -0
- data/manifest.yaml +1 -0
- data/rbi/deeprails/internal/stream.rbi +20 -0
- data/rbi/deeprails/internal/transport/base_client.rbi +18 -2
- data/rbi/deeprails/internal/type/base_stream.rbi +75 -0
- data/rbi/deeprails/models/defend_create_workflow_params.rbi +21 -0
- data/rbi/deeprails/models/defend_response.rbi +286 -14
- data/rbi/deeprails/models/defend_submit_and_stream_event_params.rbi +148 -0
- data/rbi/deeprails/models/defend_submit_and_stream_event_response.rbi +7 -0
- data/rbi/deeprails/models/defend_submit_event_params.rbi +108 -25
- data/rbi/deeprails/models/defend_update_response.rbi +14 -3
- data/rbi/deeprails/models/defend_update_workflow_params.rbi +298 -4
- data/rbi/deeprails/models/monitor_create_params.rbi +21 -0
- data/rbi/deeprails/models/monitor_detail_response.rbi +103 -22
- data/rbi/deeprails/models/monitor_event_detail_response.rbi +4 -2
- data/rbi/deeprails/models/monitor_submit_event_params.rbi +108 -25
- data/rbi/deeprails/models/monitor_update_params.rbi +107 -4
- data/rbi/deeprails/models/workflow_event_detail_response.rbi +170 -24
- data/rbi/deeprails/models/workflow_event_response.rbi +8 -0
- data/rbi/deeprails/models.rbi +3 -0
- data/rbi/deeprails/resources/defend.rbi +96 -6
- data/rbi/deeprails/resources/monitor.rbi +28 -8
- data/sig/deeprails/internal/stream.rbs +9 -0
- data/sig/deeprails/internal/type/base_stream.rbs +38 -0
- data/sig/deeprails/models/defend_create_workflow_params.rbs +7 -0
- data/sig/deeprails/models/defend_response.rbs +114 -8
- data/sig/deeprails/models/defend_submit_and_stream_event_params.rbs +74 -0
- data/sig/deeprails/models/defend_submit_and_stream_event_response.rbs +5 -0
- data/sig/deeprails/models/defend_submit_event_params.rbs +39 -10
- data/sig/deeprails/models/defend_update_response.rbs +10 -3
- data/sig/deeprails/models/defend_update_workflow_params.rbs +103 -1
- data/sig/deeprails/models/monitor_create_params.rbs +7 -0
- data/sig/deeprails/models/monitor_detail_response.rbs +36 -9
- data/sig/deeprails/models/monitor_submit_event_params.rbs +39 -10
- data/sig/deeprails/models/monitor_update_params.rbs +45 -1
- data/sig/deeprails/models/workflow_event_detail_response.rbs +88 -15
- data/sig/deeprails/models/workflow_event_response.rbs +5 -0
- data/sig/deeprails/models.rbs +2 -0
- data/sig/deeprails/resources/defend.rbs +20 -0
- data/sig/deeprails/resources/monitor.rbs +4 -0
- metadata +28 -2
|
@@ -8,7 +8,8 @@ module Deeprails
|
|
|
8
8
|
T.any(Deeprails::MonitorDetailResponse, Deeprails::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
# An array of capabilities associated with this monitor.
|
|
11
|
+
# An array of extended AI capabilities associated with this monitor. Can be
|
|
12
|
+
# `web_search`, `file_search`, and/or `context_awareness`.
|
|
12
13
|
sig { returns(T::Array[Deeprails::MonitorDetailResponse::Capability]) }
|
|
13
14
|
attr_accessor :capabilities
|
|
14
15
|
|
|
@@ -77,7 +78,8 @@ module Deeprails
|
|
|
77
78
|
).returns(T.attached_class)
|
|
78
79
|
end
|
|
79
80
|
def self.new(
|
|
80
|
-
# An array of capabilities associated with this monitor.
|
|
81
|
+
# An array of extended AI capabilities associated with this monitor. Can be
|
|
82
|
+
# `web_search`, `file_search`, and/or `context_awareness`.
|
|
81
83
|
capabilities:,
|
|
82
84
|
# The time the monitor was created in UTC.
|
|
83
85
|
created_at:,
|
|
@@ -170,8 +172,9 @@ module Deeprails
|
|
|
170
172
|
attr_accessor :evaluation_status
|
|
171
173
|
|
|
172
174
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
173
|
-
# contain
|
|
174
|
-
#
|
|
175
|
+
# contain a `user_prompt` field. For ground_truth_adherence guardrail metric,
|
|
176
|
+
# `ground_truth` should be provided. When `context_awareness` is enabled,
|
|
177
|
+
# `context` should be provided.
|
|
175
178
|
sig do
|
|
176
179
|
returns(Deeprails::MonitorDetailResponse::Evaluation::ModelInput)
|
|
177
180
|
end
|
|
@@ -290,8 +293,9 @@ module Deeprails
|
|
|
290
293
|
# Status of the evaluation.
|
|
291
294
|
evaluation_status:,
|
|
292
295
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
293
|
-
# contain
|
|
294
|
-
#
|
|
296
|
+
# contain a `user_prompt` field. For ground_truth_adherence guardrail metric,
|
|
297
|
+
# `ground_truth` should be provided. When `context_awareness` is enabled,
|
|
298
|
+
# `context` should be provided.
|
|
295
299
|
model_input:,
|
|
296
300
|
# Output generated by the LLM to be evaluated.
|
|
297
301
|
model_output:,
|
|
@@ -403,6 +407,36 @@ module Deeprails
|
|
|
403
407
|
)
|
|
404
408
|
end
|
|
405
409
|
|
|
410
|
+
# The user prompt used to generate the output.
|
|
411
|
+
sig { returns(String) }
|
|
412
|
+
attr_accessor :user_prompt
|
|
413
|
+
|
|
414
|
+
# Any structured information that directly relates to the model’s input and
|
|
415
|
+
# expected output—e.g., the recent turn-by-turn history between an AI tutor and a
|
|
416
|
+
# student, facts or state passed through an agentic workflow, or other
|
|
417
|
+
# domain-specific signals your system already knows and wants the model to
|
|
418
|
+
# condition on.
|
|
419
|
+
sig do
|
|
420
|
+
returns(
|
|
421
|
+
T.nilable(
|
|
422
|
+
T::Array[
|
|
423
|
+
Deeprails::MonitorDetailResponse::Evaluation::ModelInput::Context
|
|
424
|
+
]
|
|
425
|
+
)
|
|
426
|
+
)
|
|
427
|
+
end
|
|
428
|
+
attr_reader :context
|
|
429
|
+
|
|
430
|
+
sig do
|
|
431
|
+
params(
|
|
432
|
+
context:
|
|
433
|
+
T::Array[
|
|
434
|
+
Deeprails::MonitorDetailResponse::Evaluation::ModelInput::Context::OrHash
|
|
435
|
+
]
|
|
436
|
+
).void
|
|
437
|
+
end
|
|
438
|
+
attr_writer :context
|
|
439
|
+
|
|
406
440
|
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
|
407
441
|
sig { returns(T.nilable(String)) }
|
|
408
442
|
attr_reader :ground_truth
|
|
@@ -417,44 +451,91 @@ module Deeprails
|
|
|
417
451
|
sig { params(system_prompt: String).void }
|
|
418
452
|
attr_writer :system_prompt
|
|
419
453
|
|
|
420
|
-
# The user prompt used to generate the output.
|
|
421
|
-
sig { returns(T.nilable(String)) }
|
|
422
|
-
attr_reader :user_prompt
|
|
423
|
-
|
|
424
|
-
sig { params(user_prompt: String).void }
|
|
425
|
-
attr_writer :user_prompt
|
|
426
|
-
|
|
427
454
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
428
|
-
# contain
|
|
429
|
-
#
|
|
455
|
+
# contain a `user_prompt` field. For ground_truth_adherence guardrail metric,
|
|
456
|
+
# `ground_truth` should be provided. When `context_awareness` is enabled,
|
|
457
|
+
# `context` should be provided.
|
|
430
458
|
sig do
|
|
431
459
|
params(
|
|
460
|
+
user_prompt: String,
|
|
461
|
+
context:
|
|
462
|
+
T::Array[
|
|
463
|
+
Deeprails::MonitorDetailResponse::Evaluation::ModelInput::Context::OrHash
|
|
464
|
+
],
|
|
432
465
|
ground_truth: String,
|
|
433
|
-
system_prompt: String
|
|
434
|
-
user_prompt: String
|
|
466
|
+
system_prompt: String
|
|
435
467
|
).returns(T.attached_class)
|
|
436
468
|
end
|
|
437
469
|
def self.new(
|
|
470
|
+
# The user prompt used to generate the output.
|
|
471
|
+
user_prompt:,
|
|
472
|
+
# Any structured information that directly relates to the model’s input and
|
|
473
|
+
# expected output—e.g., the recent turn-by-turn history between an AI tutor and a
|
|
474
|
+
# student, facts or state passed through an agentic workflow, or other
|
|
475
|
+
# domain-specific signals your system already knows and wants the model to
|
|
476
|
+
# condition on.
|
|
477
|
+
context: nil,
|
|
438
478
|
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
|
439
479
|
ground_truth: nil,
|
|
440
480
|
# The system prompt used to generate the output.
|
|
441
|
-
system_prompt: nil
|
|
442
|
-
# The user prompt used to generate the output.
|
|
443
|
-
user_prompt: nil
|
|
481
|
+
system_prompt: nil
|
|
444
482
|
)
|
|
445
483
|
end
|
|
446
484
|
|
|
447
485
|
sig do
|
|
448
486
|
override.returns(
|
|
449
487
|
{
|
|
488
|
+
user_prompt: String,
|
|
489
|
+
context:
|
|
490
|
+
T::Array[
|
|
491
|
+
Deeprails::MonitorDetailResponse::Evaluation::ModelInput::Context
|
|
492
|
+
],
|
|
450
493
|
ground_truth: String,
|
|
451
|
-
system_prompt: String
|
|
452
|
-
user_prompt: String
|
|
494
|
+
system_prompt: String
|
|
453
495
|
}
|
|
454
496
|
)
|
|
455
497
|
end
|
|
456
498
|
def to_hash
|
|
457
499
|
end
|
|
500
|
+
|
|
501
|
+
class Context < Deeprails::Internal::Type::BaseModel
|
|
502
|
+
OrHash =
|
|
503
|
+
T.type_alias do
|
|
504
|
+
T.any(
|
|
505
|
+
Deeprails::MonitorDetailResponse::Evaluation::ModelInput::Context,
|
|
506
|
+
Deeprails::Internal::AnyHash
|
|
507
|
+
)
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
# The content of the message.
|
|
511
|
+
sig { returns(T.nilable(String)) }
|
|
512
|
+
attr_reader :content
|
|
513
|
+
|
|
514
|
+
sig { params(content: String).void }
|
|
515
|
+
attr_writer :content
|
|
516
|
+
|
|
517
|
+
# The role of the speaker.
|
|
518
|
+
sig { returns(T.nilable(String)) }
|
|
519
|
+
attr_reader :role
|
|
520
|
+
|
|
521
|
+
sig { params(role: String).void }
|
|
522
|
+
attr_writer :role
|
|
523
|
+
|
|
524
|
+
sig do
|
|
525
|
+
params(content: String, role: String).returns(T.attached_class)
|
|
526
|
+
end
|
|
527
|
+
def self.new(
|
|
528
|
+
# The content of the message.
|
|
529
|
+
content: nil,
|
|
530
|
+
# The role of the speaker.
|
|
531
|
+
role: nil
|
|
532
|
+
)
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
sig { override.returns({ content: String, role: String }) }
|
|
536
|
+
def to_hash
|
|
537
|
+
end
|
|
538
|
+
end
|
|
458
539
|
end
|
|
459
540
|
|
|
460
541
|
# Run mode for the evaluation. The run mode allows the user to optimize for speed,
|
|
@@ -11,7 +11,8 @@ module Deeprails
|
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
# The capabilities associated with the monitor event.
|
|
14
|
+
# The extended AI capabilities associated with the monitor event. Can be
|
|
15
|
+
# `web_search`, `file_search`, and/or `context_awareness`.
|
|
15
16
|
sig do
|
|
16
17
|
returns(
|
|
17
18
|
T.nilable(T::Array[Deeprails::MonitorEventDetailResponse::Capability])
|
|
@@ -156,7 +157,8 @@ module Deeprails
|
|
|
156
157
|
).returns(T.attached_class)
|
|
157
158
|
end
|
|
158
159
|
def self.new(
|
|
159
|
-
# The capabilities associated with the monitor event.
|
|
160
|
+
# The extended AI capabilities associated with the monitor event. Can be
|
|
161
|
+
# `web_search`, `file_search`, and/or `context_awareness`.
|
|
160
162
|
capabilities: nil,
|
|
161
163
|
# The time spent on the evaluation in seconds.
|
|
162
164
|
eval_time: nil,
|
|
@@ -15,8 +15,8 @@ module Deeprails
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
18
|
-
# contain
|
|
19
|
-
#
|
|
18
|
+
# contain a `user_prompt` field. For ground_truth_adherence guardrail metric,
|
|
19
|
+
# `ground_truth` should be provided.
|
|
20
20
|
sig { returns(Deeprails::MonitorSubmitEventParams::ModelInput) }
|
|
21
21
|
attr_reader :model_input
|
|
22
22
|
|
|
@@ -40,8 +40,8 @@ module Deeprails
|
|
|
40
40
|
|
|
41
41
|
# Run mode for the monitor event. The run mode allows the user to optimize for
|
|
42
42
|
# speed, accuracy, and cost by determining which models are used to evaluate the
|
|
43
|
-
# event. Available run modes include `
|
|
44
|
-
# `economy`. Defaults to `smart`.
|
|
43
|
+
# event. Available run modes include `precision_plus_codex`, `precision_plus`,
|
|
44
|
+
# `precision`, `smart`, and `economy`. Defaults to `smart`.
|
|
45
45
|
sig do
|
|
46
46
|
returns(
|
|
47
47
|
T.nilable(Deeprails::MonitorSubmitEventParams::RunMode::OrSymbol)
|
|
@@ -67,8 +67,8 @@ module Deeprails
|
|
|
67
67
|
end
|
|
68
68
|
def self.new(
|
|
69
69
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
70
|
-
# contain
|
|
71
|
-
#
|
|
70
|
+
# contain a `user_prompt` field. For ground_truth_adherence guardrail metric,
|
|
71
|
+
# `ground_truth` should be provided.
|
|
72
72
|
model_input:,
|
|
73
73
|
# Output generated by the LLM to be evaluated.
|
|
74
74
|
model_output:,
|
|
@@ -76,8 +76,8 @@ module Deeprails
|
|
|
76
76
|
nametag: nil,
|
|
77
77
|
# Run mode for the monitor event. The run mode allows the user to optimize for
|
|
78
78
|
# speed, accuracy, and cost by determining which models are used to evaluate the
|
|
79
|
-
# event. Available run modes include `
|
|
80
|
-
# `economy`. Defaults to `smart`.
|
|
79
|
+
# event. Available run modes include `precision_plus_codex`, `precision_plus`,
|
|
80
|
+
# `precision`, `smart`, and `economy`. Defaults to `smart`.
|
|
81
81
|
run_mode: nil,
|
|
82
82
|
request_options: {}
|
|
83
83
|
)
|
|
@@ -106,6 +106,34 @@ module Deeprails
|
|
|
106
106
|
)
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
+
# The user prompt used to generate the output.
|
|
110
|
+
sig { returns(String) }
|
|
111
|
+
attr_accessor :user_prompt
|
|
112
|
+
|
|
113
|
+
# Any structured information that directly relates to the model’s input and
|
|
114
|
+
# expected output—e.g., the recent turn-by-turn history between an AI tutor and a
|
|
115
|
+
# student, facts or state passed through an agentic workflow, or other
|
|
116
|
+
# domain-specific signals your system already knows and wants the model to
|
|
117
|
+
# condition on.
|
|
118
|
+
sig do
|
|
119
|
+
returns(
|
|
120
|
+
T.nilable(
|
|
121
|
+
T::Array[Deeprails::MonitorSubmitEventParams::ModelInput::Context]
|
|
122
|
+
)
|
|
123
|
+
)
|
|
124
|
+
end
|
|
125
|
+
attr_reader :context
|
|
126
|
+
|
|
127
|
+
sig do
|
|
128
|
+
params(
|
|
129
|
+
context:
|
|
130
|
+
T::Array[
|
|
131
|
+
Deeprails::MonitorSubmitEventParams::ModelInput::Context::OrHash
|
|
132
|
+
]
|
|
133
|
+
).void
|
|
134
|
+
end
|
|
135
|
+
attr_writer :context
|
|
136
|
+
|
|
109
137
|
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
|
110
138
|
sig { returns(T.nilable(String)) }
|
|
111
139
|
attr_reader :ground_truth
|
|
@@ -120,46 +148,96 @@ module Deeprails
|
|
|
120
148
|
sig { params(system_prompt: String).void }
|
|
121
149
|
attr_writer :system_prompt
|
|
122
150
|
|
|
123
|
-
# The user prompt used to generate the output.
|
|
124
|
-
sig { returns(T.nilable(String)) }
|
|
125
|
-
attr_reader :user_prompt
|
|
126
|
-
|
|
127
|
-
sig { params(user_prompt: String).void }
|
|
128
|
-
attr_writer :user_prompt
|
|
129
|
-
|
|
130
151
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
|
131
|
-
# contain
|
|
132
|
-
#
|
|
152
|
+
# contain a `user_prompt` field. For ground_truth_adherence guardrail metric,
|
|
153
|
+
# `ground_truth` should be provided.
|
|
133
154
|
sig do
|
|
134
155
|
params(
|
|
156
|
+
user_prompt: String,
|
|
157
|
+
context:
|
|
158
|
+
T::Array[
|
|
159
|
+
Deeprails::MonitorSubmitEventParams::ModelInput::Context::OrHash
|
|
160
|
+
],
|
|
135
161
|
ground_truth: String,
|
|
136
|
-
system_prompt: String
|
|
137
|
-
user_prompt: String
|
|
162
|
+
system_prompt: String
|
|
138
163
|
).returns(T.attached_class)
|
|
139
164
|
end
|
|
140
165
|
def self.new(
|
|
166
|
+
# The user prompt used to generate the output.
|
|
167
|
+
user_prompt:,
|
|
168
|
+
# Any structured information that directly relates to the model’s input and
|
|
169
|
+
# expected output—e.g., the recent turn-by-turn history between an AI tutor and a
|
|
170
|
+
# student, facts or state passed through an agentic workflow, or other
|
|
171
|
+
# domain-specific signals your system already knows and wants the model to
|
|
172
|
+
# condition on.
|
|
173
|
+
context: nil,
|
|
141
174
|
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
|
142
175
|
ground_truth: nil,
|
|
143
176
|
# The system prompt used to generate the output.
|
|
144
|
-
system_prompt: nil
|
|
145
|
-
# The user prompt used to generate the output.
|
|
146
|
-
user_prompt: nil
|
|
177
|
+
system_prompt: nil
|
|
147
178
|
)
|
|
148
179
|
end
|
|
149
180
|
|
|
150
181
|
sig do
|
|
151
182
|
override.returns(
|
|
152
|
-
{
|
|
183
|
+
{
|
|
184
|
+
user_prompt: String,
|
|
185
|
+
context:
|
|
186
|
+
T::Array[
|
|
187
|
+
Deeprails::MonitorSubmitEventParams::ModelInput::Context
|
|
188
|
+
],
|
|
189
|
+
ground_truth: String,
|
|
190
|
+
system_prompt: String
|
|
191
|
+
}
|
|
153
192
|
)
|
|
154
193
|
end
|
|
155
194
|
def to_hash
|
|
156
195
|
end
|
|
196
|
+
|
|
197
|
+
class Context < Deeprails::Internal::Type::BaseModel
|
|
198
|
+
OrHash =
|
|
199
|
+
T.type_alias do
|
|
200
|
+
T.any(
|
|
201
|
+
Deeprails::MonitorSubmitEventParams::ModelInput::Context,
|
|
202
|
+
Deeprails::Internal::AnyHash
|
|
203
|
+
)
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# The content of the message.
|
|
207
|
+
sig { returns(T.nilable(String)) }
|
|
208
|
+
attr_reader :content
|
|
209
|
+
|
|
210
|
+
sig { params(content: String).void }
|
|
211
|
+
attr_writer :content
|
|
212
|
+
|
|
213
|
+
# The role of the speaker.
|
|
214
|
+
sig { returns(T.nilable(String)) }
|
|
215
|
+
attr_reader :role
|
|
216
|
+
|
|
217
|
+
sig { params(role: String).void }
|
|
218
|
+
attr_writer :role
|
|
219
|
+
|
|
220
|
+
sig do
|
|
221
|
+
params(content: String, role: String).returns(T.attached_class)
|
|
222
|
+
end
|
|
223
|
+
def self.new(
|
|
224
|
+
# The content of the message.
|
|
225
|
+
content: nil,
|
|
226
|
+
# The role of the speaker.
|
|
227
|
+
role: nil
|
|
228
|
+
)
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
sig { override.returns({ content: String, role: String }) }
|
|
232
|
+
def to_hash
|
|
233
|
+
end
|
|
234
|
+
end
|
|
157
235
|
end
|
|
158
236
|
|
|
159
237
|
# Run mode for the monitor event. The run mode allows the user to optimize for
|
|
160
238
|
# speed, accuracy, and cost by determining which models are used to evaluate the
|
|
161
|
-
# event. Available run modes include `
|
|
162
|
-
# `economy`. Defaults to `smart`.
|
|
239
|
+
# event. Available run modes include `precision_plus_codex`, `precision_plus`,
|
|
240
|
+
# `precision`, `smart`, and `economy`. Defaults to `smart`.
|
|
163
241
|
module RunMode
|
|
164
242
|
extend Deeprails::Internal::Type::Enum
|
|
165
243
|
|
|
@@ -169,6 +247,11 @@ module Deeprails
|
|
|
169
247
|
end
|
|
170
248
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
171
249
|
|
|
250
|
+
PRECISION_PLUS_CODEX =
|
|
251
|
+
T.let(
|
|
252
|
+
:precision_plus_codex,
|
|
253
|
+
Deeprails::MonitorSubmitEventParams::RunMode::TaggedSymbol
|
|
254
|
+
)
|
|
172
255
|
PRECISION_PLUS =
|
|
173
256
|
T.let(
|
|
174
257
|
:precision_plus,
|
|
@@ -11,14 +11,41 @@ module Deeprails
|
|
|
11
11
|
T.any(Deeprails::MonitorUpdateParams, Deeprails::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
#
|
|
14
|
+
# New description of the monitor.
|
|
15
15
|
sig { returns(T.nilable(String)) }
|
|
16
16
|
attr_reader :description
|
|
17
17
|
|
|
18
18
|
sig { params(description: String).void }
|
|
19
19
|
attr_writer :description
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# An array of file IDs to search in the monitor's evaluations. Files must be
|
|
22
|
+
# uploaded via the DeepRails API first.
|
|
23
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
24
|
+
attr_reader :file_search
|
|
25
|
+
|
|
26
|
+
sig { params(file_search: T::Array[String]).void }
|
|
27
|
+
attr_writer :file_search
|
|
28
|
+
|
|
29
|
+
# An array of the new guardrail metrics that model input and output pairs will be
|
|
30
|
+
# evaluated on.
|
|
31
|
+
sig do
|
|
32
|
+
returns(
|
|
33
|
+
T.nilable(
|
|
34
|
+
T::Array[Deeprails::MonitorUpdateParams::GuardrailMetric::OrSymbol]
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
attr_reader :guardrail_metrics
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
guardrail_metrics:
|
|
43
|
+
T::Array[Deeprails::MonitorUpdateParams::GuardrailMetric::OrSymbol]
|
|
44
|
+
).void
|
|
45
|
+
end
|
|
46
|
+
attr_writer :guardrail_metrics
|
|
47
|
+
|
|
48
|
+
# New name of the monitor.
|
|
22
49
|
sig { returns(T.nilable(String)) }
|
|
23
50
|
attr_reader :name
|
|
24
51
|
|
|
@@ -37,22 +64,41 @@ module Deeprails
|
|
|
37
64
|
end
|
|
38
65
|
attr_writer :status
|
|
39
66
|
|
|
67
|
+
# Whether to enable web search for this monitor's evaluations.
|
|
68
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
69
|
+
attr_reader :web_search
|
|
70
|
+
|
|
71
|
+
sig { params(web_search: T::Boolean).void }
|
|
72
|
+
attr_writer :web_search
|
|
73
|
+
|
|
40
74
|
sig do
|
|
41
75
|
params(
|
|
42
76
|
description: String,
|
|
77
|
+
file_search: T::Array[String],
|
|
78
|
+
guardrail_metrics:
|
|
79
|
+
T::Array[Deeprails::MonitorUpdateParams::GuardrailMetric::OrSymbol],
|
|
43
80
|
name: String,
|
|
44
81
|
status: Deeprails::MonitorUpdateParams::Status::OrSymbol,
|
|
82
|
+
web_search: T::Boolean,
|
|
45
83
|
request_options: Deeprails::RequestOptions::OrHash
|
|
46
84
|
).returns(T.attached_class)
|
|
47
85
|
end
|
|
48
86
|
def self.new(
|
|
49
|
-
#
|
|
87
|
+
# New description of the monitor.
|
|
50
88
|
description: nil,
|
|
51
|
-
#
|
|
89
|
+
# An array of file IDs to search in the monitor's evaluations. Files must be
|
|
90
|
+
# uploaded via the DeepRails API first.
|
|
91
|
+
file_search: nil,
|
|
92
|
+
# An array of the new guardrail metrics that model input and output pairs will be
|
|
93
|
+
# evaluated on.
|
|
94
|
+
guardrail_metrics: nil,
|
|
95
|
+
# New name of the monitor.
|
|
52
96
|
name: nil,
|
|
53
97
|
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
54
98
|
# longer record and evaluate events.
|
|
55
99
|
status: nil,
|
|
100
|
+
# Whether to enable web search for this monitor's evaluations.
|
|
101
|
+
web_search: nil,
|
|
56
102
|
request_options: {}
|
|
57
103
|
)
|
|
58
104
|
end
|
|
@@ -61,8 +107,14 @@ module Deeprails
|
|
|
61
107
|
override.returns(
|
|
62
108
|
{
|
|
63
109
|
description: String,
|
|
110
|
+
file_search: T::Array[String],
|
|
111
|
+
guardrail_metrics:
|
|
112
|
+
T::Array[
|
|
113
|
+
Deeprails::MonitorUpdateParams::GuardrailMetric::OrSymbol
|
|
114
|
+
],
|
|
64
115
|
name: String,
|
|
65
116
|
status: Deeprails::MonitorUpdateParams::Status::OrSymbol,
|
|
117
|
+
web_search: T::Boolean,
|
|
66
118
|
request_options: Deeprails::RequestOptions
|
|
67
119
|
}
|
|
68
120
|
)
|
|
@@ -70,6 +122,57 @@ module Deeprails
|
|
|
70
122
|
def to_hash
|
|
71
123
|
end
|
|
72
124
|
|
|
125
|
+
module GuardrailMetric
|
|
126
|
+
extend Deeprails::Internal::Type::Enum
|
|
127
|
+
|
|
128
|
+
TaggedSymbol =
|
|
129
|
+
T.type_alias do
|
|
130
|
+
T.all(Symbol, Deeprails::MonitorUpdateParams::GuardrailMetric)
|
|
131
|
+
end
|
|
132
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
133
|
+
|
|
134
|
+
CORRECTNESS =
|
|
135
|
+
T.let(
|
|
136
|
+
:correctness,
|
|
137
|
+
Deeprails::MonitorUpdateParams::GuardrailMetric::TaggedSymbol
|
|
138
|
+
)
|
|
139
|
+
COMPLETENESS =
|
|
140
|
+
T.let(
|
|
141
|
+
:completeness,
|
|
142
|
+
Deeprails::MonitorUpdateParams::GuardrailMetric::TaggedSymbol
|
|
143
|
+
)
|
|
144
|
+
INSTRUCTION_ADHERENCE =
|
|
145
|
+
T.let(
|
|
146
|
+
:instruction_adherence,
|
|
147
|
+
Deeprails::MonitorUpdateParams::GuardrailMetric::TaggedSymbol
|
|
148
|
+
)
|
|
149
|
+
CONTEXT_ADHERENCE =
|
|
150
|
+
T.let(
|
|
151
|
+
:context_adherence,
|
|
152
|
+
Deeprails::MonitorUpdateParams::GuardrailMetric::TaggedSymbol
|
|
153
|
+
)
|
|
154
|
+
GROUND_TRUTH_ADHERENCE =
|
|
155
|
+
T.let(
|
|
156
|
+
:ground_truth_adherence,
|
|
157
|
+
Deeprails::MonitorUpdateParams::GuardrailMetric::TaggedSymbol
|
|
158
|
+
)
|
|
159
|
+
COMPREHENSIVE_SAFETY =
|
|
160
|
+
T.let(
|
|
161
|
+
:comprehensive_safety,
|
|
162
|
+
Deeprails::MonitorUpdateParams::GuardrailMetric::TaggedSymbol
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
sig do
|
|
166
|
+
override.returns(
|
|
167
|
+
T::Array[
|
|
168
|
+
Deeprails::MonitorUpdateParams::GuardrailMetric::TaggedSymbol
|
|
169
|
+
]
|
|
170
|
+
)
|
|
171
|
+
end
|
|
172
|
+
def self.values
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
73
176
|
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
74
177
|
# longer record and evaluate events.
|
|
75
178
|
module Status
|