Class: OpenAI::Models::Beta::BetaWebSearchPreviewTool::UserLocation

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

Overview

See Also:

  • OpenAI::Models::Beta::BetaWebSearchPreviewTool#user_location

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 ⇒ UserLocation

Returns a new instance of UserLocation.

Parameters:

  • city —

    Free text input for the city of the user, e.g. San Francisco.

  • country —

    The two-letter ISO country code of the user, e.g. US.

  • region —

    Free text input for the region of the user, e.g. California.

  • timezone —

    The IANA timezone of the user, e.g. America/Los_Angeles.

  • type —

    The type of location approximation. Always approximate.

  • city: (String, nil)
  • country: (String, nil)
  • region: (String, nil)
  • timezone: (String, nil)
  • type: (:approximate)


137
138
139
140
141
142
143
# File 'sig/openai/models/beta/beta_web_search_preview_tool.rbs', line 137

def initialize: (
  ?city: String?,
  ?country: String?,
  ?region: String?,
  ?timezone: String?,
  ?type: :approximate
) -> void

Instance Attribute Details

#city ⇒ String?

Free text input for the city of the user, e.g. San Francisco.

Returns:

  • (String, nil)


108
# File 'lib/openai/models/beta/beta_web_search_preview_tool.rb', line 108

optional :city, String, nil?: true

#country ⇒ String?

The two-letter ISO country code of the user, e.g. US.

Returns:

  • (String, nil)


115
# File 'lib/openai/models/beta/beta_web_search_preview_tool.rb', line 115

optional :country, String, nil?: true

#region ⇒ String?

Free text input for the region of the user, e.g. California.

Returns:

  • (String, nil)


121
# File 'lib/openai/models/beta/beta_web_search_preview_tool.rb', line 121

optional :region, String, nil?: true

#timezone ⇒ String?

The IANA timezone of the user, e.g. America/Los_Angeles.

Returns:

  • (String, nil)


128
# File 'lib/openai/models/beta/beta_web_search_preview_tool.rb', line 128

optional :timezone, String, nil?: true

#type ⇒ :approximate

The type of location approximation. Always approximate.

Returns:

  • (:approximate)


102
# File 'lib/openai/models/beta/beta_web_search_preview_tool.rb', line 102

required :type, const: :approximate

Instance Method Details

#to_hash ⇒ { ?type: :approximate, ?city: String?, ?country: String?, ?region: String?, ?timezone: String? }

Returns:

  • ({ ?type: :approximate, ?city: String?, ?country: String?, ?region: String?, ?timezone: String? })


145
146
147
148
149
150
151
# File 'sig/openai/models/beta/beta_web_search_preview_tool.rbs', line 145

def to_hash: -> {
  ?type: :approximate,
  ?city: String?,
  ?country: String?,
  ?region: String?,
  ?timezone: String?
}