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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Deeprails
|
|
4
4
|
module Models
|
|
5
|
-
# @see Deeprails::Resources::Defend#
|
|
5
|
+
# @see Deeprails::Resources::Defend#retrieve_workflow
|
|
6
6
|
class DefendResponse < Deeprails::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute name
|
|
8
8
|
# Name of the workflow.
|
|
@@ -16,40 +16,57 @@ module Deeprails
|
|
|
16
16
|
# @return [String]
|
|
17
17
|
required :workflow_id, String
|
|
18
18
|
|
|
19
|
+
# @!attribute automatic_hallucination_tolerance_levels
|
|
20
|
+
# Mapping of guardrail metric names to tolerance values. Values can be strings
|
|
21
|
+
# (`low`, `medium`, `high`) for automatic tolerance levels.
|
|
22
|
+
#
|
|
23
|
+
# @return [Hash{Symbol=>Symbol, Deeprails::Models::DefendResponse::AutomaticHallucinationToleranceLevel}, nil]
|
|
24
|
+
optional :automatic_hallucination_tolerance_levels,
|
|
25
|
+
-> { Deeprails::Internal::Type::HashOf[enum: Deeprails::DefendResponse::AutomaticHallucinationToleranceLevel] }
|
|
26
|
+
|
|
27
|
+
# @!attribute capabilities
|
|
28
|
+
# Extended AI capabilities available to the event, if any. Can be `web_search`
|
|
29
|
+
# and/or `file_search`.
|
|
30
|
+
#
|
|
31
|
+
# @return [Array<Deeprails::Models::DefendResponse::Capability>, nil]
|
|
32
|
+
optional :capabilities, -> { Deeprails::Internal::Type::ArrayOf[Deeprails::DefendResponse::Capability] }
|
|
33
|
+
|
|
19
34
|
# @!attribute created_at
|
|
20
35
|
# The time the workflow was created in UTC.
|
|
21
36
|
#
|
|
22
37
|
# @return [Time, nil]
|
|
23
38
|
optional :created_at, Time
|
|
24
39
|
|
|
40
|
+
# @!attribute custom_hallucination_threshold_values
|
|
41
|
+
# Mapping of guardrail metric names to threshold values. Values can be floating
|
|
42
|
+
# point numbers (0.0-1.0) for custom thresholds.
|
|
43
|
+
#
|
|
44
|
+
# @return [Hash{Symbol=>Float}, nil]
|
|
45
|
+
optional :custom_hallucination_threshold_values, Deeprails::Internal::Type::HashOf[Float]
|
|
46
|
+
|
|
25
47
|
# @!attribute description
|
|
26
48
|
# Description for the workflow.
|
|
27
49
|
#
|
|
28
50
|
# @return [String, nil]
|
|
29
51
|
optional :description, String
|
|
30
52
|
|
|
31
|
-
# @!attribute
|
|
32
|
-
#
|
|
33
|
-
# the workflow events. May be `regen`, `fixit`, or `do_nothing`. ReGen runs the
|
|
34
|
-
# user's input prompt with minor induced variance. FixIt attempts to directly
|
|
35
|
-
# address the shortcomings of the output using the guardrail failure rationale. Do
|
|
36
|
-
# Nothing does not attempt any improvement.
|
|
53
|
+
# @!attribute events
|
|
54
|
+
# An array of events associated with this workflow.
|
|
37
55
|
#
|
|
38
|
-
# @return [
|
|
39
|
-
optional :
|
|
56
|
+
# @return [Array<Deeprails::Models::DefendResponse::Event>, nil]
|
|
57
|
+
optional :events, -> { Deeprails::Internal::Type::ArrayOf[Deeprails::DefendResponse::Event] }
|
|
40
58
|
|
|
41
|
-
# @!attribute
|
|
42
|
-
#
|
|
43
|
-
#
|
|
59
|
+
# @!attribute files
|
|
60
|
+
# List of files associated with the workflow. If this is not empty, models can
|
|
61
|
+
# search these files when performing evaluations or remediations
|
|
44
62
|
#
|
|
45
|
-
# @return [
|
|
46
|
-
optional :
|
|
63
|
+
# @return [Array<Deeprails::Models::DefendResponse::File>, nil]
|
|
64
|
+
optional :files, -> { Deeprails::Internal::Type::ArrayOf[Deeprails::DefendResponse::File] }
|
|
47
65
|
|
|
48
|
-
# @!attribute
|
|
49
|
-
# The most recent time the workflow was modified in UTC.
|
|
66
|
+
# @!attribute stats
|
|
50
67
|
#
|
|
51
|
-
# @return [
|
|
52
|
-
optional :
|
|
68
|
+
# @return [Deeprails::Models::DefendResponse::Stats, nil]
|
|
69
|
+
optional :stats, -> { Deeprails::DefendResponse::Stats }
|
|
53
70
|
|
|
54
71
|
# @!attribute status
|
|
55
72
|
# Status of the selected workflow. May be `inactive` or `active`. Inactive
|
|
@@ -58,13 +75,19 @@ module Deeprails
|
|
|
58
75
|
# @return [Symbol, Deeprails::Models::DefendResponse::Status, nil]
|
|
59
76
|
optional :status, enum: -> { Deeprails::DefendResponse::Status }
|
|
60
77
|
|
|
61
|
-
# @!attribute
|
|
62
|
-
#
|
|
78
|
+
# @!attribute threshold_type
|
|
79
|
+
# Type of thresholds used to evaluate the event.
|
|
63
80
|
#
|
|
64
|
-
# @return [
|
|
65
|
-
optional :
|
|
81
|
+
# @return [Symbol, Deeprails::Models::DefendResponse::ThresholdType, nil]
|
|
82
|
+
optional :threshold_type, enum: -> { Deeprails::DefendResponse::ThresholdType }
|
|
66
83
|
|
|
67
|
-
# @!
|
|
84
|
+
# @!attribute updated_at
|
|
85
|
+
# The most recent time the workflow was updated in UTC.
|
|
86
|
+
#
|
|
87
|
+
# @return [Time, nil]
|
|
88
|
+
optional :updated_at, Time
|
|
89
|
+
|
|
90
|
+
# @!method initialize(name:, workflow_id:, automatic_hallucination_tolerance_levels: nil, capabilities: nil, created_at: nil, custom_hallucination_threshold_values: nil, description: nil, events: nil, files: nil, stats: nil, status: nil, threshold_type: nil, updated_at: nil)
|
|
68
91
|
# Some parameter documentations has been truncated, see
|
|
69
92
|
# {Deeprails::Models::DefendResponse} for more details.
|
|
70
93
|
#
|
|
@@ -72,38 +95,242 @@ module Deeprails
|
|
|
72
95
|
#
|
|
73
96
|
# @param workflow_id [String] A unique workflow ID.
|
|
74
97
|
#
|
|
98
|
+
# @param automatic_hallucination_tolerance_levels [Hash{Symbol=>Symbol, Deeprails::Models::DefendResponse::AutomaticHallucinationToleranceLevel}] Mapping of guardrail metric names to tolerance values. Values can be strings (`l
|
|
99
|
+
#
|
|
100
|
+
# @param capabilities [Array<Deeprails::Models::DefendResponse::Capability>] Extended AI capabilities available to the event, if any. Can be `web_search` and
|
|
101
|
+
#
|
|
75
102
|
# @param created_at [Time] The time the workflow was created in UTC.
|
|
76
103
|
#
|
|
104
|
+
# @param custom_hallucination_threshold_values [Hash{Symbol=>Float}] Mapping of guardrail metric names to threshold values. Values can be floating po
|
|
105
|
+
#
|
|
77
106
|
# @param description [String] Description for the workflow.
|
|
78
107
|
#
|
|
79
|
-
# @param
|
|
108
|
+
# @param events [Array<Deeprails::Models::DefendResponse::Event>] An array of events associated with this workflow.
|
|
80
109
|
#
|
|
81
|
-
# @param
|
|
110
|
+
# @param files [Array<Deeprails::Models::DefendResponse::File>] List of files associated with the workflow. If this is not empty, models can sea
|
|
82
111
|
#
|
|
83
|
-
# @param
|
|
112
|
+
# @param stats [Deeprails::Models::DefendResponse::Stats]
|
|
84
113
|
#
|
|
85
114
|
# @param status [Symbol, Deeprails::Models::DefendResponse::Status] Status of the selected workflow. May be `inactive` or `active`. Inactive workf
|
|
86
115
|
#
|
|
87
|
-
# @param
|
|
88
|
-
|
|
89
|
-
# The action used to improve outputs that fail one or more guardrail metrics for
|
|
90
|
-
# the workflow events. May be `regen`, `fixit`, or `do_nothing`. ReGen runs the
|
|
91
|
-
# user's input prompt with minor induced variance. FixIt attempts to directly
|
|
92
|
-
# address the shortcomings of the output using the guardrail failure rationale. Do
|
|
93
|
-
# Nothing does not attempt any improvement.
|
|
116
|
+
# @param threshold_type [Symbol, Deeprails::Models::DefendResponse::ThresholdType] Type of thresholds used to evaluate the event.
|
|
94
117
|
#
|
|
95
|
-
#
|
|
96
|
-
|
|
118
|
+
# @param updated_at [Time] The most recent time the workflow was updated in UTC.
|
|
119
|
+
|
|
120
|
+
module AutomaticHallucinationToleranceLevel
|
|
97
121
|
extend Deeprails::Internal::Type::Enum
|
|
98
122
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
123
|
+
LOW = :low
|
|
124
|
+
MEDIUM = :medium
|
|
125
|
+
HIGH = :high
|
|
102
126
|
|
|
103
127
|
# @!method self.values
|
|
104
128
|
# @return [Array<Symbol>]
|
|
105
129
|
end
|
|
106
130
|
|
|
131
|
+
class Capability < Deeprails::Internal::Type::BaseModel
|
|
132
|
+
# @!attribute capability
|
|
133
|
+
#
|
|
134
|
+
# @return [String, nil]
|
|
135
|
+
optional :capability, String
|
|
136
|
+
|
|
137
|
+
# @!method initialize(capability: nil)
|
|
138
|
+
# @param capability [String]
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
class Event < Deeprails::Internal::Type::BaseModel
|
|
142
|
+
# @!attribute evaluations
|
|
143
|
+
# An array of evaluations for this event.
|
|
144
|
+
#
|
|
145
|
+
# @return [Array<Deeprails::Models::DefendResponse::Event::Evaluation>, nil]
|
|
146
|
+
optional :evaluations,
|
|
147
|
+
-> { Deeprails::Internal::Type::ArrayOf[Deeprails::DefendResponse::Event::Evaluation] }
|
|
148
|
+
|
|
149
|
+
# @!attribute event_id
|
|
150
|
+
# A unique workflow event ID.
|
|
151
|
+
#
|
|
152
|
+
# @return [String, nil]
|
|
153
|
+
optional :event_id, String
|
|
154
|
+
|
|
155
|
+
# @!attribute improved_model_output
|
|
156
|
+
# Improved model output after improvement tool was applied.
|
|
157
|
+
#
|
|
158
|
+
# @return [String, nil]
|
|
159
|
+
optional :improved_model_output, String
|
|
160
|
+
|
|
161
|
+
# @!attribute improvement_tool_status
|
|
162
|
+
# Status of the improvement tool used to improve the event.
|
|
163
|
+
#
|
|
164
|
+
# @return [String, nil]
|
|
165
|
+
optional :improvement_tool_status, String
|
|
166
|
+
|
|
167
|
+
# @!method initialize(evaluations: nil, event_id: nil, improved_model_output: nil, improvement_tool_status: nil)
|
|
168
|
+
# @param evaluations [Array<Deeprails::Models::DefendResponse::Event::Evaluation>] An array of evaluations for this event.
|
|
169
|
+
#
|
|
170
|
+
# @param event_id [String] A unique workflow event ID.
|
|
171
|
+
#
|
|
172
|
+
# @param improved_model_output [String] Improved model output after improvement tool was applied.
|
|
173
|
+
#
|
|
174
|
+
# @param improvement_tool_status [String] Status of the improvement tool used to improve the event.
|
|
175
|
+
|
|
176
|
+
class Evaluation < Deeprails::Internal::Type::BaseModel
|
|
177
|
+
# @!attribute attempt
|
|
178
|
+
# The attempt number or identifier for this evaluation.
|
|
179
|
+
#
|
|
180
|
+
# @return [String, nil]
|
|
181
|
+
optional :attempt, String
|
|
182
|
+
|
|
183
|
+
# @!attribute created_at
|
|
184
|
+
# The time the evaluation was created in UTC.
|
|
185
|
+
#
|
|
186
|
+
# @return [Time, nil]
|
|
187
|
+
optional :created_at, Time
|
|
188
|
+
|
|
189
|
+
# @!attribute error_message
|
|
190
|
+
# Error message if the evaluation failed.
|
|
191
|
+
#
|
|
192
|
+
# @return [String, nil]
|
|
193
|
+
optional :error_message, String
|
|
194
|
+
|
|
195
|
+
# @!attribute evaluation_result
|
|
196
|
+
# The result of the evaluation.
|
|
197
|
+
#
|
|
198
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
199
|
+
optional :evaluation_result, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]
|
|
200
|
+
|
|
201
|
+
# @!attribute evaluation_status
|
|
202
|
+
# Status of the evaluation.
|
|
203
|
+
#
|
|
204
|
+
# @return [String, nil]
|
|
205
|
+
optional :evaluation_status, String
|
|
206
|
+
|
|
207
|
+
# @!attribute evaluation_total_cost
|
|
208
|
+
# Total cost of the evaluation.
|
|
209
|
+
#
|
|
210
|
+
# @return [Float, nil]
|
|
211
|
+
optional :evaluation_total_cost, Float
|
|
212
|
+
|
|
213
|
+
# @!attribute guardrail_metrics
|
|
214
|
+
# An array of guardrail metrics evaluated.
|
|
215
|
+
#
|
|
216
|
+
# @return [Array<String>, nil]
|
|
217
|
+
optional :guardrail_metrics, Deeprails::Internal::Type::ArrayOf[String]
|
|
218
|
+
|
|
219
|
+
# @!attribute model_input
|
|
220
|
+
# The model input used for the evaluation.
|
|
221
|
+
#
|
|
222
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
223
|
+
optional :model_input, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]
|
|
224
|
+
|
|
225
|
+
# @!attribute model_output
|
|
226
|
+
# The model output that was evaluated.
|
|
227
|
+
#
|
|
228
|
+
# @return [String, nil]
|
|
229
|
+
optional :model_output, String
|
|
230
|
+
|
|
231
|
+
# @!attribute modified_at
|
|
232
|
+
# The time the evaluation was last modified in UTC.
|
|
233
|
+
#
|
|
234
|
+
# @return [Time, nil]
|
|
235
|
+
optional :modified_at, Time
|
|
236
|
+
|
|
237
|
+
# @!attribute nametag
|
|
238
|
+
# An optional tag for the evaluation.
|
|
239
|
+
#
|
|
240
|
+
# @return [String, nil]
|
|
241
|
+
optional :nametag, String
|
|
242
|
+
|
|
243
|
+
# @!attribute progress
|
|
244
|
+
# Evaluation progress (0-100).
|
|
245
|
+
#
|
|
246
|
+
# @return [Integer, nil]
|
|
247
|
+
optional :progress, Integer
|
|
248
|
+
|
|
249
|
+
# @!attribute run_mode
|
|
250
|
+
# Run mode used for the evaluation.
|
|
251
|
+
#
|
|
252
|
+
# @return [String, nil]
|
|
253
|
+
optional :run_mode, String
|
|
254
|
+
|
|
255
|
+
# @!method initialize(attempt: nil, created_at: nil, error_message: nil, evaluation_result: nil, evaluation_status: nil, evaluation_total_cost: nil, guardrail_metrics: nil, model_input: nil, model_output: nil, modified_at: nil, nametag: nil, progress: nil, run_mode: nil)
|
|
256
|
+
# @param attempt [String] The attempt number or identifier for this evaluation.
|
|
257
|
+
#
|
|
258
|
+
# @param created_at [Time] The time the evaluation was created in UTC.
|
|
259
|
+
#
|
|
260
|
+
# @param error_message [String] Error message if the evaluation failed.
|
|
261
|
+
#
|
|
262
|
+
# @param evaluation_result [Hash{Symbol=>Object}] The result of the evaluation.
|
|
263
|
+
#
|
|
264
|
+
# @param evaluation_status [String] Status of the evaluation.
|
|
265
|
+
#
|
|
266
|
+
# @param evaluation_total_cost [Float] Total cost of the evaluation.
|
|
267
|
+
#
|
|
268
|
+
# @param guardrail_metrics [Array<String>] An array of guardrail metrics evaluated.
|
|
269
|
+
#
|
|
270
|
+
# @param model_input [Hash{Symbol=>Object}] The model input used for the evaluation.
|
|
271
|
+
#
|
|
272
|
+
# @param model_output [String] The model output that was evaluated.
|
|
273
|
+
#
|
|
274
|
+
# @param modified_at [Time] The time the evaluation was last modified in UTC.
|
|
275
|
+
#
|
|
276
|
+
# @param nametag [String] An optional tag for the evaluation.
|
|
277
|
+
#
|
|
278
|
+
# @param progress [Integer] Evaluation progress (0-100).
|
|
279
|
+
#
|
|
280
|
+
# @param run_mode [String] Run mode used for the evaluation.
|
|
281
|
+
end
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
class File < Deeprails::Internal::Type::BaseModel
|
|
285
|
+
# @!attribute file_id
|
|
286
|
+
#
|
|
287
|
+
# @return [String, nil]
|
|
288
|
+
optional :file_id, String
|
|
289
|
+
|
|
290
|
+
# @!attribute file_name
|
|
291
|
+
#
|
|
292
|
+
# @return [String, nil]
|
|
293
|
+
optional :file_name, String
|
|
294
|
+
|
|
295
|
+
# @!attribute file_size
|
|
296
|
+
#
|
|
297
|
+
# @return [Integer, nil]
|
|
298
|
+
optional :file_size, Integer
|
|
299
|
+
|
|
300
|
+
# @!method initialize(file_id: nil, file_name: nil, file_size: nil)
|
|
301
|
+
# @param file_id [String]
|
|
302
|
+
# @param file_name [String]
|
|
303
|
+
# @param file_size [Integer]
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# @see Deeprails::Models::DefendResponse#stats
|
|
307
|
+
class Stats < Deeprails::Internal::Type::BaseModel
|
|
308
|
+
# @!attribute outputs_below_threshold
|
|
309
|
+
# Number of AI outputs that failed the guardrails.
|
|
310
|
+
#
|
|
311
|
+
# @return [Integer, nil]
|
|
312
|
+
optional :outputs_below_threshold, Integer
|
|
313
|
+
|
|
314
|
+
# @!attribute outputs_improved
|
|
315
|
+
# Number of AI outputs that were improved.
|
|
316
|
+
#
|
|
317
|
+
# @return [Integer, nil]
|
|
318
|
+
optional :outputs_improved, Integer
|
|
319
|
+
|
|
320
|
+
# @!attribute outputs_processed
|
|
321
|
+
# Total number of AI outputs processed by the workflow.
|
|
322
|
+
#
|
|
323
|
+
# @return [Integer, nil]
|
|
324
|
+
optional :outputs_processed, Integer
|
|
325
|
+
|
|
326
|
+
# @!method initialize(outputs_below_threshold: nil, outputs_improved: nil, outputs_processed: nil)
|
|
327
|
+
# @param outputs_below_threshold [Integer] Number of AI outputs that failed the guardrails.
|
|
328
|
+
#
|
|
329
|
+
# @param outputs_improved [Integer] Number of AI outputs that were improved.
|
|
330
|
+
#
|
|
331
|
+
# @param outputs_processed [Integer] Total number of AI outputs processed by the workflow.
|
|
332
|
+
end
|
|
333
|
+
|
|
107
334
|
# Status of the selected workflow. May be `inactive` or `active`. Inactive
|
|
108
335
|
# workflows will not accept events.
|
|
109
336
|
#
|
|
@@ -117,6 +344,19 @@ module Deeprails
|
|
|
117
344
|
# @!method self.values
|
|
118
345
|
# @return [Array<Symbol>]
|
|
119
346
|
end
|
|
347
|
+
|
|
348
|
+
# Type of thresholds used to evaluate the event.
|
|
349
|
+
#
|
|
350
|
+
# @see Deeprails::Models::DefendResponse#threshold_type
|
|
351
|
+
module ThresholdType
|
|
352
|
+
extend Deeprails::Internal::Type::Enum
|
|
353
|
+
|
|
354
|
+
CUSTOM = :custom
|
|
355
|
+
AUTOMATIC = :automatic
|
|
356
|
+
|
|
357
|
+
# @!method self.values
|
|
358
|
+
# @return [Array<Symbol>]
|
|
359
|
+
end
|
|
120
360
|
end
|
|
121
361
|
end
|
|
122
362
|
end
|
|
@@ -7,7 +7,19 @@ module Deeprails
|
|
|
7
7
|
extend Deeprails::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Deeprails::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!
|
|
10
|
+
# @!attribute limit
|
|
11
|
+
# Limit the number of returned events associated with this workflow. Defaults
|
|
12
|
+
# to 10.
|
|
13
|
+
#
|
|
14
|
+
# @return [Integer, nil]
|
|
15
|
+
optional :limit, Integer
|
|
16
|
+
|
|
17
|
+
# @!method initialize(limit: nil, request_options: {})
|
|
18
|
+
# Some parameter documentations has been truncated, see
|
|
19
|
+
# {Deeprails::Models::DefendRetrieveWorkflowParams} for more details.
|
|
20
|
+
#
|
|
21
|
+
# @param limit [Integer] Limit the number of returned events associated with this workflow. Defaults to
|
|
22
|
+
#
|
|
11
23
|
# @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
|
|
12
24
|
end
|
|
13
25
|
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Deeprails
|
|
4
|
+
module Models
|
|
5
|
+
# @see Deeprails::Resources::Defend#update_workflow
|
|
6
|
+
class DefendUpdateResponse < Deeprails::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute modified_at
|
|
8
|
+
# The time the workflow was last modified in UTC.
|
|
9
|
+
#
|
|
10
|
+
# @return [Time]
|
|
11
|
+
required :modified_at, Time
|
|
12
|
+
|
|
13
|
+
# @!attribute status
|
|
14
|
+
# Status of the selected workflow. May be `inactive` or `active`. Inactive
|
|
15
|
+
# workflows will not accept events.
|
|
16
|
+
#
|
|
17
|
+
# @return [Symbol, Deeprails::Models::DefendUpdateResponse::Status]
|
|
18
|
+
required :status, enum: -> { Deeprails::DefendUpdateResponse::Status }
|
|
19
|
+
|
|
20
|
+
# @!attribute workflow_id
|
|
21
|
+
# A unique workflow ID.
|
|
22
|
+
#
|
|
23
|
+
# @return [String]
|
|
24
|
+
required :workflow_id, String
|
|
25
|
+
|
|
26
|
+
# @!method initialize(modified_at:, status:, workflow_id:)
|
|
27
|
+
# Some parameter documentations has been truncated, see
|
|
28
|
+
# {Deeprails::Models::DefendUpdateResponse} for more details.
|
|
29
|
+
#
|
|
30
|
+
# @param modified_at [Time] The time the workflow was last modified in UTC.
|
|
31
|
+
#
|
|
32
|
+
# @param status [Symbol, Deeprails::Models::DefendUpdateResponse::Status] Status of the selected workflow. May be `inactive` or `active`. Inactive workf
|
|
33
|
+
#
|
|
34
|
+
# @param workflow_id [String] A unique workflow ID.
|
|
35
|
+
|
|
36
|
+
# Status of the selected workflow. May be `inactive` or `active`. Inactive
|
|
37
|
+
# workflows will not accept events.
|
|
38
|
+
#
|
|
39
|
+
# @see Deeprails::Models::DefendUpdateResponse#status
|
|
40
|
+
module Status
|
|
41
|
+
extend Deeprails::Internal::Type::Enum
|
|
42
|
+
|
|
43
|
+
INACTIVE = :inactive
|
|
44
|
+
ACTIVE = :active
|
|
45
|
+
|
|
46
|
+
# @!method self.values
|
|
47
|
+
# @return [Array<Symbol>]
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -4,12 +4,6 @@ module Deeprails
|
|
|
4
4
|
module Models
|
|
5
5
|
# @see Deeprails::Resources::Files#upload
|
|
6
6
|
class FileResponse < Deeprails::Internal::Type::BaseModel
|
|
7
|
-
# @!attribute created_at
|
|
8
|
-
# The time the file was created in UTC.
|
|
9
|
-
#
|
|
10
|
-
# @return [Time, nil]
|
|
11
|
-
optional :created_at, Time
|
|
12
|
-
|
|
13
7
|
# @!attribute file_id
|
|
14
8
|
# A unique file ID.
|
|
15
9
|
#
|
|
@@ -22,28 +16,18 @@ module Deeprails
|
|
|
22
16
|
# @return [String, nil]
|
|
23
17
|
optional :file_name, String
|
|
24
18
|
|
|
25
|
-
# @!attribute
|
|
26
|
-
#
|
|
19
|
+
# @!attribute file_size
|
|
20
|
+
# The size of the file in bytes.
|
|
27
21
|
#
|
|
28
|
-
# @return [
|
|
29
|
-
optional :
|
|
22
|
+
# @return [Integer, nil]
|
|
23
|
+
optional :file_size, Integer
|
|
30
24
|
|
|
31
|
-
# @!
|
|
32
|
-
# The most recent time the file was modified in UTC.
|
|
33
|
-
#
|
|
34
|
-
# @return [Time, nil]
|
|
35
|
-
optional :updated_at, Time
|
|
36
|
-
|
|
37
|
-
# @!method initialize(created_at: nil, file_id: nil, file_name: nil, file_path: nil, updated_at: nil)
|
|
38
|
-
# @param created_at [Time] The time the file was created in UTC.
|
|
39
|
-
#
|
|
25
|
+
# @!method initialize(file_id: nil, file_name: nil, file_size: nil)
|
|
40
26
|
# @param file_id [String] A unique file ID.
|
|
41
27
|
#
|
|
42
28
|
# @param file_name [String] Name of the file.
|
|
43
29
|
#
|
|
44
|
-
# @param
|
|
45
|
-
#
|
|
46
|
-
# @param updated_at [Time] The most recent time the file was modified in UTC.
|
|
30
|
+
# @param file_size [Integer] The size of the file in bytes.
|
|
47
31
|
end
|
|
48
32
|
end
|
|
49
33
|
end
|
|
@@ -10,11 +10,11 @@ module Deeprails
|
|
|
10
10
|
# @!attribute file
|
|
11
11
|
# The contents of the file to upload.
|
|
12
12
|
#
|
|
13
|
-
# @return [
|
|
14
|
-
required :file, Deeprails::Internal::Type::
|
|
13
|
+
# @return [Array<String>]
|
|
14
|
+
required :file, Deeprails::Internal::Type::ArrayOf[String]
|
|
15
15
|
|
|
16
16
|
# @!method initialize(file:, request_options: {})
|
|
17
|
-
# @param file [
|
|
17
|
+
# @param file [Array<String>] The contents of the file to upload.
|
|
18
18
|
#
|
|
19
19
|
# @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
|
|
20
20
|
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Deeprails
|
|
4
|
+
module Models
|
|
5
|
+
# @see Deeprails::Resources::Monitor#create
|
|
6
|
+
class MonitorCreateResponse < Deeprails::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute created_at
|
|
8
|
+
# The time the monitor was created in UTC.
|
|
9
|
+
#
|
|
10
|
+
# @return [Time]
|
|
11
|
+
required :created_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::MonitorCreateResponse::Status]
|
|
24
|
+
required :status, enum: -> { Deeprails::MonitorCreateResponse::Status }
|
|
25
|
+
|
|
26
|
+
# @!method initialize(created_at:, monitor_id:, status:)
|
|
27
|
+
# Some parameter documentations has been truncated, see
|
|
28
|
+
# {Deeprails::Models::MonitorCreateResponse} for more details.
|
|
29
|
+
#
|
|
30
|
+
# @param created_at [Time] The time the monitor was created in UTC.
|
|
31
|
+
#
|
|
32
|
+
# @param monitor_id [String] A unique monitor ID.
|
|
33
|
+
#
|
|
34
|
+
# @param status [Symbol, Deeprails::Models::MonitorCreateResponse::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::MonitorCreateResponse#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
|