deeprails 0.23.0 → 0.24.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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/README.md +1 -1
  4. data/lib/deeprails/internal/transport/pooled_net_requester.rb +1 -1
  5. data/lib/deeprails/internal/util.rb +32 -1
  6. data/lib/deeprails/models/defend_retrieve_event_params.rb +7 -1
  7. data/lib/deeprails/models/defend_retrieve_workflow_params.rb +8 -1
  8. data/lib/deeprails/models/defend_submit_and_stream_event_params.rb +21 -12
  9. data/lib/deeprails/models/defend_submit_event_params.rb +23 -9
  10. data/lib/deeprails/models/defend_update_workflow_params.rb +8 -1
  11. data/lib/deeprails/models/monitor_detail_response.rb +7 -3
  12. data/lib/deeprails/models/monitor_event_detail_response.rb +5 -3
  13. data/lib/deeprails/models/monitor_retrieve_event_params.rb +7 -1
  14. data/lib/deeprails/models/monitor_retrieve_params.rb +8 -1
  15. data/lib/deeprails/models/monitor_submit_event_params.rb +23 -9
  16. data/lib/deeprails/models/monitor_update_params.rb +8 -1
  17. data/lib/deeprails/models/workflow_event_detail_response.rb +14 -3
  18. data/lib/deeprails/resources/defend.rb +9 -7
  19. data/lib/deeprails/resources/monitor.rb +2 -1
  20. data/lib/deeprails/version.rb +1 -1
  21. data/rbi/deeprails/internal/util.rbi +21 -1
  22. data/rbi/deeprails/models/defend_retrieve_event_params.rbi +10 -2
  23. data/rbi/deeprails/models/defend_retrieve_workflow_params.rbi +10 -1
  24. data/rbi/deeprails/models/defend_submit_and_stream_event_params.rbi +27 -20
  25. data/rbi/deeprails/models/defend_submit_event_params.rbi +34 -14
  26. data/rbi/deeprails/models/defend_update_workflow_params.rbi +6 -0
  27. data/rbi/deeprails/models/monitor_detail_response.rbi +19 -6
  28. data/rbi/deeprails/models/monitor_event_detail_response.rbi +16 -6
  29. data/rbi/deeprails/models/monitor_retrieve_event_params.rbi +10 -2
  30. data/rbi/deeprails/models/monitor_retrieve_params.rbi +10 -1
  31. data/rbi/deeprails/models/monitor_submit_event_params.rbi +34 -14
  32. data/rbi/deeprails/models/monitor_update_params.rbi +6 -0
  33. data/rbi/deeprails/models/workflow_event_detail_response.rbi +37 -3
  34. data/rbi/deeprails/resources/defend.rbi +13 -8
  35. data/rbi/deeprails/resources/monitor.rbi +5 -2
  36. data/sig/deeprails/internal/util.rbs +10 -0
  37. data/sig/deeprails/models/defend_retrieve_event_params.rbs +6 -1
  38. data/sig/deeprails/models/defend_retrieve_workflow_params.rbs +6 -1
  39. data/sig/deeprails/models/defend_submit_and_stream_event_params.rbs +7 -8
  40. data/sig/deeprails/models/defend_submit_event_params.rbs +16 -5
  41. data/sig/deeprails/models/defend_update_workflow_params.rbs +5 -0
  42. data/sig/deeprails/models/monitor_detail_response.rbs +12 -4
  43. data/sig/deeprails/models/monitor_event_detail_response.rbs +12 -4
  44. data/sig/deeprails/models/monitor_retrieve_event_params.rbs +6 -1
  45. data/sig/deeprails/models/monitor_retrieve_params.rbs +6 -1
  46. data/sig/deeprails/models/monitor_submit_event_params.rbs +16 -5
  47. data/sig/deeprails/models/monitor_update_params.rbs +5 -0
  48. data/sig/deeprails/models/workflow_event_detail_response.rbs +16 -4
  49. metadata +1 -1
@@ -296,11 +296,31 @@ module Deeprails
296
296
  end
297
297
 
298
298
  JSON_CONTENT =
299
- T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp)
299
+ T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp)
300
300
  JSONL_CONTENT =
301
301
  T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
302
302
 
303
303
  class << self
304
+ # @api private
305
+ sig do
306
+ params(query: Deeprails::Internal::AnyHash).returns(
307
+ Deeprails::Internal::AnyHash
308
+ )
309
+ end
310
+ def encode_query_params(query)
311
+ end
312
+
313
+ # @api private
314
+ sig do
315
+ params(
316
+ collection: Deeprails::Internal::AnyHash,
317
+ key: String,
318
+ element: T.anything
319
+ ).void
320
+ end
321
+ private def write_query_param_element!(collection, key, element)
322
+ end
323
+
304
324
  # @api private
305
325
  sig do
306
326
  params(
@@ -17,18 +17,26 @@ module Deeprails
17
17
  sig { returns(String) }
18
18
  attr_accessor :workflow_id
19
19
 
20
+ sig { returns(String) }
21
+ attr_accessor :event_id
22
+
20
23
  sig do
21
24
  params(
22
25
  workflow_id: String,
26
+ event_id: String,
23
27
  request_options: Deeprails::RequestOptions::OrHash
24
28
  ).returns(T.attached_class)
25
29
  end
26
- def self.new(workflow_id:, request_options: {})
30
+ def self.new(workflow_id:, event_id:, request_options: {})
27
31
  end
28
32
 
29
33
  sig do
30
34
  override.returns(
31
- { workflow_id: String, request_options: Deeprails::RequestOptions }
35
+ {
36
+ workflow_id: String,
37
+ event_id: String,
38
+ request_options: Deeprails::RequestOptions
39
+ }
32
40
  )
33
41
  end
34
42
  def to_hash
@@ -14,6 +14,9 @@ module Deeprails
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :workflow_id
19
+
17
20
  # Limit the number of returned events associated with this workflow. Defaults
18
21
  # to 10.
19
22
  sig { returns(T.nilable(Integer)) }
@@ -24,11 +27,13 @@ module Deeprails
24
27
 
25
28
  sig do
26
29
  params(
30
+ workflow_id: String,
27
31
  limit: Integer,
28
32
  request_options: Deeprails::RequestOptions::OrHash
29
33
  ).returns(T.attached_class)
30
34
  end
31
35
  def self.new(
36
+ workflow_id:,
32
37
  # Limit the number of returned events associated with this workflow. Defaults
33
38
  # to 10.
34
39
  limit: nil,
@@ -38,7 +43,11 @@ module Deeprails
38
43
 
39
44
  sig do
40
45
  override.returns(
41
- { limit: Integer, request_options: Deeprails::RequestOptions }
46
+ {
47
+ workflow_id: String,
48
+ limit: Integer,
49
+ request_options: Deeprails::RequestOptions
50
+ }
42
51
  )
43
52
  end
44
53
  def to_hash
@@ -14,6 +14,9 @@ module Deeprails
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :workflow_id
19
+
17
20
  # The input provided to the model (e.g., prompt, messages).
18
21
  sig { returns(T::Hash[Symbol, T.anything]) }
19
22
  attr_accessor :model_input
@@ -26,15 +29,17 @@ module Deeprails
26
29
  sig { returns(String) }
27
30
  attr_accessor :model_used
28
31
 
29
- # The evaluation run mode. Streaming only supports fast, precision, and
30
- # precision_codex.
32
+ # The evaluation run mode. Streaming is supported on all run modes except
33
+ # precision_max and precision_max_codex. Note: super_fast does not support Web
34
+ # Search or File Search — if your workflow has these enabled, use a different run
35
+ # mode or disable the capability on the workflow.
31
36
  sig do
32
37
  returns(Deeprails::DefendSubmitAndStreamEventParams::RunMode::OrSymbol)
33
38
  end
34
39
  attr_accessor :run_mode
35
40
 
36
- # Enable SSE streaming for real-time token feedback. Only supported for
37
- # single-model run modes (fast, precision, precision_codex).
41
+ # Enable SSE streaming for real-time token feedback. Supported on all run modes
42
+ # except precision_max and precision_max_codex.
38
43
  sig { returns(T.nilable(T::Boolean)) }
39
44
  attr_reader :stream
40
45
 
@@ -50,6 +55,7 @@ module Deeprails
50
55
 
51
56
  sig do
52
57
  params(
58
+ workflow_id: String,
53
59
  model_input: T::Hash[Symbol, T.anything],
54
60
  model_output: String,
55
61
  model_used: String,
@@ -61,17 +67,20 @@ module Deeprails
61
67
  ).returns(T.attached_class)
62
68
  end
63
69
  def self.new(
70
+ workflow_id:,
64
71
  # The input provided to the model (e.g., prompt, messages).
65
72
  model_input:,
66
73
  # The output generated by the model to be evaluated.
67
74
  model_output:,
68
75
  # The model that generated the output (e.g., "gpt-4", "claude-3").
69
76
  model_used:,
70
- # The evaluation run mode. Streaming only supports fast, precision, and
71
- # precision_codex.
77
+ # The evaluation run mode. Streaming is supported on all run modes except
78
+ # precision_max and precision_max_codex. Note: super_fast does not support Web
79
+ # Search or File Search — if your workflow has these enabled, use a different run
80
+ # mode or disable the capability on the workflow.
72
81
  run_mode:,
73
- # Enable SSE streaming for real-time token feedback. Only supported for
74
- # single-model run modes (fast, precision, precision_codex).
82
+ # Enable SSE streaming for real-time token feedback. Supported on all run modes
83
+ # except precision_max and precision_max_codex.
75
84
  stream: nil,
76
85
  # Optional tag to identify this event.
77
86
  nametag: nil,
@@ -82,6 +91,7 @@ module Deeprails
82
91
  sig do
83
92
  override.returns(
84
93
  {
94
+ workflow_id: String,
85
95
  model_input: T::Hash[Symbol, T.anything],
86
96
  model_output: String,
87
97
  model_used: String,
@@ -96,8 +106,10 @@ module Deeprails
96
106
  def to_hash
97
107
  end
98
108
 
99
- # The evaluation run mode. Streaming only supports fast, precision, and
100
- # precision_codex.
109
+ # The evaluation run mode. Streaming is supported on all run modes except
110
+ # precision_max and precision_max_codex. Note: super_fast does not support Web
111
+ # Search or File Search — if your workflow has these enabled, use a different run
112
+ # mode or disable the capability on the workflow.
101
113
  module RunMode
102
114
  extend Deeprails::Internal::Type::Enum
103
115
 
@@ -107,6 +119,11 @@ module Deeprails
107
119
  end
108
120
  OrSymbol = T.type_alias { T.any(Symbol, String) }
109
121
 
122
+ SUPER_FAST =
123
+ T.let(
124
+ :super_fast,
125
+ Deeprails::DefendSubmitAndStreamEventParams::RunMode::TaggedSymbol
126
+ )
110
127
  FAST =
111
128
  T.let(
112
129
  :fast,
@@ -122,16 +139,6 @@ module Deeprails
122
139
  :precision_codex,
123
140
  Deeprails::DefendSubmitAndStreamEventParams::RunMode::TaggedSymbol
124
141
  )
125
- PRECISION_MAX =
126
- T.let(
127
- :precision_max,
128
- Deeprails::DefendSubmitAndStreamEventParams::RunMode::TaggedSymbol
129
- )
130
- PRECISION_MAX_CODEX =
131
- T.let(
132
- :precision_max_codex,
133
- Deeprails::DefendSubmitAndStreamEventParams::RunMode::TaggedSymbol
134
- )
135
142
 
136
143
  sig do
137
144
  override.returns(
@@ -14,6 +14,9 @@ module Deeprails
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :workflow_id
19
+
17
20
  # A dictionary of inputs sent to the LLM to generate output. The dictionary must
18
21
  # contain a `user_prompt` field. For the ground_truth_adherence guardrail metric,
19
22
  # `ground_truth` should be provided.
@@ -37,8 +40,11 @@ module Deeprails
37
40
 
38
41
  # Run mode for the workflow event. The run mode allows the user to optimize for
39
42
  # speed, accuracy, and cost by determining which models are used to evaluate the
40
- # event. Available run modes include `precision_plus_codex`, `precision_plus`,
41
- # `precision`, `smart`, and `economy`. Defaults to `smart`.
43
+ # event. Available run modes (fastest to most thorough): `super_fast`, `fast`,
44
+ # `precision`, `precision_codex`, `precision_max`, and `precision_max_codex`.
45
+ # Defaults to `fast`. Note: `super_fast` does not support Web Search or File
46
+ # Search — if your workflow has these capabilities enabled, use a different run
47
+ # mode or edit the workflow to disable them.
42
48
  sig { returns(Deeprails::DefendSubmitEventParams::RunMode::OrSymbol) }
43
49
  attr_accessor :run_mode
44
50
 
@@ -51,6 +57,7 @@ module Deeprails
51
57
 
52
58
  sig do
53
59
  params(
60
+ workflow_id: String,
54
61
  model_input: Deeprails::DefendSubmitEventParams::ModelInput::OrHash,
55
62
  model_output: String,
56
63
  model_used: String,
@@ -60,6 +67,7 @@ module Deeprails
60
67
  ).returns(T.attached_class)
61
68
  end
62
69
  def self.new(
70
+ workflow_id:,
63
71
  # A dictionary of inputs sent to the LLM to generate output. The dictionary must
64
72
  # contain a `user_prompt` field. For the ground_truth_adherence guardrail metric,
65
73
  # `ground_truth` should be provided.
@@ -70,8 +78,11 @@ module Deeprails
70
78
  model_used:,
71
79
  # Run mode for the workflow event. The run mode allows the user to optimize for
72
80
  # speed, accuracy, and cost by determining which models are used to evaluate the
73
- # event. Available run modes include `precision_plus_codex`, `precision_plus`,
74
- # `precision`, `smart`, and `economy`. Defaults to `smart`.
81
+ # event. Available run modes (fastest to most thorough): `super_fast`, `fast`,
82
+ # `precision`, `precision_codex`, `precision_max`, and `precision_max_codex`.
83
+ # Defaults to `fast`. Note: `super_fast` does not support Web Search or File
84
+ # Search — if your workflow has these capabilities enabled, use a different run
85
+ # mode or edit the workflow to disable them.
75
86
  run_mode:,
76
87
  # An optional, user-defined tag for the event.
77
88
  nametag: nil,
@@ -82,6 +93,7 @@ module Deeprails
82
93
  sig do
83
94
  override.returns(
84
95
  {
96
+ workflow_id: String,
85
97
  model_input: Deeprails::DefendSubmitEventParams::ModelInput,
86
98
  model_output: String,
87
99
  model_used: String,
@@ -233,8 +245,11 @@ module Deeprails
233
245
 
234
246
  # Run mode for the workflow event. The run mode allows the user to optimize for
235
247
  # speed, accuracy, and cost by determining which models are used to evaluate the
236
- # event. Available run modes include `precision_plus_codex`, `precision_plus`,
237
- # `precision`, `smart`, and `economy`. Defaults to `smart`.
248
+ # event. Available run modes (fastest to most thorough): `super_fast`, `fast`,
249
+ # `precision`, `precision_codex`, `precision_max`, and `precision_max_codex`.
250
+ # Defaults to `fast`. Note: `super_fast` does not support Web Search or File
251
+ # Search — if your workflow has these capabilities enabled, use a different run
252
+ # mode or edit the workflow to disable them.
238
253
  module RunMode
239
254
  extend Deeprails::Internal::Type::Enum
240
255
 
@@ -244,14 +259,14 @@ module Deeprails
244
259
  end
245
260
  OrSymbol = T.type_alias { T.any(Symbol, String) }
246
261
 
247
- PRECISION_PLUS_CODEX =
262
+ SUPER_FAST =
248
263
  T.let(
249
- :precision_plus_codex,
264
+ :super_fast,
250
265
  Deeprails::DefendSubmitEventParams::RunMode::TaggedSymbol
251
266
  )
252
- PRECISION_PLUS =
267
+ FAST =
253
268
  T.let(
254
- :precision_plus,
269
+ :fast,
255
270
  Deeprails::DefendSubmitEventParams::RunMode::TaggedSymbol
256
271
  )
257
272
  PRECISION =
@@ -259,14 +274,19 @@ module Deeprails
259
274
  :precision,
260
275
  Deeprails::DefendSubmitEventParams::RunMode::TaggedSymbol
261
276
  )
262
- SMART =
277
+ PRECISION_CODEX =
278
+ T.let(
279
+ :precision_codex,
280
+ Deeprails::DefendSubmitEventParams::RunMode::TaggedSymbol
281
+ )
282
+ PRECISION_MAX =
263
283
  T.let(
264
- :smart,
284
+ :precision_max,
265
285
  Deeprails::DefendSubmitEventParams::RunMode::TaggedSymbol
266
286
  )
267
- ECONOMY =
287
+ PRECISION_MAX_CODEX =
268
288
  T.let(
269
- :economy,
289
+ :precision_max_codex,
270
290
  Deeprails::DefendSubmitEventParams::RunMode::TaggedSymbol
271
291
  )
272
292
 
@@ -14,6 +14,9 @@ module Deeprails
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :workflow_id
19
+
17
20
  # New mapping of guardrail metrics to hallucination tolerance levels (either
18
21
  # `low`, `medium`, or `high`) to be used when `threshold_type` is set to
19
22
  # `automatic`. Possible metrics are `completeness`, `instruction_adherence`,
@@ -145,6 +148,7 @@ module Deeprails
145
148
 
146
149
  sig do
147
150
  params(
151
+ workflow_id: String,
148
152
  automatic_hallucination_tolerance_levels:
149
153
  T::Hash[
150
154
  Symbol,
@@ -165,6 +169,7 @@ module Deeprails
165
169
  ).returns(T.attached_class)
166
170
  end
167
171
  def self.new(
172
+ workflow_id:,
168
173
  # New mapping of guardrail metrics to hallucination tolerance levels (either
169
174
  # `low`, `medium`, or `high`) to be used when `threshold_type` is set to
170
175
  # `automatic`. Possible metrics are `completeness`, `instruction_adherence`,
@@ -208,6 +213,7 @@ module Deeprails
208
213
  sig do
209
214
  override.returns(
210
215
  {
216
+ workflow_id: String,
211
217
  automatic_hallucination_tolerance_levels:
212
218
  T::Hash[
213
219
  Symbol,
@@ -194,6 +194,7 @@ module Deeprails
194
194
 
195
195
  # Run mode for the evaluation. The run mode allows the user to optimize for speed,
196
196
  # accuracy, and cost by determining which models are used to evaluate the event.
197
+ # Note: `super_fast` do not support Web Search or File Search capabilities.
197
198
  sig do
198
199
  returns(
199
200
  Deeprails::MonitorDetailResponse::Evaluation::RunMode::TaggedSymbol
@@ -301,6 +302,7 @@ module Deeprails
301
302
  model_output:,
302
303
  # Run mode for the evaluation. The run mode allows the user to optimize for speed,
303
304
  # accuracy, and cost by determining which models are used to evaluate the event.
305
+ # Note: `super_fast` do not support Web Search or File Search capabilities.
304
306
  run_mode:,
305
307
  # The time the evaluation was created in UTC.
306
308
  created_at: nil,
@@ -540,6 +542,7 @@ module Deeprails
540
542
 
541
543
  # Run mode for the evaluation. The run mode allows the user to optimize for speed,
542
544
  # accuracy, and cost by determining which models are used to evaluate the event.
545
+ # Note: `super_fast` do not support Web Search or File Search capabilities.
543
546
  module RunMode
544
547
  extend Deeprails::Internal::Type::Enum
545
548
 
@@ -552,9 +555,14 @@ module Deeprails
552
555
  end
553
556
  OrSymbol = T.type_alias { T.any(Symbol, String) }
554
557
 
555
- PRECISION_PLUS =
558
+ SUPER_FAST =
556
559
  T.let(
557
- :precision_plus,
560
+ :super_fast,
561
+ Deeprails::MonitorDetailResponse::Evaluation::RunMode::TaggedSymbol
562
+ )
563
+ FAST =
564
+ T.let(
565
+ :fast,
558
566
  Deeprails::MonitorDetailResponse::Evaluation::RunMode::TaggedSymbol
559
567
  )
560
568
  PRECISION =
@@ -562,14 +570,19 @@ module Deeprails
562
570
  :precision,
563
571
  Deeprails::MonitorDetailResponse::Evaluation::RunMode::TaggedSymbol
564
572
  )
565
- SMART =
573
+ PRECISION_CODEX =
574
+ T.let(
575
+ :precision_codex,
576
+ Deeprails::MonitorDetailResponse::Evaluation::RunMode::TaggedSymbol
577
+ )
578
+ PRECISION_MAX =
566
579
  T.let(
567
- :smart,
580
+ :precision_max,
568
581
  Deeprails::MonitorDetailResponse::Evaluation::RunMode::TaggedSymbol
569
582
  )
570
- ECONOMY =
583
+ PRECISION_MAX_CODEX =
571
584
  T.let(
572
- :economy,
585
+ :precision_max_codex,
573
586
  Deeprails::MonitorDetailResponse::Evaluation::RunMode::TaggedSymbol
574
587
  )
575
588
 
@@ -305,9 +305,14 @@ module Deeprails
305
305
  end
306
306
  OrSymbol = T.type_alias { T.any(Symbol, String) }
307
307
 
308
- PRECISION_PLUS =
308
+ SUPER_FAST =
309
309
  T.let(
310
- :precision_plus,
310
+ :super_fast,
311
+ Deeprails::MonitorEventDetailResponse::RunMode::TaggedSymbol
312
+ )
313
+ FAST =
314
+ T.let(
315
+ :fast,
311
316
  Deeprails::MonitorEventDetailResponse::RunMode::TaggedSymbol
312
317
  )
313
318
  PRECISION =
@@ -315,14 +320,19 @@ module Deeprails
315
320
  :precision,
316
321
  Deeprails::MonitorEventDetailResponse::RunMode::TaggedSymbol
317
322
  )
318
- SMART =
323
+ PRECISION_CODEX =
324
+ T.let(
325
+ :precision_codex,
326
+ Deeprails::MonitorEventDetailResponse::RunMode::TaggedSymbol
327
+ )
328
+ PRECISION_MAX =
319
329
  T.let(
320
- :smart,
330
+ :precision_max,
321
331
  Deeprails::MonitorEventDetailResponse::RunMode::TaggedSymbol
322
332
  )
323
- ECONOMY =
333
+ PRECISION_MAX_CODEX =
324
334
  T.let(
325
- :economy,
335
+ :precision_max_codex,
326
336
  Deeprails::MonitorEventDetailResponse::RunMode::TaggedSymbol
327
337
  )
328
338
 
@@ -17,18 +17,26 @@ module Deeprails
17
17
  sig { returns(String) }
18
18
  attr_accessor :monitor_id
19
19
 
20
+ sig { returns(String) }
21
+ attr_accessor :event_id
22
+
20
23
  sig do
21
24
  params(
22
25
  monitor_id: String,
26
+ event_id: String,
23
27
  request_options: Deeprails::RequestOptions::OrHash
24
28
  ).returns(T.attached_class)
25
29
  end
26
- def self.new(monitor_id:, request_options: {})
30
+ def self.new(monitor_id:, event_id:, request_options: {})
27
31
  end
28
32
 
29
33
  sig do
30
34
  override.returns(
31
- { monitor_id: String, request_options: Deeprails::RequestOptions }
35
+ {
36
+ monitor_id: String,
37
+ event_id: String,
38
+ request_options: Deeprails::RequestOptions
39
+ }
32
40
  )
33
41
  end
34
42
  def to_hash
@@ -11,6 +11,9 @@ module Deeprails
11
11
  T.any(Deeprails::MonitorRetrieveParams, Deeprails::Internal::AnyHash)
12
12
  end
13
13
 
14
+ sig { returns(String) }
15
+ attr_accessor :monitor_id
16
+
14
17
  # Limit the number of returned evaluations associated with this monitor. Defaults
15
18
  # to 10.
16
19
  sig { returns(T.nilable(Integer)) }
@@ -21,11 +24,13 @@ module Deeprails
21
24
 
22
25
  sig do
23
26
  params(
27
+ monitor_id: String,
24
28
  limit: Integer,
25
29
  request_options: Deeprails::RequestOptions::OrHash
26
30
  ).returns(T.attached_class)
27
31
  end
28
32
  def self.new(
33
+ monitor_id:,
29
34
  # Limit the number of returned evaluations associated with this monitor. Defaults
30
35
  # to 10.
31
36
  limit: nil,
@@ -35,7 +40,11 @@ module Deeprails
35
40
 
36
41
  sig do
37
42
  override.returns(
38
- { limit: Integer, request_options: Deeprails::RequestOptions }
43
+ {
44
+ monitor_id: String,
45
+ limit: Integer,
46
+ request_options: Deeprails::RequestOptions
47
+ }
39
48
  )
40
49
  end
41
50
  def to_hash
@@ -14,6 +14,9 @@ module Deeprails
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :monitor_id
19
+
17
20
  # A dictionary of inputs sent to the LLM to generate output. The dictionary must
18
21
  # contain a `user_prompt` field. For ground_truth_adherence guardrail metric,
19
22
  # `ground_truth` should be provided.
@@ -40,8 +43,11 @@ module Deeprails
40
43
 
41
44
  # Run mode for the monitor event. The run mode allows the user to optimize for
42
45
  # speed, accuracy, and cost by determining which models are used to evaluate the
43
- # event. Available run modes include `precision_plus_codex`, `precision_plus`,
44
- # `precision`, `smart`, and `economy`. Defaults to `smart`.
46
+ # event. Available run modes (fastest to most thorough): `super_fast`, `fast`,
47
+ # `precision`, `precision_codex`, `precision_max`, and `precision_max_codex`.
48
+ # Defaults to `fast`. Note: `super_fast` does not support Web Search or File
49
+ # Search — if your monitor has these capabilities enabled, use a different run
50
+ # mode or edit the monitor to disable them.
45
51
  sig do
46
52
  returns(
47
53
  T.nilable(Deeprails::MonitorSubmitEventParams::RunMode::OrSymbol)
@@ -58,6 +64,7 @@ module Deeprails
58
64
 
59
65
  sig do
60
66
  params(
67
+ monitor_id: String,
61
68
  model_input: Deeprails::MonitorSubmitEventParams::ModelInput::OrHash,
62
69
  model_output: String,
63
70
  nametag: String,
@@ -66,6 +73,7 @@ module Deeprails
66
73
  ).returns(T.attached_class)
67
74
  end
68
75
  def self.new(
76
+ monitor_id:,
69
77
  # A dictionary of inputs sent to the LLM to generate output. The dictionary must
70
78
  # contain a `user_prompt` field. For ground_truth_adherence guardrail metric,
71
79
  # `ground_truth` should be provided.
@@ -76,8 +84,11 @@ module Deeprails
76
84
  nametag: nil,
77
85
  # Run mode for the monitor event. The run mode allows the user to optimize for
78
86
  # speed, accuracy, and cost by determining which models are used to evaluate the
79
- # event. Available run modes include `precision_plus_codex`, `precision_plus`,
80
- # `precision`, `smart`, and `economy`. Defaults to `smart`.
87
+ # event. Available run modes (fastest to most thorough): `super_fast`, `fast`,
88
+ # `precision`, `precision_codex`, `precision_max`, and `precision_max_codex`.
89
+ # Defaults to `fast`. Note: `super_fast` does not support Web Search or File
90
+ # Search — if your monitor has these capabilities enabled, use a different run
91
+ # mode or edit the monitor to disable them.
81
92
  run_mode: nil,
82
93
  request_options: {}
83
94
  )
@@ -86,6 +97,7 @@ module Deeprails
86
97
  sig do
87
98
  override.returns(
88
99
  {
100
+ monitor_id: String,
89
101
  model_input: Deeprails::MonitorSubmitEventParams::ModelInput,
90
102
  model_output: String,
91
103
  nametag: String,
@@ -236,8 +248,11 @@ module Deeprails
236
248
 
237
249
  # Run mode for the monitor event. The run mode allows the user to optimize for
238
250
  # speed, accuracy, and cost by determining which models are used to evaluate the
239
- # event. Available run modes include `precision_plus_codex`, `precision_plus`,
240
- # `precision`, `smart`, and `economy`. Defaults to `smart`.
251
+ # event. Available run modes (fastest to most thorough): `super_fast`, `fast`,
252
+ # `precision`, `precision_codex`, `precision_max`, and `precision_max_codex`.
253
+ # Defaults to `fast`. Note: `super_fast` does not support Web Search or File
254
+ # Search — if your monitor has these capabilities enabled, use a different run
255
+ # mode or edit the monitor to disable them.
241
256
  module RunMode
242
257
  extend Deeprails::Internal::Type::Enum
243
258
 
@@ -247,14 +262,14 @@ module Deeprails
247
262
  end
248
263
  OrSymbol = T.type_alias { T.any(Symbol, String) }
249
264
 
250
- PRECISION_PLUS_CODEX =
265
+ SUPER_FAST =
251
266
  T.let(
252
- :precision_plus_codex,
267
+ :super_fast,
253
268
  Deeprails::MonitorSubmitEventParams::RunMode::TaggedSymbol
254
269
  )
255
- PRECISION_PLUS =
270
+ FAST =
256
271
  T.let(
257
- :precision_plus,
272
+ :fast,
258
273
  Deeprails::MonitorSubmitEventParams::RunMode::TaggedSymbol
259
274
  )
260
275
  PRECISION =
@@ -262,14 +277,19 @@ module Deeprails
262
277
  :precision,
263
278
  Deeprails::MonitorSubmitEventParams::RunMode::TaggedSymbol
264
279
  )
265
- SMART =
280
+ PRECISION_CODEX =
281
+ T.let(
282
+ :precision_codex,
283
+ Deeprails::MonitorSubmitEventParams::RunMode::TaggedSymbol
284
+ )
285
+ PRECISION_MAX =
266
286
  T.let(
267
- :smart,
287
+ :precision_max,
268
288
  Deeprails::MonitorSubmitEventParams::RunMode::TaggedSymbol
269
289
  )
270
- ECONOMY =
290
+ PRECISION_MAX_CODEX =
271
291
  T.let(
272
- :economy,
292
+ :precision_max_codex,
273
293
  Deeprails::MonitorSubmitEventParams::RunMode::TaggedSymbol
274
294
  )
275
295