deeprails 0.11.0 → 0.12.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 +18 -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 +278 -38
- 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 +69 -70
- data/lib/deeprails/models/monitor_event_detail_response.rb +182 -0
- data/lib/deeprails/models/monitor_event_response.rb +1 -9
- 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 +12 -2
- data/lib/deeprails/resources/defend.rb +20 -13
- data/lib/deeprails/resources/files.rb +1 -1
- data/lib/deeprails/resources/monitor.rb +11 -8
- data/lib/deeprails/version.rb +1 -1
- data/lib/deeprails.rb +7 -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 +555 -72
- 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 +144 -104
- data/rbi/deeprails/models/monitor_event_detail_response.rbi +383 -0
- data/rbi/deeprails/models/monitor_event_response.rbi +4 -18
- 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 +685 -0
- data/rbi/deeprails/models/workflow_event_response.rbi +49 -42
- data/rbi/deeprails/models.rbi +12 -2
- data/rbi/deeprails/resources/defend.rbi +17 -12
- data/rbi/deeprails/resources/files.rbi +1 -1
- data/rbi/deeprails/resources/monitor.rbi +8 -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 +297 -28
- 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 +72 -61
- 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_update_params.rbs +13 -13
- data/sig/deeprails/models/monitor_update_response.rbs +41 -0
- data/sig/deeprails/models/workflow_event_detail_response.rbs +315 -0
- data/sig/deeprails/models/workflow_event_response.rbs +24 -24
- data/sig/deeprails/models.rbs +12 -2
- data/sig/deeprails/resources/defend.rbs +5 -4
- data/sig/deeprails/resources/files.rbs +1 -1
- data/sig/deeprails/resources/monitor.rbs +3 -3
- metadata +20 -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
|
@@ -10,19 +10,26 @@ module Deeprails
|
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :monitor_id, String
|
|
12
12
|
|
|
13
|
-
# @!attribute monitor_status
|
|
14
|
-
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
15
|
-
# longer record and evaluate events.
|
|
16
|
-
#
|
|
17
|
-
# @return [Symbol, Deeprails::Models::MonitorDetailResponse::MonitorStatus]
|
|
18
|
-
required :monitor_status, enum: -> { Deeprails::MonitorDetailResponse::MonitorStatus }
|
|
19
|
-
|
|
20
13
|
# @!attribute name
|
|
21
14
|
# Name of this monitor.
|
|
22
15
|
#
|
|
23
16
|
# @return [String]
|
|
24
17
|
required :name, String
|
|
25
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::MonitorDetailResponse::Status]
|
|
24
|
+
required :status, enum: -> { Deeprails::MonitorDetailResponse::Status }
|
|
25
|
+
|
|
26
|
+
# @!attribute capabilities
|
|
27
|
+
# An array of capabilities associated with this monitor.
|
|
28
|
+
#
|
|
29
|
+
# @return [Array<Deeprails::Models::MonitorDetailResponse::Capability>, nil]
|
|
30
|
+
optional :capabilities,
|
|
31
|
+
-> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorDetailResponse::Capability] }
|
|
32
|
+
|
|
26
33
|
# @!attribute created_at
|
|
27
34
|
# The time the monitor was created in UTC.
|
|
28
35
|
#
|
|
@@ -43,6 +50,12 @@ module Deeprails
|
|
|
43
50
|
optional :evaluations,
|
|
44
51
|
-> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorDetailResponse::Evaluation] }
|
|
45
52
|
|
|
53
|
+
# @!attribute files
|
|
54
|
+
# An array of files associated with this monitor.
|
|
55
|
+
#
|
|
56
|
+
# @return [Array<Deeprails::Models::MonitorDetailResponse::File>, nil]
|
|
57
|
+
optional :files, -> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorDetailResponse::File] }
|
|
58
|
+
|
|
46
59
|
# @!attribute stats
|
|
47
60
|
# Contains five fields used for stats of this monitor: total evaluations,
|
|
48
61
|
# completed evaluations, failed evaluations, queued evaluations, and in progress
|
|
@@ -57,39 +70,35 @@ module Deeprails
|
|
|
57
70
|
# @return [Time, nil]
|
|
58
71
|
optional :updated_at, Time
|
|
59
72
|
|
|
60
|
-
# @!
|
|
61
|
-
# User ID of the user who created the monitor.
|
|
62
|
-
#
|
|
63
|
-
# @return [String, nil]
|
|
64
|
-
optional :user_id, String
|
|
65
|
-
|
|
66
|
-
# @!method initialize(monitor_id:, monitor_status:, name:, created_at: nil, description: nil, evaluations: nil, stats: nil, updated_at: nil, user_id: nil)
|
|
73
|
+
# @!method initialize(monitor_id:, name:, status:, capabilities: nil, created_at: nil, description: nil, evaluations: nil, files: nil, stats: nil, updated_at: nil)
|
|
67
74
|
# Some parameter documentations has been truncated, see
|
|
68
75
|
# {Deeprails::Models::MonitorDetailResponse} for more details.
|
|
69
76
|
#
|
|
70
77
|
# @param monitor_id [String] A unique monitor ID.
|
|
71
78
|
#
|
|
72
|
-
# @param monitor_status [Symbol, Deeprails::Models::MonitorDetailResponse::MonitorStatus] Status of the monitor. Can be `active` or `inactive`. Inactive monitors no lon
|
|
73
|
-
#
|
|
74
79
|
# @param name [String] Name of this monitor.
|
|
75
80
|
#
|
|
81
|
+
# @param status [Symbol, Deeprails::Models::MonitorDetailResponse::Status] Status of the monitor. Can be `active` or `inactive`. Inactive monitors no lon
|
|
82
|
+
#
|
|
83
|
+
# @param capabilities [Array<Deeprails::Models::MonitorDetailResponse::Capability>] An array of capabilities associated with this monitor.
|
|
84
|
+
#
|
|
76
85
|
# @param created_at [Time] The time the monitor was created in UTC.
|
|
77
86
|
#
|
|
78
87
|
# @param description [String] Description of this monitor.
|
|
79
88
|
#
|
|
80
89
|
# @param evaluations [Array<Deeprails::Models::MonitorDetailResponse::Evaluation>] An array of all evaluations performed by this monitor. Each one corresponds to
|
|
81
90
|
#
|
|
91
|
+
# @param files [Array<Deeprails::Models::MonitorDetailResponse::File>] An array of files associated with this monitor.
|
|
92
|
+
#
|
|
82
93
|
# @param stats [Deeprails::Models::MonitorDetailResponse::Stats] Contains five fields used for stats of this monitor: total evaluations, complete
|
|
83
94
|
#
|
|
84
95
|
# @param updated_at [Time] The most recent time the monitor was modified in UTC.
|
|
85
|
-
#
|
|
86
|
-
# @param user_id [String] User ID of the user who created the monitor.
|
|
87
96
|
|
|
88
97
|
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
89
98
|
# longer record and evaluate events.
|
|
90
99
|
#
|
|
91
|
-
# @see Deeprails::Models::MonitorDetailResponse#
|
|
92
|
-
module
|
|
100
|
+
# @see Deeprails::Models::MonitorDetailResponse#status
|
|
101
|
+
module Status
|
|
93
102
|
extend Deeprails::Internal::Type::Enum
|
|
94
103
|
|
|
95
104
|
ACTIVE = :active
|
|
@@ -99,13 +108,18 @@ module Deeprails
|
|
|
99
108
|
# @return [Array<Symbol>]
|
|
100
109
|
end
|
|
101
110
|
|
|
102
|
-
class
|
|
103
|
-
# @!attribute
|
|
104
|
-
#
|
|
111
|
+
class Capability < Deeprails::Internal::Type::BaseModel
|
|
112
|
+
# @!attribute capability
|
|
113
|
+
# The type of capability.
|
|
105
114
|
#
|
|
106
|
-
# @return [String]
|
|
107
|
-
|
|
115
|
+
# @return [String, nil]
|
|
116
|
+
optional :capability, String
|
|
108
117
|
|
|
118
|
+
# @!method initialize(capability: nil)
|
|
119
|
+
# @param capability [String] The type of capability.
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
class Evaluation < Deeprails::Internal::Type::BaseModel
|
|
109
123
|
# @!attribute evaluation_status
|
|
110
124
|
# Status of the evaluation.
|
|
111
125
|
#
|
|
@@ -139,24 +153,12 @@ module Deeprails
|
|
|
139
153
|
# @return [Time, nil]
|
|
140
154
|
optional :created_at, Time
|
|
141
155
|
|
|
142
|
-
# @!attribute end_timestamp
|
|
143
|
-
# The time the evaluation completed in UTC.
|
|
144
|
-
#
|
|
145
|
-
# @return [Time, nil]
|
|
146
|
-
optional :end_timestamp, Time
|
|
147
|
-
|
|
148
156
|
# @!attribute error_message
|
|
149
|
-
#
|
|
157
|
+
# Error message if the evaluation failed.
|
|
150
158
|
#
|
|
151
159
|
# @return [String, nil]
|
|
152
160
|
optional :error_message, String
|
|
153
161
|
|
|
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
162
|
# @!attribute evaluation_result
|
|
161
163
|
# Evaluation result consisting of average scores and rationales for each of the
|
|
162
164
|
# evaluated guardrail metrics.
|
|
@@ -178,18 +180,6 @@ module Deeprails
|
|
|
178
180
|
optional :guardrail_metrics,
|
|
179
181
|
-> { Deeprails::Internal::Type::ArrayOf[enum: Deeprails::MonitorDetailResponse::Evaluation::GuardrailMetric] }
|
|
180
182
|
|
|
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
183
|
# @!attribute nametag
|
|
194
184
|
# An optional, user-defined tag for the evaluation.
|
|
195
185
|
#
|
|
@@ -203,18 +193,10 @@ module Deeprails
|
|
|
203
193
|
# @return [Integer, nil]
|
|
204
194
|
optional :progress, Integer
|
|
205
195
|
|
|
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)
|
|
196
|
+
# @!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
197
|
# Some parameter documentations has been truncated, see
|
|
214
198
|
# {Deeprails::Models::MonitorDetailResponse::Evaluation} for more details.
|
|
215
199
|
#
|
|
216
|
-
# @param eval_id [String] A unique evaluation ID.
|
|
217
|
-
#
|
|
218
200
|
# @param evaluation_status [Symbol, Deeprails::Models::MonitorDetailResponse::Evaluation::EvaluationStatus] Status of the evaluation.
|
|
219
201
|
#
|
|
220
202
|
# @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 +207,7 @@ module Deeprails
|
|
|
225
207
|
#
|
|
226
208
|
# @param created_at [Time] The time the evaluation was created in UTC.
|
|
227
209
|
#
|
|
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.
|
|
210
|
+
# @param error_message [String] Error message if the evaluation failed.
|
|
233
211
|
#
|
|
234
212
|
# @param evaluation_result [Hash{Symbol=>Object}] Evaluation result consisting of average scores and rationales for each of the ev
|
|
235
213
|
#
|
|
@@ -237,15 +215,9 @@ module Deeprails
|
|
|
237
215
|
#
|
|
238
216
|
# @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
217
|
#
|
|
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
218
|
# @param nametag [String] An optional, user-defined tag for the evaluation.
|
|
245
219
|
#
|
|
246
220
|
# @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
221
|
|
|
250
222
|
# Status of the evaluation.
|
|
251
223
|
#
|
|
@@ -326,6 +298,33 @@ module Deeprails
|
|
|
326
298
|
end
|
|
327
299
|
end
|
|
328
300
|
|
|
301
|
+
class File < Deeprails::Internal::Type::BaseModel
|
|
302
|
+
# @!attribute file_id
|
|
303
|
+
# The ID of the file.
|
|
304
|
+
#
|
|
305
|
+
# @return [String, nil]
|
|
306
|
+
optional :file_id, String
|
|
307
|
+
|
|
308
|
+
# @!attribute file_name
|
|
309
|
+
# The name of the file.
|
|
310
|
+
#
|
|
311
|
+
# @return [String, nil]
|
|
312
|
+
optional :file_name, String
|
|
313
|
+
|
|
314
|
+
# @!attribute file_size
|
|
315
|
+
# The size of the file in bytes.
|
|
316
|
+
#
|
|
317
|
+
# @return [Integer, nil]
|
|
318
|
+
optional :file_size, Integer
|
|
319
|
+
|
|
320
|
+
# @!method initialize(file_id: nil, file_name: nil, file_size: nil)
|
|
321
|
+
# @param file_id [String] The ID of the file.
|
|
322
|
+
#
|
|
323
|
+
# @param file_name [String] The name of the file.
|
|
324
|
+
#
|
|
325
|
+
# @param file_size [Integer] The size of the file in bytes.
|
|
326
|
+
end
|
|
327
|
+
|
|
329
328
|
# @see Deeprails::Models::MonitorDetailResponse#stats
|
|
330
329
|
class Stats < Deeprails::Internal::Type::BaseModel
|
|
331
330
|
# @!attribute completed_evaluations
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Deeprails
|
|
4
|
+
module Models
|
|
5
|
+
class MonitorEventDetailResponse < Deeprails::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute capabilities
|
|
7
|
+
# The capabilities associated with the monitor event.
|
|
8
|
+
#
|
|
9
|
+
# @return [Array<Deeprails::Models::MonitorEventDetailResponse::Capability>, nil]
|
|
10
|
+
optional :capabilities,
|
|
11
|
+
-> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorEventDetailResponse::Capability] }
|
|
12
|
+
|
|
13
|
+
# @!attribute eval_time
|
|
14
|
+
# The time spent on the evaluation in seconds.
|
|
15
|
+
#
|
|
16
|
+
# @return [String, nil]
|
|
17
|
+
optional :eval_time, String
|
|
18
|
+
|
|
19
|
+
# @!attribute evaluation_result
|
|
20
|
+
# The result of the evaluation of the monitor event.
|
|
21
|
+
#
|
|
22
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
23
|
+
optional :evaluation_result, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]
|
|
24
|
+
|
|
25
|
+
# @!attribute event_id
|
|
26
|
+
# A unique monitor event ID.
|
|
27
|
+
#
|
|
28
|
+
# @return [String, nil]
|
|
29
|
+
optional :event_id, String
|
|
30
|
+
|
|
31
|
+
# @!attribute files
|
|
32
|
+
# The files associated with the monitor event.
|
|
33
|
+
#
|
|
34
|
+
# @return [Array<Deeprails::Models::MonitorEventDetailResponse::File>, nil]
|
|
35
|
+
optional :files, -> { Deeprails::Internal::Type::ArrayOf[Deeprails::MonitorEventDetailResponse::File] }
|
|
36
|
+
|
|
37
|
+
# @!attribute guardrail_metrics
|
|
38
|
+
# The guardrail metrics evaluated by the monitor event.
|
|
39
|
+
#
|
|
40
|
+
# @return [Array<String>, nil]
|
|
41
|
+
optional :guardrail_metrics, Deeprails::Internal::Type::ArrayOf[String]
|
|
42
|
+
|
|
43
|
+
# @!attribute model_input
|
|
44
|
+
# The model input used to create the monitor event.
|
|
45
|
+
#
|
|
46
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
47
|
+
optional :model_input, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]
|
|
48
|
+
|
|
49
|
+
# @!attribute model_output
|
|
50
|
+
# The output evaluated by the monitor event.
|
|
51
|
+
#
|
|
52
|
+
# @return [String, nil]
|
|
53
|
+
optional :model_output, String
|
|
54
|
+
|
|
55
|
+
# @!attribute monitor_id
|
|
56
|
+
# Monitor ID associated with this event.
|
|
57
|
+
#
|
|
58
|
+
# @return [String, nil]
|
|
59
|
+
optional :monitor_id, String
|
|
60
|
+
|
|
61
|
+
# @!attribute nametag
|
|
62
|
+
# A human-readable tag for the monitor event.
|
|
63
|
+
#
|
|
64
|
+
# @return [String, nil]
|
|
65
|
+
optional :nametag, String
|
|
66
|
+
|
|
67
|
+
# @!attribute run_mode
|
|
68
|
+
# The run mode used to evaluate the monitor event.
|
|
69
|
+
#
|
|
70
|
+
# @return [Symbol, Deeprails::Models::MonitorEventDetailResponse::RunMode, nil]
|
|
71
|
+
optional :run_mode, enum: -> { Deeprails::MonitorEventDetailResponse::RunMode }
|
|
72
|
+
|
|
73
|
+
# @!attribute status
|
|
74
|
+
# Status of the monitor event's evaluation.
|
|
75
|
+
#
|
|
76
|
+
# @return [Symbol, Deeprails::Models::MonitorEventDetailResponse::Status, nil]
|
|
77
|
+
optional :status, enum: -> { Deeprails::MonitorEventDetailResponse::Status }
|
|
78
|
+
|
|
79
|
+
# @!attribute timestamp
|
|
80
|
+
# The time the monitor event was created in UTC.
|
|
81
|
+
#
|
|
82
|
+
# @return [Time, nil]
|
|
83
|
+
optional :timestamp, Time
|
|
84
|
+
|
|
85
|
+
# @!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)
|
|
86
|
+
# @param capabilities [Array<Deeprails::Models::MonitorEventDetailResponse::Capability>] The capabilities associated with the monitor event.
|
|
87
|
+
#
|
|
88
|
+
# @param eval_time [String] The time spent on the evaluation in seconds.
|
|
89
|
+
#
|
|
90
|
+
# @param evaluation_result [Hash{Symbol=>Object}] The result of the evaluation of the monitor event.
|
|
91
|
+
#
|
|
92
|
+
# @param event_id [String] A unique monitor event ID.
|
|
93
|
+
#
|
|
94
|
+
# @param files [Array<Deeprails::Models::MonitorEventDetailResponse::File>] The files associated with the monitor event.
|
|
95
|
+
#
|
|
96
|
+
# @param guardrail_metrics [Array<String>] The guardrail metrics evaluated by the monitor event.
|
|
97
|
+
#
|
|
98
|
+
# @param model_input [Hash{Symbol=>Object}] The model input used to create the monitor event.
|
|
99
|
+
#
|
|
100
|
+
# @param model_output [String] The output evaluated by the monitor event.
|
|
101
|
+
#
|
|
102
|
+
# @param monitor_id [String] Monitor ID associated with this event.
|
|
103
|
+
#
|
|
104
|
+
# @param nametag [String] A human-readable tag for the monitor event.
|
|
105
|
+
#
|
|
106
|
+
# @param run_mode [Symbol, Deeprails::Models::MonitorEventDetailResponse::RunMode] The run mode used to evaluate the monitor event.
|
|
107
|
+
#
|
|
108
|
+
# @param status [Symbol, Deeprails::Models::MonitorEventDetailResponse::Status] Status of the monitor event's evaluation.
|
|
109
|
+
#
|
|
110
|
+
# @param timestamp [Time] The time the monitor event was created in UTC.
|
|
111
|
+
|
|
112
|
+
class Capability < Deeprails::Internal::Type::BaseModel
|
|
113
|
+
# @!attribute capability
|
|
114
|
+
# The type of capability.
|
|
115
|
+
#
|
|
116
|
+
# @return [String, nil]
|
|
117
|
+
optional :capability, String
|
|
118
|
+
|
|
119
|
+
# @!method initialize(capability: nil)
|
|
120
|
+
# @param capability [String] The type of capability.
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
class File < Deeprails::Internal::Type::BaseModel
|
|
124
|
+
# @!attribute file_id
|
|
125
|
+
# The ID of the file.
|
|
126
|
+
#
|
|
127
|
+
# @return [String, nil]
|
|
128
|
+
optional :file_id, String
|
|
129
|
+
|
|
130
|
+
# @!attribute file_name
|
|
131
|
+
# The name of the file.
|
|
132
|
+
#
|
|
133
|
+
# @return [String, nil]
|
|
134
|
+
optional :file_name, String
|
|
135
|
+
|
|
136
|
+
# @!attribute file_size
|
|
137
|
+
# The size of the file in bytes.
|
|
138
|
+
#
|
|
139
|
+
# @return [Integer, nil]
|
|
140
|
+
optional :file_size, Integer
|
|
141
|
+
|
|
142
|
+
# @!method initialize(file_id: nil, file_name: nil, file_size: nil)
|
|
143
|
+
# @param file_id [String] The ID of the file.
|
|
144
|
+
#
|
|
145
|
+
# @param file_name [String] The name of the file.
|
|
146
|
+
#
|
|
147
|
+
# @param file_size [Integer] The size of the file in bytes.
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# The run mode used to evaluate the monitor event.
|
|
151
|
+
#
|
|
152
|
+
# @see Deeprails::Models::MonitorEventDetailResponse#run_mode
|
|
153
|
+
module RunMode
|
|
154
|
+
extend Deeprails::Internal::Type::Enum
|
|
155
|
+
|
|
156
|
+
PRECISION_PLUS = :precision_plus
|
|
157
|
+
PRECISION = :precision
|
|
158
|
+
SMART = :smart
|
|
159
|
+
ECONOMY = :economy
|
|
160
|
+
|
|
161
|
+
# @!method self.values
|
|
162
|
+
# @return [Array<Symbol>]
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Status of the monitor event's evaluation.
|
|
166
|
+
#
|
|
167
|
+
# @see Deeprails::Models::MonitorEventDetailResponse#status
|
|
168
|
+
module Status
|
|
169
|
+
extend Deeprails::Internal::Type::Enum
|
|
170
|
+
|
|
171
|
+
IN_PROGRESS = :in_progress
|
|
172
|
+
COMPLETED = :completed
|
|
173
|
+
CANCELED = :canceled
|
|
174
|
+
QUEUED = :queued
|
|
175
|
+
FAILED = :failed
|
|
176
|
+
|
|
177
|
+
# @!method self.values
|
|
178
|
+
# @return [Array<Symbol>]
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
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.
|
|
@@ -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
|