Class: ContextDev::Models::WebSearchResponse::Result

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/context_dev/models/web_search_response.rb

Defined Under Namespace

Modules: Relevance Classes: Markdown

Instance Attribute Summary collapse

Class Method 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(description:, markdown:, relevance:, title:, url:) ⇒ Object

Parameters:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/context_dev/models/web_search_response.rb', line 36

class Result < ContextDev::Internal::Type::BaseModel
  # @!attribute description
  #   Snippet excerpt from the page.
  #
  #   @return [String]
  required :description, String

  # @!attribute markdown
  #   Markdown scrape status and content for this result.
  #
  #   @return [ContextDev::Models::WebSearchResponse::Result::Markdown]
  required :markdown, -> { ContextDev::Models::WebSearchResponse::Result::Markdown }

  # @!attribute relevance
  #   Relevance to the original query.
  #
  #   @return [Symbol, ContextDev::Models::WebSearchResponse::Result::Relevance]
  required :relevance, enum: -> { ContextDev::Models::WebSearchResponse::Result::Relevance }

  # @!attribute title
  #   Page title.
  #
  #   @return [String]
  required :title, String

  # @!attribute url
  #   Canonical result URL.
  #
  #   @return [String]
  required :url, String

  # @!method initialize(description:, markdown:, relevance:, title:, url:)
  #   @param description [String] Snippet excerpt from the page.
  #
  #   @param markdown [ContextDev::Models::WebSearchResponse::Result::Markdown] Markdown scrape status and content for this result.
  #
  #   @param relevance [Symbol, ContextDev::Models::WebSearchResponse::Result::Relevance] Relevance to the original query.
  #
  #   @param title [String] Page title.
  #
  #   @param url [String] Canonical result URL.

  # @see ContextDev::Models::WebSearchResponse::Result#markdown
  class Markdown < ContextDev::Internal::Type::BaseModel
    # @!attribute code
    #   Per-result scrape outcome. Inspect this before reading `markdown`.
    #
    #   @return [Symbol, ContextDev::Models::WebSearchResponse::Result::Markdown::Code]
    required :code, enum: -> { ContextDev::Models::WebSearchResponse::Result::Markdown::Code }

    # @!attribute markdown
    #   GFM Markdown of the page. Null unless markdownOptions.enabled is true and
    #   scraping succeeded.
    #
    #   @return [String, nil]
    required :markdown, String, nil?: true

    # @!method initialize(code:, markdown:)
    #   Some parameter documentations has been truncated, see
    #   {ContextDev::Models::WebSearchResponse::Result::Markdown} for more details.
    #
    #   Markdown scrape status and content for this result.
    #
    #   @param code [Symbol, ContextDev::Models::WebSearchResponse::Result::Markdown::Code] Per-result scrape outcome. Inspect this before reading `markdown`.
    #
    #   @param markdown [String, nil] GFM Markdown of the page. Null unless markdownOptions.enabled is true and scrapi

    # Per-result scrape outcome. Inspect this before reading `markdown`.
    #
    # @see ContextDev::Models::WebSearchResponse::Result::Markdown#code
    module Code
      extend ContextDev::Internal::Type::Enum

      SUCCESS = :SUCCESS
      NOT_REQUESTED = :NOT_REQUESTED
      TIMEOUT = :TIMEOUT
      WEBSITE_ACCESS_ERROR = :WEBSITE_ACCESS_ERROR
      ERROR = :ERROR

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end

  # Relevance to the original query.
  #
  # @see ContextDev::Models::WebSearchResponse::Result#relevance
  module Relevance
    extend ContextDev::Internal::Type::Enum

    HIGH = :high
    MEDIUM = :medium
    LOW = :low

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#descriptionString

Snippet excerpt from the page.

Returns:

  • (String)


41
# File 'lib/context_dev/models/web_search_response.rb', line 41

required :description, String

#markdownContextDev::Models::WebSearchResponse::Result::Markdown

Markdown scrape status and content for this result.



47
# File 'lib/context_dev/models/web_search_response.rb', line 47

required :markdown, -> { ContextDev::Models::WebSearchResponse::Result::Markdown }

#relevanceSymbol, ContextDev::Models::WebSearchResponse::Result::Relevance

Relevance to the original query.



53
# File 'lib/context_dev/models/web_search_response.rb', line 53

required :relevance, enum: -> { ContextDev::Models::WebSearchResponse::Result::Relevance }

#titleString

Page title.

Returns:

  • (String)


59
# File 'lib/context_dev/models/web_search_response.rb', line 59

required :title, String

#urlString

Canonical result URL.

Returns:

  • (String)


65
# File 'lib/context_dev/models/web_search_response.rb', line 65

required :url, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/context_dev/models/web_search_response.rb', line 115