deeprails 0.3.1 → 0.4.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 +8 -0
- data/README.md +1 -1
- data/lib/deeprails/models/defend_submit_event_params.rb +26 -15
- data/lib/deeprails/models/evaluate_create_params.rb +26 -15
- data/lib/deeprails/models/evaluation.rb +22 -14
- data/lib/deeprails/models/monitor_submit_event_params.rb +26 -15
- data/lib/deeprails/resources/defend.rb +1 -1
- data/lib/deeprails/resources/evaluate.rb +1 -1
- data/lib/deeprails/resources/monitor.rb +1 -1
- data/lib/deeprails/version.rb +1 -1
- data/rbi/deeprails/models/defend_submit_event_params.rbi +44 -17
- data/rbi/deeprails/models/evaluate_create_params.rbi +44 -17
- data/rbi/deeprails/models/evaluation.rbi +38 -18
- data/rbi/deeprails/models/monitor_submit_event_params.rbi +44 -17
- data/rbi/deeprails/resources/defend.rbi +3 -3
- data/rbi/deeprails/resources/evaluate.rbi +3 -3
- data/rbi/deeprails/resources/monitor.rbi +3 -3
- data/sig/deeprails/models/defend_submit_event_params.rbs +21 -6
- data/sig/deeprails/models/evaluate_create_params.rbs +21 -6
- data/sig/deeprails/models/evaluation.rbs +21 -6
- data/sig/deeprails/models/monitor_submit_event_params.rbs +21 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7192d4dabd071a76430b8c959bf2d81f4e8e669c3ff435b3e03137e571ccf6a
|
4
|
+
data.tar.gz: de4f603949d3e0e379c7c0f4549d9d96f776f0ce4a591bceabdc54eb4b957a21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba34997d3b6e6c383ee5570dc9bdfb4b39a88ab9b18749d15bb52c053fcd7b8cc5104382b5ea48cc23be05dbf98ede56d60edf0dc9997264c3d9323db35e6a34
|
7
|
+
data.tar.gz: d25c2b15590f995f3eb80ec2460c7888cc7f7359c6f5dc157cf582594b8ed813b0025fdc029c2128a2fa6b912e8338f139a8afba19a6067dd9fe15e43ed71b6c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.4.0 (2025-10-16)
|
4
|
+
|
5
|
+
Full Changelog: [v0.3.1...v0.4.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.3.1...v0.4.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** adding support for system_prompt and ground_truth ([6b292f8](https://github.com/deeprails/deeprails-ruby-sdk/commit/6b292f8e125423e582f3937c343934e916e94ff6))
|
10
|
+
|
3
11
|
## 0.3.1 (2025-10-16)
|
4
12
|
|
5
13
|
Full Changelog: [v0.3.0...v0.3.1](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.3.0...v0.3.1)
|
data/README.md
CHANGED
@@ -8,9 +8,9 @@ module Deeprails
|
|
8
8
|
include Deeprails::Internal::Type::RequestParameters
|
9
9
|
|
10
10
|
# @!attribute model_input
|
11
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
12
|
-
#
|
13
|
-
#
|
11
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
12
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
13
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
14
14
|
#
|
15
15
|
# @return [Deeprails::Models::DefendSubmitEventParams::ModelInput]
|
16
16
|
required :model_input, -> { Deeprails::DefendSubmitEventParams::ModelInput }
|
@@ -46,7 +46,7 @@ module Deeprails
|
|
46
46
|
# Some parameter documentations has been truncated, see
|
47
47
|
# {Deeprails::Models::DefendSubmitEventParams} for more details.
|
48
48
|
#
|
49
|
-
# @param model_input [Deeprails::Models::DefendSubmitEventParams::ModelInput] A dictionary of inputs sent to the LLM to generate output.
|
49
|
+
# @param model_input [Deeprails::Models::DefendSubmitEventParams::ModelInput] A dictionary of inputs sent to the LLM to generate output. The dictionary must c
|
50
50
|
#
|
51
51
|
# @param model_output [String] Output generated by the LLM to be evaluated.
|
52
52
|
#
|
@@ -59,23 +59,34 @@ module Deeprails
|
|
59
59
|
# @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
|
60
60
|
|
61
61
|
class ModelInput < Deeprails::Internal::Type::BaseModel
|
62
|
-
# @!attribute
|
62
|
+
# @!attribute ground_truth
|
63
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
64
|
+
#
|
65
|
+
# @return [String, nil]
|
66
|
+
optional :ground_truth, String
|
67
|
+
|
68
|
+
# @!attribute system_prompt
|
69
|
+
# The system prompt used to generate the output.
|
63
70
|
#
|
64
|
-
# @return [String]
|
65
|
-
|
71
|
+
# @return [String, nil]
|
72
|
+
optional :system_prompt, String
|
66
73
|
|
67
|
-
# @!attribute
|
74
|
+
# @!attribute user_prompt
|
75
|
+
# The user prompt used to generate the output.
|
68
76
|
#
|
69
77
|
# @return [String, nil]
|
70
|
-
optional :
|
78
|
+
optional :user_prompt, String
|
71
79
|
|
72
|
-
# @!method initialize(
|
73
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
74
|
-
#
|
75
|
-
#
|
80
|
+
# @!method initialize(ground_truth: nil, system_prompt: nil, user_prompt: nil)
|
81
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
82
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
83
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
84
|
+
#
|
85
|
+
# @param ground_truth [String] The ground truth for evaluating Ground Truth Adherence guardrail.
|
86
|
+
#
|
87
|
+
# @param system_prompt [String] The system prompt used to generate the output.
|
76
88
|
#
|
77
|
-
# @param user_prompt [String]
|
78
|
-
# @param context [String]
|
89
|
+
# @param user_prompt [String] The user prompt used to generate the output.
|
79
90
|
end
|
80
91
|
|
81
92
|
# Run mode for the workflow event. The run mode allows the user to optimize for
|
@@ -8,9 +8,9 @@ module Deeprails
|
|
8
8
|
include Deeprails::Internal::Type::RequestParameters
|
9
9
|
|
10
10
|
# @!attribute model_input
|
11
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
12
|
-
#
|
13
|
-
#
|
11
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
12
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
13
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
14
14
|
#
|
15
15
|
# @return [Deeprails::Models::EvaluateCreateParams::ModelInput]
|
16
16
|
required :model_input, -> { Deeprails::EvaluateCreateParams::ModelInput }
|
@@ -55,7 +55,7 @@ module Deeprails
|
|
55
55
|
# Some parameter documentations has been truncated, see
|
56
56
|
# {Deeprails::Models::EvaluateCreateParams} for more details.
|
57
57
|
#
|
58
|
-
# @param model_input [Deeprails::Models::EvaluateCreateParams::ModelInput] A dictionary of inputs sent to the LLM to generate output.
|
58
|
+
# @param model_input [Deeprails::Models::EvaluateCreateParams::ModelInput] A dictionary of inputs sent to the LLM to generate output. The dictionary must c
|
59
59
|
#
|
60
60
|
# @param model_output [String] Output generated by the LLM to be evaluated.
|
61
61
|
#
|
@@ -70,23 +70,34 @@ module Deeprails
|
|
70
70
|
# @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
|
71
71
|
|
72
72
|
class ModelInput < Deeprails::Internal::Type::BaseModel
|
73
|
-
# @!attribute
|
73
|
+
# @!attribute ground_truth
|
74
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
75
|
+
#
|
76
|
+
# @return [String, nil]
|
77
|
+
optional :ground_truth, String
|
78
|
+
|
79
|
+
# @!attribute system_prompt
|
80
|
+
# The system prompt used to generate the output.
|
74
81
|
#
|
75
|
-
# @return [String]
|
76
|
-
|
82
|
+
# @return [String, nil]
|
83
|
+
optional :system_prompt, String
|
77
84
|
|
78
|
-
# @!attribute
|
85
|
+
# @!attribute user_prompt
|
86
|
+
# The user prompt used to generate the output.
|
79
87
|
#
|
80
88
|
# @return [String, nil]
|
81
|
-
optional :
|
89
|
+
optional :user_prompt, String
|
82
90
|
|
83
|
-
# @!method initialize(
|
84
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
85
|
-
#
|
86
|
-
#
|
91
|
+
# @!method initialize(ground_truth: nil, system_prompt: nil, user_prompt: nil)
|
92
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
93
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
94
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
95
|
+
#
|
96
|
+
# @param ground_truth [String] The ground truth for evaluating Ground Truth Adherence guardrail.
|
97
|
+
#
|
98
|
+
# @param system_prompt [String] The system prompt used to generate the output.
|
87
99
|
#
|
88
|
-
# @param user_prompt [String]
|
89
|
-
# @param context [String]
|
100
|
+
# @param user_prompt [String] The user prompt used to generate the output.
|
90
101
|
end
|
91
102
|
|
92
103
|
# Run mode for the evaluation. The run mode allows the user to optimize for speed,
|
@@ -18,8 +18,8 @@ module Deeprails
|
|
18
18
|
|
19
19
|
# @!attribute model_input
|
20
20
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
21
|
-
# contain
|
22
|
-
#
|
21
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
22
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
23
23
|
#
|
24
24
|
# @return [Deeprails::Models::Evaluation::ModelInput]
|
25
25
|
required :model_input, -> { Deeprails::Evaluation::ModelInput }
|
@@ -169,26 +169,34 @@ module Deeprails
|
|
169
169
|
|
170
170
|
# @see Deeprails::Models::Evaluation#model_input
|
171
171
|
class ModelInput < Deeprails::Internal::Type::BaseModel
|
172
|
-
# @!attribute
|
173
|
-
# The
|
172
|
+
# @!attribute ground_truth
|
173
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
174
174
|
#
|
175
|
-
# @return [String]
|
176
|
-
|
175
|
+
# @return [String, nil]
|
176
|
+
optional :ground_truth, String
|
177
177
|
|
178
|
-
# @!attribute
|
179
|
-
#
|
178
|
+
# @!attribute system_prompt
|
179
|
+
# The system prompt used to generate the output.
|
180
180
|
#
|
181
181
|
# @return [String, nil]
|
182
|
-
optional :
|
182
|
+
optional :system_prompt, String
|
183
183
|
|
184
|
-
# @!
|
184
|
+
# @!attribute user_prompt
|
185
|
+
# The user prompt used to generate the output.
|
186
|
+
#
|
187
|
+
# @return [String, nil]
|
188
|
+
optional :user_prompt, String
|
189
|
+
|
190
|
+
# @!method initialize(ground_truth: nil, system_prompt: nil, user_prompt: nil)
|
185
191
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
186
|
-
# contain
|
187
|
-
#
|
192
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
193
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
188
194
|
#
|
189
|
-
# @param
|
195
|
+
# @param ground_truth [String] The ground truth for evaluating Ground Truth Adherence guardrail.
|
190
196
|
#
|
191
|
-
# @param
|
197
|
+
# @param system_prompt [String] The system prompt used to generate the output.
|
198
|
+
#
|
199
|
+
# @param user_prompt [String] The user prompt used to generate the output.
|
192
200
|
end
|
193
201
|
|
194
202
|
# Run mode for the evaluation. The run mode allows the user to optimize for speed,
|
@@ -18,9 +18,9 @@ module Deeprails
|
|
18
18
|
-> { Deeprails::Internal::Type::ArrayOf[enum: Deeprails::MonitorSubmitEventParams::GuardrailMetric] }
|
19
19
|
|
20
20
|
# @!attribute model_input
|
21
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
22
|
-
#
|
23
|
-
#
|
21
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
22
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
23
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
24
24
|
#
|
25
25
|
# @return [Deeprails::Models::MonitorSubmitEventParams::ModelInput]
|
26
26
|
required :model_input, -> { Deeprails::MonitorSubmitEventParams::ModelInput }
|
@@ -58,7 +58,7 @@ module Deeprails
|
|
58
58
|
#
|
59
59
|
# @param guardrail_metrics [Array<Symbol, Deeprails::Models::MonitorSubmitEventParams::GuardrailMetric>] An array of guardrail metrics that the model input and output pair will be evalu
|
60
60
|
#
|
61
|
-
# @param model_input [Deeprails::Models::MonitorSubmitEventParams::ModelInput] A dictionary of inputs sent to the LLM to generate output.
|
61
|
+
# @param model_input [Deeprails::Models::MonitorSubmitEventParams::ModelInput] A dictionary of inputs sent to the LLM to generate output. The dictionary must c
|
62
62
|
#
|
63
63
|
# @param model_output [String] Output generated by the LLM to be evaluated.
|
64
64
|
#
|
@@ -85,23 +85,34 @@ module Deeprails
|
|
85
85
|
end
|
86
86
|
|
87
87
|
class ModelInput < Deeprails::Internal::Type::BaseModel
|
88
|
-
# @!attribute
|
88
|
+
# @!attribute ground_truth
|
89
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
90
|
+
#
|
91
|
+
# @return [String, nil]
|
92
|
+
optional :ground_truth, String
|
93
|
+
|
94
|
+
# @!attribute system_prompt
|
95
|
+
# The system prompt used to generate the output.
|
89
96
|
#
|
90
|
-
# @return [String]
|
91
|
-
|
97
|
+
# @return [String, nil]
|
98
|
+
optional :system_prompt, String
|
92
99
|
|
93
|
-
# @!attribute
|
100
|
+
# @!attribute user_prompt
|
101
|
+
# The user prompt used to generate the output.
|
94
102
|
#
|
95
103
|
# @return [String, nil]
|
96
|
-
optional :
|
104
|
+
optional :user_prompt, String
|
97
105
|
|
98
|
-
# @!method initialize(
|
99
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
100
|
-
#
|
101
|
-
#
|
106
|
+
# @!method initialize(ground_truth: nil, system_prompt: nil, user_prompt: nil)
|
107
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
108
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
109
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
110
|
+
#
|
111
|
+
# @param ground_truth [String] The ground truth for evaluating Ground Truth Adherence guardrail.
|
112
|
+
#
|
113
|
+
# @param system_prompt [String] The system prompt used to generate the output.
|
102
114
|
#
|
103
|
-
# @param user_prompt [String]
|
104
|
-
# @param context [String]
|
115
|
+
# @param user_prompt [String] The user prompt used to generate the output.
|
105
116
|
end
|
106
117
|
|
107
118
|
# Run mode for the monitor event. The run mode allows the user to optimize for
|
@@ -98,7 +98,7 @@ module Deeprails
|
|
98
98
|
#
|
99
99
|
# @param workflow_id [String] Workflow ID associated with this event.
|
100
100
|
#
|
101
|
-
# @param model_input [Deeprails::Models::DefendSubmitEventParams::ModelInput] A dictionary of inputs sent to the LLM to generate output.
|
101
|
+
# @param model_input [Deeprails::Models::DefendSubmitEventParams::ModelInput] A dictionary of inputs sent to the LLM to generate output. The dictionary must c
|
102
102
|
#
|
103
103
|
# @param model_output [String] Output generated by the LLM to be evaluated.
|
104
104
|
#
|
@@ -11,7 +11,7 @@ module Deeprails
|
|
11
11
|
#
|
12
12
|
# @overload create(model_input:, model_output:, run_mode:, guardrail_metrics: nil, model_used: nil, nametag: nil, request_options: {})
|
13
13
|
#
|
14
|
-
# @param model_input [Deeprails::Models::EvaluateCreateParams::ModelInput] A dictionary of inputs sent to the LLM to generate output.
|
14
|
+
# @param model_input [Deeprails::Models::EvaluateCreateParams::ModelInput] A dictionary of inputs sent to the LLM to generate output. The dictionary must c
|
15
15
|
#
|
16
16
|
# @param model_output [String] Output generated by the LLM to be evaluated.
|
17
17
|
#
|
@@ -97,7 +97,7 @@ module Deeprails
|
|
97
97
|
#
|
98
98
|
# @param guardrail_metrics [Array<Symbol, Deeprails::Models::MonitorSubmitEventParams::GuardrailMetric>] An array of guardrail metrics that the model input and output pair will be evalu
|
99
99
|
#
|
100
|
-
# @param model_input [Deeprails::Models::MonitorSubmitEventParams::ModelInput] A dictionary of inputs sent to the LLM to generate output.
|
100
|
+
# @param model_input [Deeprails::Models::MonitorSubmitEventParams::ModelInput] A dictionary of inputs sent to the LLM to generate output. The dictionary must c
|
101
101
|
#
|
102
102
|
# @param model_output [String] Output generated by the LLM to be evaluated.
|
103
103
|
#
|
data/lib/deeprails/version.rb
CHANGED
@@ -14,9 +14,9 @@ module Deeprails
|
|
14
14
|
)
|
15
15
|
end
|
16
16
|
|
17
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
18
|
-
#
|
19
|
-
#
|
17
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
18
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
19
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
20
20
|
sig { returns(Deeprails::DefendSubmitEventParams::ModelInput) }
|
21
21
|
attr_reader :model_input
|
22
22
|
|
@@ -60,9 +60,9 @@ module Deeprails
|
|
60
60
|
).returns(T.attached_class)
|
61
61
|
end
|
62
62
|
def self.new(
|
63
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
64
|
-
#
|
65
|
-
#
|
63
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
64
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
65
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
66
66
|
model_input:,
|
67
67
|
# Output generated by the LLM to be evaluated.
|
68
68
|
model_output:,
|
@@ -103,25 +103,52 @@ module Deeprails
|
|
103
103
|
)
|
104
104
|
end
|
105
105
|
|
106
|
-
|
107
|
-
|
106
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
107
|
+
sig { returns(T.nilable(String)) }
|
108
|
+
attr_reader :ground_truth
|
109
|
+
|
110
|
+
sig { params(ground_truth: String).void }
|
111
|
+
attr_writer :ground_truth
|
112
|
+
|
113
|
+
# The system prompt used to generate the output.
|
114
|
+
sig { returns(T.nilable(String)) }
|
115
|
+
attr_reader :system_prompt
|
116
|
+
|
117
|
+
sig { params(system_prompt: String).void }
|
118
|
+
attr_writer :system_prompt
|
108
119
|
|
120
|
+
# The user prompt used to generate the output.
|
109
121
|
sig { returns(T.nilable(String)) }
|
110
|
-
attr_reader :
|
122
|
+
attr_reader :user_prompt
|
111
123
|
|
112
|
-
sig { params(
|
113
|
-
attr_writer :
|
124
|
+
sig { params(user_prompt: String).void }
|
125
|
+
attr_writer :user_prompt
|
114
126
|
|
115
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
116
|
-
#
|
117
|
-
#
|
127
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
128
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
129
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
118
130
|
sig do
|
119
|
-
params(
|
131
|
+
params(
|
132
|
+
ground_truth: String,
|
133
|
+
system_prompt: String,
|
134
|
+
user_prompt: String
|
135
|
+
).returns(T.attached_class)
|
120
136
|
end
|
121
|
-
def self.new(
|
137
|
+
def self.new(
|
138
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
139
|
+
ground_truth: nil,
|
140
|
+
# The system prompt used to generate the output.
|
141
|
+
system_prompt: nil,
|
142
|
+
# The user prompt used to generate the output.
|
143
|
+
user_prompt: nil
|
144
|
+
)
|
122
145
|
end
|
123
146
|
|
124
|
-
sig
|
147
|
+
sig do
|
148
|
+
override.returns(
|
149
|
+
{ ground_truth: String, system_prompt: String, user_prompt: String }
|
150
|
+
)
|
151
|
+
end
|
125
152
|
def to_hash
|
126
153
|
end
|
127
154
|
end
|
@@ -11,9 +11,9 @@ module Deeprails
|
|
11
11
|
T.any(Deeprails::EvaluateCreateParams, Deeprails::Internal::AnyHash)
|
12
12
|
end
|
13
13
|
|
14
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
15
|
-
#
|
16
|
-
#
|
14
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
15
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
16
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
17
17
|
sig { returns(Deeprails::EvaluateCreateParams::ModelInput) }
|
18
18
|
attr_reader :model_input
|
19
19
|
|
@@ -84,9 +84,9 @@ module Deeprails
|
|
84
84
|
).returns(T.attached_class)
|
85
85
|
end
|
86
86
|
def self.new(
|
87
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
88
|
-
#
|
89
|
-
#
|
87
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
88
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
89
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
90
90
|
model_input:,
|
91
91
|
# Output generated by the LLM to be evaluated.
|
92
92
|
model_output:,
|
@@ -135,25 +135,52 @@ module Deeprails
|
|
135
135
|
)
|
136
136
|
end
|
137
137
|
|
138
|
-
|
139
|
-
|
138
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
139
|
+
sig { returns(T.nilable(String)) }
|
140
|
+
attr_reader :ground_truth
|
141
|
+
|
142
|
+
sig { params(ground_truth: String).void }
|
143
|
+
attr_writer :ground_truth
|
144
|
+
|
145
|
+
# The system prompt used to generate the output.
|
146
|
+
sig { returns(T.nilable(String)) }
|
147
|
+
attr_reader :system_prompt
|
148
|
+
|
149
|
+
sig { params(system_prompt: String).void }
|
150
|
+
attr_writer :system_prompt
|
140
151
|
|
152
|
+
# The user prompt used to generate the output.
|
141
153
|
sig { returns(T.nilable(String)) }
|
142
|
-
attr_reader :
|
154
|
+
attr_reader :user_prompt
|
143
155
|
|
144
|
-
sig { params(
|
145
|
-
attr_writer :
|
156
|
+
sig { params(user_prompt: String).void }
|
157
|
+
attr_writer :user_prompt
|
146
158
|
|
147
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
148
|
-
#
|
149
|
-
#
|
159
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
160
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
161
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
150
162
|
sig do
|
151
|
-
params(
|
163
|
+
params(
|
164
|
+
ground_truth: String,
|
165
|
+
system_prompt: String,
|
166
|
+
user_prompt: String
|
167
|
+
).returns(T.attached_class)
|
152
168
|
end
|
153
|
-
def self.new(
|
169
|
+
def self.new(
|
170
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
171
|
+
ground_truth: nil,
|
172
|
+
# The system prompt used to generate the output.
|
173
|
+
system_prompt: nil,
|
174
|
+
# The user prompt used to generate the output.
|
175
|
+
user_prompt: nil
|
176
|
+
)
|
154
177
|
end
|
155
178
|
|
156
|
-
sig
|
179
|
+
sig do
|
180
|
+
override.returns(
|
181
|
+
{ ground_truth: String, system_prompt: String, user_prompt: String }
|
182
|
+
)
|
183
|
+
end
|
157
184
|
def to_hash
|
158
185
|
end
|
159
186
|
end
|
@@ -17,8 +17,8 @@ module Deeprails
|
|
17
17
|
attr_accessor :evaluation_status
|
18
18
|
|
19
19
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
20
|
-
# contain
|
21
|
-
#
|
20
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
21
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
22
22
|
sig { returns(Deeprails::Evaluation::ModelInput) }
|
23
23
|
attr_reader :model_input
|
24
24
|
|
@@ -162,8 +162,8 @@ module Deeprails
|
|
162
162
|
# Status of the evaluation.
|
163
163
|
evaluation_status:,
|
164
164
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
165
|
-
# contain
|
166
|
-
#
|
165
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
166
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
167
167
|
model_input:,
|
168
168
|
# Output generated by the LLM to be evaluated.
|
169
169
|
model_output:,
|
@@ -276,32 +276,52 @@ module Deeprails
|
|
276
276
|
)
|
277
277
|
end
|
278
278
|
|
279
|
-
# The
|
280
|
-
sig { returns(String) }
|
281
|
-
|
279
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
280
|
+
sig { returns(T.nilable(String)) }
|
281
|
+
attr_reader :ground_truth
|
282
|
+
|
283
|
+
sig { params(ground_truth: String).void }
|
284
|
+
attr_writer :ground_truth
|
282
285
|
|
283
|
-
#
|
286
|
+
# The system prompt used to generate the output.
|
284
287
|
sig { returns(T.nilable(String)) }
|
285
|
-
attr_reader :
|
288
|
+
attr_reader :system_prompt
|
286
289
|
|
287
|
-
sig { params(
|
288
|
-
attr_writer :
|
290
|
+
sig { params(system_prompt: String).void }
|
291
|
+
attr_writer :system_prompt
|
292
|
+
|
293
|
+
# The user prompt used to generate the output.
|
294
|
+
sig { returns(T.nilable(String)) }
|
295
|
+
attr_reader :user_prompt
|
296
|
+
|
297
|
+
sig { params(user_prompt: String).void }
|
298
|
+
attr_writer :user_prompt
|
289
299
|
|
290
300
|
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
291
|
-
# contain
|
292
|
-
#
|
301
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
302
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
293
303
|
sig do
|
294
|
-
params(
|
304
|
+
params(
|
305
|
+
ground_truth: String,
|
306
|
+
system_prompt: String,
|
307
|
+
user_prompt: String
|
308
|
+
).returns(T.attached_class)
|
295
309
|
end
|
296
310
|
def self.new(
|
311
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
312
|
+
ground_truth: nil,
|
313
|
+
# The system prompt used to generate the output.
|
314
|
+
system_prompt: nil,
|
297
315
|
# The user prompt used to generate the output.
|
298
|
-
user_prompt
|
299
|
-
# Optional context supplied to the LLM when generating the output.
|
300
|
-
context: nil
|
316
|
+
user_prompt: nil
|
301
317
|
)
|
302
318
|
end
|
303
319
|
|
304
|
-
sig
|
320
|
+
sig do
|
321
|
+
override.returns(
|
322
|
+
{ ground_truth: String, system_prompt: String, user_prompt: String }
|
323
|
+
)
|
324
|
+
end
|
305
325
|
def to_hash
|
306
326
|
end
|
307
327
|
end
|
@@ -27,9 +27,9 @@ module Deeprails
|
|
27
27
|
end
|
28
28
|
attr_accessor :guardrail_metrics
|
29
29
|
|
30
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
31
|
-
#
|
32
|
-
#
|
30
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
31
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
32
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
33
33
|
sig { returns(Deeprails::MonitorSubmitEventParams::ModelInput) }
|
34
34
|
attr_reader :model_input
|
35
35
|
|
@@ -96,9 +96,9 @@ module Deeprails
|
|
96
96
|
# `completeness`, `instruction_adherence`, `context_adherence`,
|
97
97
|
# `ground_truth_adherence`, and/or `comprehensive_safety`.
|
98
98
|
guardrail_metrics:,
|
99
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
100
|
-
#
|
101
|
-
#
|
99
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
100
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
101
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
102
102
|
model_input:,
|
103
103
|
# Output generated by the LLM to be evaluated.
|
104
104
|
model_output:,
|
@@ -194,25 +194,52 @@ module Deeprails
|
|
194
194
|
)
|
195
195
|
end
|
196
196
|
|
197
|
-
|
198
|
-
|
197
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
198
|
+
sig { returns(T.nilable(String)) }
|
199
|
+
attr_reader :ground_truth
|
200
|
+
|
201
|
+
sig { params(ground_truth: String).void }
|
202
|
+
attr_writer :ground_truth
|
203
|
+
|
204
|
+
# The system prompt used to generate the output.
|
205
|
+
sig { returns(T.nilable(String)) }
|
206
|
+
attr_reader :system_prompt
|
207
|
+
|
208
|
+
sig { params(system_prompt: String).void }
|
209
|
+
attr_writer :system_prompt
|
199
210
|
|
211
|
+
# The user prompt used to generate the output.
|
200
212
|
sig { returns(T.nilable(String)) }
|
201
|
-
attr_reader :
|
213
|
+
attr_reader :user_prompt
|
202
214
|
|
203
|
-
sig { params(
|
204
|
-
attr_writer :
|
215
|
+
sig { params(user_prompt: String).void }
|
216
|
+
attr_writer :user_prompt
|
205
217
|
|
206
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
207
|
-
#
|
208
|
-
#
|
218
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
219
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
220
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
209
221
|
sig do
|
210
|
-
params(
|
222
|
+
params(
|
223
|
+
ground_truth: String,
|
224
|
+
system_prompt: String,
|
225
|
+
user_prompt: String
|
226
|
+
).returns(T.attached_class)
|
211
227
|
end
|
212
|
-
def self.new(
|
228
|
+
def self.new(
|
229
|
+
# The ground truth for evaluating Ground Truth Adherence guardrail.
|
230
|
+
ground_truth: nil,
|
231
|
+
# The system prompt used to generate the output.
|
232
|
+
system_prompt: nil,
|
233
|
+
# The user prompt used to generate the output.
|
234
|
+
user_prompt: nil
|
235
|
+
)
|
213
236
|
end
|
214
237
|
|
215
|
-
sig
|
238
|
+
sig do
|
239
|
+
override.returns(
|
240
|
+
{ ground_truth: String, system_prompt: String, user_prompt: String }
|
241
|
+
)
|
242
|
+
end
|
216
243
|
def to_hash
|
217
244
|
end
|
218
245
|
end
|
@@ -101,9 +101,9 @@ module Deeprails
|
|
101
101
|
def submit_event(
|
102
102
|
# Workflow ID associated with this event.
|
103
103
|
workflow_id,
|
104
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
105
|
-
#
|
106
|
-
#
|
104
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
105
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
106
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
107
107
|
model_input:,
|
108
108
|
# Output generated by the LLM to be evaluated.
|
109
109
|
model_output:,
|
@@ -20,9 +20,9 @@ module Deeprails
|
|
20
20
|
).returns(Deeprails::Evaluation)
|
21
21
|
end
|
22
22
|
def create(
|
23
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
24
|
-
#
|
25
|
-
#
|
23
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
24
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
25
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
26
26
|
model_input:,
|
27
27
|
# Output generated by the LLM to be evaluated.
|
28
28
|
model_output:,
|
@@ -90,9 +90,9 @@ module Deeprails
|
|
90
90
|
# `completeness`, `instruction_adherence`, `context_adherence`,
|
91
91
|
# `ground_truth_adherence`, and/or `comprehensive_safety`.
|
92
92
|
guardrail_metrics:,
|
93
|
-
# A dictionary of inputs sent to the LLM to generate output.
|
94
|
-
#
|
95
|
-
#
|
93
|
+
# A dictionary of inputs sent to the LLM to generate output. The dictionary must
|
94
|
+
# contain at least one of `user_prompt` or `system_prompt`. For
|
95
|
+
# ground_truth_aherence guadrail metric, `ground_truth` should be provided.
|
96
96
|
model_input:,
|
97
97
|
# Output generated by the LLM to be evaluated.
|
98
98
|
model_output:,
|
@@ -44,18 +44,33 @@ module Deeprails
|
|
44
44
|
request_options: Deeprails::RequestOptions
|
45
45
|
}
|
46
46
|
|
47
|
-
type model_input =
|
47
|
+
type model_input =
|
48
|
+
{ ground_truth: String, system_prompt: String, user_prompt: String }
|
48
49
|
|
49
50
|
class ModelInput < Deeprails::Internal::Type::BaseModel
|
50
|
-
|
51
|
+
attr_reader ground_truth: String?
|
51
52
|
|
52
|
-
|
53
|
+
def ground_truth=: (String) -> String
|
53
54
|
|
54
|
-
|
55
|
+
attr_reader system_prompt: String?
|
55
56
|
|
56
|
-
def
|
57
|
+
def system_prompt=: (String) -> String
|
57
58
|
|
58
|
-
|
59
|
+
attr_reader user_prompt: String?
|
60
|
+
|
61
|
+
def user_prompt=: (String) -> String
|
62
|
+
|
63
|
+
def initialize: (
|
64
|
+
?ground_truth: String,
|
65
|
+
?system_prompt: String,
|
66
|
+
?user_prompt: String
|
67
|
+
) -> void
|
68
|
+
|
69
|
+
def to_hash: -> {
|
70
|
+
ground_truth: String,
|
71
|
+
system_prompt: String,
|
72
|
+
user_prompt: String
|
73
|
+
}
|
59
74
|
end
|
60
75
|
|
61
76
|
type run_mode = :precision_plus | :precision | :smart | :economy
|
@@ -55,18 +55,33 @@ module Deeprails
|
|
55
55
|
request_options: Deeprails::RequestOptions
|
56
56
|
}
|
57
57
|
|
58
|
-
type model_input =
|
58
|
+
type model_input =
|
59
|
+
{ ground_truth: String, system_prompt: String, user_prompt: String }
|
59
60
|
|
60
61
|
class ModelInput < Deeprails::Internal::Type::BaseModel
|
61
|
-
|
62
|
+
attr_reader ground_truth: String?
|
62
63
|
|
63
|
-
|
64
|
+
def ground_truth=: (String) -> String
|
64
65
|
|
65
|
-
|
66
|
+
attr_reader system_prompt: String?
|
66
67
|
|
67
|
-
def
|
68
|
+
def system_prompt=: (String) -> String
|
68
69
|
|
69
|
-
|
70
|
+
attr_reader user_prompt: String?
|
71
|
+
|
72
|
+
def user_prompt=: (String) -> String
|
73
|
+
|
74
|
+
def initialize: (
|
75
|
+
?ground_truth: String,
|
76
|
+
?system_prompt: String,
|
77
|
+
?user_prompt: String
|
78
|
+
) -> void
|
79
|
+
|
80
|
+
def to_hash: -> {
|
81
|
+
ground_truth: String,
|
82
|
+
system_prompt: String,
|
83
|
+
user_prompt: String
|
84
|
+
}
|
70
85
|
end
|
71
86
|
|
72
87
|
type run_mode = :precision_plus | :precision | :smart | :economy
|
@@ -137,18 +137,33 @@ module Deeprails
|
|
137
137
|
def self?.values: -> ::Array[Deeprails::Models::Evaluation::evaluation_status]
|
138
138
|
end
|
139
139
|
|
140
|
-
type model_input =
|
140
|
+
type model_input =
|
141
|
+
{ ground_truth: String, system_prompt: String, user_prompt: String }
|
141
142
|
|
142
143
|
class ModelInput < Deeprails::Internal::Type::BaseModel
|
143
|
-
|
144
|
+
attr_reader ground_truth: String?
|
144
145
|
|
145
|
-
|
146
|
+
def ground_truth=: (String) -> String
|
146
147
|
|
147
|
-
|
148
|
+
attr_reader system_prompt: String?
|
148
149
|
|
149
|
-
def
|
150
|
+
def system_prompt=: (String) -> String
|
150
151
|
|
151
|
-
|
152
|
+
attr_reader user_prompt: String?
|
153
|
+
|
154
|
+
def user_prompt=: (String) -> String
|
155
|
+
|
156
|
+
def initialize: (
|
157
|
+
?ground_truth: String,
|
158
|
+
?system_prompt: String,
|
159
|
+
?user_prompt: String
|
160
|
+
) -> void
|
161
|
+
|
162
|
+
def to_hash: -> {
|
163
|
+
ground_truth: String,
|
164
|
+
system_prompt: String,
|
165
|
+
user_prompt: String
|
166
|
+
}
|
152
167
|
end
|
153
168
|
|
154
169
|
type run_mode = :precision_plus | :precision | :smart | :economy
|
@@ -76,18 +76,33 @@ module Deeprails
|
|
76
76
|
def self?.values: -> ::Array[Deeprails::Models::MonitorSubmitEventParams::guardrail_metric]
|
77
77
|
end
|
78
78
|
|
79
|
-
type model_input =
|
79
|
+
type model_input =
|
80
|
+
{ ground_truth: String, system_prompt: String, user_prompt: String }
|
80
81
|
|
81
82
|
class ModelInput < Deeprails::Internal::Type::BaseModel
|
82
|
-
|
83
|
+
attr_reader ground_truth: String?
|
83
84
|
|
84
|
-
|
85
|
+
def ground_truth=: (String) -> String
|
85
86
|
|
86
|
-
|
87
|
+
attr_reader system_prompt: String?
|
87
88
|
|
88
|
-
def
|
89
|
+
def system_prompt=: (String) -> String
|
89
90
|
|
90
|
-
|
91
|
+
attr_reader user_prompt: String?
|
92
|
+
|
93
|
+
def user_prompt=: (String) -> String
|
94
|
+
|
95
|
+
def initialize: (
|
96
|
+
?ground_truth: String,
|
97
|
+
?system_prompt: String,
|
98
|
+
?user_prompt: String
|
99
|
+
) -> void
|
100
|
+
|
101
|
+
def to_hash: -> {
|
102
|
+
ground_truth: String,
|
103
|
+
system_prompt: String,
|
104
|
+
user_prompt: String
|
105
|
+
}
|
91
106
|
end
|
92
107
|
|
93
108
|
type run_mode = :precision_plus | :precision | :smart | :economy
|