Class: OpenAI::Models::Beta::BetaFileSearchTool::RankingOptions

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/beta_file_search_tool.rb,
sig/openai/models/beta/beta_file_search_tool.rbs

Overview

See Also:

  • OpenAI::Models::Beta::BetaFileSearchTool#ranking_options

Defined Under Namespace

Modules: Ranker Classes: HybridSearch

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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(embedding_weight:, text_weight:) ⇒ RankingOptions

Returns a new instance of RankingOptions.

Parameters:

  • hybrid_search —

    Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

  • ranker —

    The ranker to use for the file search.

  • score_threshold —

    The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

  • hybrid_search: (OpenAI::Beta::BetaFileSearchTool::RankingOptions::HybridSearch)
  • ranker: (OpenAI::Models::Beta::BetaFileSearchTool::RankingOptions::ranker)
  • score_threshold: (Float)


# File 'lib/openai/models/beta/beta_file_search_tool.rb', line 415

Instance Attribute Details

#hybrid_search ⇒ OpenAI::Beta::BetaFileSearchTool::RankingOptions::HybridSearch?

Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

Returns:

  • (OpenAI::Beta::BetaFileSearchTool::RankingOptions::HybridSearch, nil)


399
# File 'lib/openai/models/beta/beta_file_search_tool.rb', line 399

optional :hybrid_search, -> { OpenAI::Beta::BetaFileSearchTool::RankingOptions::HybridSearch }

#ranker ⇒ OpenAI::Models::Beta::BetaFileSearchTool::RankingOptions::ranker?

The ranker to use for the file search.

Returns:

  • (OpenAI::Models::Beta::BetaFileSearchTool::RankingOptions::ranker, nil)


405
# File 'lib/openai/models/beta/beta_file_search_tool.rb', line 405

optional :ranker, enum: -> { OpenAI::Beta::BetaFileSearchTool::RankingOptions::Ranker }

#score_threshold ⇒ Float?

The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

Returns:

  • (Float, nil)


413
# File 'lib/openai/models/beta/beta_file_search_tool.rb', line 413

optional :score_threshold, Float

Instance Method Details

#to_hash ⇒ { ?hybrid_search: OpenAI::Beta::BetaFileSearchTool::RankingOptions::HybridSearch, ?ranker: OpenAI::Models::Beta::BetaFileSearchTool::RankingOptions::ranker, ?score_threshold: Float }

Returns:

  • ({ ?hybrid_search: OpenAI::Beta::BetaFileSearchTool::RankingOptions::HybridSearch, ?ranker: OpenAI::Models::Beta::BetaFileSearchTool::RankingOptions::ranker, ?score_threshold: Float })


374
375
376
377
378
# File 'sig/openai/models/beta/beta_file_search_tool.rbs', line 374

def to_hash: -> {
  ?hybrid_search: OpenAI::Beta::BetaFileSearchTool::RankingOptions::HybridSearch,
  ?ranker: OpenAI::Models::Beta::BetaFileSearchTool::RankingOptions::ranker,
  ?score_threshold: Float
}