deeprails 0.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d0bb2bc489ff93e8154059bdae38683517ce5236f83cef8526137d119d16860
4
- data.tar.gz: 5e50572d0197927215cd8bd5742a19f8bbf1fdc13f4bf02466b5db2024424e5a
3
+ metadata.gz: 54176c43a05bdde5394a3f0f01c37c0f1485e5e29049174c0d480debcd6b5f04
4
+ data.tar.gz: 8bd890ce30a2c75f3abc6e46261f7df60179bc4d2802a44db4eb27e1fb6e4bf7
5
5
  SHA512:
6
- metadata.gz: 7d54b53af12982fa3338176f2344ff4692a6956e46086c4c43aaf030d58a36ed1b573038eaf81fcf8b52bc180bc8a2e54fda1d000120eaf3fea94eaae8124788
7
- data.tar.gz: 2b7636cfdaf35d9efe26cfecb6f8bc3340620c9ef4e35747023bfe79bec11fb732083633865f8d4d68d3fa34f4df8b226841f91f8e9f97e40c06c5d8d059ac11
6
+ metadata.gz: 2ee61755f2763bbdf7b29e5a2c9f2890863c85e16e5a32175251360f21ccb6128c1af96ac04feb026c00ee19ad0a5fc631c382e9a8a91c0af7e1cb485795093e
7
+ data.tar.gz: 1509a75d3b7a7565fe47ab1cb831de2445eaa8c08769b78f3d66d13ab9530752d8b1d41898d495b77aac678e4d7aaac59c58bde46a491bff8ea036bc2cca5826
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
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
+
12
+ ## 0.17.0 (2025-11-19)
13
+
14
+ Full Changelog: [v0.16.0...v0.17.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.16.0...v0.17.0)
15
+
16
+ ### Features
17
+
18
+ * **api:** update package name casing ([94dcce7](https://github.com/deeprails/deeprails-ruby-sdk/commit/94dcce764af00fa51541e4fb2217eb2e743efe61))
19
+
3
20
  ## 0.16.0 (2025-11-18)
4
21
 
5
22
  Full Changelog: [v0.15.0...v0.16.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.15.0...v0.16.0)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Deeprails Ruby API library
1
+ # DeepRails Ruby API library
2
2
 
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.
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.16.0"
18
+ gem "deeprails", "~> 0.18.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -26,11 +26,11 @@ gem "deeprails", "~> 0.16.0"
26
26
  require "bundler/setup"
27
27
  require "deeprails"
28
28
 
29
- deeprails = Deeprails::Client.new(
29
+ deep_rails = Deeprails::Client.new(
30
30
  api_key: ENV["DEEPRAILS_API_KEY"] # This is the default and can be omitted
31
31
  )
32
32
 
33
- defend_create_response = deeprails.defend.create_workflow(
33
+ defend_create_response = deep_rails.defend.create_workflow(
34
34
  improvement_action: "fixit",
35
35
  name: "Push Alert Workflow",
36
36
  threshold_type: "custom",
@@ -47,7 +47,7 @@ When the library is unable to connect to the API, or if the API returns a non-su
47
47
 
48
48
  ```ruby
49
49
  begin
50
- defend = deeprails.defend.create_workflow(
50
+ defend = deep_rails.defend.create_workflow(
51
51
  improvement_action: "fixit",
52
52
  name: "Push Alert Workflow",
53
53
  threshold_type: "custom",
@@ -91,12 +91,12 @@ You can use the `max_retries` option to configure or disable this:
91
91
 
92
92
  ```ruby
93
93
  # Configure the default for all requests:
94
- deeprails = Deeprails::Client.new(
94
+ deep_rails = Deeprails::Client.new(
95
95
  max_retries: 0 # default is 2
96
96
  )
97
97
 
98
98
  # Or, configure per-request:
99
- deeprails.defend.create_workflow(
99
+ deep_rails.defend.create_workflow(
100
100
  improvement_action: "fixit",
101
101
  name: "Push Alert Workflow",
102
102
  threshold_type: "custom",
@@ -112,12 +112,12 @@ By default, requests will time out after 60 seconds. You can use the timeout opt
112
112
 
113
113
  ```ruby
114
114
  # Configure the default for all requests:
115
- deeprails = Deeprails::Client.new(
115
+ deep_rails = Deeprails::Client.new(
116
116
  timeout: nil # default is 60
117
117
  )
118
118
 
119
119
  # Or, configure per-request:
120
- deeprails.defend.create_workflow(
120
+ deep_rails.defend.create_workflow(
121
121
  improvement_action: "fixit",
122
122
  name: "Push Alert Workflow",
123
123
  threshold_type: "custom",
@@ -155,7 +155,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
155
155
 
156
156
  ```ruby
157
157
  defend_create_response =
158
- deeprails.defend.create_workflow(
158
+ deep_rails.defend.create_workflow(
159
159
  improvement_action: "fixit",
160
160
  name: "Push Alert Workflow",
161
161
  threshold_type: "custom",
@@ -206,7 +206,7 @@ This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitio
206
206
  You can provide typesafe request parameters like so:
207
207
 
208
208
  ```ruby
209
- deeprails.defend.create_workflow(
209
+ deep_rails.defend.create_workflow(
210
210
  improvement_action: "fixit",
211
211
  name: "Push Alert Workflow",
212
212
  threshold_type: "custom",
@@ -219,7 +219,7 @@ Or, equivalently:
219
219
 
220
220
  ```ruby
221
221
  # Hashes work, but are not typesafe:
222
- deeprails.defend.create_workflow(
222
+ deep_rails.defend.create_workflow(
223
223
  improvement_action: "fixit",
224
224
  name: "Push Alert Workflow",
225
225
  threshold_type: "custom",
@@ -235,7 +235,7 @@ params = Deeprails::DefendCreateWorkflowParams.new(
235
235
  custom_hallucination_threshold_values: {completeness: 0.7, instruction_adherence: 0.75},
236
236
  web_search: true
237
237
  )
238
- deeprails.defend.create_workflow(**params)
238
+ deep_rails.defend.create_workflow(**params)
239
239
  ```
240
240
 
241
241
  ### Enums
@@ -254,13 +254,13 @@ Enum parameters have a "relaxed" type, so you can either pass in enum constants
254
254
 
255
255
  ```ruby
256
256
  # Using the enum constants preserves the tagged type information:
257
- deeprails.defend.create_workflow(
257
+ deep_rails.defend.create_workflow(
258
258
  improvement_action: Deeprails::DefendCreateWorkflowParams::ImprovementAction::REGEN,
259
259
  # …
260
260
  )
261
261
 
262
262
  # Literal values are also permissible:
263
- deeprails.defend.create_workflow(
263
+ deep_rails.defend.create_workflow(
264
264
  improvement_action: :regen,
265
265
  # …
266
266
  )
data/SECURITY.md CHANGED
@@ -16,9 +16,9 @@ before making any information public.
16
16
  ## Reporting Non-SDK Related Security Issues
17
17
 
18
18
  If you encounter security issues that are not directly related to SDKs but pertain to the services
19
- or products provided by Deeprails, please follow the respective company's security reporting guidelines.
19
+ or products provided by Deep Rails, please follow the respective company's security reporting guidelines.
20
20
 
21
- ### Deeprails Terms and Policies
21
+ ### Deep Rails Terms and Policies
22
22
 
23
23
  Please contact support@deeprails.ai for any questions or concerns regarding the security of our services.
24
24
 
@@ -41,7 +41,7 @@ module Deeprails
41
41
  # @param api_key [String, nil] Defaults to `ENV["DEEPRAILS_API_KEY"]`
42
42
  #
43
43
  # @param base_url [String, nil] Override the default base URL for the API, e.g.,
44
- # `"https://api.example.com/v2/"`. Defaults to `ENV["DEEPRAILS_BASE_URL"]`
44
+ # `"https://api.example.com/v2/"`. Defaults to `ENV["DEEP_RAILS_BASE_URL"]`
45
45
  #
46
46
  # @param max_retries [Integer] Max number of retries to attempt after a failed retryable request.
47
47
  #
@@ -52,7 +52,7 @@ module Deeprails
52
52
  # @param max_retry_delay [Float]
53
53
  def initialize(
54
54
  api_key: ENV["DEEPRAILS_API_KEY"],
55
- base_url: ENV["DEEPRAILS_BASE_URL"],
55
+ base_url: ENV["DEEP_RAILS_BASE_URL"],
56
56
  max_retries: self.class::DEFAULT_MAX_RETRIES,
57
57
  timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS,
58
58
  initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY,
@@ -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 file
11
- # The contents of the file to upload.
10
+ # @!attribute files
11
+ # The contents of the files to upload.
12
12
  #
13
13
  # @return [Array<String>]
14
- required :file, Deeprails::Internal::Type::ArrayOf[String]
14
+ required :files, Deeprails::Internal::Type::ArrayOf[String]
15
15
 
16
- # @!method initialize(file:, request_options: {})
17
- # @param file [Array<String>] The contents of the file to upload.
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 model input and output pair will be
163
- # evaluated on.
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 model input and output pair will be evalu
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:, event_status:, filtered:, improved_model_output:, improvement_action:, improvement_tool_status:, threshold_type:, workflow_id:, automatic_hallucination_tolerance_levels: nil, capabilities: nil, custom_hallucination_threshold_values: nil, files: nil)
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 with optional guardrail
10
- # thresholds and improvement actions
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(file:, request_options: {})
8
+ # @overload upload(files:, request_options: {})
9
9
  #
10
- # @param file [Array<String>] The contents of the file to upload.
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
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deeprails
4
- VERSION = "0.16.0"
4
+ VERSION = "0.18.0"
5
5
  end
@@ -42,8 +42,8 @@ module Deeprails
42
42
  # Defaults to `ENV["DEEPRAILS_API_KEY"]`
43
43
  api_key: ENV["DEEPRAILS_API_KEY"],
44
44
  # Override the default base URL for the API, e.g.,
45
- # `"https://api.example.com/v2/"`. Defaults to `ENV["DEEPRAILS_BASE_URL"]`
46
- base_url: ENV["DEEPRAILS_BASE_URL"],
45
+ # `"https://api.example.com/v2/"`. Defaults to `ENV["DEEP_RAILS_BASE_URL"]`
46
+ base_url: ENV["DEEP_RAILS_BASE_URL"],
47
47
  # Max number of retries to attempt after a failed retryable request.
48
48
  max_retries: Deeprails::Client::DEFAULT_MAX_RETRIES,
49
49
  timeout: Deeprails::Client::DEFAULT_TIMEOUT_IN_SECONDS,
@@ -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 file to upload.
14
+ # The contents of the files to upload.
15
15
  sig { returns(T::Array[String]) }
16
- attr_accessor :file
16
+ attr_accessor :files
17
17
 
18
18
  sig do
19
19
  params(
20
- file: T::Array[String],
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 file to upload.
26
- file:,
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
- { file: T::Array[String], request_options: Deeprails::RequestOptions }
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 model input and output pair will be
231
- # evaluated on.
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 model input and output pair will be
311
- # evaluated on.
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 with optional guardrail
7
- # thresholds and improvement actions
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
- file: T::Array[String],
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 file to upload.
15
- file:,
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
- { file: ::Array[String] } & Deeprails::Internal::Type::request_parameters
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 file: ::Array[String]
10
+ attr_accessor files: ::Array[String]
11
11
 
12
12
  def initialize: (
13
- file: ::Array[String],
13
+ files: ::Array[String],
14
14
  ?request_options: Deeprails::request_opts
15
15
  ) -> void
16
16
 
17
17
  def to_hash: -> {
18
- file: ::Array[String],
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
@@ -2,7 +2,7 @@ module Deeprails
2
2
  module Resources
3
3
  class Files
4
4
  def upload: (
5
- file: ::Array[String],
5
+ files: ::Array[String],
6
6
  ?request_options: Deeprails::request_opts
7
7
  ) -> Deeprails::FileResponse
8
8
 
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.16.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
- - Deeprails
7
+ - Deep Rails
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-18 00:00:00.000000000 Z
11
+ date: 2025-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -199,5 +199,5 @@ requirements: []
199
199
  rubygems_version: 3.4.1
200
200
  signing_key:
201
201
  specification_version: 4
202
- summary: Ruby library to access the Deeprails API
202
+ summary: Ruby library to access the Deep Rails API
203
203
  test_files: []