deeprails 0.3.1 → 0.5.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 +16 -0
 - data/README.md +9 -9
 - 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 +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 17f2a467a1c77c17f12b6364a779e6bcf81102c66ba668173a2a99ec4605df02
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 28eca4b4b7fa3e5f1699c9befb2e9b5c5a66527d651ee10f86f22e586f0787ca
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: cbae3b08e491f8935fb5728659d987a1a47cd3a524f4a2e752093428ade6134fef3f2fcb54d5457035ac780c2ed0e1b110f563fb069e1ccd93958cb6bc4bef18
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 4f36db907c90712f67725492240e22045172daeedc69a85e687193bc210bf2e058a6d3b4997040c4f0c4ec070f5b9c2d366ffa5c0e50108809f44aa0f0e16a55
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,5 +1,21 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Changelog
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            ## 0.5.0 (2025-10-20)
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Full Changelog: [v0.4.0...v0.5.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.4.0...v0.5.0)
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ### Features
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            * **api:** readme example update ([4cdb59b](https://github.com/deeprails/deeprails-ruby-sdk/commit/4cdb59b5a0c9a5af34851fbd7885551a6253cf69))
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            ## 0.4.0 (2025-10-16)
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            Full Changelog: [v0.3.1...v0.4.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.3.1...v0.4.0)
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            ### Features
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            * **api:** adding support for system_prompt and ground_truth ([6b292f8](https://github.com/deeprails/deeprails-ruby-sdk/commit/6b292f8e125423e582f3937c343934e916e94ff6))
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
       3 
19 
     | 
    
         
             
            ## 0.3.1 (2025-10-16)
         
     | 
| 
       4 
20 
     | 
    
         | 
| 
       5 
21 
     | 
    
         
             
            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
    
    | 
         @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application 
     | 
|
| 
       15 
15 
     | 
    
         
             
            <!-- x-release-please-start-version -->
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
            ```ruby
         
     | 
| 
       18 
     | 
    
         
            -
            gem "deeprails", "~> 0. 
     | 
| 
      
 18 
     | 
    
         
            +
            gem "deeprails", "~> 0.5.0"
         
     | 
| 
       19 
19 
     | 
    
         
             
            ```
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
            <!-- x-release-please-end -->
         
     | 
| 
         @@ -32,7 +32,7 @@ deeprails = Deeprails::Client.new( 
     | 
|
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
            defend_response = deeprails.defend.create_workflow(
         
     | 
| 
       34 
34 
     | 
    
         
             
              improvement_action: "fixit",
         
     | 
| 
       35 
     | 
    
         
            -
              metrics: {completeness: 0. 
     | 
| 
      
 35 
     | 
    
         
            +
              metrics: {completeness: 0.7, instruction_adherence: 0.75},
         
     | 
| 
       36 
36 
     | 
    
         
             
              name: "Push Alert Workflow",
         
     | 
| 
       37 
37 
     | 
    
         
             
              type: "custom"
         
     | 
| 
       38 
38 
     | 
    
         
             
            )
         
     | 
| 
         @@ -48,7 +48,7 @@ When the library is unable to connect to the API, or if the API returns a non-su 
     | 
|
| 
       48 
48 
     | 
    
         
             
            begin
         
     | 
| 
       49 
49 
     | 
    
         
             
              defend = deeprails.defend.create_workflow(
         
     | 
| 
       50 
50 
     | 
    
         
             
                improvement_action: "fixit",
         
     | 
| 
       51 
     | 
    
         
            -
                metrics: {completeness: 0. 
     | 
| 
      
 51 
     | 
    
         
            +
                metrics: {completeness: 0.7, instruction_adherence: 0.75},
         
     | 
| 
       52 
52 
     | 
    
         
             
                name: "Push Alert Workflow",
         
     | 
| 
       53 
53 
     | 
    
         
             
                type: "custom"
         
     | 
| 
       54 
54 
     | 
    
         
             
              )
         
     | 
| 
         @@ -96,7 +96,7 @@ deeprails = Deeprails::Client.new( 
     | 
|
| 
       96 
96 
     | 
    
         
             
            # Or, configure per-request:
         
     | 
| 
       97 
97 
     | 
    
         
             
            deeprails.defend.create_workflow(
         
     | 
| 
       98 
98 
     | 
    
         
             
              improvement_action: "fixit",
         
     | 
| 
       99 
     | 
    
         
            -
              metrics: {completeness: 0. 
     | 
| 
      
 99 
     | 
    
         
            +
              metrics: {completeness: 0.7, instruction_adherence: 0.75},
         
     | 
| 
       100 
100 
     | 
    
         
             
              name: "Push Alert Workflow",
         
     | 
| 
       101 
101 
     | 
    
         
             
              type: "custom",
         
     | 
| 
       102 
102 
     | 
    
         
             
              request_options: {max_retries: 5}
         
     | 
| 
         @@ -116,7 +116,7 @@ deeprails = Deeprails::Client.new( 
     | 
|
| 
       116 
116 
     | 
    
         
             
            # Or, configure per-request:
         
     | 
| 
       117 
117 
     | 
    
         
             
            deeprails.defend.create_workflow(
         
     | 
| 
       118 
118 
     | 
    
         
             
              improvement_action: "fixit",
         
     | 
| 
       119 
     | 
    
         
            -
              metrics: {completeness: 0. 
     | 
| 
      
 119 
     | 
    
         
            +
              metrics: {completeness: 0.7, instruction_adherence: 0.75},
         
     | 
| 
       120 
120 
     | 
    
         
             
              name: "Push Alert Workflow",
         
     | 
| 
       121 
121 
     | 
    
         
             
              type: "custom",
         
     | 
| 
       122 
122 
     | 
    
         
             
              request_options: {timeout: 5}
         
     | 
| 
         @@ -153,7 +153,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete 
     | 
|
| 
       153 
153 
     | 
    
         
             
            defend_response =
         
     | 
| 
       154 
154 
     | 
    
         
             
              deeprails.defend.create_workflow(
         
     | 
| 
       155 
155 
     | 
    
         
             
                improvement_action: "fixit",
         
     | 
| 
       156 
     | 
    
         
            -
                metrics: {completeness: 0. 
     | 
| 
      
 156 
     | 
    
         
            +
                metrics: {completeness: 0.7, instruction_adherence: 0.75},
         
     | 
| 
       157 
157 
     | 
    
         
             
                name: "Push Alert Workflow",
         
     | 
| 
       158 
158 
     | 
    
         
             
                type: "custom",
         
     | 
| 
       159 
159 
     | 
    
         
             
                request_options: {
         
     | 
| 
         @@ -203,7 +203,7 @@ You can provide typesafe request parameters like so: 
     | 
|
| 
       203 
203 
     | 
    
         
             
            ```ruby
         
     | 
| 
       204 
204 
     | 
    
         
             
            deeprails.defend.create_workflow(
         
     | 
| 
       205 
205 
     | 
    
         
             
              improvement_action: "fixit",
         
     | 
| 
       206 
     | 
    
         
            -
              metrics: {completeness: 0. 
     | 
| 
      
 206 
     | 
    
         
            +
              metrics: {completeness: 0.7, instruction_adherence: 0.75},
         
     | 
| 
       207 
207 
     | 
    
         
             
              name: "Push Alert Workflow",
         
     | 
| 
       208 
208 
     | 
    
         
             
              type: "custom"
         
     | 
| 
       209 
209 
     | 
    
         
             
            )
         
     | 
| 
         @@ -215,7 +215,7 @@ Or, equivalently: 
     | 
|
| 
       215 
215 
     | 
    
         
             
            # Hashes work, but are not typesafe:
         
     | 
| 
       216 
216 
     | 
    
         
             
            deeprails.defend.create_workflow(
         
     | 
| 
       217 
217 
     | 
    
         
             
              improvement_action: "fixit",
         
     | 
| 
       218 
     | 
    
         
            -
              metrics: {completeness: 0. 
     | 
| 
      
 218 
     | 
    
         
            +
              metrics: {completeness: 0.7, instruction_adherence: 0.75},
         
     | 
| 
       219 
219 
     | 
    
         
             
              name: "Push Alert Workflow",
         
     | 
| 
       220 
220 
     | 
    
         
             
              type: "custom"
         
     | 
| 
       221 
221 
     | 
    
         
             
            )
         
     | 
| 
         @@ -223,7 +223,7 @@ deeprails.defend.create_workflow( 
     | 
|
| 
       223 
223 
     | 
    
         
             
            # You can also splat a full Params class:
         
     | 
| 
       224 
224 
     | 
    
         
             
            params = Deeprails::DefendCreateWorkflowParams.new(
         
     | 
| 
       225 
225 
     | 
    
         
             
              improvement_action: "fixit",
         
     | 
| 
       226 
     | 
    
         
            -
              metrics: {completeness: 0. 
     | 
| 
      
 226 
     | 
    
         
            +
              metrics: {completeness: 0.7, instruction_adherence: 0.75},
         
     | 
| 
       227 
227 
     | 
    
         
             
              name: "Push Alert Workflow",
         
     | 
| 
       228 
228 
     | 
    
         
             
              type: "custom"
         
     | 
| 
       229 
229 
     | 
    
         
             
            )
         
     | 
| 
         @@ -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
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: deeprails
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.5.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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-10-20 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: connection_pool
         
     |