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

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

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(user_prompt:, context: nil, ground_truth: nil, system_prompt: nil) ⇒ Object

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.

Parameters:

  • user_prompt (String)

    The user prompt used to generate the output.

  • context (Array<Deeprails::Models::DefendSubmitEventParams::ModelInput::Context>) (defaults to: nil)

    Any structured information that directly relates to the model’s input and expect

  • ground_truth (String) (defaults to: nil)

    The ground truth for evaluating the Ground Truth Adherence guardrail.

  • system_prompt (String) (defaults to: nil)

    The system prompt used to generate the output.



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/deeprails/models/defend_submit_event_params.rb', line 117

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

Instance Attribute Details

#contentString?

The content of the message.

Returns:

  • (String, nil)


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

optional :content, String

#roleString?

The role of the speaker.

Returns:

  • (String, nil)


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

optional :role, String