deeprails 0.11.0 → 0.13.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 +26 -0
- data/README.md +26 -40
- data/lib/deeprails/internal/transport/base_client.rb +7 -1
- data/lib/deeprails/internal/transport/pooled_net_requester.rb +6 -2
- data/lib/deeprails/internal/type/base_model.rb +5 -5
- data/lib/deeprails/models/defend_create_response.rb +51 -0
- data/lib/deeprails/models/defend_create_workflow_params.rb +19 -19
- data/lib/deeprails/models/defend_response.rb +294 -54
- data/lib/deeprails/models/defend_retrieve_workflow_params.rb +13 -1
- data/lib/deeprails/models/defend_update_response.rb +51 -0
- data/lib/deeprails/models/file_response.rb +6 -22
- data/lib/deeprails/models/file_upload_params.rb +3 -3
- data/lib/deeprails/models/monitor_create_response.rb +51 -0
- data/lib/deeprails/models/monitor_detail_response.rb +103 -104
- data/lib/deeprails/models/monitor_event_detail_response.rb +183 -0
- data/lib/deeprails/models/monitor_event_response.rb +1 -9
- data/lib/deeprails/models/monitor_retrieve_event_params.rb +20 -0
- data/lib/deeprails/models/monitor_retrieve_params.rb +6 -2
- data/lib/deeprails/models/monitor_update_params.rb +11 -11
- data/lib/deeprails/models/monitor_update_response.rb +51 -0
- data/lib/deeprails/models/workflow_event_detail_response.rb +314 -0
- data/lib/deeprails/models/workflow_event_response.rb +29 -30
- data/lib/deeprails/models.rb +13 -1
- data/lib/deeprails/resources/defend.rb +20 -13
- data/lib/deeprails/resources/files.rb +1 -1
- data/lib/deeprails/resources/monitor.rb +38 -8
- data/lib/deeprails/version.rb +1 -1
- data/lib/deeprails.rb +8 -1
- data/manifest.yaml +1 -0
- data/rbi/deeprails/internal/transport/base_client.rbi +5 -0
- data/rbi/deeprails/internal/transport/pooled_net_requester.rbi +6 -2
- data/rbi/deeprails/internal/type/base_model.rbi +8 -4
- data/rbi/deeprails/models/defend_create_response.rbi +83 -0
- data/rbi/deeprails/models/defend_create_workflow_params.rbi +33 -27
- data/rbi/deeprails/models/defend_response.rbi +528 -109
- data/rbi/deeprails/models/defend_retrieve_workflow_params.rbi +23 -5
- data/rbi/deeprails/models/defend_update_response.rbi +83 -0
- data/rbi/deeprails/models/file_response.rbi +11 -39
- data/rbi/deeprails/models/file_upload_params.rbi +3 -6
- data/rbi/deeprails/models/monitor_create_response.rbi +83 -0
- data/rbi/deeprails/models/monitor_detail_response.rbi +168 -167
- data/rbi/deeprails/models/monitor_event_detail_response.rbi +386 -0
- data/rbi/deeprails/models/monitor_event_response.rbi +4 -18
- data/rbi/deeprails/models/monitor_retrieve_event_params.rbi +38 -0
- data/rbi/deeprails/models/monitor_retrieve_params.rbi +4 -2
- data/rbi/deeprails/models/monitor_update_params.rbi +21 -38
- data/rbi/deeprails/models/monitor_update_response.rbi +83 -0
- data/rbi/deeprails/models/workflow_event_detail_response.rbi +657 -0
- data/rbi/deeprails/models/workflow_event_response.rbi +49 -42
- data/rbi/deeprails/models.rbi +13 -1
- data/rbi/deeprails/resources/defend.rbi +17 -12
- data/rbi/deeprails/resources/files.rbi +1 -1
- data/rbi/deeprails/resources/monitor.rbi +25 -8
- data/sig/deeprails/internal/transport/base_client.rbs +2 -0
- data/sig/deeprails/internal/transport/pooled_net_requester.rbs +4 -1
- data/sig/deeprails/models/defend_create_response.rbs +41 -0
- data/sig/deeprails/models/defend_create_workflow_params.rbs +7 -7
- data/sig/deeprails/models/defend_response.rbs +282 -47
- data/sig/deeprails/models/defend_retrieve_workflow_params.rbs +13 -3
- data/sig/deeprails/models/defend_update_response.rbs +41 -0
- data/sig/deeprails/models/file_response.rbs +5 -27
- data/sig/deeprails/models/file_upload_params.rbs +4 -5
- data/sig/deeprails/models/monitor_create_response.rbs +41 -0
- data/sig/deeprails/models/monitor_detail_response.rbs +80 -89
- data/sig/deeprails/models/monitor_event_detail_response.rbs +181 -0
- data/sig/deeprails/models/monitor_event_response.rbs +2 -15
- data/sig/deeprails/models/monitor_retrieve_event_params.rbs +23 -0
- data/sig/deeprails/models/monitor_update_params.rbs +13 -13
- data/sig/deeprails/models/monitor_update_response.rbs +41 -0
- data/sig/deeprails/models/workflow_event_detail_response.rbs +303 -0
- data/sig/deeprails/models/workflow_event_response.rbs +24 -24
- data/sig/deeprails/models.rbs +13 -1
- data/sig/deeprails/resources/defend.rbs +5 -4
- data/sig/deeprails/resources/files.rbs +1 -1
- data/sig/deeprails/resources/monitor.rbs +9 -3
- metadata +23 -5
- data/lib/deeprails/models/monitor_response.rb +0 -83
- data/rbi/deeprails/models/monitor_response.rbi +0 -142
- data/sig/deeprails/models/monitor_response.rbs +0 -73
|
@@ -4,108 +4,108 @@ module Deeprails
|
|
|
4
4
|
module Models
|
|
5
5
|
# @see Deeprails::Resources::Monitor#retrieve
|
|
6
6
|
class MonitorDetailResponse < Deeprails::Internal::Type::BaseModel
|
|
7
|
-
# @!attribute
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
# @return [String]
|
|
11
|
-
required :monitor_id, String
|
|
12
|
-
|
|
13
|
-
# @!attribute monitor_status
|
|
14
|
-
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
15
|
-
# longer record and evaluate events.
|
|
7
|
+
# @!attribute capabilities
|
|
8
|
+
# An array of capabilities associated with this monitor.
|
|
16
9
|
#
|
|
17
|
-
# @return [
|
|
18
|
-
required :
|
|
19
|
-
|
|
20
|
-
# @!attribute name
|
|
21
|
-
# Name of this monitor.
|
|
22
|
-
#
|
|
23
|
-
# @return [String]
|
|
24
|
-
required :name, String
|
|
10
|
+
# @return [Array<Deeprails::Models::MonitorDetailResponse::Capability>]
|
|
11
|
+
required :capabilities,
|
|
12
|
+
-> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorDetailResponse::Capability] }
|
|
25
13
|
|
|
26
14
|
# @!attribute created_at
|
|
27
15
|
# The time the monitor was created in UTC.
|
|
28
16
|
#
|
|
29
|
-
# @return [Time
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
# @!attribute description
|
|
33
|
-
# Description of this monitor.
|
|
34
|
-
#
|
|
35
|
-
# @return [String, nil]
|
|
36
|
-
optional :description, String
|
|
17
|
+
# @return [Time]
|
|
18
|
+
required :created_at, Time
|
|
37
19
|
|
|
38
20
|
# @!attribute evaluations
|
|
39
21
|
# An array of all evaluations performed by this monitor. Each one corresponds to a
|
|
40
22
|
# separate monitor event.
|
|
41
23
|
#
|
|
42
|
-
# @return [Array<Deeprails::Models::MonitorDetailResponse::Evaluation
|
|
43
|
-
|
|
24
|
+
# @return [Array<Deeprails::Models::MonitorDetailResponse::Evaluation>]
|
|
25
|
+
required :evaluations,
|
|
44
26
|
-> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorDetailResponse::Evaluation] }
|
|
45
27
|
|
|
28
|
+
# @!attribute files
|
|
29
|
+
# An array of files associated with this monitor.
|
|
30
|
+
#
|
|
31
|
+
# @return [Array<Deeprails::Models::MonitorDetailResponse::File>]
|
|
32
|
+
required :files, -> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorDetailResponse::File] }
|
|
33
|
+
|
|
34
|
+
# @!attribute monitor_id
|
|
35
|
+
# A unique monitor ID.
|
|
36
|
+
#
|
|
37
|
+
# @return [String]
|
|
38
|
+
required :monitor_id, String
|
|
39
|
+
|
|
40
|
+
# @!attribute name
|
|
41
|
+
# Name of this monitor.
|
|
42
|
+
#
|
|
43
|
+
# @return [String]
|
|
44
|
+
required :name, String
|
|
45
|
+
|
|
46
46
|
# @!attribute stats
|
|
47
47
|
# Contains five fields used for stats of this monitor: total evaluations,
|
|
48
48
|
# completed evaluations, failed evaluations, queued evaluations, and in progress
|
|
49
49
|
# evaluations.
|
|
50
50
|
#
|
|
51
|
-
# @return [Deeprails::Models::MonitorDetailResponse::Stats
|
|
52
|
-
|
|
51
|
+
# @return [Deeprails::Models::MonitorDetailResponse::Stats]
|
|
52
|
+
required :stats, -> { Deeprails::MonitorDetailResponse::Stats }
|
|
53
|
+
|
|
54
|
+
# @!attribute status
|
|
55
|
+
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
56
|
+
# longer record and evaluate events.
|
|
57
|
+
#
|
|
58
|
+
# @return [Symbol, Deeprails::Models::MonitorDetailResponse::Status]
|
|
59
|
+
required :status, enum: -> { Deeprails::MonitorDetailResponse::Status }
|
|
53
60
|
|
|
54
61
|
# @!attribute updated_at
|
|
55
62
|
# The most recent time the monitor was modified in UTC.
|
|
56
63
|
#
|
|
57
|
-
# @return [Time
|
|
58
|
-
|
|
64
|
+
# @return [Time]
|
|
65
|
+
required :updated_at, Time
|
|
59
66
|
|
|
60
|
-
# @!attribute
|
|
61
|
-
#
|
|
67
|
+
# @!attribute description
|
|
68
|
+
# Description of this monitor.
|
|
62
69
|
#
|
|
63
70
|
# @return [String, nil]
|
|
64
|
-
optional :
|
|
71
|
+
optional :description, String
|
|
65
72
|
|
|
66
|
-
# @!method initialize(
|
|
73
|
+
# @!method initialize(capabilities:, created_at:, evaluations:, files:, monitor_id:, name:, stats:, status:, updated_at:, description: nil)
|
|
67
74
|
# Some parameter documentations has been truncated, see
|
|
68
75
|
# {Deeprails::Models::MonitorDetailResponse} for more details.
|
|
69
76
|
#
|
|
70
|
-
# @param
|
|
77
|
+
# @param capabilities [Array<Deeprails::Models::MonitorDetailResponse::Capability>] An array of capabilities associated with this monitor.
|
|
71
78
|
#
|
|
72
|
-
# @param
|
|
79
|
+
# @param created_at [Time] The time the monitor was created in UTC.
|
|
73
80
|
#
|
|
74
|
-
# @param
|
|
81
|
+
# @param evaluations [Array<Deeprails::Models::MonitorDetailResponse::Evaluation>] An array of all evaluations performed by this monitor. Each one corresponds to
|
|
75
82
|
#
|
|
76
|
-
# @param
|
|
83
|
+
# @param files [Array<Deeprails::Models::MonitorDetailResponse::File>] An array of files associated with this monitor.
|
|
77
84
|
#
|
|
78
|
-
# @param
|
|
85
|
+
# @param monitor_id [String] A unique monitor ID.
|
|
79
86
|
#
|
|
80
|
-
# @param
|
|
87
|
+
# @param name [String] Name of this monitor.
|
|
81
88
|
#
|
|
82
89
|
# @param stats [Deeprails::Models::MonitorDetailResponse::Stats] Contains five fields used for stats of this monitor: total evaluations, complete
|
|
83
90
|
#
|
|
84
|
-
# @param
|
|
91
|
+
# @param status [Symbol, Deeprails::Models::MonitorDetailResponse::Status] Status of the monitor. Can be `active` or `inactive`. Inactive monitors no lon
|
|
85
92
|
#
|
|
86
|
-
# @param
|
|
87
|
-
|
|
88
|
-
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
89
|
-
# longer record and evaluate events.
|
|
93
|
+
# @param updated_at [Time] The most recent time the monitor was modified in UTC.
|
|
90
94
|
#
|
|
91
|
-
#
|
|
92
|
-
module MonitorStatus
|
|
93
|
-
extend Deeprails::Internal::Type::Enum
|
|
95
|
+
# @param description [String] Description of this monitor.
|
|
94
96
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
class Capability < Deeprails::Internal::Type::BaseModel
|
|
98
|
+
# @!attribute capability
|
|
99
|
+
# The type of capability.
|
|
100
|
+
#
|
|
101
|
+
# @return [String, nil]
|
|
102
|
+
optional :capability, String
|
|
97
103
|
|
|
98
|
-
# @!method
|
|
99
|
-
# @
|
|
104
|
+
# @!method initialize(capability: nil)
|
|
105
|
+
# @param capability [String] The type of capability.
|
|
100
106
|
end
|
|
101
107
|
|
|
102
108
|
class Evaluation < Deeprails::Internal::Type::BaseModel
|
|
103
|
-
# @!attribute eval_id
|
|
104
|
-
# A unique evaluation ID.
|
|
105
|
-
#
|
|
106
|
-
# @return [String]
|
|
107
|
-
required :eval_id, String
|
|
108
|
-
|
|
109
109
|
# @!attribute evaluation_status
|
|
110
110
|
# Status of the evaluation.
|
|
111
111
|
#
|
|
@@ -139,24 +139,12 @@ module Deeprails
|
|
|
139
139
|
# @return [Time, nil]
|
|
140
140
|
optional :created_at, Time
|
|
141
141
|
|
|
142
|
-
# @!attribute end_timestamp
|
|
143
|
-
# The time the evaluation completed in UTC.
|
|
144
|
-
#
|
|
145
|
-
# @return [Time, nil]
|
|
146
|
-
optional :end_timestamp, Time
|
|
147
|
-
|
|
148
142
|
# @!attribute error_message
|
|
149
|
-
#
|
|
143
|
+
# Error message if the evaluation failed.
|
|
150
144
|
#
|
|
151
145
|
# @return [String, nil]
|
|
152
146
|
optional :error_message, String
|
|
153
147
|
|
|
154
|
-
# @!attribute error_timestamp
|
|
155
|
-
# The time the error causing the evaluation to fail was recorded.
|
|
156
|
-
#
|
|
157
|
-
# @return [Time, nil]
|
|
158
|
-
optional :error_timestamp, Time
|
|
159
|
-
|
|
160
148
|
# @!attribute evaluation_result
|
|
161
149
|
# Evaluation result consisting of average scores and rationales for each of the
|
|
162
150
|
# evaluated guardrail metrics.
|
|
@@ -178,18 +166,6 @@ module Deeprails
|
|
|
178
166
|
optional :guardrail_metrics,
|
|
179
167
|
-> { Deeprails::Internal::Type::ArrayOf[enum: Deeprails::MonitorDetailResponse::Evaluation::GuardrailMetric] }
|
|
180
168
|
|
|
181
|
-
# @!attribute model_used
|
|
182
|
-
# Model ID used to generate the output, like `gpt-4o` or `o3`.
|
|
183
|
-
#
|
|
184
|
-
# @return [String, nil]
|
|
185
|
-
optional :model_used, String
|
|
186
|
-
|
|
187
|
-
# @!attribute modified_at
|
|
188
|
-
# The most recent time the evaluation was modified in UTC.
|
|
189
|
-
#
|
|
190
|
-
# @return [Time, nil]
|
|
191
|
-
optional :modified_at, Time
|
|
192
|
-
|
|
193
169
|
# @!attribute nametag
|
|
194
170
|
# An optional, user-defined tag for the evaluation.
|
|
195
171
|
#
|
|
@@ -203,18 +179,10 @@ module Deeprails
|
|
|
203
179
|
# @return [Integer, nil]
|
|
204
180
|
optional :progress, Integer
|
|
205
181
|
|
|
206
|
-
# @!
|
|
207
|
-
# The time the evaluation started in UTC.
|
|
208
|
-
#
|
|
209
|
-
# @return [Time, nil]
|
|
210
|
-
optional :start_timestamp, Time
|
|
211
|
-
|
|
212
|
-
# @!method initialize(eval_id:, evaluation_status:, model_input:, model_output:, run_mode:, created_at: nil, end_timestamp: nil, error_message: nil, error_timestamp: nil, evaluation_result: nil, evaluation_total_cost: nil, guardrail_metrics: nil, model_used: nil, modified_at: nil, nametag: nil, progress: nil, start_timestamp: nil)
|
|
182
|
+
# @!method initialize(evaluation_status:, model_input:, model_output:, run_mode:, created_at: nil, error_message: nil, evaluation_result: nil, evaluation_total_cost: nil, guardrail_metrics: nil, nametag: nil, progress: nil)
|
|
213
183
|
# Some parameter documentations has been truncated, see
|
|
214
184
|
# {Deeprails::Models::MonitorDetailResponse::Evaluation} for more details.
|
|
215
185
|
#
|
|
216
|
-
# @param eval_id [String] A unique evaluation ID.
|
|
217
|
-
#
|
|
218
186
|
# @param evaluation_status [Symbol, Deeprails::Models::MonitorDetailResponse::Evaluation::EvaluationStatus] Status of the evaluation.
|
|
219
187
|
#
|
|
220
188
|
# @param model_input [Deeprails::Models::MonitorDetailResponse::Evaluation::ModelInput] A dictionary of inputs sent to the LLM to generate output. The dictionary must c
|
|
@@ -225,11 +193,7 @@ module Deeprails
|
|
|
225
193
|
#
|
|
226
194
|
# @param created_at [Time] The time the evaluation was created in UTC.
|
|
227
195
|
#
|
|
228
|
-
# @param
|
|
229
|
-
#
|
|
230
|
-
# @param error_message [String] Description of the error causing the evaluation to fail, if any.
|
|
231
|
-
#
|
|
232
|
-
# @param error_timestamp [Time] The time the error causing the evaluation to fail was recorded.
|
|
196
|
+
# @param error_message [String] Error message if the evaluation failed.
|
|
233
197
|
#
|
|
234
198
|
# @param evaluation_result [Hash{Symbol=>Object}] Evaluation result consisting of average scores and rationales for each of the ev
|
|
235
199
|
#
|
|
@@ -237,15 +201,9 @@ module Deeprails
|
|
|
237
201
|
#
|
|
238
202
|
# @param guardrail_metrics [Array<Symbol, Deeprails::Models::MonitorDetailResponse::Evaluation::GuardrailMetric>] An array of guardrail metrics that the model input and output pair will be evalu
|
|
239
203
|
#
|
|
240
|
-
# @param model_used [String] Model ID used to generate the output, like `gpt-4o` or `o3`.
|
|
241
|
-
#
|
|
242
|
-
# @param modified_at [Time] The most recent time the evaluation was modified in UTC.
|
|
243
|
-
#
|
|
244
204
|
# @param nametag [String] An optional, user-defined tag for the evaluation.
|
|
245
205
|
#
|
|
246
206
|
# @param progress [Integer] Evaluation progress. Values range between 0 and 100; 100 corresponds to a compl
|
|
247
|
-
#
|
|
248
|
-
# @param start_timestamp [Time] The time the evaluation started in UTC.
|
|
249
207
|
|
|
250
208
|
# Status of the evaluation.
|
|
251
209
|
#
|
|
@@ -326,6 +284,33 @@ module Deeprails
|
|
|
326
284
|
end
|
|
327
285
|
end
|
|
328
286
|
|
|
287
|
+
class File < Deeprails::Internal::Type::BaseModel
|
|
288
|
+
# @!attribute file_id
|
|
289
|
+
# The ID of the file.
|
|
290
|
+
#
|
|
291
|
+
# @return [String, nil]
|
|
292
|
+
optional :file_id, String
|
|
293
|
+
|
|
294
|
+
# @!attribute file_name
|
|
295
|
+
# The name of the file.
|
|
296
|
+
#
|
|
297
|
+
# @return [String, nil]
|
|
298
|
+
optional :file_name, String
|
|
299
|
+
|
|
300
|
+
# @!attribute file_size
|
|
301
|
+
# The size of the file in bytes.
|
|
302
|
+
#
|
|
303
|
+
# @return [Integer, nil]
|
|
304
|
+
optional :file_size, Integer
|
|
305
|
+
|
|
306
|
+
# @!method initialize(file_id: nil, file_name: nil, file_size: nil)
|
|
307
|
+
# @param file_id [String] The ID of the file.
|
|
308
|
+
#
|
|
309
|
+
# @param file_name [String] The name of the file.
|
|
310
|
+
#
|
|
311
|
+
# @param file_size [Integer] The size of the file in bytes.
|
|
312
|
+
end
|
|
313
|
+
|
|
329
314
|
# @see Deeprails::Models::MonitorDetailResponse#stats
|
|
330
315
|
class Stats < Deeprails::Internal::Type::BaseModel
|
|
331
316
|
# @!attribute completed_evaluations
|
|
@@ -373,6 +358,20 @@ module Deeprails
|
|
|
373
358
|
#
|
|
374
359
|
# @param total_evaluations [Integer] Total number of evaluations performed by this monitor.
|
|
375
360
|
end
|
|
361
|
+
|
|
362
|
+
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
363
|
+
# longer record and evaluate events.
|
|
364
|
+
#
|
|
365
|
+
# @see Deeprails::Models::MonitorDetailResponse#status
|
|
366
|
+
module Status
|
|
367
|
+
extend Deeprails::Internal::Type::Enum
|
|
368
|
+
|
|
369
|
+
ACTIVE = :active
|
|
370
|
+
INACTIVE = :inactive
|
|
371
|
+
|
|
372
|
+
# @!method self.values
|
|
373
|
+
# @return [Array<Symbol>]
|
|
374
|
+
end
|
|
376
375
|
end
|
|
377
376
|
end
|
|
378
377
|
end
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Deeprails
|
|
4
|
+
module Models
|
|
5
|
+
# @see Deeprails::Resources::Monitor#retrieve_event
|
|
6
|
+
class MonitorEventDetailResponse < Deeprails::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute capabilities
|
|
8
|
+
# The capabilities associated with the monitor event.
|
|
9
|
+
#
|
|
10
|
+
# @return [Array<Deeprails::Models::MonitorEventDetailResponse::Capability>, nil]
|
|
11
|
+
optional :capabilities,
|
|
12
|
+
-> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorEventDetailResponse::Capability] }
|
|
13
|
+
|
|
14
|
+
# @!attribute eval_time
|
|
15
|
+
# The time spent on the evaluation in seconds.
|
|
16
|
+
#
|
|
17
|
+
# @return [String, nil]
|
|
18
|
+
optional :eval_time, String
|
|
19
|
+
|
|
20
|
+
# @!attribute evaluation_result
|
|
21
|
+
# The result of the evaluation of the monitor event.
|
|
22
|
+
#
|
|
23
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
24
|
+
optional :evaluation_result, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]
|
|
25
|
+
|
|
26
|
+
# @!attribute event_id
|
|
27
|
+
# A unique monitor event ID.
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
optional :event_id, String
|
|
31
|
+
|
|
32
|
+
# @!attribute files
|
|
33
|
+
# The files associated with the monitor event.
|
|
34
|
+
#
|
|
35
|
+
# @return [Array<Deeprails::Models::MonitorEventDetailResponse::File>, nil]
|
|
36
|
+
optional :files, -> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorEventDetailResponse::File] }
|
|
37
|
+
|
|
38
|
+
# @!attribute guardrail_metrics
|
|
39
|
+
# The guardrail metrics evaluated by the monitor event.
|
|
40
|
+
#
|
|
41
|
+
# @return [Array<String>, nil]
|
|
42
|
+
optional :guardrail_metrics, Deeprails::Internal::Type::ArrayOf[String]
|
|
43
|
+
|
|
44
|
+
# @!attribute model_input
|
|
45
|
+
# The model input used to create the monitor event.
|
|
46
|
+
#
|
|
47
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
48
|
+
optional :model_input, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]
|
|
49
|
+
|
|
50
|
+
# @!attribute model_output
|
|
51
|
+
# The output evaluated by the monitor event.
|
|
52
|
+
#
|
|
53
|
+
# @return [String, nil]
|
|
54
|
+
optional :model_output, String
|
|
55
|
+
|
|
56
|
+
# @!attribute monitor_id
|
|
57
|
+
# Monitor ID associated with this event.
|
|
58
|
+
#
|
|
59
|
+
# @return [String, nil]
|
|
60
|
+
optional :monitor_id, String
|
|
61
|
+
|
|
62
|
+
# @!attribute nametag
|
|
63
|
+
# A human-readable tag for the monitor event.
|
|
64
|
+
#
|
|
65
|
+
# @return [String, nil]
|
|
66
|
+
optional :nametag, String
|
|
67
|
+
|
|
68
|
+
# @!attribute run_mode
|
|
69
|
+
# The run mode used to evaluate the monitor event.
|
|
70
|
+
#
|
|
71
|
+
# @return [Symbol, Deeprails::Models::MonitorEventDetailResponse::RunMode, nil]
|
|
72
|
+
optional :run_mode, enum: -> { Deeprails::MonitorEventDetailResponse::RunMode }
|
|
73
|
+
|
|
74
|
+
# @!attribute status
|
|
75
|
+
# Status of the monitor event's evaluation.
|
|
76
|
+
#
|
|
77
|
+
# @return [Symbol, Deeprails::Models::MonitorEventDetailResponse::Status, nil]
|
|
78
|
+
optional :status, enum: -> { Deeprails::MonitorEventDetailResponse::Status }
|
|
79
|
+
|
|
80
|
+
# @!attribute timestamp
|
|
81
|
+
# The time the monitor event was created in UTC.
|
|
82
|
+
#
|
|
83
|
+
# @return [Time, nil]
|
|
84
|
+
optional :timestamp, Time
|
|
85
|
+
|
|
86
|
+
# @!method initialize(capabilities: nil, eval_time: nil, evaluation_result: nil, event_id: nil, files: nil, guardrail_metrics: nil, model_input: nil, model_output: nil, monitor_id: nil, nametag: nil, run_mode: nil, status: nil, timestamp: nil)
|
|
87
|
+
# @param capabilities [Array<Deeprails::Models::MonitorEventDetailResponse::Capability>] The capabilities associated with the monitor event.
|
|
88
|
+
#
|
|
89
|
+
# @param eval_time [String] The time spent on the evaluation in seconds.
|
|
90
|
+
#
|
|
91
|
+
# @param evaluation_result [Hash{Symbol=>Object}] The result of the evaluation of the monitor event.
|
|
92
|
+
#
|
|
93
|
+
# @param event_id [String] A unique monitor event ID.
|
|
94
|
+
#
|
|
95
|
+
# @param files [Array<Deeprails::Models::MonitorEventDetailResponse::File>] The files associated with the monitor event.
|
|
96
|
+
#
|
|
97
|
+
# @param guardrail_metrics [Array<String>] The guardrail metrics evaluated by the monitor event.
|
|
98
|
+
#
|
|
99
|
+
# @param model_input [Hash{Symbol=>Object}] The model input used to create the monitor event.
|
|
100
|
+
#
|
|
101
|
+
# @param model_output [String] The output evaluated by the monitor event.
|
|
102
|
+
#
|
|
103
|
+
# @param monitor_id [String] Monitor ID associated with this event.
|
|
104
|
+
#
|
|
105
|
+
# @param nametag [String] A human-readable tag for the monitor event.
|
|
106
|
+
#
|
|
107
|
+
# @param run_mode [Symbol, Deeprails::Models::MonitorEventDetailResponse::RunMode] The run mode used to evaluate the monitor event.
|
|
108
|
+
#
|
|
109
|
+
# @param status [Symbol, Deeprails::Models::MonitorEventDetailResponse::Status] Status of the monitor event's evaluation.
|
|
110
|
+
#
|
|
111
|
+
# @param timestamp [Time] The time the monitor event was created in UTC.
|
|
112
|
+
|
|
113
|
+
class Capability < Deeprails::Internal::Type::BaseModel
|
|
114
|
+
# @!attribute capability
|
|
115
|
+
# The type of capability.
|
|
116
|
+
#
|
|
117
|
+
# @return [String, nil]
|
|
118
|
+
optional :capability, String
|
|
119
|
+
|
|
120
|
+
# @!method initialize(capability: nil)
|
|
121
|
+
# @param capability [String] The type of capability.
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
class File < Deeprails::Internal::Type::BaseModel
|
|
125
|
+
# @!attribute file_id
|
|
126
|
+
# The ID of the file.
|
|
127
|
+
#
|
|
128
|
+
# @return [String, nil]
|
|
129
|
+
optional :file_id, String
|
|
130
|
+
|
|
131
|
+
# @!attribute file_name
|
|
132
|
+
# The name of the file.
|
|
133
|
+
#
|
|
134
|
+
# @return [String, nil]
|
|
135
|
+
optional :file_name, String
|
|
136
|
+
|
|
137
|
+
# @!attribute file_size
|
|
138
|
+
# The size of the file in bytes.
|
|
139
|
+
#
|
|
140
|
+
# @return [Integer, nil]
|
|
141
|
+
optional :file_size, Integer
|
|
142
|
+
|
|
143
|
+
# @!method initialize(file_id: nil, file_name: nil, file_size: nil)
|
|
144
|
+
# @param file_id [String] The ID of the file.
|
|
145
|
+
#
|
|
146
|
+
# @param file_name [String] The name of the file.
|
|
147
|
+
#
|
|
148
|
+
# @param file_size [Integer] The size of the file in bytes.
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# The run mode used to evaluate the monitor event.
|
|
152
|
+
#
|
|
153
|
+
# @see Deeprails::Models::MonitorEventDetailResponse#run_mode
|
|
154
|
+
module RunMode
|
|
155
|
+
extend Deeprails::Internal::Type::Enum
|
|
156
|
+
|
|
157
|
+
PRECISION_PLUS = :precision_plus
|
|
158
|
+
PRECISION = :precision
|
|
159
|
+
SMART = :smart
|
|
160
|
+
ECONOMY = :economy
|
|
161
|
+
|
|
162
|
+
# @!method self.values
|
|
163
|
+
# @return [Array<Symbol>]
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Status of the monitor event's evaluation.
|
|
167
|
+
#
|
|
168
|
+
# @see Deeprails::Models::MonitorEventDetailResponse#status
|
|
169
|
+
module Status
|
|
170
|
+
extend Deeprails::Internal::Type::Enum
|
|
171
|
+
|
|
172
|
+
IN_PROGRESS = :in_progress
|
|
173
|
+
COMPLETED = :completed
|
|
174
|
+
CANCELED = :canceled
|
|
175
|
+
QUEUED = :queued
|
|
176
|
+
FAILED = :failed
|
|
177
|
+
|
|
178
|
+
# @!method self.values
|
|
179
|
+
# @return [Array<Symbol>]
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -4,12 +4,6 @@ module Deeprails
|
|
|
4
4
|
module Models
|
|
5
5
|
# @see Deeprails::Resources::Monitor#submit_event
|
|
6
6
|
class MonitorEventResponse < Deeprails::Internal::Type::BaseModel
|
|
7
|
-
# @!attribute evaluation_id
|
|
8
|
-
# A unique evaluation ID associated with this event.
|
|
9
|
-
#
|
|
10
|
-
# @return [String]
|
|
11
|
-
required :evaluation_id, String
|
|
12
|
-
|
|
13
7
|
# @!attribute event_id
|
|
14
8
|
# A unique monitor event ID.
|
|
15
9
|
#
|
|
@@ -28,9 +22,7 @@ module Deeprails
|
|
|
28
22
|
# @return [Time, nil]
|
|
29
23
|
optional :created_at, Time
|
|
30
24
|
|
|
31
|
-
# @!method initialize(
|
|
32
|
-
# @param evaluation_id [String] A unique evaluation ID associated with this event.
|
|
33
|
-
#
|
|
25
|
+
# @!method initialize(event_id:, monitor_id:, created_at: nil)
|
|
34
26
|
# @param event_id [String] A unique monitor event ID.
|
|
35
27
|
#
|
|
36
28
|
# @param monitor_id [String] Monitor ID associated with this event.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Deeprails
|
|
4
|
+
module Models
|
|
5
|
+
# @see Deeprails::Resources::Monitor#retrieve_event
|
|
6
|
+
class MonitorRetrieveEventParams < Deeprails::Internal::Type::BaseModel
|
|
7
|
+
extend Deeprails::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Deeprails::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute monitor_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :monitor_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(monitor_id:, request_options: {})
|
|
16
|
+
# @param monitor_id [String]
|
|
17
|
+
# @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -8,13 +8,17 @@ module Deeprails
|
|
|
8
8
|
include Deeprails::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute limit
|
|
11
|
-
# Limit the returned
|
|
11
|
+
# Limit the number of returned evaluations associated with this monitor. Defaults
|
|
12
|
+
# to 10.
|
|
12
13
|
#
|
|
13
14
|
# @return [Integer, nil]
|
|
14
15
|
optional :limit, Integer
|
|
15
16
|
|
|
16
17
|
# @!method initialize(limit: nil, request_options: {})
|
|
17
|
-
#
|
|
18
|
+
# Some parameter documentations has been truncated, see
|
|
19
|
+
# {Deeprails::Models::MonitorRetrieveParams} for more details.
|
|
20
|
+
#
|
|
21
|
+
# @param limit [Integer] Limit the number of returned evaluations associated with this monitor. Defaults
|
|
18
22
|
#
|
|
19
23
|
# @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
|
|
20
24
|
end
|
|
@@ -13,34 +13,34 @@ module Deeprails
|
|
|
13
13
|
# @return [String, nil]
|
|
14
14
|
optional :description, String
|
|
15
15
|
|
|
16
|
-
# @!attribute monitor_status
|
|
17
|
-
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
18
|
-
# longer record and evaluate events.
|
|
19
|
-
#
|
|
20
|
-
# @return [Symbol, Deeprails::Models::MonitorUpdateParams::MonitorStatus, nil]
|
|
21
|
-
optional :monitor_status, enum: -> { Deeprails::MonitorUpdateParams::MonitorStatus }
|
|
22
|
-
|
|
23
16
|
# @!attribute name
|
|
24
17
|
# Name of the monitor.
|
|
25
18
|
#
|
|
26
19
|
# @return [String, nil]
|
|
27
20
|
optional :name, String
|
|
28
21
|
|
|
29
|
-
# @!
|
|
22
|
+
# @!attribute status
|
|
23
|
+
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
24
|
+
# longer record and evaluate events.
|
|
25
|
+
#
|
|
26
|
+
# @return [Symbol, Deeprails::Models::MonitorUpdateParams::Status, nil]
|
|
27
|
+
optional :status, enum: -> { Deeprails::MonitorUpdateParams::Status }
|
|
28
|
+
|
|
29
|
+
# @!method initialize(description: nil, name: nil, status: nil, request_options: {})
|
|
30
30
|
# Some parameter documentations has been truncated, see
|
|
31
31
|
# {Deeprails::Models::MonitorUpdateParams} for more details.
|
|
32
32
|
#
|
|
33
33
|
# @param description [String] Description of the monitor.
|
|
34
34
|
#
|
|
35
|
-
# @param monitor_status [Symbol, Deeprails::Models::MonitorUpdateParams::MonitorStatus] Status of the monitor. Can be `active` or `inactive`. Inactive monitors no lon
|
|
36
|
-
#
|
|
37
35
|
# @param name [String] Name of the monitor.
|
|
38
36
|
#
|
|
37
|
+
# @param status [Symbol, Deeprails::Models::MonitorUpdateParams::Status] Status of the monitor. Can be `active` or `inactive`. Inactive monitors no lon
|
|
38
|
+
#
|
|
39
39
|
# @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
|
|
40
40
|
|
|
41
41
|
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
42
42
|
# longer record and evaluate events.
|
|
43
|
-
module
|
|
43
|
+
module Status
|
|
44
44
|
extend Deeprails::Internal::Type::Enum
|
|
45
45
|
|
|
46
46
|
ACTIVE = :active
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Deeprails
|
|
4
|
+
module Models
|
|
5
|
+
# @see Deeprails::Resources::Monitor#update
|
|
6
|
+
class MonitorUpdateResponse < Deeprails::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute modified_at
|
|
8
|
+
# The time the monitor was last modified in UTC.
|
|
9
|
+
#
|
|
10
|
+
# @return [Time]
|
|
11
|
+
required :modified_at, Time
|
|
12
|
+
|
|
13
|
+
# @!attribute monitor_id
|
|
14
|
+
# A unique monitor ID.
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :monitor_id, String
|
|
18
|
+
|
|
19
|
+
# @!attribute status
|
|
20
|
+
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
21
|
+
# longer record and evaluate events.
|
|
22
|
+
#
|
|
23
|
+
# @return [Symbol, Deeprails::Models::MonitorUpdateResponse::Status]
|
|
24
|
+
required :status, enum: -> { Deeprails::MonitorUpdateResponse::Status }
|
|
25
|
+
|
|
26
|
+
# @!method initialize(modified_at:, monitor_id:, status:)
|
|
27
|
+
# Some parameter documentations has been truncated, see
|
|
28
|
+
# {Deeprails::Models::MonitorUpdateResponse} for more details.
|
|
29
|
+
#
|
|
30
|
+
# @param modified_at [Time] The time the monitor was last modified in UTC.
|
|
31
|
+
#
|
|
32
|
+
# @param monitor_id [String] A unique monitor ID.
|
|
33
|
+
#
|
|
34
|
+
# @param status [Symbol, Deeprails::Models::MonitorUpdateResponse::Status] Status of the monitor. Can be `active` or `inactive`. Inactive monitors no lon
|
|
35
|
+
|
|
36
|
+
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
37
|
+
# longer record and evaluate events.
|
|
38
|
+
#
|
|
39
|
+
# @see Deeprails::Models::MonitorUpdateResponse#status
|
|
40
|
+
module Status
|
|
41
|
+
extend Deeprails::Internal::Type::Enum
|
|
42
|
+
|
|
43
|
+
ACTIVE = :active
|
|
44
|
+
INACTIVE = :inactive
|
|
45
|
+
|
|
46
|
+
# @!method self.values
|
|
47
|
+
# @return [Array<Symbol>]
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|