Class: Deeprails::Models::DefendCreateWorkflowParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/deeprails/models/defend_create_workflow_params.rb

Overview

Defined Under Namespace

Modules: AutomaticHallucinationToleranceLevel, ImprovementAction, ThresholdType

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(improvement_action:, name:, threshold_type:, automatic_hallucination_tolerance_levels: nil, custom_hallucination_threshold_values: nil, description: nil, file_search: nil, max_improvement_attempts: nil, web_search: nil, request_options: {}) ⇒ Object

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

Parameters:

  • improvement_action (Symbol, Deeprails::Models::DefendCreateWorkflowParams::ImprovementAction)

    The action used to improve outputs that fail one or more guardrail metrics for t

  • name (String)

    Name of the workflow.

  • threshold_type (Symbol, Deeprails::Models::DefendCreateWorkflowParams::ThresholdType)

    Type of thresholds to use for the workflow, either ‘automatic` or `custom`. Aut

  • automatic_hallucination_tolerance_levels (Hash{Symbol=>Symbol, Deeprails::Models::DefendCreateWorkflowParams::AutomaticHallucinationToleranceLevel}) (defaults to: nil)

    Mapping of guardrail metrics to hallucination tolerance levels

  • custom_hallucination_threshold_values (Hash{Symbol=>Float}) (defaults to: nil)

    Mapping of guardrail metrics to floating point threshold values. Possible metric

  • description (String) (defaults to: nil)

    Description for the workflow.

  • file_search (Array<String>) (defaults to: nil)

    An array of file IDs to search in the workflow’s evaluations. Files must be uplo

  • max_improvement_attempts (Integer) (defaults to: nil)

    Max. number of improvement action attempts until a given event passes the guardr

  • web_search (Boolean) (defaults to: nil)

    Whether to enable web search for this workflow’s evaluations. Defaults to false.

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


# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 80


Instance Attribute Details

#automatic_hallucination_tolerance_levelsHash{Symbol=>Symbol, Deeprails::Models::DefendCreateWorkflowParams::AutomaticHallucinationToleranceLevel}?

Mapping of guardrail metrics to hallucination tolerance levels (either ‘low`, `medium`, or `high`). Possible metrics are `completeness`, `instruction_adherence`, `context_adherence`, `ground_truth_adherence`, or `comprehensive_safety`.



43
44
# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 43

optional :automatic_hallucination_tolerance_levels,
-> { Deeprails::Internal::Type::HashOf[enum: Deeprails::DefendCreateWorkflowParams::AutomaticHallucinationToleranceLevel] }

#custom_hallucination_threshold_valuesHash{Symbol=>Float}?

Mapping of guardrail metrics to floating point threshold values. Possible metrics are ‘correctness`, `completeness`, `instruction_adherence`, `context_adherence`, `ground_truth_adherence`, or `comprehensive_safety`.

Returns:

  • (Hash{Symbol=>Float}, nil)


52
# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 52

optional :custom_hallucination_threshold_values, Deeprails::Internal::Type::HashOf[Float]

#descriptionString?

Description for the workflow.

Returns:

  • (String, nil)


58
# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 58

optional :description, String

#file_searchArray<String>?

An array of file IDs to search in the workflow’s evaluations. Files must be uploaded via the DeepRails API first.

Returns:

  • (Array<String>, nil)


65
# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 65

optional :file_search, Deeprails::Internal::Type::ArrayOf[String]

#improvement_actionSymbol, Deeprails::Models::DefendCreateWorkflowParams::ImprovementAction

The action used to improve outputs that fail one or more guardrail metrics for the workflow events. May be ‘regen`, `fixit`, or `do_nothing`. ReGen runs the user’s input prompt with minor induced variance. FixIt attempts to directly address the shortcomings of the output using the guardrail failure rationale. Do Nothing does not attempt any improvement.



18
# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 18

required :improvement_action, enum: -> { Deeprails::DefendCreateWorkflowParams::ImprovementAction }

#max_improvement_attemptsInteger?

Max. number of improvement action attempts until a given event passes the guardrails. Defaults to 10.

Returns:

  • (Integer, nil)


72
# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 72

optional :max_improvement_attempts, Integer

#nameString

Name of the workflow.

Returns:

  • (String)


24
# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 24

required :name, String

#threshold_typeSymbol, Deeprails::Models::DefendCreateWorkflowParams::ThresholdType

Type of thresholds to use for the workflow, either ‘automatic` or `custom`. Automatic thresholds are assigned internally after the user specifies a qualitative tolerance for the metrics, whereas custom metrics allow the user to set the threshold for each metric as a floating point number between 0.0 and 1.0.



34
# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 34

required :threshold_type, enum: -> { Deeprails::DefendCreateWorkflowParams::ThresholdType }

#web_searchBoolean?

Whether to enable web search for this workflow’s evaluations. Defaults to false.

Returns:

  • (Boolean, nil)


78
# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 78

optional :web_search, Deeprails::Internal::Type::Boolean

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/deeprails/models/defend_create_workflow_params.rb', line 116