Class: Turbopuffer::Models::HighlightConfigParams

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/turbopuffer/models/highlight_config_params.rb,
sig/turbopuffer/models/highlight_config_params.rbs

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(fragment_by: nil, fragment_limit: nil, include_offsets: nil, rank_fragments_by: nil) ⇒ Object

Some parameter documentations has been truncated, see Turbopuffer::Models::HighlightConfigParams for more details.

Additional (optional) parameters for the Highlight compute expression.

Parameters:

  • fragment_by (Symbol, Turbopuffer::Models::HighlightFragmentBy) (defaults to: nil)

    How to split a text attribute into fragments for highlighting.

  • fragment_limit (Integer) (defaults to: nil)

    The maximum number of fragments to return. Defaults to 3.

  • include_offsets (Symbol, Turbopuffer::Models::HighlightOffsetUnits) (defaults to: nil)

    The units to report highlighted fragment offsets in.

  • rank_fragments_by (Object) (defaults to: nil)

    How to rank candidate fragments within the attribute before selecting the top `f



# File 'lib/turbopuffer/models/highlight_config_params.rb', line 31

Instance Attribute Details

#fragment_bySymbol, ...

How to split a text attribute into fragments for highlighting.



10
# File 'lib/turbopuffer/models/highlight_config_params.rb', line 10

optional :fragment_by, enum: -> { Turbopuffer::HighlightFragmentBy }

#fragment_limitInteger?

The maximum number of fragments to return. Defaults to 3.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


16
# File 'lib/turbopuffer/models/highlight_config_params.rb', line 16

optional :fragment_limit, Integer

#include_offsetsSymbol, ...

The units to report highlighted fragment offsets in.



22
# File 'lib/turbopuffer/models/highlight_config_params.rb', line 22

optional :include_offsets, enum: -> { Turbopuffer::HighlightOffsetUnits }

#rank_fragments_byObject?

How to rank candidate fragments within the attribute before selecting the top fragment_limit. Defaults to the query's rank_by.

Parameters:

  • (top)

Returns:

  • (Object, nil)


29
# File 'lib/turbopuffer/models/highlight_config_params.rb', line 29

optional :rank_fragments_by, Turbopuffer::Internal::Type::Unknown

Instance Method Details

#to_hash{

Returns:

  • ({)


39
# File 'sig/turbopuffer/models/highlight_config_params.rbs', line 39

def to_hash: -> {