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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +62 -0
  3. data/README.md +1 -1
  4. data/lib/deeprails/internal/stream.rb +29 -0
  5. data/lib/deeprails/internal/transport/base_client.rb +3 -1
  6. data/lib/deeprails/internal/transport/pooled_net_requester.rb +12 -10
  7. data/lib/deeprails/internal/type/base_stream.rb +83 -0
  8. data/lib/deeprails/internal/util.rb +7 -2
  9. data/lib/deeprails/models/defend_create_workflow_params.rb +14 -1
  10. data/lib/deeprails/models/defend_response.rb +134 -10
  11. data/lib/deeprails/models/defend_submit_and_stream_event_params.rb +83 -0
  12. data/lib/deeprails/models/defend_submit_and_stream_event_response.rb +7 -0
  13. data/lib/deeprails/models/defend_submit_event_params.rb +52 -16
  14. data/lib/deeprails/models/defend_update_response.rb +9 -1
  15. data/lib/deeprails/models/defend_update_workflow_params.rb +131 -5
  16. data/lib/deeprails/models/monitor_create_params.rb +14 -1
  17. data/lib/deeprails/models/monitor_detail_response.rb +53 -14
  18. data/lib/deeprails/models/monitor_event_detail_response.rb +6 -2
  19. data/lib/deeprails/models/monitor_submit_event_params.rb +52 -16
  20. data/lib/deeprails/models/monitor_update_params.rb +46 -5
  21. data/lib/deeprails/models/workflow_event_detail_response.rb +88 -16
  22. data/lib/deeprails/models/workflow_event_response.rb +9 -1
  23. data/lib/deeprails/models.rb +2 -0
  24. data/lib/deeprails/resources/defend.rb +67 -4
  25. data/lib/deeprails/resources/monitor.rb +14 -6
  26. data/lib/deeprails/version.rb +1 -1
  27. data/lib/deeprails.rb +5 -0
  28. data/manifest.yaml +1 -0
  29. data/rbi/deeprails/internal/stream.rbi +20 -0
  30. data/rbi/deeprails/internal/transport/base_client.rbi +18 -2
  31. data/rbi/deeprails/internal/type/base_stream.rbi +75 -0
  32. data/rbi/deeprails/models/defend_create_workflow_params.rbi +21 -0
  33. data/rbi/deeprails/models/defend_response.rbi +286 -14
  34. data/rbi/deeprails/models/defend_submit_and_stream_event_params.rbi +148 -0
  35. data/rbi/deeprails/models/defend_submit_and_stream_event_response.rbi +7 -0
  36. data/rbi/deeprails/models/defend_submit_event_params.rbi +108 -25
  37. data/rbi/deeprails/models/defend_update_response.rbi +14 -3
  38. data/rbi/deeprails/models/defend_update_workflow_params.rbi +298 -4
  39. data/rbi/deeprails/models/monitor_create_params.rbi +21 -0
  40. data/rbi/deeprails/models/monitor_detail_response.rbi +103 -22
  41. data/rbi/deeprails/models/monitor_event_detail_response.rbi +4 -2
  42. data/rbi/deeprails/models/monitor_submit_event_params.rbi +108 -25
  43. data/rbi/deeprails/models/monitor_update_params.rbi +107 -4
  44. data/rbi/deeprails/models/workflow_event_detail_response.rbi +170 -24
  45. data/rbi/deeprails/models/workflow_event_response.rbi +8 -0
  46. data/rbi/deeprails/models.rbi +3 -0
  47. data/rbi/deeprails/resources/defend.rbi +96 -6
  48. data/rbi/deeprails/resources/monitor.rbi +28 -8
  49. data/sig/deeprails/internal/stream.rbs +9 -0
  50. data/sig/deeprails/internal/type/base_stream.rbs +38 -0
  51. data/sig/deeprails/models/defend_create_workflow_params.rbs +7 -0
  52. data/sig/deeprails/models/defend_response.rbs +114 -8
  53. data/sig/deeprails/models/defend_submit_and_stream_event_params.rbs +74 -0
  54. data/sig/deeprails/models/defend_submit_and_stream_event_response.rbs +5 -0
  55. data/sig/deeprails/models/defend_submit_event_params.rbs +39 -10
  56. data/sig/deeprails/models/defend_update_response.rbs +10 -3
  57. data/sig/deeprails/models/defend_update_workflow_params.rbs +103 -1
  58. data/sig/deeprails/models/monitor_create_params.rbs +7 -0
  59. data/sig/deeprails/models/monitor_detail_response.rbs +36 -9
  60. data/sig/deeprails/models/monitor_submit_event_params.rbs +39 -10
  61. data/sig/deeprails/models/monitor_update_params.rbs +45 -1
  62. data/sig/deeprails/models/workflow_event_detail_response.rbs +88 -15
  63. data/sig/deeprails/models/workflow_event_response.rbs +5 -0
  64. data/sig/deeprails/models.rbs +2 -0
  65. data/sig/deeprails/resources/defend.rbs +20 -0
  66. data/sig/deeprails/resources/monitor.rbs +4 -0
  67. metadata +28 -2
@@ -0,0 +1,38 @@
1
+ module Deeprails
2
+ module Internal
3
+ module Type
4
+ module BaseStream[Message, Elem]
5
+ include Enumerable[Elem]
6
+
7
+ attr_reader status: Integer
8
+
9
+ attr_reader headers: ::Hash[String, String]
10
+
11
+ def close: -> void
12
+
13
+ private def iterator: -> Enumerable[Elem]
14
+
15
+ def each: { (Elem arg0) -> void } -> void
16
+
17
+ def to_enum: -> Enumerator[Elem]
18
+
19
+ alias enum_for to_enum
20
+
21
+ def initialize: (
22
+ model: Class | Deeprails::Internal::Type::Converter,
23
+ url: URI::Generic,
24
+ status: Integer,
25
+ headers: ::Hash[String, String],
26
+ response: top,
27
+ unwrap: Symbol
28
+ | Integer
29
+ | ::Array[Symbol | Integer]
30
+ | ^(top arg0) -> top,
31
+ stream: Enumerable[Message]
32
+ ) -> void
33
+
34
+ def inspect: -> String
35
+ end
36
+ end
37
+ end
38
+ end
@@ -6,6 +6,7 @@ module Deeprails
6
6
  name: String,
7
7
  threshold_type: Deeprails::Models::DefendCreateWorkflowParams::threshold_type,
8
8
  automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
9
+ context_awareness: bool,
9
10
  custom_hallucination_threshold_values: ::Hash[Symbol, Float],
10
11
  description: String,
11
12
  file_search: ::Array[String],
@@ -30,6 +31,10 @@ module Deeprails
30
31
  ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level]
31
32
  ) -> ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level]
32
33
 
34
+ attr_reader context_awareness: bool?
35
+
36
+ def context_awareness=: (bool) -> bool
37
+
33
38
  attr_reader custom_hallucination_threshold_values: ::Hash[Symbol, Float]?
34
39
 
35
40
  def custom_hallucination_threshold_values=: (
@@ -57,6 +62,7 @@ module Deeprails
57
62
  name: String,
58
63
  threshold_type: Deeprails::Models::DefendCreateWorkflowParams::threshold_type,
59
64
  ?automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
65
+ ?context_awareness: bool,
60
66
  ?custom_hallucination_threshold_values: ::Hash[Symbol, Float],
61
67
  ?description: String,
62
68
  ?file_search: ::Array[String],
@@ -70,6 +76,7 @@ module Deeprails
70
76
  name: String,
71
77
  threshold_type: Deeprails::Models::DefendCreateWorkflowParams::threshold_type,
72
78
  automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
79
+ context_awareness: bool,
73
80
  custom_hallucination_threshold_values: ::Hash[Symbol, Float],
74
81
  description: String,
75
82
  file_search: ::Array[String],
@@ -115,13 +115,19 @@ module Deeprails
115
115
 
116
116
  type event =
117
117
  {
118
+ billing_request_id: String,
118
119
  evaluations: ::Array[Deeprails::DefendResponse::Event::Evaluation],
119
120
  event_id: String,
120
121
  improved_model_output: String,
121
- improvement_tool_status: String
122
+ improvement_tool_status: Deeprails::Models::DefendResponse::Event::improvement_tool_status,
123
+ status: Deeprails::Models::DefendResponse::Event::status
122
124
  }
123
125
 
124
126
  class Event < Deeprails::Internal::Type::BaseModel
127
+ attr_reader billing_request_id: String?
128
+
129
+ def billing_request_id=: (String) -> String
130
+
125
131
  attr_reader evaluations: ::Array[Deeprails::DefendResponse::Event::Evaluation]?
126
132
 
127
133
  def evaluations=: (
@@ -136,26 +142,39 @@ module Deeprails
136
142
 
137
143
  def improved_model_output=: (String) -> String
138
144
 
139
- attr_reader improvement_tool_status: String?
145
+ attr_reader improvement_tool_status: Deeprails::Models::DefendResponse::Event::improvement_tool_status?
146
+
147
+ def improvement_tool_status=: (
148
+ Deeprails::Models::DefendResponse::Event::improvement_tool_status
149
+ ) -> Deeprails::Models::DefendResponse::Event::improvement_tool_status
150
+
151
+ attr_reader status: Deeprails::Models::DefendResponse::Event::status?
140
152
 
141
- def improvement_tool_status=: (String) -> String
153
+ def status=: (
154
+ Deeprails::Models::DefendResponse::Event::status
155
+ ) -> Deeprails::Models::DefendResponse::Event::status
142
156
 
143
157
  def initialize: (
158
+ ?billing_request_id: String,
144
159
  ?evaluations: ::Array[Deeprails::DefendResponse::Event::Evaluation],
145
160
  ?event_id: String,
146
161
  ?improved_model_output: String,
147
- ?improvement_tool_status: String
162
+ ?improvement_tool_status: Deeprails::Models::DefendResponse::Event::improvement_tool_status,
163
+ ?status: Deeprails::Models::DefendResponse::Event::status
148
164
  ) -> void
149
165
 
150
166
  def to_hash: -> {
167
+ billing_request_id: String,
151
168
  evaluations: ::Array[Deeprails::DefendResponse::Event::Evaluation],
152
169
  event_id: String,
153
170
  improved_model_output: String,
154
- improvement_tool_status: String
171
+ improvement_tool_status: Deeprails::Models::DefendResponse::Event::improvement_tool_status,
172
+ status: Deeprails::Models::DefendResponse::Event::status
155
173
  }
156
174
 
157
175
  type evaluation =
158
176
  {
177
+ analysis_of_failures: String,
159
178
  attempt: String,
160
179
  created_at: Time,
161
180
  error_message: String,
@@ -163,6 +182,8 @@ module Deeprails
163
182
  evaluation_status: String,
164
183
  evaluation_total_cost: Float,
165
184
  guardrail_metrics: ::Array[String],
185
+ improvement_tool_status: Deeprails::Models::DefendResponse::Event::Evaluation::improvement_tool_status,
186
+ key_improvements: ::Array[String],
166
187
  model_input: ::Hash[Symbol, top],
167
188
  model_output: String,
168
189
  modified_at: Time,
@@ -172,6 +193,10 @@ module Deeprails
172
193
  }
173
194
 
174
195
  class Evaluation < Deeprails::Internal::Type::BaseModel
196
+ attr_reader analysis_of_failures: String?
197
+
198
+ def analysis_of_failures=: (String) -> String
199
+
175
200
  attr_reader attempt: String?
176
201
 
177
202
  def attempt=: (String) -> String
@@ -200,6 +225,16 @@ module Deeprails
200
225
 
201
226
  def guardrail_metrics=: (::Array[String]) -> ::Array[String]
202
227
 
228
+ attr_reader improvement_tool_status: Deeprails::Models::DefendResponse::Event::Evaluation::improvement_tool_status?
229
+
230
+ def improvement_tool_status=: (
231
+ Deeprails::Models::DefendResponse::Event::Evaluation::improvement_tool_status
232
+ ) -> Deeprails::Models::DefendResponse::Event::Evaluation::improvement_tool_status
233
+
234
+ attr_reader key_improvements: ::Array[String]?
235
+
236
+ def key_improvements=: (::Array[String]) -> ::Array[String]
237
+
203
238
  attr_reader model_input: ::Hash[Symbol, top]?
204
239
 
205
240
  def model_input=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
@@ -225,6 +260,7 @@ module Deeprails
225
260
  def run_mode=: (String) -> String
226
261
 
227
262
  def initialize: (
263
+ ?analysis_of_failures: String,
228
264
  ?attempt: String,
229
265
  ?created_at: Time,
230
266
  ?error_message: String,
@@ -232,6 +268,8 @@ module Deeprails
232
268
  ?evaluation_status: String,
233
269
  ?evaluation_total_cost: Float,
234
270
  ?guardrail_metrics: ::Array[String],
271
+ ?improvement_tool_status: Deeprails::Models::DefendResponse::Event::Evaluation::improvement_tool_status,
272
+ ?key_improvements: ::Array[String],
235
273
  ?model_input: ::Hash[Symbol, top],
236
274
  ?model_output: String,
237
275
  ?modified_at: Time,
@@ -241,6 +279,7 @@ module Deeprails
241
279
  ) -> void
242
280
 
243
281
  def to_hash: -> {
282
+ analysis_of_failures: String,
244
283
  attempt: String,
245
284
  created_at: Time,
246
285
  error_message: String,
@@ -248,6 +287,8 @@ module Deeprails
248
287
  evaluation_status: String,
249
288
  evaluation_total_cost: Float,
250
289
  guardrail_metrics: ::Array[String],
290
+ improvement_tool_status: Deeprails::Models::DefendResponse::Event::Evaluation::improvement_tool_status,
291
+ key_improvements: ::Array[String],
251
292
  model_input: ::Hash[Symbol, top],
252
293
  model_output: String,
253
294
  modified_at: Time,
@@ -255,10 +296,63 @@ module Deeprails
255
296
  progress: Integer,
256
297
  run_mode: String
257
298
  }
299
+
300
+ type improvement_tool_status =
301
+ :improved
302
+ | :improvement_failed
303
+ | :no_improvement_required
304
+ | :improvement_required
305
+
306
+ module ImprovementToolStatus
307
+ extend Deeprails::Internal::Type::Enum
308
+
309
+ IMPROVED: :improved
310
+ IMPROVEMENT_FAILED: :improvement_failed
311
+ NO_IMPROVEMENT_REQUIRED: :no_improvement_required
312
+ IMPROVEMENT_REQUIRED: :improvement_required
313
+
314
+ def self?.values: -> ::Array[Deeprails::Models::DefendResponse::Event::Evaluation::improvement_tool_status]
315
+ end
316
+ end
317
+
318
+ type improvement_tool_status =
319
+ :improved
320
+ | :improvement_failed
321
+ | :no_improvement_required
322
+ | :improvement_required
323
+
324
+ module ImprovementToolStatus
325
+ extend Deeprails::Internal::Type::Enum
326
+
327
+ IMPROVED: :improved
328
+ IMPROVEMENT_FAILED: :improvement_failed
329
+ NO_IMPROVEMENT_REQUIRED: :no_improvement_required
330
+ IMPROVEMENT_REQUIRED: :improvement_required
331
+
332
+ def self?.values: -> ::Array[Deeprails::Models::DefendResponse::Event::improvement_tool_status]
333
+ end
334
+
335
+ type status = :completed | :failed | :in_progress
336
+
337
+ module Status
338
+ extend Deeprails::Internal::Type::Enum
339
+
340
+ COMPLETED: :completed
341
+ FAILED: :failed
342
+ IN_PROGRESS: :in_progress
343
+
344
+ def self?.values: -> ::Array[Deeprails::Models::DefendResponse::Event::status]
258
345
  end
259
346
  end
260
347
 
261
- type file = { file_id: String, file_name: String, file_size: Integer }
348
+ type file =
349
+ {
350
+ file_id: String,
351
+ file_name: String,
352
+ file_size: Integer,
353
+ presigned_url: String,
354
+ presigned_url_expires_at: Time
355
+ }
262
356
 
263
357
  class File < Deeprails::Internal::Type::BaseModel
264
358
  attr_reader file_id: String?
@@ -273,16 +367,28 @@ module Deeprails
273
367
 
274
368
  def file_size=: (Integer) -> Integer
275
369
 
370
+ attr_reader presigned_url: String?
371
+
372
+ def presigned_url=: (String) -> String
373
+
374
+ attr_reader presigned_url_expires_at: Time?
375
+
376
+ def presigned_url_expires_at=: (Time) -> Time
377
+
276
378
  def initialize: (
277
379
  ?file_id: String,
278
380
  ?file_name: String,
279
- ?file_size: Integer
381
+ ?file_size: Integer,
382
+ ?presigned_url: String,
383
+ ?presigned_url_expires_at: Time
280
384
  ) -> void
281
385
 
282
386
  def to_hash: -> {
283
387
  file_id: String,
284
388
  file_name: String,
285
- file_size: Integer
389
+ file_size: Integer,
390
+ presigned_url: String,
391
+ presigned_url_expires_at: Time
286
392
  }
287
393
  end
288
394
 
@@ -0,0 +1,74 @@
1
+ module Deeprails
2
+ module Models
3
+ type defend_submit_and_stream_event_params =
4
+ {
5
+ model_input: ::Hash[Symbol, top],
6
+ model_output: String,
7
+ model_used: String,
8
+ run_mode: Deeprails::Models::DefendSubmitAndStreamEventParams::run_mode,
9
+ stream: bool,
10
+ nametag: String
11
+ }
12
+ & Deeprails::Internal::Type::request_parameters
13
+
14
+ class DefendSubmitAndStreamEventParams < Deeprails::Internal::Type::BaseModel
15
+ extend Deeprails::Internal::Type::RequestParameters::Converter
16
+ include Deeprails::Internal::Type::RequestParameters
17
+
18
+ attr_accessor model_input: ::Hash[Symbol, top]
19
+
20
+ attr_accessor model_output: String
21
+
22
+ attr_accessor model_used: String
23
+
24
+ attr_accessor run_mode: Deeprails::Models::DefendSubmitAndStreamEventParams::run_mode
25
+
26
+ attr_reader stream: bool?
27
+
28
+ def stream=: (bool) -> bool
29
+
30
+ attr_reader nametag: String?
31
+
32
+ def nametag=: (String) -> String
33
+
34
+ def initialize: (
35
+ model_input: ::Hash[Symbol, top],
36
+ model_output: String,
37
+ model_used: String,
38
+ run_mode: Deeprails::Models::DefendSubmitAndStreamEventParams::run_mode,
39
+ ?stream: bool,
40
+ ?nametag: String,
41
+ ?request_options: Deeprails::request_opts
42
+ ) -> void
43
+
44
+ def to_hash: -> {
45
+ model_input: ::Hash[Symbol, top],
46
+ model_output: String,
47
+ model_used: String,
48
+ run_mode: Deeprails::Models::DefendSubmitAndStreamEventParams::run_mode,
49
+ stream: bool,
50
+ nametag: String,
51
+ request_options: Deeprails::RequestOptions
52
+ }
53
+
54
+ type run_mode =
55
+ :fast
56
+ | :precision
57
+ | :precision_codex
58
+ | :precision_max
59
+ | :precision_max_codex
60
+
61
+ module RunMode
62
+ extend Deeprails::Internal::Type::Enum
63
+
64
+ FAST: :fast
65
+ PRECISION: :precision
66
+ PRECISION_CODEX: :precision_codex
67
+ PRECISION_MAX: :precision_max
68
+ PRECISION_MAX_CODEX: :precision_max_codex
69
+
70
+ def self?.values: -> ::Array[Deeprails::Models::DefendSubmitAndStreamEventParams::run_mode]
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,5 @@
1
+ module Deeprails
2
+ module Models
3
+ class DefendSubmitAndStreamEventResponse = String
4
+ end
5
+ end
@@ -45,9 +45,22 @@ module Deeprails
45
45
  }
46
46
 
47
47
  type model_input =
48
- { ground_truth: String, system_prompt: String, user_prompt: String }
48
+ {
49
+ user_prompt: String,
50
+ context: ::Array[Deeprails::DefendSubmitEventParams::ModelInput::Context],
51
+ ground_truth: String,
52
+ system_prompt: String
53
+ }
49
54
 
50
55
  class ModelInput < Deeprails::Internal::Type::BaseModel
56
+ attr_accessor user_prompt: String
57
+
58
+ attr_reader context: ::Array[Deeprails::DefendSubmitEventParams::ModelInput::Context]?
59
+
60
+ def context=: (
61
+ ::Array[Deeprails::DefendSubmitEventParams::ModelInput::Context]
62
+ ) -> ::Array[Deeprails::DefendSubmitEventParams::ModelInput::Context]
63
+
51
64
  attr_reader ground_truth: String?
52
65
 
53
66
  def ground_truth=: (String) -> String
@@ -56,28 +69,44 @@ module Deeprails
56
69
 
57
70
  def system_prompt=: (String) -> String
58
71
 
59
- attr_reader user_prompt: String?
60
-
61
- def user_prompt=: (String) -> String
62
-
63
72
  def initialize: (
73
+ user_prompt: String,
74
+ ?context: ::Array[Deeprails::DefendSubmitEventParams::ModelInput::Context],
64
75
  ?ground_truth: String,
65
- ?system_prompt: String,
66
- ?user_prompt: String
76
+ ?system_prompt: String
67
77
  ) -> void
68
78
 
69
79
  def to_hash: -> {
80
+ user_prompt: String,
81
+ context: ::Array[Deeprails::DefendSubmitEventParams::ModelInput::Context],
70
82
  ground_truth: String,
71
- system_prompt: String,
72
- user_prompt: String
83
+ system_prompt: String
73
84
  }
85
+
86
+ type context = { content: String, role: String }
87
+
88
+ class Context < Deeprails::Internal::Type::BaseModel
89
+ attr_reader content: String?
90
+
91
+ def content=: (String) -> String
92
+
93
+ attr_reader role: String?
94
+
95
+ def role=: (String) -> String
96
+
97
+ def initialize: (?content: String, ?role: String) -> void
98
+
99
+ def to_hash: -> { content: String, role: String }
100
+ end
74
101
  end
75
102
 
76
- type run_mode = :precision_plus | :precision | :smart | :economy
103
+ type run_mode =
104
+ :precision_plus_codex | :precision_plus | :precision | :smart | :economy
77
105
 
78
106
  module RunMode
79
107
  extend Deeprails::Internal::Type::Enum
80
108
 
109
+ PRECISION_PLUS_CODEX: :precision_plus_codex
81
110
  PRECISION_PLUS: :precision_plus
82
111
  PRECISION: :precision
83
112
  SMART: :smart
@@ -4,7 +4,8 @@ module Deeprails
4
4
  {
5
5
  modified_at: Time,
6
6
  status: Deeprails::Models::DefendUpdateResponse::status,
7
- workflow_id: String
7
+ workflow_id: String,
8
+ name: String
8
9
  }
9
10
 
10
11
  class DefendUpdateResponse < Deeprails::Internal::Type::BaseModel
@@ -14,16 +15,22 @@ module Deeprails
14
15
 
15
16
  attr_accessor workflow_id: String
16
17
 
18
+ attr_reader name: String?
19
+
20
+ def name=: (String) -> String
21
+
17
22
  def initialize: (
18
23
  modified_at: Time,
19
24
  status: Deeprails::Models::DefendUpdateResponse::status,
20
- workflow_id: String
25
+ workflow_id: String,
26
+ ?name: String
21
27
  ) -> void
22
28
 
23
29
  def to_hash: -> {
24
30
  modified_at: Time,
25
31
  status: Deeprails::Models::DefendUpdateResponse::status,
26
- workflow_id: String
32
+ workflow_id: String,
33
+ name: String
27
34
  }
28
35
 
29
36
  type status = :inactive | :active
@@ -1,32 +1,134 @@
1
1
  module Deeprails
2
2
  module Models
3
3
  type defend_update_workflow_params =
4
- { description: String, name: String }
4
+ {
5
+ automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendUpdateWorkflowParams::automatic_hallucination_tolerance_level],
6
+ context_awareness: bool,
7
+ custom_hallucination_threshold_values: ::Hash[Symbol, Float],
8
+ description: String,
9
+ file_search: ::Array[String],
10
+ improvement_action: Deeprails::Models::DefendUpdateWorkflowParams::improvement_action,
11
+ max_improvement_attempts: Integer,
12
+ name: String,
13
+ threshold_type: Deeprails::Models::DefendUpdateWorkflowParams::threshold_type,
14
+ web_search: bool
15
+ }
5
16
  & Deeprails::Internal::Type::request_parameters
6
17
 
7
18
  class DefendUpdateWorkflowParams < Deeprails::Internal::Type::BaseModel
8
19
  extend Deeprails::Internal::Type::RequestParameters::Converter
9
20
  include Deeprails::Internal::Type::RequestParameters
10
21
 
22
+ attr_reader automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendUpdateWorkflowParams::automatic_hallucination_tolerance_level]?
23
+
24
+ def automatic_hallucination_tolerance_levels=: (
25
+ ::Hash[Symbol, Deeprails::Models::DefendUpdateWorkflowParams::automatic_hallucination_tolerance_level]
26
+ ) -> ::Hash[Symbol, Deeprails::Models::DefendUpdateWorkflowParams::automatic_hallucination_tolerance_level]
27
+
28
+ attr_reader context_awareness: bool?
29
+
30
+ def context_awareness=: (bool) -> bool
31
+
32
+ attr_reader custom_hallucination_threshold_values: ::Hash[Symbol, Float]?
33
+
34
+ def custom_hallucination_threshold_values=: (
35
+ ::Hash[Symbol, Float]
36
+ ) -> ::Hash[Symbol, Float]
37
+
11
38
  attr_reader description: String?
12
39
 
13
40
  def description=: (String) -> String
14
41
 
42
+ attr_reader file_search: ::Array[String]?
43
+
44
+ def file_search=: (::Array[String]) -> ::Array[String]
45
+
46
+ attr_reader improvement_action: Deeprails::Models::DefendUpdateWorkflowParams::improvement_action?
47
+
48
+ def improvement_action=: (
49
+ Deeprails::Models::DefendUpdateWorkflowParams::improvement_action
50
+ ) -> Deeprails::Models::DefendUpdateWorkflowParams::improvement_action
51
+
52
+ attr_reader max_improvement_attempts: Integer?
53
+
54
+ def max_improvement_attempts=: (Integer) -> Integer
55
+
15
56
  attr_reader name: String?
16
57
 
17
58
  def name=: (String) -> String
18
59
 
60
+ attr_reader threshold_type: Deeprails::Models::DefendUpdateWorkflowParams::threshold_type?
61
+
62
+ def threshold_type=: (
63
+ Deeprails::Models::DefendUpdateWorkflowParams::threshold_type
64
+ ) -> Deeprails::Models::DefendUpdateWorkflowParams::threshold_type
65
+
66
+ attr_reader web_search: bool?
67
+
68
+ def web_search=: (bool) -> bool
69
+
19
70
  def initialize: (
71
+ ?automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendUpdateWorkflowParams::automatic_hallucination_tolerance_level],
72
+ ?context_awareness: bool,
73
+ ?custom_hallucination_threshold_values: ::Hash[Symbol, Float],
20
74
  ?description: String,
75
+ ?file_search: ::Array[String],
76
+ ?improvement_action: Deeprails::Models::DefendUpdateWorkflowParams::improvement_action,
77
+ ?max_improvement_attempts: Integer,
21
78
  ?name: String,
79
+ ?threshold_type: Deeprails::Models::DefendUpdateWorkflowParams::threshold_type,
80
+ ?web_search: bool,
22
81
  ?request_options: Deeprails::request_opts
23
82
  ) -> void
24
83
 
25
84
  def to_hash: -> {
85
+ automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendUpdateWorkflowParams::automatic_hallucination_tolerance_level],
86
+ context_awareness: bool,
87
+ custom_hallucination_threshold_values: ::Hash[Symbol, Float],
26
88
  description: String,
89
+ file_search: ::Array[String],
90
+ improvement_action: Deeprails::Models::DefendUpdateWorkflowParams::improvement_action,
91
+ max_improvement_attempts: Integer,
27
92
  name: String,
93
+ threshold_type: Deeprails::Models::DefendUpdateWorkflowParams::threshold_type,
94
+ web_search: bool,
28
95
  request_options: Deeprails::RequestOptions
29
96
  }
97
+
98
+ type automatic_hallucination_tolerance_level = :low | :medium | :high
99
+
100
+ module AutomaticHallucinationToleranceLevel
101
+ extend Deeprails::Internal::Type::Enum
102
+
103
+ LOW: :low
104
+ MEDIUM: :medium
105
+ HIGH: :high
106
+
107
+ def self?.values: -> ::Array[Deeprails::Models::DefendUpdateWorkflowParams::automatic_hallucination_tolerance_level]
108
+ end
109
+
110
+ type improvement_action = :regen | :fixit | :do_nothing
111
+
112
+ module ImprovementAction
113
+ extend Deeprails::Internal::Type::Enum
114
+
115
+ REGEN: :regen
116
+ FIXIT: :fixit
117
+ DO_NOTHING: :do_nothing
118
+
119
+ def self?.values: -> ::Array[Deeprails::Models::DefendUpdateWorkflowParams::improvement_action]
120
+ end
121
+
122
+ type threshold_type = :automatic | :custom
123
+
124
+ module ThresholdType
125
+ extend Deeprails::Internal::Type::Enum
126
+
127
+ AUTOMATIC: :automatic
128
+ CUSTOM: :custom
129
+
130
+ def self?.values: -> ::Array[Deeprails::Models::DefendUpdateWorkflowParams::threshold_type]
131
+ end
30
132
  end
31
133
  end
32
134
  end
@@ -4,6 +4,7 @@ module Deeprails
4
4
  {
5
5
  guardrail_metrics: ::Array[Deeprails::Models::MonitorCreateParams::guardrail_metric],
6
6
  name: String,
7
+ context_awareness: bool,
7
8
  description: String,
8
9
  file_search: ::Array[String],
9
10
  web_search: bool
@@ -18,6 +19,10 @@ module Deeprails
18
19
 
19
20
  attr_accessor name: String
20
21
 
22
+ attr_reader context_awareness: bool?
23
+
24
+ def context_awareness=: (bool) -> bool
25
+
21
26
  attr_reader description: String?
22
27
 
23
28
  def description=: (String) -> String
@@ -33,6 +38,7 @@ module Deeprails
33
38
  def initialize: (
34
39
  guardrail_metrics: ::Array[Deeprails::Models::MonitorCreateParams::guardrail_metric],
35
40
  name: String,
41
+ ?context_awareness: bool,
36
42
  ?description: String,
37
43
  ?file_search: ::Array[String],
38
44
  ?web_search: bool,
@@ -42,6 +48,7 @@ module Deeprails
42
48
  def to_hash: -> {
43
49
  guardrail_metrics: ::Array[Deeprails::Models::MonitorCreateParams::guardrail_metric],
44
50
  name: String,
51
+ context_awareness: bool,
45
52
  description: String,
46
53
  file_search: ::Array[String],
47
54
  web_search: bool,