deeprails 0.7.0 → 0.9.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 +18 -0
 - data/README.md +1 -1
 - data/lib/deeprails/client.rb +0 -4
 - data/lib/deeprails/internal/transport/pooled_net_requester.rb +30 -24
 - data/lib/deeprails/models/defend_create_workflow_params.rb +4 -4
 - data/lib/deeprails/models/defend_response.rb +4 -4
 - data/lib/deeprails/models/defend_submit_event_params.rb +4 -4
 - data/lib/deeprails/models/monitor_detail_response.rb +378 -0
 - data/lib/deeprails/models/monitor_event_response.rb +41 -0
 - data/lib/deeprails/models/monitor_response.rb +83 -0
 - data/lib/deeprails/models/monitor_submit_event_params.rb +2 -2
 - data/lib/deeprails/models.rb +4 -6
 - data/lib/deeprails/resources/defend.rb +2 -2
 - data/lib/deeprails/resources/monitor.rb +8 -8
 - data/lib/deeprails/version.rb +1 -1
 - data/lib/deeprails.rb +3 -7
 - data/rbi/deeprails/client.rbi +0 -3
 - data/rbi/deeprails/models/defend_create_workflow_params.rbi +6 -6
 - data/rbi/deeprails/models/defend_response.rbi +6 -6
 - data/rbi/deeprails/models/defend_submit_event_params.rbi +5 -5
 - data/rbi/deeprails/models/monitor_detail_response.rbi +730 -0
 - data/rbi/deeprails/models/monitor_event_response.rbi +64 -0
 - data/rbi/deeprails/models/monitor_response.rbi +142 -0
 - data/rbi/deeprails/models/monitor_submit_event_params.rbi +3 -3
 - data/rbi/deeprails/models.rbi +4 -6
 - data/rbi/deeprails/resources/defend.rbi +3 -3
 - data/rbi/deeprails/resources/monitor.rbi +5 -5
 - data/sig/deeprails/client.rbs +0 -2
 - data/sig/deeprails/models/defend_create_workflow_params.rbs +5 -5
 - data/sig/deeprails/models/defend_response.rbs +5 -5
 - data/sig/deeprails/models/monitor_detail_response.rbs +335 -0
 - data/sig/deeprails/models/monitor_event_response.rbs +37 -0
 - data/sig/deeprails/models/monitor_response.rbs +73 -0
 - data/sig/deeprails/models.rbs +4 -6
 - data/sig/deeprails/resources/defend.rbs +1 -1
 - data/sig/deeprails/resources/monitor.rbs +4 -4
 - metadata +11 -23
 - data/lib/deeprails/models/api_response.rb +0 -116
 - data/lib/deeprails/models/evaluate_create_params.rb +0 -134
 - data/lib/deeprails/models/evaluate_retrieve_params.rb +0 -14
 - data/lib/deeprails/models/evaluation.rb +0 -233
 - data/lib/deeprails/models/monitor_retrieve_response.rb +0 -183
 - data/lib/deeprails/models/monitor_submit_event_response.rb +0 -74
 - data/lib/deeprails/resources/evaluate.rb +0 -70
 - data/rbi/deeprails/models/api_response.rbi +0 -201
 - data/rbi/deeprails/models/evaluate_create_params.rbi +0 -280
 - data/rbi/deeprails/models/evaluate_retrieve_params.rbi +0 -27
 - data/rbi/deeprails/models/evaluation.rbi +0 -402
 - data/rbi/deeprails/models/monitor_retrieve_response.rbi +0 -333
 - data/rbi/deeprails/models/monitor_submit_event_response.rbi +0 -131
 - data/rbi/deeprails/resources/evaluate.rbi +0 -66
 - data/sig/deeprails/models/api_response.rbs +0 -100
 - data/sig/deeprails/models/evaluate_create_params.rbs +0 -122
 - data/sig/deeprails/models/evaluate_retrieve_params.rbs +0 -15
 - data/sig/deeprails/models/evaluation.rbs +0 -204
 - data/sig/deeprails/models/monitor_retrieve_response.rbs +0 -167
 - data/sig/deeprails/models/monitor_submit_event_response.rbs +0 -70
 - data/sig/deeprails/resources/evaluate.rbs +0 -22
 
| 
         @@ -0,0 +1,64 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # typed: strong
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Deeprails
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Models
         
     | 
| 
      
 5 
     | 
    
         
            +
                class MonitorEventResponse < Deeprails::Internal::Type::BaseModel
         
     | 
| 
      
 6 
     | 
    
         
            +
                  OrHash =
         
     | 
| 
      
 7 
     | 
    
         
            +
                    T.type_alias do
         
     | 
| 
      
 8 
     | 
    
         
            +
                      T.any(Deeprails::MonitorEventResponse, Deeprails::Internal::AnyHash)
         
     | 
| 
      
 9 
     | 
    
         
            +
                    end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                  # A unique evaluation ID associated with this event.
         
     | 
| 
      
 12 
     | 
    
         
            +
                  sig { returns(String) }
         
     | 
| 
      
 13 
     | 
    
         
            +
                  attr_accessor :evaluation_id
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                  # A unique monitor event ID.
         
     | 
| 
      
 16 
     | 
    
         
            +
                  sig { returns(String) }
         
     | 
| 
      
 17 
     | 
    
         
            +
                  attr_accessor :event_id
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                  # Monitor ID associated with this event.
         
     | 
| 
      
 20 
     | 
    
         
            +
                  sig { returns(String) }
         
     | 
| 
      
 21 
     | 
    
         
            +
                  attr_accessor :monitor_id
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                  # The time the monitor event was created in UTC.
         
     | 
| 
      
 24 
     | 
    
         
            +
                  sig { returns(T.nilable(Time)) }
         
     | 
| 
      
 25 
     | 
    
         
            +
                  attr_reader :created_at
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                  sig { params(created_at: Time).void }
         
     | 
| 
      
 28 
     | 
    
         
            +
                  attr_writer :created_at
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                  sig do
         
     | 
| 
      
 31 
     | 
    
         
            +
                    params(
         
     | 
| 
      
 32 
     | 
    
         
            +
                      evaluation_id: String,
         
     | 
| 
      
 33 
     | 
    
         
            +
                      event_id: String,
         
     | 
| 
      
 34 
     | 
    
         
            +
                      monitor_id: String,
         
     | 
| 
      
 35 
     | 
    
         
            +
                      created_at: Time
         
     | 
| 
      
 36 
     | 
    
         
            +
                    ).returns(T.attached_class)
         
     | 
| 
      
 37 
     | 
    
         
            +
                  end
         
     | 
| 
      
 38 
     | 
    
         
            +
                  def self.new(
         
     | 
| 
      
 39 
     | 
    
         
            +
                    # A unique evaluation ID associated with this event.
         
     | 
| 
      
 40 
     | 
    
         
            +
                    evaluation_id:,
         
     | 
| 
      
 41 
     | 
    
         
            +
                    # A unique monitor event ID.
         
     | 
| 
      
 42 
     | 
    
         
            +
                    event_id:,
         
     | 
| 
      
 43 
     | 
    
         
            +
                    # Monitor ID associated with this event.
         
     | 
| 
      
 44 
     | 
    
         
            +
                    monitor_id:,
         
     | 
| 
      
 45 
     | 
    
         
            +
                    # The time the monitor event was created in UTC.
         
     | 
| 
      
 46 
     | 
    
         
            +
                    created_at: nil
         
     | 
| 
      
 47 
     | 
    
         
            +
                  )
         
     | 
| 
      
 48 
     | 
    
         
            +
                  end
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                  sig do
         
     | 
| 
      
 51 
     | 
    
         
            +
                    override.returns(
         
     | 
| 
      
 52 
     | 
    
         
            +
                      {
         
     | 
| 
      
 53 
     | 
    
         
            +
                        evaluation_id: String,
         
     | 
| 
      
 54 
     | 
    
         
            +
                        event_id: String,
         
     | 
| 
      
 55 
     | 
    
         
            +
                        monitor_id: String,
         
     | 
| 
      
 56 
     | 
    
         
            +
                        created_at: Time
         
     | 
| 
      
 57 
     | 
    
         
            +
                      }
         
     | 
| 
      
 58 
     | 
    
         
            +
                    )
         
     | 
| 
      
 59 
     | 
    
         
            +
                  end
         
     | 
| 
      
 60 
     | 
    
         
            +
                  def to_hash
         
     | 
| 
      
 61 
     | 
    
         
            +
                  end
         
     | 
| 
      
 62 
     | 
    
         
            +
                end
         
     | 
| 
      
 63 
     | 
    
         
            +
              end
         
     | 
| 
      
 64 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,142 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # typed: strong
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Deeprails
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Models
         
     | 
| 
      
 5 
     | 
    
         
            +
                class MonitorResponse < Deeprails::Internal::Type::BaseModel
         
     | 
| 
      
 6 
     | 
    
         
            +
                  OrHash =
         
     | 
| 
      
 7 
     | 
    
         
            +
                    T.type_alias do
         
     | 
| 
      
 8 
     | 
    
         
            +
                      T.any(Deeprails::MonitorResponse, Deeprails::Internal::AnyHash)
         
     | 
| 
      
 9 
     | 
    
         
            +
                    end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                  # A unique monitor ID.
         
     | 
| 
      
 12 
     | 
    
         
            +
                  sig { returns(String) }
         
     | 
| 
      
 13 
     | 
    
         
            +
                  attr_accessor :monitor_id
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                  # Name of the monitor.
         
     | 
| 
      
 16 
     | 
    
         
            +
                  sig { returns(String) }
         
     | 
| 
      
 17 
     | 
    
         
            +
                  attr_accessor :name
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                  # The time the monitor was created in UTC.
         
     | 
| 
      
 20 
     | 
    
         
            +
                  sig { returns(T.nilable(Time)) }
         
     | 
| 
      
 21 
     | 
    
         
            +
                  attr_reader :created_at
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                  sig { params(created_at: Time).void }
         
     | 
| 
      
 24 
     | 
    
         
            +
                  attr_writer :created_at
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                  # Description of the monitor.
         
     | 
| 
      
 27 
     | 
    
         
            +
                  sig { returns(T.nilable(String)) }
         
     | 
| 
      
 28 
     | 
    
         
            +
                  attr_reader :description
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                  sig { params(description: String).void }
         
     | 
| 
      
 31 
     | 
    
         
            +
                  attr_writer :description
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                  # Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
         
     | 
| 
      
 34 
     | 
    
         
            +
                  # longer record and evaluate events.
         
     | 
| 
      
 35 
     | 
    
         
            +
                  sig do
         
     | 
| 
      
 36 
     | 
    
         
            +
                    returns(
         
     | 
| 
      
 37 
     | 
    
         
            +
                      T.nilable(Deeprails::MonitorResponse::MonitorStatus::TaggedSymbol)
         
     | 
| 
      
 38 
     | 
    
         
            +
                    )
         
     | 
| 
      
 39 
     | 
    
         
            +
                  end
         
     | 
| 
      
 40 
     | 
    
         
            +
                  attr_reader :monitor_status
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
                  sig do
         
     | 
| 
      
 43 
     | 
    
         
            +
                    params(
         
     | 
| 
      
 44 
     | 
    
         
            +
                      monitor_status: Deeprails::MonitorResponse::MonitorStatus::OrSymbol
         
     | 
| 
      
 45 
     | 
    
         
            +
                    ).void
         
     | 
| 
      
 46 
     | 
    
         
            +
                  end
         
     | 
| 
      
 47 
     | 
    
         
            +
                  attr_writer :monitor_status
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                  # The most recent time the monitor was modified in UTC.
         
     | 
| 
      
 50 
     | 
    
         
            +
                  sig { returns(T.nilable(Time)) }
         
     | 
| 
      
 51 
     | 
    
         
            +
                  attr_reader :updated_at
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
                  sig { params(updated_at: Time).void }
         
     | 
| 
      
 54 
     | 
    
         
            +
                  attr_writer :updated_at
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                  # User ID of the user who created the monitor.
         
     | 
| 
      
 57 
     | 
    
         
            +
                  sig { returns(T.nilable(String)) }
         
     | 
| 
      
 58 
     | 
    
         
            +
                  attr_reader :user_id
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                  sig { params(user_id: String).void }
         
     | 
| 
      
 61 
     | 
    
         
            +
                  attr_writer :user_id
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
                  sig do
         
     | 
| 
      
 64 
     | 
    
         
            +
                    params(
         
     | 
| 
      
 65 
     | 
    
         
            +
                      monitor_id: String,
         
     | 
| 
      
 66 
     | 
    
         
            +
                      name: String,
         
     | 
| 
      
 67 
     | 
    
         
            +
                      created_at: Time,
         
     | 
| 
      
 68 
     | 
    
         
            +
                      description: String,
         
     | 
| 
      
 69 
     | 
    
         
            +
                      monitor_status: Deeprails::MonitorResponse::MonitorStatus::OrSymbol,
         
     | 
| 
      
 70 
     | 
    
         
            +
                      updated_at: Time,
         
     | 
| 
      
 71 
     | 
    
         
            +
                      user_id: String
         
     | 
| 
      
 72 
     | 
    
         
            +
                    ).returns(T.attached_class)
         
     | 
| 
      
 73 
     | 
    
         
            +
                  end
         
     | 
| 
      
 74 
     | 
    
         
            +
                  def self.new(
         
     | 
| 
      
 75 
     | 
    
         
            +
                    # A unique monitor ID.
         
     | 
| 
      
 76 
     | 
    
         
            +
                    monitor_id:,
         
     | 
| 
      
 77 
     | 
    
         
            +
                    # Name of the monitor.
         
     | 
| 
      
 78 
     | 
    
         
            +
                    name:,
         
     | 
| 
      
 79 
     | 
    
         
            +
                    # The time the monitor was created in UTC.
         
     | 
| 
      
 80 
     | 
    
         
            +
                    created_at: nil,
         
     | 
| 
      
 81 
     | 
    
         
            +
                    # Description of the monitor.
         
     | 
| 
      
 82 
     | 
    
         
            +
                    description: nil,
         
     | 
| 
      
 83 
     | 
    
         
            +
                    # Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
         
     | 
| 
      
 84 
     | 
    
         
            +
                    # longer record and evaluate events.
         
     | 
| 
      
 85 
     | 
    
         
            +
                    monitor_status: nil,
         
     | 
| 
      
 86 
     | 
    
         
            +
                    # The most recent time the monitor was modified in UTC.
         
     | 
| 
      
 87 
     | 
    
         
            +
                    updated_at: nil,
         
     | 
| 
      
 88 
     | 
    
         
            +
                    # User ID of the user who created the monitor.
         
     | 
| 
      
 89 
     | 
    
         
            +
                    user_id: nil
         
     | 
| 
      
 90 
     | 
    
         
            +
                  )
         
     | 
| 
      
 91 
     | 
    
         
            +
                  end
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
      
 93 
     | 
    
         
            +
                  sig do
         
     | 
| 
      
 94 
     | 
    
         
            +
                    override.returns(
         
     | 
| 
      
 95 
     | 
    
         
            +
                      {
         
     | 
| 
      
 96 
     | 
    
         
            +
                        monitor_id: String,
         
     | 
| 
      
 97 
     | 
    
         
            +
                        name: String,
         
     | 
| 
      
 98 
     | 
    
         
            +
                        created_at: Time,
         
     | 
| 
      
 99 
     | 
    
         
            +
                        description: String,
         
     | 
| 
      
 100 
     | 
    
         
            +
                        monitor_status:
         
     | 
| 
      
 101 
     | 
    
         
            +
                          Deeprails::MonitorResponse::MonitorStatus::TaggedSymbol,
         
     | 
| 
      
 102 
     | 
    
         
            +
                        updated_at: Time,
         
     | 
| 
      
 103 
     | 
    
         
            +
                        user_id: String
         
     | 
| 
      
 104 
     | 
    
         
            +
                      }
         
     | 
| 
      
 105 
     | 
    
         
            +
                    )
         
     | 
| 
      
 106 
     | 
    
         
            +
                  end
         
     | 
| 
      
 107 
     | 
    
         
            +
                  def to_hash
         
     | 
| 
      
 108 
     | 
    
         
            +
                  end
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                  # Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
         
     | 
| 
      
 111 
     | 
    
         
            +
                  # longer record and evaluate events.
         
     | 
| 
      
 112 
     | 
    
         
            +
                  module MonitorStatus
         
     | 
| 
      
 113 
     | 
    
         
            +
                    extend Deeprails::Internal::Type::Enum
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
                    TaggedSymbol =
         
     | 
| 
      
 116 
     | 
    
         
            +
                      T.type_alias do
         
     | 
| 
      
 117 
     | 
    
         
            +
                        T.all(Symbol, Deeprails::MonitorResponse::MonitorStatus)
         
     | 
| 
      
 118 
     | 
    
         
            +
                      end
         
     | 
| 
      
 119 
     | 
    
         
            +
                    OrSymbol = T.type_alias { T.any(Symbol, String) }
         
     | 
| 
      
 120 
     | 
    
         
            +
             
     | 
| 
      
 121 
     | 
    
         
            +
                    ACTIVE =
         
     | 
| 
      
 122 
     | 
    
         
            +
                      T.let(
         
     | 
| 
      
 123 
     | 
    
         
            +
                        :active,
         
     | 
| 
      
 124 
     | 
    
         
            +
                        Deeprails::MonitorResponse::MonitorStatus::TaggedSymbol
         
     | 
| 
      
 125 
     | 
    
         
            +
                      )
         
     | 
| 
      
 126 
     | 
    
         
            +
                    INACTIVE =
         
     | 
| 
      
 127 
     | 
    
         
            +
                      T.let(
         
     | 
| 
      
 128 
     | 
    
         
            +
                        :inactive,
         
     | 
| 
      
 129 
     | 
    
         
            +
                        Deeprails::MonitorResponse::MonitorStatus::TaggedSymbol
         
     | 
| 
      
 130 
     | 
    
         
            +
                      )
         
     | 
| 
      
 131 
     | 
    
         
            +
             
     | 
| 
      
 132 
     | 
    
         
            +
                    sig do
         
     | 
| 
      
 133 
     | 
    
         
            +
                      override.returns(
         
     | 
| 
      
 134 
     | 
    
         
            +
                        T::Array[Deeprails::MonitorResponse::MonitorStatus::TaggedSymbol]
         
     | 
| 
      
 135 
     | 
    
         
            +
                      )
         
     | 
| 
      
 136 
     | 
    
         
            +
                    end
         
     | 
| 
      
 137 
     | 
    
         
            +
                    def self.values
         
     | 
| 
      
 138 
     | 
    
         
            +
                    end
         
     | 
| 
      
 139 
     | 
    
         
            +
                  end
         
     | 
| 
      
 140 
     | 
    
         
            +
                end
         
     | 
| 
      
 141 
     | 
    
         
            +
              end
         
     | 
| 
      
 142 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -28,7 +28,7 @@ module Deeprails 
     | 
|
| 
       28 
28 
     | 
    
         
             
                  attr_accessor :guardrail_metrics
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
                  # A dictionary of inputs sent to the LLM to generate output. The dictionary must
         
     | 
| 
       31 
     | 
    
         
            -
                  # contain at least a `user_prompt` or `system_prompt` field. For
         
     | 
| 
      
 31 
     | 
    
         
            +
                  # contain at least a `user_prompt` field or a `system_prompt` field. For
         
     | 
| 
       32 
32 
     | 
    
         
             
                  # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
         
     | 
| 
       33 
33 
     | 
    
         
             
                  sig { returns(Deeprails::MonitorSubmitEventParams::ModelInput) }
         
     | 
| 
       34 
34 
     | 
    
         
             
                  attr_reader :model_input
         
     | 
| 
         @@ -97,7 +97,7 @@ module Deeprails 
     | 
|
| 
       97 
97 
     | 
    
         
             
                    # `ground_truth_adherence`, and/or `comprehensive_safety`.
         
     | 
| 
       98 
98 
     | 
    
         
             
                    guardrail_metrics:,
         
     | 
| 
       99 
99 
     | 
    
         
             
                    # A dictionary of inputs sent to the LLM to generate output. The dictionary must
         
     | 
| 
       100 
     | 
    
         
            -
                    # contain at least a `user_prompt` or `system_prompt` field. For
         
     | 
| 
      
 100 
     | 
    
         
            +
                    # contain at least a `user_prompt` field or a `system_prompt` field. For
         
     | 
| 
       101 
101 
     | 
    
         
             
                    # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
         
     | 
| 
       102 
102 
     | 
    
         
             
                    model_input:,
         
     | 
| 
       103 
103 
     | 
    
         
             
                    # Output generated by the LLM to be evaluated.
         
     | 
| 
         @@ -216,7 +216,7 @@ module Deeprails 
     | 
|
| 
       216 
216 
     | 
    
         
             
                    attr_writer :user_prompt
         
     | 
| 
       217 
217 
     | 
    
         | 
| 
       218 
218 
     | 
    
         
             
                    # A dictionary of inputs sent to the LLM to generate output. The dictionary must
         
     | 
| 
       219 
     | 
    
         
            -
                    # contain at least a `user_prompt` or `system_prompt` field. For
         
     | 
| 
      
 219 
     | 
    
         
            +
                    # contain at least a `user_prompt` field or a `system_prompt` field. For
         
     | 
| 
       220 
220 
     | 
    
         
             
                    # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
         
     | 
| 
       221 
221 
     | 
    
         
             
                    sig do
         
     | 
| 
       222 
222 
     | 
    
         
             
                      params(
         
     | 
    
        data/rbi/deeprails/models.rbi
    CHANGED
    
    | 
         @@ -1,8 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # typed: strong
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module Deeprails
         
     | 
| 
       4 
     | 
    
         
            -
              APIResponse = Deeprails::Models::APIResponse
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
4 
     | 
    
         
             
              DefendCreateWorkflowParams = Deeprails::Models::DefendCreateWorkflowParams
         
     | 
| 
       7 
5 
     | 
    
         | 
| 
       8 
6 
     | 
    
         
             
              DefendResponse = Deeprails::Models::DefendResponse
         
     | 
| 
         @@ -15,13 +13,13 @@ module Deeprails 
     | 
|
| 
       15 
13 
     | 
    
         | 
| 
       16 
14 
     | 
    
         
             
              DefendUpdateWorkflowParams = Deeprails::Models::DefendUpdateWorkflowParams
         
     | 
| 
       17 
15 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
               
     | 
| 
      
 16 
     | 
    
         
            +
              MonitorCreateParams = Deeprails::Models::MonitorCreateParams
         
     | 
| 
       19 
17 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
               
     | 
| 
      
 18 
     | 
    
         
            +
              MonitorDetailResponse = Deeprails::Models::MonitorDetailResponse
         
     | 
| 
       21 
19 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
               
     | 
| 
      
 20 
     | 
    
         
            +
              MonitorEventResponse = Deeprails::Models::MonitorEventResponse
         
     | 
| 
       23 
21 
     | 
    
         | 
| 
       24 
     | 
    
         
            -
               
     | 
| 
      
 22 
     | 
    
         
            +
              MonitorResponse = Deeprails::Models::MonitorResponse
         
     | 
| 
       25 
23 
     | 
    
         | 
| 
       26 
24 
     | 
    
         
             
              MonitorRetrieveParams = Deeprails::Models::MonitorRetrieveParams
         
     | 
| 
       27 
25 
     | 
    
         | 
| 
         @@ -18,7 +18,7 @@ module Deeprails 
     | 
|
| 
       18 
18 
     | 
    
         
             
                        ],
         
     | 
| 
       19 
19 
     | 
    
         
             
                      custom_hallucination_threshold_values: T::Hash[Symbol, Float],
         
     | 
| 
       20 
20 
     | 
    
         
             
                      description: String,
         
     | 
| 
       21 
     | 
    
         
            -
                       
     | 
| 
      
 21 
     | 
    
         
            +
                      max_improvement_attempts: Integer,
         
     | 
| 
       22 
22 
     | 
    
         
             
                      request_options: Deeprails::RequestOptions::OrHash
         
     | 
| 
       23 
23 
     | 
    
         
             
                    ).returns(Deeprails::DefendResponse)
         
     | 
| 
       24 
24 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -50,7 +50,7 @@ module Deeprails 
     | 
|
| 
       50 
50 
     | 
    
         
             
                    description: nil,
         
     | 
| 
       51 
51 
     | 
    
         
             
                    # Max. number of improvement action retries until a given event passes the
         
     | 
| 
       52 
52 
     | 
    
         
             
                    # guardrails. Defaults to 10.
         
     | 
| 
       53 
     | 
    
         
            -
                     
     | 
| 
      
 53 
     | 
    
         
            +
                    max_improvement_attempts: nil,
         
     | 
| 
       54 
54 
     | 
    
         
             
                    request_options: {}
         
     | 
| 
       55 
55 
     | 
    
         
             
                  )
         
     | 
| 
       56 
56 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -103,7 +103,7 @@ module Deeprails 
     | 
|
| 
       103 
103 
     | 
    
         
             
                    # Workflow ID associated with this event.
         
     | 
| 
       104 
104 
     | 
    
         
             
                    workflow_id,
         
     | 
| 
       105 
105 
     | 
    
         
             
                    # A dictionary of inputs sent to the LLM to generate output. The dictionary must
         
     | 
| 
       106 
     | 
    
         
            -
                    # contain at least `user_prompt` or `system_prompt` field. For the
         
     | 
| 
      
 106 
     | 
    
         
            +
                    # contain at least a `user_prompt` field or a `system_prompt` field. For the
         
     | 
| 
       107 
107 
     | 
    
         
             
                    # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
         
     | 
| 
       108 
108 
     | 
    
         
             
                    model_input:,
         
     | 
| 
       109 
109 
     | 
    
         
             
                    # Output generated by the LLM to be evaluated.
         
     | 
| 
         @@ -10,7 +10,7 @@ module Deeprails 
     | 
|
| 
       10 
10 
     | 
    
         
             
                      name: String,
         
     | 
| 
       11 
11 
     | 
    
         
             
                      description: String,
         
     | 
| 
       12 
12 
     | 
    
         
             
                      request_options: Deeprails::RequestOptions::OrHash
         
     | 
| 
       13 
     | 
    
         
            -
                    ).returns(Deeprails:: 
     | 
| 
      
 13 
     | 
    
         
            +
                    ).returns(Deeprails::MonitorResponse)
         
     | 
| 
       14 
14 
     | 
    
         
             
                  end
         
     | 
| 
       15 
15 
     | 
    
         
             
                  def create(
         
     | 
| 
       16 
16 
     | 
    
         
             
                    # Name of the new monitor.
         
     | 
| 
         @@ -28,7 +28,7 @@ module Deeprails 
     | 
|
| 
       28 
28 
     | 
    
         
             
                      monitor_id: String,
         
     | 
| 
       29 
29 
     | 
    
         
             
                      limit: Integer,
         
     | 
| 
       30 
30 
     | 
    
         
             
                      request_options: Deeprails::RequestOptions::OrHash
         
     | 
| 
       31 
     | 
    
         
            -
                    ).returns(Deeprails:: 
     | 
| 
      
 31 
     | 
    
         
            +
                    ).returns(Deeprails::MonitorDetailResponse)
         
     | 
| 
       32 
32 
     | 
    
         
             
                  end
         
     | 
| 
       33 
33 
     | 
    
         
             
                  def retrieve(
         
     | 
| 
       34 
34 
     | 
    
         
             
                    # The ID of the monitor to retrieve.
         
     | 
| 
         @@ -49,7 +49,7 @@ module Deeprails 
     | 
|
| 
       49 
49 
     | 
    
         
             
                        Deeprails::MonitorUpdateParams::MonitorStatus::OrSymbol,
         
     | 
| 
       50 
50 
     | 
    
         
             
                      name: String,
         
     | 
| 
       51 
51 
     | 
    
         
             
                      request_options: Deeprails::RequestOptions::OrHash
         
     | 
| 
       52 
     | 
    
         
            -
                    ).returns(Deeprails:: 
     | 
| 
      
 52 
     | 
    
         
            +
                    ).returns(Deeprails::MonitorResponse)
         
     | 
| 
       53 
53 
     | 
    
         
             
                  end
         
     | 
| 
       54 
54 
     | 
    
         
             
                  def update(
         
     | 
| 
       55 
55 
     | 
    
         
             
                    # The ID of the monitor to edit.
         
     | 
| 
         @@ -80,7 +80,7 @@ module Deeprails 
     | 
|
| 
       80 
80 
     | 
    
         
             
                      nametag: String,
         
     | 
| 
       81 
81 
     | 
    
         
             
                      run_mode: Deeprails::MonitorSubmitEventParams::RunMode::OrSymbol,
         
     | 
| 
       82 
82 
     | 
    
         
             
                      request_options: Deeprails::RequestOptions::OrHash
         
     | 
| 
       83 
     | 
    
         
            -
                    ).returns(Deeprails:: 
     | 
| 
      
 83 
     | 
    
         
            +
                    ).returns(Deeprails::MonitorEventResponse)
         
     | 
| 
       84 
84 
     | 
    
         
             
                  end
         
     | 
| 
       85 
85 
     | 
    
         
             
                  def submit_event(
         
     | 
| 
       86 
86 
     | 
    
         
             
                    # The ID of the monitor associated with this event.
         
     | 
| 
         @@ -91,7 +91,7 @@ module Deeprails 
     | 
|
| 
       91 
91 
     | 
    
         
             
                    # `ground_truth_adherence`, and/or `comprehensive_safety`.
         
     | 
| 
       92 
92 
     | 
    
         
             
                    guardrail_metrics:,
         
     | 
| 
       93 
93 
     | 
    
         
             
                    # A dictionary of inputs sent to the LLM to generate output. The dictionary must
         
     | 
| 
       94 
     | 
    
         
            -
                    # contain at least a `user_prompt` or `system_prompt` field. For
         
     | 
| 
      
 94 
     | 
    
         
            +
                    # contain at least a `user_prompt` field or a `system_prompt` field. For
         
     | 
| 
       95 
95 
     | 
    
         
             
                    # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
         
     | 
| 
       96 
96 
     | 
    
         
             
                    model_input:,
         
     | 
| 
       97 
97 
     | 
    
         
             
                    # Output generated by the LLM to be evaluated.
         
     | 
    
        data/sig/deeprails/client.rbs
    CHANGED
    
    
| 
         @@ -8,7 +8,7 @@ module Deeprails 
     | 
|
| 
       8 
8 
     | 
    
         
             
                    automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
         
     | 
| 
       9 
9 
     | 
    
         
             
                    custom_hallucination_threshold_values: ::Hash[Symbol, Float],
         
     | 
| 
       10 
10 
     | 
    
         
             
                    description: String,
         
     | 
| 
       11 
     | 
    
         
            -
                     
     | 
| 
      
 11 
     | 
    
         
            +
                    max_improvement_attempts: Integer
         
     | 
| 
       12 
12 
     | 
    
         
             
                  }
         
     | 
| 
       13 
13 
     | 
    
         
             
                  & Deeprails::Internal::Type::request_parameters
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
         @@ -38,9 +38,9 @@ module Deeprails 
     | 
|
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                  def description=: (String) -> String
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
                  attr_reader  
     | 
| 
      
 41 
     | 
    
         
            +
                  attr_reader max_improvement_attempts: Integer?
         
     | 
| 
       42 
42 
     | 
    
         | 
| 
       43 
     | 
    
         
            -
                  def  
     | 
| 
      
 43 
     | 
    
         
            +
                  def max_improvement_attempts=: (Integer) -> Integer
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
       45 
45 
     | 
    
         
             
                  def initialize: (
         
     | 
| 
       46 
46 
     | 
    
         
             
                    improvement_action: Deeprails::Models::DefendCreateWorkflowParams::improvement_action,
         
     | 
| 
         @@ -49,7 +49,7 @@ module Deeprails 
     | 
|
| 
       49 
49 
     | 
    
         
             
                    ?automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
         
     | 
| 
       50 
50 
     | 
    
         
             
                    ?custom_hallucination_threshold_values: ::Hash[Symbol, Float],
         
     | 
| 
       51 
51 
     | 
    
         
             
                    ?description: String,
         
     | 
| 
       52 
     | 
    
         
            -
                    ? 
     | 
| 
      
 52 
     | 
    
         
            +
                    ?max_improvement_attempts: Integer,
         
     | 
| 
       53 
53 
     | 
    
         
             
                    ?request_options: Deeprails::request_opts
         
     | 
| 
       54 
54 
     | 
    
         
             
                  ) -> void
         
     | 
| 
       55 
55 
     | 
    
         | 
| 
         @@ -60,7 +60,7 @@ module Deeprails 
     | 
|
| 
       60 
60 
     | 
    
         
             
                    automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
         
     | 
| 
       61 
61 
     | 
    
         
             
                    custom_hallucination_threshold_values: ::Hash[Symbol, Float],
         
     | 
| 
       62 
62 
     | 
    
         
             
                    description: String,
         
     | 
| 
       63 
     | 
    
         
            -
                     
     | 
| 
      
 63 
     | 
    
         
            +
                    max_improvement_attempts: Integer,
         
     | 
| 
       64 
64 
     | 
    
         
             
                    request_options: Deeprails::RequestOptions
         
     | 
| 
       65 
65 
     | 
    
         
             
                  }
         
     | 
| 
       66 
66 
     | 
    
         | 
| 
         @@ -7,7 +7,7 @@ module Deeprails 
     | 
|
| 
       7 
7 
     | 
    
         
             
                    created_at: Time,
         
     | 
| 
       8 
8 
     | 
    
         
             
                    description: String,
         
     | 
| 
       9 
9 
     | 
    
         
             
                    improvement_action: Deeprails::Models::DefendResponse::improvement_action,
         
     | 
| 
       10 
     | 
    
         
            -
                     
     | 
| 
      
 10 
     | 
    
         
            +
                    max_improvement_attempts: Integer,
         
     | 
| 
       11 
11 
     | 
    
         
             
                    modified_at: Time,
         
     | 
| 
       12 
12 
     | 
    
         
             
                    status: Deeprails::Models::DefendResponse::status,
         
     | 
| 
       13 
13 
     | 
    
         
             
                    success_rate: Float
         
     | 
| 
         @@ -32,9 +32,9 @@ module Deeprails 
     | 
|
| 
       32 
32 
     | 
    
         
             
                    Deeprails::Models::DefendResponse::improvement_action
         
     | 
| 
       33 
33 
     | 
    
         
             
                  ) -> Deeprails::Models::DefendResponse::improvement_action
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
                  attr_reader  
     | 
| 
      
 35 
     | 
    
         
            +
                  attr_reader max_improvement_attempts: Integer?
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
                  def  
     | 
| 
      
 37 
     | 
    
         
            +
                  def max_improvement_attempts=: (Integer) -> Integer
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                  attr_reader modified_at: Time?
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
         @@ -56,7 +56,7 @@ module Deeprails 
     | 
|
| 
       56 
56 
     | 
    
         
             
                    ?created_at: Time,
         
     | 
| 
       57 
57 
     | 
    
         
             
                    ?description: String,
         
     | 
| 
       58 
58 
     | 
    
         
             
                    ?improvement_action: Deeprails::Models::DefendResponse::improvement_action,
         
     | 
| 
       59 
     | 
    
         
            -
                    ? 
     | 
| 
      
 59 
     | 
    
         
            +
                    ?max_improvement_attempts: Integer,
         
     | 
| 
       60 
60 
     | 
    
         
             
                    ?modified_at: Time,
         
     | 
| 
       61 
61 
     | 
    
         
             
                    ?status: Deeprails::Models::DefendResponse::status,
         
     | 
| 
       62 
62 
     | 
    
         
             
                    ?success_rate: Float
         
     | 
| 
         @@ -68,7 +68,7 @@ module Deeprails 
     | 
|
| 
       68 
68 
     | 
    
         
             
                    created_at: Time,
         
     | 
| 
       69 
69 
     | 
    
         
             
                    description: String,
         
     | 
| 
       70 
70 
     | 
    
         
             
                    improvement_action: Deeprails::Models::DefendResponse::improvement_action,
         
     | 
| 
       71 
     | 
    
         
            -
                     
     | 
| 
      
 71 
     | 
    
         
            +
                    max_improvement_attempts: Integer,
         
     | 
| 
       72 
72 
     | 
    
         
             
                    modified_at: Time,
         
     | 
| 
       73 
73 
     | 
    
         
             
                    status: Deeprails::Models::DefendResponse::status,
         
     | 
| 
       74 
74 
     | 
    
         
             
                    success_rate: Float
         
     |