deeprails 0.17.0 → 0.18.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 +9 -0
- data/README.md +3 -3
- data/lib/deeprails/models/defend_response.rb +2 -2
- data/lib/deeprails/models/file_upload_params.rb +5 -5
- data/lib/deeprails/models/monitor_detail_response.rb +3 -3
- data/lib/deeprails/models/workflow_event_detail_response.rb +22 -22
- data/lib/deeprails/resources/defend.rb +3 -3
- data/lib/deeprails/resources/files.rb +2 -2
- data/lib/deeprails/version.rb +1 -1
- data/rbi/deeprails/models/defend_response.rbi +2 -2
- data/rbi/deeprails/models/file_upload_params.rbi +9 -6
- data/rbi/deeprails/models/monitor_detail_response.rbi +4 -4
- data/rbi/deeprails/models/workflow_event_detail_response.rbi +43 -46
- data/rbi/deeprails/resources/defend.rbi +3 -3
- data/rbi/deeprails/resources/files.rbi +3 -3
- data/sig/deeprails/models/file_upload_params.rbs +4 -4
- data/sig/deeprails/models/workflow_event_detail_response.rbs +16 -16
- data/sig/deeprails/resources/files.rbs +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54176c43a05bdde5394a3f0f01c37c0f1485e5e29049174c0d480debcd6b5f04
|
|
4
|
+
data.tar.gz: 8bd890ce30a2c75f3abc6e46261f7df60179bc4d2802a44db4eb27e1fb6e4bf7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ee61755f2763bbdf7b29e5a2c9f2890863c85e16e5a32175251360f21ccb6128c1af96ac04feb026c00ee19ad0a5fc631c382e9a8a91c0af7e1cb485795093e
|
|
7
|
+
data.tar.gz: 1509a75d3b7a7565fe47ab1cb831de2445eaa8c08769b78f3d66d13ab9530752d8b1d41898d495b77aac678e4d7aaac59c58bde46a491bff8ea036bc2cca5826
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.0 (2025-11-20)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.17.0...v0.18.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.17.0...v0.18.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** fix files upload parameter ([65d38fa](https://github.com/deeprails/deeprails-ruby-sdk/commit/65d38fa89d23857fad01820282af44e8f5a63458))
|
|
10
|
+
* **api:** Minor changes and updates to examples ([4b690d4](https://github.com/deeprails/deeprails-ruby-sdk/commit/4b690d41df9fa9ad16c34015fb806a9a7ce83bd7))
|
|
11
|
+
|
|
3
12
|
## 0.17.0 (2025-11-19)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v0.16.0...v0.17.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.16.0...v0.17.0)
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DeepRails Ruby API library
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The DeepRails Ruby library provides convenient access to the DeepRails REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/deeprails/deeprails-ruby-sdk#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
15
15
|
<!-- x-release-please-start-version -->
|
|
16
16
|
|
|
17
17
|
```ruby
|
|
18
|
-
gem "deeprails", "~> 0.
|
|
18
|
+
gem "deeprails", "~> 0.18.0"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- x-release-please-end -->
|
|
@@ -78,7 +78,7 @@ module Deeprails
|
|
|
78
78
|
required :updated_at, Time
|
|
79
79
|
|
|
80
80
|
# @!attribute workflow_id
|
|
81
|
-
# A unique workflow ID.
|
|
81
|
+
# A unique workflow ID used to identify the workflow in other endpoints.
|
|
82
82
|
#
|
|
83
83
|
# @return [String]
|
|
84
84
|
required :workflow_id, String
|
|
@@ -121,7 +121,7 @@ module Deeprails
|
|
|
121
121
|
#
|
|
122
122
|
# @param updated_at [Time] The most recent time the workflow was updated in UTC.
|
|
123
123
|
#
|
|
124
|
-
# @param workflow_id [String] A unique workflow ID.
|
|
124
|
+
# @param workflow_id [String] A unique workflow ID used to identify the workflow in other endpoints.
|
|
125
125
|
#
|
|
126
126
|
# @param improvement_action [Symbol, Deeprails::Models::DefendResponse::ImprovementAction] The action used to improve outputs that fail one or more guardrail metrics for t
|
|
127
127
|
#
|
|
@@ -7,14 +7,14 @@ module Deeprails
|
|
|
7
7
|
extend Deeprails::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Deeprails::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!attribute
|
|
11
|
-
# The contents of the
|
|
10
|
+
# @!attribute files
|
|
11
|
+
# The contents of the files to upload.
|
|
12
12
|
#
|
|
13
13
|
# @return [Array<String>]
|
|
14
|
-
required :
|
|
14
|
+
required :files, Deeprails::Internal::Type::ArrayOf[String]
|
|
15
15
|
|
|
16
|
-
# @!method initialize(
|
|
17
|
-
# @param
|
|
16
|
+
# @!method initialize(files:, request_options: {})
|
|
17
|
+
# @param files [Array<String>] The contents of the files to upload.
|
|
18
18
|
#
|
|
19
19
|
# @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
|
|
20
20
|
end
|
|
@@ -159,8 +159,8 @@ module Deeprails
|
|
|
159
159
|
optional :evaluation_total_cost, Float
|
|
160
160
|
|
|
161
161
|
# @!attribute guardrail_metrics
|
|
162
|
-
# An array of guardrail metrics that the
|
|
163
|
-
#
|
|
162
|
+
# An array of guardrail metrics that the input and output pair will be evaluated
|
|
163
|
+
# on.
|
|
164
164
|
#
|
|
165
165
|
# @return [Array<Symbol, Deeprails::Models::MonitorDetailResponse::Evaluation::GuardrailMetric>, nil]
|
|
166
166
|
optional :guardrail_metrics,
|
|
@@ -199,7 +199,7 @@ module Deeprails
|
|
|
199
199
|
#
|
|
200
200
|
# @param evaluation_total_cost [Float] Total cost of the evaluation.
|
|
201
201
|
#
|
|
202
|
-
# @param guardrail_metrics [Array<Symbol, Deeprails::Models::MonitorDetailResponse::Evaluation::GuardrailMetric>] An array of guardrail metrics that the
|
|
202
|
+
# @param guardrail_metrics [Array<Symbol, Deeprails::Models::MonitorDetailResponse::Evaluation::GuardrailMetric>] An array of guardrail metrics that the input and output pair will be evaluated o
|
|
203
203
|
#
|
|
204
204
|
# @param nametag [String] An optional, user-defined tag for the evaluation.
|
|
205
205
|
#
|
|
@@ -24,12 +24,6 @@ module Deeprails
|
|
|
24
24
|
# @return [String]
|
|
25
25
|
required :event_id, String
|
|
26
26
|
|
|
27
|
-
# @!attribute event_status
|
|
28
|
-
# Status of the event.
|
|
29
|
-
#
|
|
30
|
-
# @return [Symbol, Deeprails::Models::WorkflowEventDetailResponse::EventStatus]
|
|
31
|
-
required :event_status, enum: -> { Deeprails::WorkflowEventDetailResponse::EventStatus }
|
|
32
|
-
|
|
33
27
|
# @!attribute filtered
|
|
34
28
|
# Whether the event was filtered and requires improvement.
|
|
35
29
|
#
|
|
@@ -57,6 +51,12 @@ module Deeprails
|
|
|
57
51
|
enum: -> { Deeprails::WorkflowEventDetailResponse::ImprovementToolStatus },
|
|
58
52
|
nil?: true
|
|
59
53
|
|
|
54
|
+
# @!attribute status
|
|
55
|
+
# Status of the event.
|
|
56
|
+
#
|
|
57
|
+
# @return [Symbol, Deeprails::Models::WorkflowEventDetailResponse::Status]
|
|
58
|
+
required :status, enum: -> { Deeprails::WorkflowEventDetailResponse::Status }
|
|
59
|
+
|
|
60
60
|
# @!attribute threshold_type
|
|
61
61
|
# Type of thresholds used to evaluate the event.
|
|
62
62
|
#
|
|
@@ -99,7 +99,7 @@ module Deeprails
|
|
|
99
99
|
# @return [Array<Deeprails::Models::WorkflowEventDetailResponse::File>, nil]
|
|
100
100
|
optional :files, -> { Deeprails::Internal::Type::ArrayOf[Deeprails::WorkflowEventDetailResponse::File] }
|
|
101
101
|
|
|
102
|
-
# @!method initialize(evaluation_history:, evaluation_result:, event_id:,
|
|
102
|
+
# @!method initialize(evaluation_history:, evaluation_result:, event_id:, filtered:, improved_model_output:, improvement_action:, improvement_tool_status:, status:, threshold_type:, workflow_id:, automatic_hallucination_tolerance_levels: nil, capabilities: nil, custom_hallucination_threshold_values: nil, files: nil)
|
|
103
103
|
# Some parameter documentations has been truncated, see
|
|
104
104
|
# {Deeprails::Models::WorkflowEventDetailResponse} for more details.
|
|
105
105
|
#
|
|
@@ -109,8 +109,6 @@ module Deeprails
|
|
|
109
109
|
#
|
|
110
110
|
# @param event_id [String] A unique workflow event ID.
|
|
111
111
|
#
|
|
112
|
-
# @param event_status [Symbol, Deeprails::Models::WorkflowEventDetailResponse::EventStatus] Status of the event.
|
|
113
|
-
#
|
|
114
112
|
# @param filtered [Boolean] Whether the event was filtered and requires improvement.
|
|
115
113
|
#
|
|
116
114
|
# @param improved_model_output [String] Improved model output after improvement tool was applied and each metric passed
|
|
@@ -119,6 +117,8 @@ module Deeprails
|
|
|
119
117
|
#
|
|
120
118
|
# @param improvement_tool_status [Symbol, Deeprails::Models::WorkflowEventDetailResponse::ImprovementToolStatus, nil] Status of the improvement tool used to improve the event.
|
|
121
119
|
#
|
|
120
|
+
# @param status [Symbol, Deeprails::Models::WorkflowEventDetailResponse::Status] Status of the event.
|
|
121
|
+
#
|
|
122
122
|
# @param threshold_type [Symbol, Deeprails::Models::WorkflowEventDetailResponse::ThresholdType] Type of thresholds used to evaluate the event.
|
|
123
123
|
#
|
|
124
124
|
# @param workflow_id [String] Workflow ID associated with the event.
|
|
@@ -213,19 +213,6 @@ module Deeprails
|
|
|
213
213
|
# @param run_mode [String]
|
|
214
214
|
end
|
|
215
215
|
|
|
216
|
-
# Status of the event.
|
|
217
|
-
#
|
|
218
|
-
# @see Deeprails::Models::WorkflowEventDetailResponse#event_status
|
|
219
|
-
module EventStatus
|
|
220
|
-
extend Deeprails::Internal::Type::Enum
|
|
221
|
-
|
|
222
|
-
IN_PROGRESS = :"In Progress"
|
|
223
|
-
COMPLETED = :Completed
|
|
224
|
-
|
|
225
|
-
# @!method self.values
|
|
226
|
-
# @return [Array<Symbol>]
|
|
227
|
-
end
|
|
228
|
-
|
|
229
216
|
# Type of improvement action used to improve the event.
|
|
230
217
|
#
|
|
231
218
|
# @see Deeprails::Models::WorkflowEventDetailResponse#improvement_action
|
|
@@ -254,6 +241,19 @@ module Deeprails
|
|
|
254
241
|
# @return [Array<Symbol>]
|
|
255
242
|
end
|
|
256
243
|
|
|
244
|
+
# Status of the event.
|
|
245
|
+
#
|
|
246
|
+
# @see Deeprails::Models::WorkflowEventDetailResponse#status
|
|
247
|
+
module Status
|
|
248
|
+
extend Deeprails::Internal::Type::Enum
|
|
249
|
+
|
|
250
|
+
IN_PROGRESS = :"In Progress"
|
|
251
|
+
COMPLETED = :Completed
|
|
252
|
+
|
|
253
|
+
# @!method self.values
|
|
254
|
+
# @return [Array<Symbol>]
|
|
255
|
+
end
|
|
256
|
+
|
|
257
257
|
# Type of thresholds used to evaluate the event.
|
|
258
258
|
#
|
|
259
259
|
# @see Deeprails::Models::WorkflowEventDetailResponse#threshold_type
|
|
@@ -6,8 +6,8 @@ module Deeprails
|
|
|
6
6
|
# Some parameter documentations has been truncated, see
|
|
7
7
|
# {Deeprails::Models::DefendCreateWorkflowParams} for more details.
|
|
8
8
|
#
|
|
9
|
-
# Use this endpoint to create a new guardrail workflow
|
|
10
|
-
# thresholds
|
|
9
|
+
# Use this endpoint to create a new guardrail workflow by specifying guardrail
|
|
10
|
+
# thresholds, an improvement action, and optional extended capabilities.
|
|
11
11
|
#
|
|
12
12
|
# @overload create_workflow(improvement_action:, name:, threshold_type:, automatic_hallucination_tolerance_levels: nil, custom_hallucination_threshold_values: nil, description: nil, file_search: nil, max_improvement_attempts: nil, web_search: nil, request_options: {})
|
|
13
13
|
#
|
|
@@ -135,7 +135,7 @@ module Deeprails
|
|
|
135
135
|
)
|
|
136
136
|
end
|
|
137
137
|
|
|
138
|
-
# Use this endpoint to update an existing defend workflow
|
|
138
|
+
# Use this endpoint to update an existing defend workflow if its details change.
|
|
139
139
|
#
|
|
140
140
|
# @overload update_workflow(workflow_id, description: nil, name: nil, request_options: {})
|
|
141
141
|
#
|
|
@@ -5,9 +5,9 @@ module Deeprails
|
|
|
5
5
|
class Files
|
|
6
6
|
# Use this endpoint to upload a file to the DeepRails API
|
|
7
7
|
#
|
|
8
|
-
# @overload upload(
|
|
8
|
+
# @overload upload(files:, request_options: {})
|
|
9
9
|
#
|
|
10
|
-
# @param
|
|
10
|
+
# @param files [Array<String>] The contents of the files to upload.
|
|
11
11
|
#
|
|
12
12
|
# @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
13
13
|
#
|
data/lib/deeprails/version.rb
CHANGED
|
@@ -65,7 +65,7 @@ module Deeprails
|
|
|
65
65
|
sig { returns(Time) }
|
|
66
66
|
attr_accessor :updated_at
|
|
67
67
|
|
|
68
|
-
# A unique workflow ID.
|
|
68
|
+
# A unique workflow ID used to identify the workflow in other endpoints.
|
|
69
69
|
sig { returns(String) }
|
|
70
70
|
attr_accessor :workflow_id
|
|
71
71
|
|
|
@@ -144,7 +144,7 @@ module Deeprails
|
|
|
144
144
|
threshold_type:,
|
|
145
145
|
# The most recent time the workflow was updated in UTC.
|
|
146
146
|
updated_at:,
|
|
147
|
-
# A unique workflow ID.
|
|
147
|
+
# A unique workflow ID used to identify the workflow in other endpoints.
|
|
148
148
|
workflow_id:,
|
|
149
149
|
# The action used to improve outputs that fail one or more guardrail metrics for
|
|
150
150
|
# the workflow events.
|
|
@@ -11,26 +11,29 @@ module Deeprails
|
|
|
11
11
|
T.any(Deeprails::FileUploadParams, Deeprails::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
# The contents of the
|
|
14
|
+
# The contents of the files to upload.
|
|
15
15
|
sig { returns(T::Array[String]) }
|
|
16
|
-
attr_accessor :
|
|
16
|
+
attr_accessor :files
|
|
17
17
|
|
|
18
18
|
sig do
|
|
19
19
|
params(
|
|
20
|
-
|
|
20
|
+
files: T::Array[String],
|
|
21
21
|
request_options: Deeprails::RequestOptions::OrHash
|
|
22
22
|
).returns(T.attached_class)
|
|
23
23
|
end
|
|
24
24
|
def self.new(
|
|
25
|
-
# The contents of the
|
|
26
|
-
|
|
25
|
+
# The contents of the files to upload.
|
|
26
|
+
files:,
|
|
27
27
|
request_options: {}
|
|
28
28
|
)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
sig do
|
|
32
32
|
override.returns(
|
|
33
|
-
{
|
|
33
|
+
{
|
|
34
|
+
files: T::Array[String],
|
|
35
|
+
request_options: Deeprails::RequestOptions
|
|
36
|
+
}
|
|
34
37
|
)
|
|
35
38
|
end
|
|
36
39
|
def to_hash
|
|
@@ -227,8 +227,8 @@ module Deeprails
|
|
|
227
227
|
sig { params(evaluation_total_cost: Float).void }
|
|
228
228
|
attr_writer :evaluation_total_cost
|
|
229
229
|
|
|
230
|
-
# An array of guardrail metrics that the
|
|
231
|
-
#
|
|
230
|
+
# An array of guardrail metrics that the input and output pair will be evaluated
|
|
231
|
+
# on.
|
|
232
232
|
sig do
|
|
233
233
|
returns(
|
|
234
234
|
T.nilable(
|
|
@@ -307,8 +307,8 @@ module Deeprails
|
|
|
307
307
|
evaluation_result: nil,
|
|
308
308
|
# Total cost of the evaluation.
|
|
309
309
|
evaluation_total_cost: nil,
|
|
310
|
-
# An array of guardrail metrics that the
|
|
311
|
-
#
|
|
310
|
+
# An array of guardrail metrics that the input and output pair will be evaluated
|
|
311
|
+
# on.
|
|
312
312
|
guardrail_metrics: nil,
|
|
313
313
|
# An optional, user-defined tag for the evaluation.
|
|
314
314
|
nametag: nil,
|
|
@@ -28,14 +28,6 @@ module Deeprails
|
|
|
28
28
|
sig { returns(String) }
|
|
29
29
|
attr_accessor :event_id
|
|
30
30
|
|
|
31
|
-
# Status of the event.
|
|
32
|
-
sig do
|
|
33
|
-
returns(
|
|
34
|
-
Deeprails::WorkflowEventDetailResponse::EventStatus::TaggedSymbol
|
|
35
|
-
)
|
|
36
|
-
end
|
|
37
|
-
attr_accessor :event_status
|
|
38
|
-
|
|
39
31
|
# Whether the event was filtered and requires improvement.
|
|
40
32
|
sig { returns(T::Boolean) }
|
|
41
33
|
attr_accessor :filtered
|
|
@@ -63,6 +55,12 @@ module Deeprails
|
|
|
63
55
|
end
|
|
64
56
|
attr_accessor :improvement_tool_status
|
|
65
57
|
|
|
58
|
+
# Status of the event.
|
|
59
|
+
sig do
|
|
60
|
+
returns(Deeprails::WorkflowEventDetailResponse::Status::TaggedSymbol)
|
|
61
|
+
end
|
|
62
|
+
attr_accessor :status
|
|
63
|
+
|
|
66
64
|
# Type of thresholds used to evaluate the event.
|
|
67
65
|
sig do
|
|
68
66
|
returns(
|
|
@@ -155,8 +153,6 @@ module Deeprails
|
|
|
155
153
|
],
|
|
156
154
|
evaluation_result: T::Hash[Symbol, T.anything],
|
|
157
155
|
event_id: String,
|
|
158
|
-
event_status:
|
|
159
|
-
Deeprails::WorkflowEventDetailResponse::EventStatus::OrSymbol,
|
|
160
156
|
filtered: T::Boolean,
|
|
161
157
|
improved_model_output: String,
|
|
162
158
|
improvement_action:
|
|
@@ -165,6 +161,7 @@ module Deeprails
|
|
|
165
161
|
T.nilable(
|
|
166
162
|
Deeprails::WorkflowEventDetailResponse::ImprovementToolStatus::OrSymbol
|
|
167
163
|
),
|
|
164
|
+
status: Deeprails::WorkflowEventDetailResponse::Status::OrSymbol,
|
|
168
165
|
threshold_type:
|
|
169
166
|
Deeprails::WorkflowEventDetailResponse::ThresholdType::OrSymbol,
|
|
170
167
|
workflow_id: String,
|
|
@@ -189,8 +186,6 @@ module Deeprails
|
|
|
189
186
|
evaluation_result:,
|
|
190
187
|
# A unique workflow event ID.
|
|
191
188
|
event_id:,
|
|
192
|
-
# Status of the event.
|
|
193
|
-
event_status:,
|
|
194
189
|
# Whether the event was filtered and requires improvement.
|
|
195
190
|
filtered:,
|
|
196
191
|
# Improved model output after improvement tool was applied and each metric passed
|
|
@@ -200,6 +195,8 @@ module Deeprails
|
|
|
200
195
|
improvement_action:,
|
|
201
196
|
# Status of the improvement tool used to improve the event.
|
|
202
197
|
improvement_tool_status:,
|
|
198
|
+
# Status of the event.
|
|
199
|
+
status:,
|
|
203
200
|
# Type of thresholds used to evaluate the event.
|
|
204
201
|
threshold_type:,
|
|
205
202
|
# Workflow ID associated with the event.
|
|
@@ -228,8 +225,6 @@ module Deeprails
|
|
|
228
225
|
],
|
|
229
226
|
evaluation_result: T::Hash[Symbol, T.anything],
|
|
230
227
|
event_id: String,
|
|
231
|
-
event_status:
|
|
232
|
-
Deeprails::WorkflowEventDetailResponse::EventStatus::TaggedSymbol,
|
|
233
228
|
filtered: T::Boolean,
|
|
234
229
|
improved_model_output: String,
|
|
235
230
|
improvement_action:
|
|
@@ -238,6 +233,8 @@ module Deeprails
|
|
|
238
233
|
T.nilable(
|
|
239
234
|
Deeprails::WorkflowEventDetailResponse::ImprovementToolStatus::TaggedSymbol
|
|
240
235
|
),
|
|
236
|
+
status:
|
|
237
|
+
Deeprails::WorkflowEventDetailResponse::Status::TaggedSymbol,
|
|
241
238
|
threshold_type:
|
|
242
239
|
Deeprails::WorkflowEventDetailResponse::ThresholdType::TaggedSymbol,
|
|
243
240
|
workflow_id: String,
|
|
@@ -400,38 +397,6 @@ module Deeprails
|
|
|
400
397
|
end
|
|
401
398
|
end
|
|
402
399
|
|
|
403
|
-
# Status of the event.
|
|
404
|
-
module EventStatus
|
|
405
|
-
extend Deeprails::Internal::Type::Enum
|
|
406
|
-
|
|
407
|
-
TaggedSymbol =
|
|
408
|
-
T.type_alias do
|
|
409
|
-
T.all(Symbol, Deeprails::WorkflowEventDetailResponse::EventStatus)
|
|
410
|
-
end
|
|
411
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
412
|
-
|
|
413
|
-
IN_PROGRESS =
|
|
414
|
-
T.let(
|
|
415
|
-
:"In Progress",
|
|
416
|
-
Deeprails::WorkflowEventDetailResponse::EventStatus::TaggedSymbol
|
|
417
|
-
)
|
|
418
|
-
COMPLETED =
|
|
419
|
-
T.let(
|
|
420
|
-
:Completed,
|
|
421
|
-
Deeprails::WorkflowEventDetailResponse::EventStatus::TaggedSymbol
|
|
422
|
-
)
|
|
423
|
-
|
|
424
|
-
sig do
|
|
425
|
-
override.returns(
|
|
426
|
-
T::Array[
|
|
427
|
-
Deeprails::WorkflowEventDetailResponse::EventStatus::TaggedSymbol
|
|
428
|
-
]
|
|
429
|
-
)
|
|
430
|
-
end
|
|
431
|
-
def self.values
|
|
432
|
-
end
|
|
433
|
-
end
|
|
434
|
-
|
|
435
400
|
# Type of improvement action used to improve the event.
|
|
436
401
|
module ImprovementAction
|
|
437
402
|
extend Deeprails::Internal::Type::Enum
|
|
@@ -512,6 +477,38 @@ module Deeprails
|
|
|
512
477
|
end
|
|
513
478
|
end
|
|
514
479
|
|
|
480
|
+
# Status of the event.
|
|
481
|
+
module Status
|
|
482
|
+
extend Deeprails::Internal::Type::Enum
|
|
483
|
+
|
|
484
|
+
TaggedSymbol =
|
|
485
|
+
T.type_alias do
|
|
486
|
+
T.all(Symbol, Deeprails::WorkflowEventDetailResponse::Status)
|
|
487
|
+
end
|
|
488
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
489
|
+
|
|
490
|
+
IN_PROGRESS =
|
|
491
|
+
T.let(
|
|
492
|
+
:"In Progress",
|
|
493
|
+
Deeprails::WorkflowEventDetailResponse::Status::TaggedSymbol
|
|
494
|
+
)
|
|
495
|
+
COMPLETED =
|
|
496
|
+
T.let(
|
|
497
|
+
:Completed,
|
|
498
|
+
Deeprails::WorkflowEventDetailResponse::Status::TaggedSymbol
|
|
499
|
+
)
|
|
500
|
+
|
|
501
|
+
sig do
|
|
502
|
+
override.returns(
|
|
503
|
+
T::Array[
|
|
504
|
+
Deeprails::WorkflowEventDetailResponse::Status::TaggedSymbol
|
|
505
|
+
]
|
|
506
|
+
)
|
|
507
|
+
end
|
|
508
|
+
def self.values
|
|
509
|
+
end
|
|
510
|
+
end
|
|
511
|
+
|
|
515
512
|
# Type of thresholds used to evaluate the event.
|
|
516
513
|
module ThresholdType
|
|
517
514
|
extend Deeprails::Internal::Type::Enum
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module Deeprails
|
|
4
4
|
module Resources
|
|
5
5
|
class Defend
|
|
6
|
-
# Use this endpoint to create a new guardrail workflow
|
|
7
|
-
# thresholds
|
|
6
|
+
# Use this endpoint to create a new guardrail workflow by specifying guardrail
|
|
7
|
+
# thresholds, an improvement action, and optional extended capabilities.
|
|
8
8
|
sig do
|
|
9
9
|
params(
|
|
10
10
|
improvement_action:
|
|
@@ -133,7 +133,7 @@ module Deeprails
|
|
|
133
133
|
)
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
-
# Use this endpoint to update an existing defend workflow
|
|
136
|
+
# Use this endpoint to update an existing defend workflow if its details change.
|
|
137
137
|
sig do
|
|
138
138
|
params(
|
|
139
139
|
workflow_id: String,
|
|
@@ -6,13 +6,13 @@ module Deeprails
|
|
|
6
6
|
# Use this endpoint to upload a file to the DeepRails API
|
|
7
7
|
sig do
|
|
8
8
|
params(
|
|
9
|
-
|
|
9
|
+
files: T::Array[String],
|
|
10
10
|
request_options: Deeprails::RequestOptions::OrHash
|
|
11
11
|
).returns(Deeprails::FileResponse)
|
|
12
12
|
end
|
|
13
13
|
def upload(
|
|
14
|
-
# The contents of the
|
|
15
|
-
|
|
14
|
+
# The contents of the files to upload.
|
|
15
|
+
files:,
|
|
16
16
|
request_options: {}
|
|
17
17
|
)
|
|
18
18
|
end
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
module Deeprails
|
|
2
2
|
module Models
|
|
3
3
|
type file_upload_params =
|
|
4
|
-
{
|
|
4
|
+
{ files: ::Array[String] } & Deeprails::Internal::Type::request_parameters
|
|
5
5
|
|
|
6
6
|
class FileUploadParams < Deeprails::Internal::Type::BaseModel
|
|
7
7
|
extend Deeprails::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Deeprails::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
attr_accessor
|
|
10
|
+
attr_accessor files: ::Array[String]
|
|
11
11
|
|
|
12
12
|
def initialize: (
|
|
13
|
-
|
|
13
|
+
files: ::Array[String],
|
|
14
14
|
?request_options: Deeprails::request_opts
|
|
15
15
|
) -> void
|
|
16
16
|
|
|
17
17
|
def to_hash: -> {
|
|
18
|
-
|
|
18
|
+
files: ::Array[String],
|
|
19
19
|
request_options: Deeprails::RequestOptions
|
|
20
20
|
}
|
|
21
21
|
end
|
|
@@ -5,11 +5,11 @@ module Deeprails
|
|
|
5
5
|
evaluation_history: ::Array[Deeprails::WorkflowEventDetailResponse::EvaluationHistory],
|
|
6
6
|
evaluation_result: ::Hash[Symbol, top],
|
|
7
7
|
event_id: String,
|
|
8
|
-
event_status: Deeprails::Models::WorkflowEventDetailResponse::event_status,
|
|
9
8
|
filtered: bool,
|
|
10
9
|
improved_model_output: String,
|
|
11
10
|
improvement_action: Deeprails::Models::WorkflowEventDetailResponse::improvement_action,
|
|
12
11
|
improvement_tool_status: Deeprails::Models::WorkflowEventDetailResponse::improvement_tool_status?,
|
|
12
|
+
status: Deeprails::Models::WorkflowEventDetailResponse::status,
|
|
13
13
|
threshold_type: Deeprails::Models::WorkflowEventDetailResponse::threshold_type,
|
|
14
14
|
workflow_id: String,
|
|
15
15
|
automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::WorkflowEventDetailResponse::automatic_hallucination_tolerance_level],
|
|
@@ -25,8 +25,6 @@ module Deeprails
|
|
|
25
25
|
|
|
26
26
|
attr_accessor event_id: String
|
|
27
27
|
|
|
28
|
-
attr_accessor event_status: Deeprails::Models::WorkflowEventDetailResponse::event_status
|
|
29
|
-
|
|
30
28
|
attr_accessor filtered: bool
|
|
31
29
|
|
|
32
30
|
attr_accessor improved_model_output: String
|
|
@@ -35,6 +33,8 @@ module Deeprails
|
|
|
35
33
|
|
|
36
34
|
attr_accessor improvement_tool_status: Deeprails::Models::WorkflowEventDetailResponse::improvement_tool_status?
|
|
37
35
|
|
|
36
|
+
attr_accessor status: Deeprails::Models::WorkflowEventDetailResponse::status
|
|
37
|
+
|
|
38
38
|
attr_accessor threshold_type: Deeprails::Models::WorkflowEventDetailResponse::threshold_type
|
|
39
39
|
|
|
40
40
|
attr_accessor workflow_id: String
|
|
@@ -67,11 +67,11 @@ module Deeprails
|
|
|
67
67
|
evaluation_history: ::Array[Deeprails::WorkflowEventDetailResponse::EvaluationHistory],
|
|
68
68
|
evaluation_result: ::Hash[Symbol, top],
|
|
69
69
|
event_id: String,
|
|
70
|
-
event_status: Deeprails::Models::WorkflowEventDetailResponse::event_status,
|
|
71
70
|
filtered: bool,
|
|
72
71
|
improved_model_output: String,
|
|
73
72
|
improvement_action: Deeprails::Models::WorkflowEventDetailResponse::improvement_action,
|
|
74
73
|
improvement_tool_status: Deeprails::Models::WorkflowEventDetailResponse::improvement_tool_status?,
|
|
74
|
+
status: Deeprails::Models::WorkflowEventDetailResponse::status,
|
|
75
75
|
threshold_type: Deeprails::Models::WorkflowEventDetailResponse::threshold_type,
|
|
76
76
|
workflow_id: String,
|
|
77
77
|
?automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::WorkflowEventDetailResponse::automatic_hallucination_tolerance_level],
|
|
@@ -84,11 +84,11 @@ module Deeprails
|
|
|
84
84
|
evaluation_history: ::Array[Deeprails::WorkflowEventDetailResponse::EvaluationHistory],
|
|
85
85
|
evaluation_result: ::Hash[Symbol, top],
|
|
86
86
|
event_id: String,
|
|
87
|
-
event_status: Deeprails::Models::WorkflowEventDetailResponse::event_status,
|
|
88
87
|
filtered: bool,
|
|
89
88
|
improved_model_output: String,
|
|
90
89
|
improvement_action: Deeprails::Models::WorkflowEventDetailResponse::improvement_action,
|
|
91
90
|
improvement_tool_status: Deeprails::Models::WorkflowEventDetailResponse::improvement_tool_status?,
|
|
91
|
+
status: Deeprails::Models::WorkflowEventDetailResponse::status,
|
|
92
92
|
threshold_type: Deeprails::Models::WorkflowEventDetailResponse::threshold_type,
|
|
93
93
|
workflow_id: String,
|
|
94
94
|
automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::WorkflowEventDetailResponse::automatic_hallucination_tolerance_level],
|
|
@@ -200,17 +200,6 @@ module Deeprails
|
|
|
200
200
|
}
|
|
201
201
|
end
|
|
202
202
|
|
|
203
|
-
type event_status = :"In Progress" | :Completed
|
|
204
|
-
|
|
205
|
-
module EventStatus
|
|
206
|
-
extend Deeprails::Internal::Type::Enum
|
|
207
|
-
|
|
208
|
-
IN_PROGRESS: :"In Progress"
|
|
209
|
-
COMPLETED: :Completed
|
|
210
|
-
|
|
211
|
-
def self?.values: -> ::Array[Deeprails::Models::WorkflowEventDetailResponse::event_status]
|
|
212
|
-
end
|
|
213
|
-
|
|
214
203
|
type improvement_action = :regen | :fixit | :do_nothing
|
|
215
204
|
|
|
216
205
|
module ImprovementAction
|
|
@@ -236,6 +225,17 @@ module Deeprails
|
|
|
236
225
|
def self?.values: -> ::Array[Deeprails::Models::WorkflowEventDetailResponse::improvement_tool_status]
|
|
237
226
|
end
|
|
238
227
|
|
|
228
|
+
type status = :"In Progress" | :Completed
|
|
229
|
+
|
|
230
|
+
module Status
|
|
231
|
+
extend Deeprails::Internal::Type::Enum
|
|
232
|
+
|
|
233
|
+
IN_PROGRESS: :"In Progress"
|
|
234
|
+
COMPLETED: :Completed
|
|
235
|
+
|
|
236
|
+
def self?.values: -> ::Array[Deeprails::Models::WorkflowEventDetailResponse::status]
|
|
237
|
+
end
|
|
238
|
+
|
|
239
239
|
type threshold_type = :custom | :automatic
|
|
240
240
|
|
|
241
241
|
module ThresholdType
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: deeprails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Deep Rails
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|