deeprails 0.9.0 → 0.11.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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +23 -1
  4. data/lib/deeprails/client.rb +4 -0
  5. data/lib/deeprails/models/defend_create_workflow_params.rb +18 -1
  6. data/lib/deeprails/models/file_response.rb +49 -0
  7. data/lib/deeprails/models/file_upload_params.rb +22 -0
  8. data/lib/deeprails/models/monitor_create_params.rb +47 -1
  9. data/lib/deeprails/models/monitor_submit_event_params.rb +1 -35
  10. data/lib/deeprails/models.rb +4 -0
  11. data/lib/deeprails/resources/defend.rb +5 -1
  12. data/lib/deeprails/resources/files.rb +37 -0
  13. data/lib/deeprails/resources/monitor.rb +11 -6
  14. data/lib/deeprails/version.rb +1 -1
  15. data/lib/deeprails.rb +3 -0
  16. data/rbi/deeprails/client.rbi +3 -0
  17. data/rbi/deeprails/models/defend_create_workflow_params.rbi +24 -0
  18. data/rbi/deeprails/models/file_response.rbi +84 -0
  19. data/rbi/deeprails/models/file_upload_params.rbi +43 -0
  20. data/rbi/deeprails/models/monitor_create_params.rbi +97 -0
  21. data/rbi/deeprails/models/monitor_submit_event_params.rbi +0 -88
  22. data/rbi/deeprails/models.rbi +4 -0
  23. data/rbi/deeprails/resources/defend.rbi +7 -0
  24. data/rbi/deeprails/resources/files.rbi +26 -0
  25. data/rbi/deeprails/resources/monitor.rbi +14 -12
  26. data/sig/deeprails/client.rbs +2 -0
  27. data/sig/deeprails/models/defend_create_workflow_params.rbs +15 -1
  28. data/sig/deeprails/models/file_response.rbs +50 -0
  29. data/sig/deeprails/models/file_upload_params.rbs +24 -0
  30. data/sig/deeprails/models/monitor_create_params.rbs +44 -1
  31. data/sig/deeprails/models/monitor_submit_event_params.rbs +0 -33
  32. data/sig/deeprails/models.rbs +4 -0
  33. data/sig/deeprails/resources/defend.rbs +2 -0
  34. data/sig/deeprails/resources/files.rbs +12 -0
  35. data/sig/deeprails/resources/monitor.rbs +3 -2
  36. metadata +11 -2
@@ -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
@@ -11,6 +11,17 @@ module Deeprails
11
11
  T.any(Deeprails::MonitorCreateParams, Deeprails::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # An array of guardrail metrics that the model input and output pair will be
15
+ # evaluated on. For non-enterprise users, these will be limited to `correctness`,
16
+ # `completeness`, `instruction_adherence`, `context_adherence`,
17
+ # `ground_truth_adherence`, and/or `comprehensive_safety`.
18
+ sig do
19
+ returns(
20
+ T::Array[Deeprails::MonitorCreateParams::GuardrailMetric::OrSymbol]
21
+ )
22
+ end
23
+ attr_accessor :guardrail_metrics
24
+
14
25
  # Name of the new monitor.
15
26
  sig { returns(String) }
16
27
  attr_accessor :name
@@ -22,18 +33,47 @@ module Deeprails
22
33
  sig { params(description: String).void }
23
34
  attr_writer :description
24
35
 
36
+ # An array of file IDs to search in the monitor's evaluations. Files must be
37
+ # uploaded via the DeepRails API first.
38
+ sig { returns(T.nilable(T::Array[String])) }
39
+ attr_reader :file_search
40
+
41
+ sig { params(file_search: T::Array[String]).void }
42
+ attr_writer :file_search
43
+
44
+ # Whether to enable web search for this monitor's evaluations. Defaults to false.
45
+ sig { returns(T.nilable(T::Boolean)) }
46
+ attr_reader :web_search
47
+
48
+ sig { params(web_search: T::Boolean).void }
49
+ attr_writer :web_search
50
+
25
51
  sig do
26
52
  params(
53
+ guardrail_metrics:
54
+ T::Array[Deeprails::MonitorCreateParams::GuardrailMetric::OrSymbol],
27
55
  name: String,
28
56
  description: String,
57
+ file_search: T::Array[String],
58
+ web_search: T::Boolean,
29
59
  request_options: Deeprails::RequestOptions::OrHash
30
60
  ).returns(T.attached_class)
31
61
  end
32
62
  def self.new(
63
+ # An array of guardrail metrics that the model input and output pair will be
64
+ # evaluated on. For non-enterprise users, these will be limited to `correctness`,
65
+ # `completeness`, `instruction_adherence`, `context_adherence`,
66
+ # `ground_truth_adherence`, and/or `comprehensive_safety`.
67
+ guardrail_metrics:,
33
68
  # Name of the new monitor.
34
69
  name:,
35
70
  # Description of the new monitor.
36
71
  description: nil,
72
+ # An array of file IDs to search in the monitor's evaluations. Files must be
73
+ # uploaded via the DeepRails API first.
74
+ file_search: nil,
75
+ # Whether to enable web search for this monitor's evaluations. Defaults to false.
76
+ web_search: nil,
37
77
  request_options: {}
38
78
  )
39
79
  end
@@ -41,14 +81,71 @@ module Deeprails
41
81
  sig do
42
82
  override.returns(
43
83
  {
84
+ guardrail_metrics:
85
+ T::Array[
86
+ Deeprails::MonitorCreateParams::GuardrailMetric::OrSymbol
87
+ ],
44
88
  name: String,
45
89
  description: String,
90
+ file_search: T::Array[String],
91
+ web_search: T::Boolean,
46
92
  request_options: Deeprails::RequestOptions
47
93
  }
48
94
  )
49
95
  end
50
96
  def to_hash
51
97
  end
98
+
99
+ module GuardrailMetric
100
+ extend Deeprails::Internal::Type::Enum
101
+
102
+ TaggedSymbol =
103
+ T.type_alias do
104
+ T.all(Symbol, Deeprails::MonitorCreateParams::GuardrailMetric)
105
+ end
106
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
107
+
108
+ CORRECTNESS =
109
+ T.let(
110
+ :correctness,
111
+ Deeprails::MonitorCreateParams::GuardrailMetric::TaggedSymbol
112
+ )
113
+ COMPLETENESS =
114
+ T.let(
115
+ :completeness,
116
+ Deeprails::MonitorCreateParams::GuardrailMetric::TaggedSymbol
117
+ )
118
+ INSTRUCTION_ADHERENCE =
119
+ T.let(
120
+ :instruction_adherence,
121
+ Deeprails::MonitorCreateParams::GuardrailMetric::TaggedSymbol
122
+ )
123
+ CONTEXT_ADHERENCE =
124
+ T.let(
125
+ :context_adherence,
126
+ Deeprails::MonitorCreateParams::GuardrailMetric::TaggedSymbol
127
+ )
128
+ GROUND_TRUTH_ADHERENCE =
129
+ T.let(
130
+ :ground_truth_adherence,
131
+ Deeprails::MonitorCreateParams::GuardrailMetric::TaggedSymbol
132
+ )
133
+ COMPREHENSIVE_SAFETY =
134
+ T.let(
135
+ :comprehensive_safety,
136
+ Deeprails::MonitorCreateParams::GuardrailMetric::TaggedSymbol
137
+ )
138
+
139
+ sig do
140
+ override.returns(
141
+ T::Array[
142
+ Deeprails::MonitorCreateParams::GuardrailMetric::TaggedSymbol
143
+ ]
144
+ )
145
+ end
146
+ def self.values
147
+ end
148
+ end
52
149
  end
53
150
  end
54
151
  end
@@ -14,19 +14,6 @@ module Deeprails
14
14
  )
15
15
  end
16
16
 
17
- # An array of guardrail metrics that the model input and output pair will be
18
- # evaluated on. For non-enterprise users, these will be limited to `correctness`,
19
- # `completeness`, `instruction_adherence`, `context_adherence`,
20
- # `ground_truth_adherence`, and/or `comprehensive_safety`.
21
- sig do
22
- returns(
23
- T::Array[
24
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::OrSymbol
25
- ]
26
- )
27
- end
28
- attr_accessor :guardrail_metrics
29
-
30
17
  # A dictionary of inputs sent to the LLM to generate output. The dictionary must
31
18
  # contain at least a `user_prompt` field or a `system_prompt` field. For
32
19
  # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
@@ -44,13 +31,6 @@ module Deeprails
44
31
  sig { returns(String) }
45
32
  attr_accessor :model_output
46
33
 
47
- # Model ID used to generate the output, like `gpt-4o` or `o3`.
48
- sig { returns(T.nilable(String)) }
49
- attr_reader :model_used
50
-
51
- sig { params(model_used: String).void }
52
- attr_writer :model_used
53
-
54
34
  # An optional, user-defined tag for the event.
55
35
  sig { returns(T.nilable(String)) }
56
36
  attr_reader :nametag
@@ -78,32 +58,20 @@ module Deeprails
78
58
 
79
59
  sig do
80
60
  params(
81
- guardrail_metrics:
82
- T::Array[
83
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::OrSymbol
84
- ],
85
61
  model_input: Deeprails::MonitorSubmitEventParams::ModelInput::OrHash,
86
62
  model_output: String,
87
- model_used: String,
88
63
  nametag: String,
89
64
  run_mode: Deeprails::MonitorSubmitEventParams::RunMode::OrSymbol,
90
65
  request_options: Deeprails::RequestOptions::OrHash
91
66
  ).returns(T.attached_class)
92
67
  end
93
68
  def self.new(
94
- # An array of guardrail metrics that the model input and output pair will be
95
- # evaluated on. For non-enterprise users, these will be limited to `correctness`,
96
- # `completeness`, `instruction_adherence`, `context_adherence`,
97
- # `ground_truth_adherence`, and/or `comprehensive_safety`.
98
- guardrail_metrics:,
99
69
  # A dictionary of inputs sent to the LLM to generate output. The dictionary must
100
70
  # contain at least a `user_prompt` field or a `system_prompt` field. For
101
71
  # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
102
72
  model_input:,
103
73
  # Output generated by the LLM to be evaluated.
104
74
  model_output:,
105
- # Model ID used to generate the output, like `gpt-4o` or `o3`.
106
- model_used: nil,
107
75
  # An optional, user-defined tag for the event.
108
76
  nametag: nil,
109
77
  # Run mode for the monitor event. The run mode allows the user to optimize for
@@ -118,13 +86,8 @@ module Deeprails
118
86
  sig do
119
87
  override.returns(
120
88
  {
121
- guardrail_metrics:
122
- T::Array[
123
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::OrSymbol
124
- ],
125
89
  model_input: Deeprails::MonitorSubmitEventParams::ModelInput,
126
90
  model_output: String,
127
- model_used: String,
128
91
  nametag: String,
129
92
  run_mode: Deeprails::MonitorSubmitEventParams::RunMode::OrSymbol,
130
93
  request_options: Deeprails::RequestOptions
@@ -134,57 +97,6 @@ module Deeprails
134
97
  def to_hash
135
98
  end
136
99
 
137
- module GuardrailMetric
138
- extend Deeprails::Internal::Type::Enum
139
-
140
- TaggedSymbol =
141
- T.type_alias do
142
- T.all(Symbol, Deeprails::MonitorSubmitEventParams::GuardrailMetric)
143
- end
144
- OrSymbol = T.type_alias { T.any(Symbol, String) }
145
-
146
- CORRECTNESS =
147
- T.let(
148
- :correctness,
149
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::TaggedSymbol
150
- )
151
- COMPLETENESS =
152
- T.let(
153
- :completeness,
154
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::TaggedSymbol
155
- )
156
- INSTRUCTION_ADHERENCE =
157
- T.let(
158
- :instruction_adherence,
159
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::TaggedSymbol
160
- )
161
- CONTEXT_ADHERENCE =
162
- T.let(
163
- :context_adherence,
164
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::TaggedSymbol
165
- )
166
- GROUND_TRUTH_ADHERENCE =
167
- T.let(
168
- :ground_truth_adherence,
169
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::TaggedSymbol
170
- )
171
- COMPREHENSIVE_SAFETY =
172
- T.let(
173
- :comprehensive_safety,
174
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::TaggedSymbol
175
- )
176
-
177
- sig do
178
- override.returns(
179
- T::Array[
180
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::TaggedSymbol
181
- ]
182
- )
183
- end
184
- def self.values
185
- end
186
- end
187
-
188
100
  class ModelInput < Deeprails::Internal::Type::BaseModel
189
101
  OrHash =
190
102
  T.type_alias do
@@ -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
@@ -7,16 +7,30 @@ module Deeprails
7
7
  # using guardrails
8
8
  sig do
9
9
  params(
10
+ guardrail_metrics:
11
+ T::Array[Deeprails::MonitorCreateParams::GuardrailMetric::OrSymbol],
10
12
  name: String,
11
13
  description: String,
14
+ file_search: T::Array[String],
15
+ web_search: T::Boolean,
12
16
  request_options: Deeprails::RequestOptions::OrHash
13
17
  ).returns(Deeprails::MonitorResponse)
14
18
  end
15
19
  def create(
20
+ # An array of guardrail metrics that the model input and output pair will be
21
+ # evaluated on. For non-enterprise users, these will be limited to `correctness`,
22
+ # `completeness`, `instruction_adherence`, `context_adherence`,
23
+ # `ground_truth_adherence`, and/or `comprehensive_safety`.
24
+ guardrail_metrics:,
16
25
  # Name of the new monitor.
17
26
  name:,
18
27
  # Description of the new monitor.
19
28
  description: nil,
29
+ # An array of file IDs to search in the monitor's evaluations. Files must be
30
+ # uploaded via the DeepRails API first.
31
+ file_search: nil,
32
+ # Whether to enable web search for this monitor's evaluations. Defaults to false.
33
+ web_search: nil,
20
34
  request_options: {}
21
35
  )
22
36
  end
@@ -70,13 +84,8 @@ module Deeprails
70
84
  sig do
71
85
  params(
72
86
  monitor_id: String,
73
- guardrail_metrics:
74
- T::Array[
75
- Deeprails::MonitorSubmitEventParams::GuardrailMetric::OrSymbol
76
- ],
77
87
  model_input: Deeprails::MonitorSubmitEventParams::ModelInput::OrHash,
78
88
  model_output: String,
79
- model_used: String,
80
89
  nametag: String,
81
90
  run_mode: Deeprails::MonitorSubmitEventParams::RunMode::OrSymbol,
82
91
  request_options: Deeprails::RequestOptions::OrHash
@@ -85,19 +94,12 @@ module Deeprails
85
94
  def submit_event(
86
95
  # The ID of the monitor associated with this event.
87
96
  monitor_id,
88
- # An array of guardrail metrics that the model input and output pair will be
89
- # evaluated on. For non-enterprise users, these will be limited to `correctness`,
90
- # `completeness`, `instruction_adherence`, `context_adherence`,
91
- # `ground_truth_adherence`, and/or `comprehensive_safety`.
92
- guardrail_metrics:,
93
97
  # A dictionary of inputs sent to the LLM to generate output. The dictionary must
94
98
  # contain at least a `user_prompt` field or a `system_prompt` field. For
95
99
  # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
96
100
  model_input:,
97
101
  # Output generated by the LLM to be evaluated.
98
102
  model_output:,
99
- # Model ID used to generate the output, like `gpt-4o` or `o3`.
100
- model_used: nil,
101
103
  # An optional, user-defined tag for the event.
102
104
  nametag: nil,
103
105
  # Run mode for the monitor event. The run mode allows the user to optimize for
@@ -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
@@ -1,30 +1,73 @@
1
1
  module Deeprails
2
2
  module Models
3
3
  type monitor_create_params =
4
- { name: String, description: String }
4
+ {
5
+ guardrail_metrics: ::Array[Deeprails::Models::MonitorCreateParams::guardrail_metric],
6
+ name: String,
7
+ description: String,
8
+ file_search: ::Array[String],
9
+ web_search: bool
10
+ }
5
11
  & Deeprails::Internal::Type::request_parameters
6
12
 
7
13
  class MonitorCreateParams < Deeprails::Internal::Type::BaseModel
8
14
  extend Deeprails::Internal::Type::RequestParameters::Converter
9
15
  include Deeprails::Internal::Type::RequestParameters
10
16
 
17
+ attr_accessor guardrail_metrics: ::Array[Deeprails::Models::MonitorCreateParams::guardrail_metric]
18
+
11
19
  attr_accessor name: String
12
20
 
13
21
  attr_reader description: String?
14
22
 
15
23
  def description=: (String) -> String
16
24
 
25
+ attr_reader file_search: ::Array[String]?
26
+
27
+ def file_search=: (::Array[String]) -> ::Array[String]
28
+
29
+ attr_reader web_search: bool?
30
+
31
+ def web_search=: (bool) -> bool
32
+
17
33
  def initialize: (
34
+ guardrail_metrics: ::Array[Deeprails::Models::MonitorCreateParams::guardrail_metric],
18
35
  name: String,
19
36
  ?description: String,
37
+ ?file_search: ::Array[String],
38
+ ?web_search: bool,
20
39
  ?request_options: Deeprails::request_opts
21
40
  ) -> void
22
41
 
23
42
  def to_hash: -> {
43
+ guardrail_metrics: ::Array[Deeprails::Models::MonitorCreateParams::guardrail_metric],
24
44
  name: String,
25
45
  description: String,
46
+ file_search: ::Array[String],
47
+ web_search: bool,
26
48
  request_options: Deeprails::RequestOptions
27
49
  }
50
+
51
+ type guardrail_metric =
52
+ :correctness
53
+ | :completeness
54
+ | :instruction_adherence
55
+ | :context_adherence
56
+ | :ground_truth_adherence
57
+ | :comprehensive_safety
58
+
59
+ module GuardrailMetric
60
+ extend Deeprails::Internal::Type::Enum
61
+
62
+ CORRECTNESS: :correctness
63
+ COMPLETENESS: :completeness
64
+ INSTRUCTION_ADHERENCE: :instruction_adherence
65
+ CONTEXT_ADHERENCE: :context_adherence
66
+ GROUND_TRUTH_ADHERENCE: :ground_truth_adherence
67
+ COMPREHENSIVE_SAFETY: :comprehensive_safety
68
+
69
+ def self?.values: -> ::Array[Deeprails::Models::MonitorCreateParams::guardrail_metric]
70
+ end
28
71
  end
29
72
  end
30
73
  end