Class: OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions

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

Defined Under Namespace

Modules: SearchContextSize Classes: UserLocation

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

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(search_context_size: nil, user_location: nil) ⇒ WebSearchOptions

Returns a new instance of WebSearchOptions.

Parameters:

  • search_context_size (defaults to: nil) —

    High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.

  • user_location (defaults to: nil) —

    Approximate location parameters for the search.

  • search_context_size: (OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::search_context_size) (defaults to: nil)
  • user_location: (OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation, nil) (defaults to: nil)


# File 'lib/openai/models/chat/completion_create_params.rb', line 1185

Instance Attribute Details

#search_context_size ⇒ OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::search_context_size?

High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.

Returns:

  • (OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::search_context_size, nil)


1170
1171
1172
1173
# File 'lib/openai/models/chat/completion_create_params.rb', line 1170

optional(
  :search_context_size,
  enum: -> { OpenAI::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize }
)

#user_location ⇒ OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation?

Approximate location parameters for the search.

Returns:

  • (OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation, nil)


1179
1180
1181
1182
1183
# File 'lib/openai/models/chat/completion_create_params.rb', line 1179

optional(
  :user_location,
  -> { OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation },
  nil?: true
)

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/chat/completion_create_params.rb', line 1208

Instance Method Details

#to_hash ⇒ { ?search_context_size: OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::search_context_size, ?user_location: OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation? }

Returns:

  • ({ ?search_context_size: OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::search_context_size, ?user_location: OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation? })


1146
1147
1148
1149
# File 'sig/openai/models/chat/completion_create_params.rbs', line 1146

def to_hash: -> {
  ?search_context_size: OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::search_context_size,
  ?user_location: OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation?
}