Class: Deeprails::Models::DefendSubmitEventParams::ModelInput

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/deeprails/models/defend_submit_event_params.rb

Defined Under Namespace

Classes: Context

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(workflow_id:, model_input:, model_output:, model_used:, run_mode:, nametag: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see Deeprails::Models::DefendSubmitEventParams for more details.

Parameters:

  • workflow_id (String)
  • model_input (Deeprails::Models::DefendSubmitEventParams::ModelInput)

    A dictionary of inputs sent to the LLM to generate output. The dictionary must c

  • model_output (String)

    Output generated by the LLM to be evaluated.

  • model_used (String)

    Model ID used to generate the output, like gpt-4o or o3.

  • run_mode (Symbol, Deeprails::Models::DefendSubmitEventParams::RunMode)

    Run mode for the workflow event. The run mode allows the user to optimize for s

  • nametag (String) (defaults to: nil)

    An optional, user-defined tag for the event.

  • request_options (Deeprails::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/deeprails/models/defend_submit_event_params.rb', line 71

class ModelInput < Deeprails::Internal::Type::BaseModel
  # @!attribute user_prompt
  #   The user prompt used to generate the output.
  #
  #   @return [String]
  required :user_prompt, String

  # @!attribute context
  #   Any structured information that directly relates to the model’s input and
  #   expected output—e.g., the recent turn-by-turn history between an AI tutor and a
  #   student, facts or state passed through an agentic workflow, or other
  #   domain-specific signals your system already knows and wants the model to
  #   condition on.
  #
  #   @return [Array<Deeprails::Models::DefendSubmitEventParams::ModelInput::Context>, nil]
  optional :context,
           -> { Deeprails::Internal::Type::ArrayOf[Deeprails::DefendSubmitEventParams::ModelInput::Context] }

  # @!attribute ground_truth
  #   The ground truth for evaluating the Ground Truth Adherence guardrail.
  #
  #   @return [String, nil]
  optional :ground_truth, String

  # @!attribute system_prompt
  #   The system prompt used to generate the output.
  #
  #   @return [String, nil]
  optional :system_prompt, String

  # @!method initialize(user_prompt:, context: nil, ground_truth: nil, system_prompt: nil)
  #   Some parameter documentations has been truncated, see
  #   {Deeprails::Models::DefendSubmitEventParams::ModelInput} for more details.
  #
  #   A dictionary of inputs sent to the LLM to generate output. The dictionary must
  #   contain a `user_prompt` field. For the ground_truth_adherence guardrail metric,
  #   `ground_truth` should be provided.
  #
  #   @param user_prompt [String] The user prompt used to generate the output.
  #
  #   @param context [Array<Deeprails::Models::DefendSubmitEventParams::ModelInput::Context>] Any structured information that directly relates to the model’s input and expect
  #
  #   @param ground_truth [String] The ground truth for evaluating the Ground Truth Adherence guardrail.
  #
  #   @param system_prompt [String] The system prompt used to generate the output.

  class Context < Deeprails::Internal::Type::BaseModel
    # @!attribute content
    #   The content of the message.
    #
    #   @return [String, nil]
    optional :content, String

    # @!attribute role
    #   The role of the speaker.
    #
    #   @return [String, nil]
    optional :role, String

    # @!method initialize(content: nil, role: nil)
    #   @param content [String] The content of the message.
    #
    #   @param role [String] The role of the speaker.
  end
end

Instance Attribute Details

#contextArray<Deeprails::Models::DefendSubmitEventParams::ModelInput::Context>?

Any structured information that directly relates to the model’s input and expected output—e.g., the recent turn-by-turn history between an AI tutor and a student, facts or state passed through an agentic workflow, or other domain-specific signals your system already knows and wants the model to condition on.



86
87
# File 'lib/deeprails/models/defend_submit_event_params.rb', line 86

optional :context,
-> { Deeprails::Internal::Type::ArrayOf[Deeprails::DefendSubmitEventParams::ModelInput::Context] }

#ground_truthString?

The ground truth for evaluating the Ground Truth Adherence guardrail.

Returns:

  • (String, nil)


93
# File 'lib/deeprails/models/defend_submit_event_params.rb', line 93

optional :ground_truth, String

#system_promptString?

The system prompt used to generate the output.

Returns:

  • (String, nil)


99
# File 'lib/deeprails/models/defend_submit_event_params.rb', line 99

optional :system_prompt, String

#user_promptString

The user prompt used to generate the output.

Returns:

  • (String)


76
# File 'lib/deeprails/models/defend_submit_event_params.rb', line 76

required :user_prompt, String