deeprails 0.9.0 → 0.10.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: 0db85ba4c5a974e1efaa1db27b1888cbbf8ae21c5b1d15b4d75733f662c42a8a
4
- data.tar.gz: 1ff3fc484f0032e6dddae533e803d7f591d270527428abba892879e5110105d3
3
+ metadata.gz: e97d49d00ebc0ed03f3be4d2e391e5091fdaf9cbb1fcd743e5800844c8f233c3
4
+ data.tar.gz: 98898cc7823efe565ccd8f7519318d9af31fd9f3197c870e467c53cdc67ceaea
5
5
  SHA512:
6
- metadata.gz: 12ba483e35868225c32653c0f8d3d464944d29e76633f52616e2557a613355222f886caae2aa3c908d535d5e693c92349ec5a8ebe5404c82ecd8d156ade46a96
7
- data.tar.gz: 68678894ea182b88ad6dd35b1cbedf1c2f86c210a7769180f2ac82d71f2687a1c96ecd8ca032e0541acd38bee83e0447cbb4fd5ff09f50d9c6fd8f8ea163ec0b
6
+ metadata.gz: 13b913ddb0433f6de13a5ea8a990b1ef1de1e308012fed87ffde7f42a21596508a280f56401e159a9c8a1a86b9b31d9825a13d35cd4d08486666bb4c57f434a7
7
+ data.tar.gz: 1326ee104ab1202895c1d3eb667be76c933584fad15979b01505ad6bdf06c07a433762d986e5a9a51fc928070d59f196f3c9bb52d36ae34d27c231a20c0a055e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0 (2025-10-30)
4
+
5
+ Full Changelog: [v0.9.0...v0.10.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.9.0...v0.10.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** Add file and web search as extended ai capabilities ([9c3e153](https://github.com/deeprails/deeprails-ruby-sdk/commit/9c3e153565a92a3e4228ffd1193cff119f7acbfe))
10
+ * **api:** manual updates ([7c6bd65](https://github.com/deeprails/deeprails-ruby-sdk/commit/7c6bd65a0fdafc880b467aa2ab5bc587d300bf76))
11
+
3
12
  ## 0.9.0 (2025-10-29)
4
13
 
5
14
  Full Changelog: [v0.8.0...v0.9.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.8.0...v0.9.0)
data/README.md CHANGED
@@ -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.9.0"
18
+ gem "deeprails", "~> 0.10.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -40,6 +40,28 @@ defend_response = deeprails.defend.create_workflow(
40
40
  puts(defend_response.workflow_id)
41
41
  ```
42
42
 
43
+ ### File uploads
44
+
45
+ Request parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance, [`StringIO`](https://rubyapi.org/3.2/o/stringio), or more.
46
+
47
+ ```ruby
48
+ require "pathname"
49
+
50
+ # Use `Pathname` to send the filename and/or avoid paging a large file into memory:
51
+ file_response = deeprails.files.upload(file: Pathname("/path/to/file"))
52
+
53
+ # Alternatively, pass file contents or a `StringIO` directly:
54
+ file_response = deeprails.files.upload(file: File.read("/path/to/file"))
55
+
56
+ # Or, to control the filename and/or content type:
57
+ file = Deeprails::FilePart.new(File.read("/path/to/file"), filename: "/path/to/file", content_type: "…")
58
+ file_response = deeprails.files.upload(file: file)
59
+
60
+ puts(file_response.file_id)
61
+ ```
62
+
63
+ Note that you can also pass a raw `IO` descriptor, but this disables retries, as the library can't be sure if the descriptor is a file or pipe (which cannot be rewound).
64
+
43
65
  ### Handling errors
44
66
 
45
67
  When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Deeprails::Errors::APIError` will be thrown:
@@ -24,6 +24,9 @@ module Deeprails
24
24
  # @return [Deeprails::Resources::Monitor]
25
25
  attr_reader :monitor
26
26
 
27
+ # @return [Deeprails::Resources::Files]
28
+ attr_reader :files
29
+
27
30
  # @api private
28
31
  #
29
32
  # @return [Hash{String=>String}]
@@ -73,6 +76,7 @@ module Deeprails
73
76
 
74
77
  @defend = Deeprails::Resources::Defend.new(client: self)
75
78
  @monitor = Deeprails::Resources::Monitor.new(client: self)
79
+ @files = Deeprails::Resources::Files.new(client: self)
76
80
  end
77
81
  end
78
82
  end
@@ -57,6 +57,13 @@ module Deeprails
57
57
  # @return [String, nil]
58
58
  optional :description, String
59
59
 
60
+ # @!attribute file_search
61
+ # An array of file IDs to search in the workflow's evaluations. Files must be
62
+ # uploaded via the DeepRails API first.
63
+ #
64
+ # @return [Array<String>, nil]
65
+ optional :file_search, Deeprails::Internal::Type::ArrayOf[String]
66
+
60
67
  # @!attribute max_improvement_attempts
61
68
  # Max. number of improvement action retries until a given event passes the
62
69
  # guardrails. Defaults to 10.
@@ -64,7 +71,13 @@ module Deeprails
64
71
  # @return [Integer, nil]
65
72
  optional :max_improvement_attempts, Integer
66
73
 
67
- # @!method initialize(improvement_action:, name:, type:, automatic_hallucination_tolerance_levels: nil, custom_hallucination_threshold_values: nil, description: nil, max_improvement_attempts: nil, request_options: {})
74
+ # @!attribute web_search
75
+ # Whether to enable web search for this workflow's evaluations. Defaults to false.
76
+ #
77
+ # @return [Boolean, nil]
78
+ optional :web_search, Deeprails::Internal::Type::Boolean
79
+
80
+ # @!method initialize(improvement_action:, name:, 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: {})
68
81
  # Some parameter documentations has been truncated, see
69
82
  # {Deeprails::Models::DefendCreateWorkflowParams} for more details.
70
83
  #
@@ -80,8 +93,12 @@ module Deeprails
80
93
  #
81
94
  # @param description [String] Description for the workflow.
82
95
  #
96
+ # @param file_search [Array<String>] An array of file IDs to search in the workflow's evaluations. Files must be uplo
97
+ #
83
98
  # @param max_improvement_attempts [Integer] Max. number of improvement action retries until a given event passes the guardra
84
99
  #
100
+ # @param web_search [Boolean] Whether to enable web search for this workflow's evaluations. Defaults to false.
101
+ #
85
102
  # @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
86
103
 
87
104
  # The action used to improve outputs that fail one or guardrail metrics for the
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Deeprails
4
+ module Models
5
+ # @see Deeprails::Resources::Files#upload
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
+ # @!attribute file_id
14
+ # A unique file ID.
15
+ #
16
+ # @return [String, nil]
17
+ optional :file_id, String
18
+
19
+ # @!attribute file_name
20
+ # Name of the file.
21
+ #
22
+ # @return [String, nil]
23
+ optional :file_name, String
24
+
25
+ # @!attribute file_path
26
+ # Path to the s3 bucket where the file is stored.
27
+ #
28
+ # @return [String, nil]
29
+ optional :file_path, String
30
+
31
+ # @!attribute updated_at
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
+ #
40
+ # @param file_id [String] A unique file ID.
41
+ #
42
+ # @param file_name [String] Name of the file.
43
+ #
44
+ # @param file_path [String] Path to the s3 bucket where the file is stored.
45
+ #
46
+ # @param updated_at [Time] The most recent time the file was modified in UTC.
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Deeprails
4
+ module Models
5
+ # @see Deeprails::Resources::Files#upload
6
+ class FileUploadParams < Deeprails::Internal::Type::BaseModel
7
+ extend Deeprails::Internal::Type::RequestParameters::Converter
8
+ include Deeprails::Internal::Type::RequestParameters
9
+
10
+ # @!attribute file
11
+ # The contents of the file to upload.
12
+ #
13
+ # @return [Pathname, StringIO, IO, String, Deeprails::FilePart]
14
+ required :file, Deeprails::Internal::Type::FileInput
15
+
16
+ # @!method initialize(file:, request_options: {})
17
+ # @param file [Pathname, StringIO, IO, String, Deeprails::FilePart] The contents of the file to upload.
18
+ #
19
+ # @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
20
+ end
21
+ end
22
+ end
@@ -51,6 +51,10 @@ module Deeprails
51
51
 
52
52
  DefendUpdateWorkflowParams = Deeprails::Models::DefendUpdateWorkflowParams
53
53
 
54
+ FileResponse = Deeprails::Models::FileResponse
55
+
56
+ FileUploadParams = Deeprails::Models::FileUploadParams
57
+
54
58
  MonitorCreateParams = Deeprails::Models::MonitorCreateParams
55
59
 
56
60
  MonitorDetailResponse = Deeprails::Models::MonitorDetailResponse
@@ -9,7 +9,7 @@ module Deeprails
9
9
  # Use this endpoint to create a new guardrail workflow with optional guardrail
10
10
  # thresholds and improvement actions
11
11
  #
12
- # @overload create_workflow(improvement_action:, name:, type:, automatic_hallucination_tolerance_levels: nil, custom_hallucination_threshold_values: nil, description: nil, max_improvement_attempts: nil, request_options: {})
12
+ # @overload create_workflow(improvement_action:, name:, 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
  #
14
14
  # @param improvement_action [Symbol, Deeprails::Models::DefendCreateWorkflowParams::ImprovementAction] The action used to improve outputs that fail one or guardrail metrics for the wo
15
15
  #
@@ -23,8 +23,12 @@ module Deeprails
23
23
  #
24
24
  # @param description [String] Description for the workflow.
25
25
  #
26
+ # @param file_search [Array<String>] An array of file IDs to search in the workflow's evaluations. Files must be uplo
27
+ #
26
28
  # @param max_improvement_attempts [Integer] Max. number of improvement action retries until a given event passes the guardra
27
29
  #
30
+ # @param web_search [Boolean] Whether to enable web search for this workflow's evaluations. Defaults to false.
31
+ #
28
32
  # @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}, nil]
29
33
  #
30
34
  # @return [Deeprails::Models::DefendResponse]
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Deeprails
4
+ module Resources
5
+ class Files
6
+ # Use this endpoint to upload a file to the DeepRails API
7
+ #
8
+ # @overload upload(file:, request_options: {})
9
+ #
10
+ # @param file [Pathname, StringIO, IO, String, Deeprails::FilePart] The contents of the file to upload.
11
+ #
12
+ # @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}, nil]
13
+ #
14
+ # @return [Deeprails::Models::FileResponse]
15
+ #
16
+ # @see Deeprails::Models::FileUploadParams
17
+ def upload(params)
18
+ parsed, options = Deeprails::FileUploadParams.dump_request(params)
19
+ @client.request(
20
+ method: :post,
21
+ path: "files/upload",
22
+ headers: {"content-type" => "multipart/form-data"},
23
+ body: parsed,
24
+ model: Deeprails::FileResponse,
25
+ options: options
26
+ )
27
+ end
28
+
29
+ # @api private
30
+ #
31
+ # @param client [Deeprails::Client]
32
+ def initialize(client:)
33
+ @client = client
34
+ end
35
+ end
36
+ end
37
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deeprails
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
data/lib/deeprails.rb CHANGED
@@ -56,6 +56,8 @@ require_relative "deeprails/models/defend_retrieve_event_params"
56
56
  require_relative "deeprails/models/defend_retrieve_workflow_params"
57
57
  require_relative "deeprails/models/defend_submit_event_params"
58
58
  require_relative "deeprails/models/defend_update_workflow_params"
59
+ require_relative "deeprails/models/file_response"
60
+ require_relative "deeprails/models/file_upload_params"
59
61
  require_relative "deeprails/models/monitor_create_params"
60
62
  require_relative "deeprails/models/monitor_detail_response"
61
63
  require_relative "deeprails/models/monitor_event_response"
@@ -66,4 +68,5 @@ require_relative "deeprails/models/monitor_update_params"
66
68
  require_relative "deeprails/models/workflow_event_response"
67
69
  require_relative "deeprails/models"
68
70
  require_relative "deeprails/resources/defend"
71
+ require_relative "deeprails/resources/files"
69
72
  require_relative "deeprails/resources/monitor"
@@ -19,6 +19,9 @@ module Deeprails
19
19
  sig { returns(Deeprails::Resources::Monitor) }
20
20
  attr_reader :monitor
21
21
 
22
+ sig { returns(Deeprails::Resources::Files) }
23
+ attr_reader :files
24
+
22
25
  # @api private
23
26
  sig { override.returns(T::Hash[String, String]) }
24
27
  private def auth_headers
@@ -85,6 +85,14 @@ module Deeprails
85
85
  sig { params(description: String).void }
86
86
  attr_writer :description
87
87
 
88
+ # An array of file IDs to search in the workflow's evaluations. Files must be
89
+ # uploaded via the DeepRails API first.
90
+ sig { returns(T.nilable(T::Array[String])) }
91
+ attr_reader :file_search
92
+
93
+ sig { params(file_search: T::Array[String]).void }
94
+ attr_writer :file_search
95
+
88
96
  # Max. number of improvement action retries until a given event passes the
89
97
  # guardrails. Defaults to 10.
90
98
  sig { returns(T.nilable(Integer)) }
@@ -93,6 +101,13 @@ module Deeprails
93
101
  sig { params(max_improvement_attempts: Integer).void }
94
102
  attr_writer :max_improvement_attempts
95
103
 
104
+ # Whether to enable web search for this workflow's evaluations. Defaults to false.
105
+ sig { returns(T.nilable(T::Boolean)) }
106
+ attr_reader :web_search
107
+
108
+ sig { params(web_search: T::Boolean).void }
109
+ attr_writer :web_search
110
+
96
111
  sig do
97
112
  params(
98
113
  improvement_action:
@@ -106,7 +121,9 @@ module Deeprails
106
121
  ],
107
122
  custom_hallucination_threshold_values: T::Hash[Symbol, Float],
108
123
  description: String,
124
+ file_search: T::Array[String],
109
125
  max_improvement_attempts: Integer,
126
+ web_search: T::Boolean,
110
127
  request_options: Deeprails::RequestOptions::OrHash
111
128
  ).returns(T.attached_class)
112
129
  end
@@ -136,9 +153,14 @@ module Deeprails
136
153
  custom_hallucination_threshold_values: nil,
137
154
  # Description for the workflow.
138
155
  description: nil,
156
+ # An array of file IDs to search in the workflow's evaluations. Files must be
157
+ # uploaded via the DeepRails API first.
158
+ file_search: nil,
139
159
  # Max. number of improvement action retries until a given event passes the
140
160
  # guardrails. Defaults to 10.
141
161
  max_improvement_attempts: nil,
162
+ # Whether to enable web search for this workflow's evaluations. Defaults to false.
163
+ web_search: nil,
142
164
  request_options: {}
143
165
  )
144
166
  end
@@ -157,7 +179,9 @@ module Deeprails
157
179
  ],
158
180
  custom_hallucination_threshold_values: T::Hash[Symbol, Float],
159
181
  description: String,
182
+ file_search: T::Array[String],
160
183
  max_improvement_attempts: Integer,
184
+ web_search: T::Boolean,
161
185
  request_options: Deeprails::RequestOptions
162
186
  }
163
187
  )
@@ -0,0 +1,84 @@
1
+ # typed: strong
2
+
3
+ module Deeprails
4
+ module Models
5
+ class FileResponse < Deeprails::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Deeprails::FileResponse, Deeprails::Internal::AnyHash)
9
+ end
10
+
11
+ # The time the file was created in UTC.
12
+ sig { returns(T.nilable(Time)) }
13
+ attr_reader :created_at
14
+
15
+ sig { params(created_at: Time).void }
16
+ attr_writer :created_at
17
+
18
+ # A unique file ID.
19
+ sig { returns(T.nilable(String)) }
20
+ attr_reader :file_id
21
+
22
+ sig { params(file_id: String).void }
23
+ attr_writer :file_id
24
+
25
+ # Name of the file.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :file_name
28
+
29
+ sig { params(file_name: String).void }
30
+ attr_writer :file_name
31
+
32
+ # Path to the s3 bucket where the file is stored.
33
+ sig { returns(T.nilable(String)) }
34
+ attr_reader :file_path
35
+
36
+ sig { params(file_path: String).void }
37
+ attr_writer :file_path
38
+
39
+ # The most recent time the file was modified in UTC.
40
+ sig { returns(T.nilable(Time)) }
41
+ attr_reader :updated_at
42
+
43
+ sig { params(updated_at: Time).void }
44
+ attr_writer :updated_at
45
+
46
+ sig do
47
+ params(
48
+ created_at: Time,
49
+ file_id: String,
50
+ file_name: String,
51
+ file_path: String,
52
+ updated_at: Time
53
+ ).returns(T.attached_class)
54
+ end
55
+ def self.new(
56
+ # The time the file was created in UTC.
57
+ created_at: nil,
58
+ # A unique file ID.
59
+ file_id: nil,
60
+ # Name of the file.
61
+ file_name: nil,
62
+ # Path to the s3 bucket where the file is stored.
63
+ file_path: nil,
64
+ # The most recent time the file was modified in UTC.
65
+ updated_at: nil
66
+ )
67
+ end
68
+
69
+ sig do
70
+ override.returns(
71
+ {
72
+ created_at: Time,
73
+ file_id: String,
74
+ file_name: String,
75
+ file_path: String,
76
+ updated_at: Time
77
+ }
78
+ )
79
+ end
80
+ def to_hash
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,43 @@
1
+ # typed: strong
2
+
3
+ module Deeprails
4
+ module Models
5
+ class FileUploadParams < Deeprails::Internal::Type::BaseModel
6
+ extend Deeprails::Internal::Type::RequestParameters::Converter
7
+ include Deeprails::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Deeprails::FileUploadParams, Deeprails::Internal::AnyHash)
12
+ end
13
+
14
+ # The contents of the file to upload.
15
+ sig { returns(Deeprails::Internal::FileInput) }
16
+ attr_accessor :file
17
+
18
+ sig do
19
+ params(
20
+ file: Deeprails::Internal::FileInput,
21
+ request_options: Deeprails::RequestOptions::OrHash
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(
25
+ # The contents of the file to upload.
26
+ file:,
27
+ request_options: {}
28
+ )
29
+ end
30
+
31
+ sig do
32
+ override.returns(
33
+ {
34
+ file: Deeprails::Internal::FileInput,
35
+ request_options: Deeprails::RequestOptions
36
+ }
37
+ )
38
+ end
39
+ def to_hash
40
+ end
41
+ end
42
+ end
43
+ end
@@ -13,6 +13,10 @@ module Deeprails
13
13
 
14
14
  DefendUpdateWorkflowParams = Deeprails::Models::DefendUpdateWorkflowParams
15
15
 
16
+ FileResponse = Deeprails::Models::FileResponse
17
+
18
+ FileUploadParams = Deeprails::Models::FileUploadParams
19
+
16
20
  MonitorCreateParams = Deeprails::Models::MonitorCreateParams
17
21
 
18
22
  MonitorDetailResponse = Deeprails::Models::MonitorDetailResponse
@@ -18,7 +18,9 @@ module Deeprails
18
18
  ],
19
19
  custom_hallucination_threshold_values: T::Hash[Symbol, Float],
20
20
  description: String,
21
+ file_search: T::Array[String],
21
22
  max_improvement_attempts: Integer,
23
+ web_search: T::Boolean,
22
24
  request_options: Deeprails::RequestOptions::OrHash
23
25
  ).returns(Deeprails::DefendResponse)
24
26
  end
@@ -48,9 +50,14 @@ module Deeprails
48
50
  custom_hallucination_threshold_values: nil,
49
51
  # Description for the workflow.
50
52
  description: nil,
53
+ # An array of file IDs to search in the workflow's evaluations. Files must be
54
+ # uploaded via the DeepRails API first.
55
+ file_search: nil,
51
56
  # Max. number of improvement action retries until a given event passes the
52
57
  # guardrails. Defaults to 10.
53
58
  max_improvement_attempts: nil,
59
+ # Whether to enable web search for this workflow's evaluations. Defaults to false.
60
+ web_search: nil,
54
61
  request_options: {}
55
62
  )
56
63
  end
@@ -0,0 +1,26 @@
1
+ # typed: strong
2
+
3
+ module Deeprails
4
+ module Resources
5
+ class Files
6
+ # Use this endpoint to upload a file to the DeepRails API
7
+ sig do
8
+ params(
9
+ file: Deeprails::Internal::FileInput,
10
+ request_options: Deeprails::RequestOptions::OrHash
11
+ ).returns(Deeprails::FileResponse)
12
+ end
13
+ def upload(
14
+ # The contents of the file to upload.
15
+ file:,
16
+ request_options: {}
17
+ )
18
+ end
19
+
20
+ # @api private
21
+ sig { params(client: Deeprails::Client).returns(T.attached_class) }
22
+ def self.new(client:)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -14,6 +14,8 @@ module Deeprails
14
14
 
15
15
  attr_reader monitor: Deeprails::Resources::Monitor
16
16
 
17
+ attr_reader files: Deeprails::Resources::Files
18
+
17
19
  private def auth_headers: -> ::Hash[String, String]
18
20
 
19
21
  def initialize: (
@@ -8,7 +8,9 @@ module Deeprails
8
8
  automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
9
9
  custom_hallucination_threshold_values: ::Hash[Symbol, Float],
10
10
  description: String,
11
- max_improvement_attempts: Integer
11
+ file_search: ::Array[String],
12
+ max_improvement_attempts: Integer,
13
+ web_search: bool
12
14
  }
13
15
  & Deeprails::Internal::Type::request_parameters
14
16
 
@@ -38,10 +40,18 @@ module Deeprails
38
40
 
39
41
  def description=: (String) -> String
40
42
 
43
+ attr_reader file_search: ::Array[String]?
44
+
45
+ def file_search=: (::Array[String]) -> ::Array[String]
46
+
41
47
  attr_reader max_improvement_attempts: Integer?
42
48
 
43
49
  def max_improvement_attempts=: (Integer) -> Integer
44
50
 
51
+ attr_reader web_search: bool?
52
+
53
+ def web_search=: (bool) -> bool
54
+
45
55
  def initialize: (
46
56
  improvement_action: Deeprails::Models::DefendCreateWorkflowParams::improvement_action,
47
57
  name: String,
@@ -49,7 +59,9 @@ module Deeprails
49
59
  ?automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
50
60
  ?custom_hallucination_threshold_values: ::Hash[Symbol, Float],
51
61
  ?description: String,
62
+ ?file_search: ::Array[String],
52
63
  ?max_improvement_attempts: Integer,
64
+ ?web_search: bool,
53
65
  ?request_options: Deeprails::request_opts
54
66
  ) -> void
55
67
 
@@ -60,7 +72,9 @@ module Deeprails
60
72
  automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
61
73
  custom_hallucination_threshold_values: ::Hash[Symbol, Float],
62
74
  description: String,
75
+ file_search: ::Array[String],
63
76
  max_improvement_attempts: Integer,
77
+ web_search: bool,
64
78
  request_options: Deeprails::RequestOptions
65
79
  }
66
80
 
@@ -0,0 +1,50 @@
1
+ module Deeprails
2
+ module Models
3
+ type file_response =
4
+ {
5
+ created_at: Time,
6
+ file_id: String,
7
+ file_name: String,
8
+ file_path: String,
9
+ updated_at: Time
10
+ }
11
+
12
+ class FileResponse < Deeprails::Internal::Type::BaseModel
13
+ attr_reader created_at: Time?
14
+
15
+ def created_at=: (Time) -> Time
16
+
17
+ attr_reader file_id: String?
18
+
19
+ def file_id=: (String) -> String
20
+
21
+ attr_reader file_name: String?
22
+
23
+ def file_name=: (String) -> String
24
+
25
+ attr_reader file_path: String?
26
+
27
+ def file_path=: (String) -> String
28
+
29
+ attr_reader updated_at: Time?
30
+
31
+ def updated_at=: (Time) -> Time
32
+
33
+ def initialize: (
34
+ ?created_at: Time,
35
+ ?file_id: String,
36
+ ?file_name: String,
37
+ ?file_path: String,
38
+ ?updated_at: Time
39
+ ) -> void
40
+
41
+ def to_hash: -> {
42
+ created_at: Time,
43
+ file_id: String,
44
+ file_name: String,
45
+ file_path: String,
46
+ updated_at: Time
47
+ }
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,24 @@
1
+ module Deeprails
2
+ module Models
3
+ type file_upload_params =
4
+ { file: Deeprails::Internal::file_input }
5
+ & Deeprails::Internal::Type::request_parameters
6
+
7
+ class FileUploadParams < Deeprails::Internal::Type::BaseModel
8
+ extend Deeprails::Internal::Type::RequestParameters::Converter
9
+ include Deeprails::Internal::Type::RequestParameters
10
+
11
+ attr_accessor file: Deeprails::Internal::file_input
12
+
13
+ def initialize: (
14
+ file: Deeprails::Internal::file_input,
15
+ ?request_options: Deeprails::request_opts
16
+ ) -> void
17
+
18
+ def to_hash: -> {
19
+ file: Deeprails::Internal::file_input,
20
+ request_options: Deeprails::RequestOptions
21
+ }
22
+ end
23
+ end
24
+ end
@@ -11,6 +11,10 @@ module Deeprails
11
11
 
12
12
  class DefendUpdateWorkflowParams = Deeprails::Models::DefendUpdateWorkflowParams
13
13
 
14
+ class FileResponse = Deeprails::Models::FileResponse
15
+
16
+ class FileUploadParams = Deeprails::Models::FileUploadParams
17
+
14
18
  class MonitorCreateParams = Deeprails::Models::MonitorCreateParams
15
19
 
16
20
  class MonitorDetailResponse = Deeprails::Models::MonitorDetailResponse
@@ -8,7 +8,9 @@ module Deeprails
8
8
  ?automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
9
9
  ?custom_hallucination_threshold_values: ::Hash[Symbol, Float],
10
10
  ?description: String,
11
+ ?file_search: ::Array[String],
11
12
  ?max_improvement_attempts: Integer,
13
+ ?web_search: bool,
12
14
  ?request_options: Deeprails::request_opts
13
15
  ) -> Deeprails::DefendResponse
14
16
 
@@ -0,0 +1,12 @@
1
+ module Deeprails
2
+ module Resources
3
+ class Files
4
+ def upload: (
5
+ file: Deeprails::Internal::file_input,
6
+ ?request_options: Deeprails::request_opts
7
+ ) -> Deeprails::FileResponse
8
+
9
+ def initialize: (client: Deeprails::Client) -> void
10
+ end
11
+ end
12
+ end
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.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deeprails
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-29 00:00:00.000000000 Z
11
+ date: 2025-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -61,6 +61,8 @@ files:
61
61
  - lib/deeprails/models/defend_retrieve_workflow_params.rb
62
62
  - lib/deeprails/models/defend_submit_event_params.rb
63
63
  - lib/deeprails/models/defend_update_workflow_params.rb
64
+ - lib/deeprails/models/file_response.rb
65
+ - lib/deeprails/models/file_upload_params.rb
64
66
  - lib/deeprails/models/monitor_create_params.rb
65
67
  - lib/deeprails/models/monitor_detail_response.rb
66
68
  - lib/deeprails/models/monitor_event_response.rb
@@ -71,6 +73,7 @@ files:
71
73
  - lib/deeprails/models/workflow_event_response.rb
72
74
  - lib/deeprails/request_options.rb
73
75
  - lib/deeprails/resources/defend.rb
76
+ - lib/deeprails/resources/files.rb
74
77
  - lib/deeprails/resources/monitor.rb
75
78
  - lib/deeprails/version.rb
76
79
  - manifest.yaml
@@ -99,6 +102,8 @@ files:
99
102
  - rbi/deeprails/models/defend_retrieve_workflow_params.rbi
100
103
  - rbi/deeprails/models/defend_submit_event_params.rbi
101
104
  - rbi/deeprails/models/defend_update_workflow_params.rbi
105
+ - rbi/deeprails/models/file_response.rbi
106
+ - rbi/deeprails/models/file_upload_params.rbi
102
107
  - rbi/deeprails/models/monitor_create_params.rbi
103
108
  - rbi/deeprails/models/monitor_detail_response.rbi
104
109
  - rbi/deeprails/models/monitor_event_response.rbi
@@ -109,6 +114,7 @@ files:
109
114
  - rbi/deeprails/models/workflow_event_response.rbi
110
115
  - rbi/deeprails/request_options.rbi
111
116
  - rbi/deeprails/resources/defend.rbi
117
+ - rbi/deeprails/resources/files.rbi
112
118
  - rbi/deeprails/resources/monitor.rbi
113
119
  - rbi/deeprails/version.rbi
114
120
  - sig/deeprails/client.rbs
@@ -136,6 +142,8 @@ files:
136
142
  - sig/deeprails/models/defend_retrieve_workflow_params.rbs
137
143
  - sig/deeprails/models/defend_submit_event_params.rbs
138
144
  - sig/deeprails/models/defend_update_workflow_params.rbs
145
+ - sig/deeprails/models/file_response.rbs
146
+ - sig/deeprails/models/file_upload_params.rbs
139
147
  - sig/deeprails/models/monitor_create_params.rbs
140
148
  - sig/deeprails/models/monitor_detail_response.rbs
141
149
  - sig/deeprails/models/monitor_event_response.rbs
@@ -146,6 +154,7 @@ files:
146
154
  - sig/deeprails/models/workflow_event_response.rbs
147
155
  - sig/deeprails/request_options.rbs
148
156
  - sig/deeprails/resources/defend.rbs
157
+ - sig/deeprails/resources/files.rbs
149
158
  - sig/deeprails/resources/monitor.rbs
150
159
  - sig/deeprails/version.rbs
151
160
  homepage: https://gemdocs.org/gems/deeprails