Class: OpenAI::Models::Responses::ResponseFunctionWebSearch::Action::Search::Source

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

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_with_error, 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(queries: nil, query: nil, sources: nil, type: :search) ⇒ Source

Returns a new instance of Source.

Parameters:

  • url —

    The URL of the source.

  • type (defaults to: :search) —

    The type of source. Always url.

  • url: (String)
  • type: (:url) (defaults to: :search)


114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/openai/models/responses/response_function_web_search.rb', line 114

class Source < OpenAI::Internal::Type::BaseModel
  # @!attribute type
  #   The type of source. Always `url`.
  #
  #   @return [Symbol, :url]
  required :type, const: :url

  # @!attribute url
  #   The URL of the source.
  #
  #   @return [String]
  required :url, String

  # @!method initialize(url:, type: :url)
  #   A source used in the search.
  #
  #   @param url [String]
  #     The URL of the source.
  #
  #   @param type [Symbol, :url]
  #     The type of source. Always `url`.
end

Instance Attribute Details

#type ⇒ :url

The type of source. Always url.

Returns:

  • (:url)


119
# File 'lib/openai/models/responses/response_function_web_search.rb', line 119

required :type, const: :url

#url ⇒ String

The URL of the source.

Returns:

  • (String)


125
# File 'lib/openai/models/responses/response_function_web_search.rb', line 125

required :url, String

Instance Method Details

#to_hash ⇒ { ?type: :url, url: String }

Returns:

  • ({ ?type: :url, url: String })


126
# File 'sig/openai/models/responses/response_function_web_search.rbs', line 126

def to_hash: -> { ?type: :url, url: String }