Class: ContextDev::Models::AIAIQueryParams::DataToExtract

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

Defined Under Namespace

Modules: DatapointListType, DatapointObjectSchema, DatapointType

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(datapoint_description:, datapoint_example:, datapoint_name:, datapoint_type:, datapoint_list_type: nil, datapoint_object_schema: nil) ⇒ Object

Some parameter documentations has been truncated, see ContextDev::Models::AIAIQueryParams::DataToExtract for more details.

Parameters:



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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/context_dev/models/ai_ai_query_params.rb', line 51

class DataToExtract < ContextDev::Internal::Type::BaseModel
  # @!attribute datapoint_description
  #   Description of what to extract
  #
  #   @return [String]
  required :datapoint_description, String

  # @!attribute datapoint_example
  #   Example of the expected value
  #
  #   @return [String]
  required :datapoint_example, String

  # @!attribute datapoint_name
  #   Name of the data point to extract
  #
  #   @return [String]
  required :datapoint_name, String

  # @!attribute datapoint_type
  #   Type of the data point
  #
  #   @return [Symbol, ContextDev::Models::AIAIQueryParams::DataToExtract::DatapointType]
  required :datapoint_type, enum: -> { ContextDev::AIAIQueryParams::DataToExtract::DatapointType }

  # @!attribute datapoint_list_type
  #   Type of items in the list when datapoint_type is 'list'. Defaults to 'string'.
  #   Use 'object' to extract an array of objects matching a schema.
  #
  #   @return [Symbol, ContextDev::Models::AIAIQueryParams::DataToExtract::DatapointListType, nil]
  optional :datapoint_list_type, enum: -> { ContextDev::AIAIQueryParams::DataToExtract::DatapointListType }

  # @!attribute datapoint_object_schema
  #   Schema definition for objects when datapoint_list_type is 'object'. Provide a
  #   map of field names to their scalar types.
  #
  #   @return [Hash{Symbol=>Symbol, ContextDev::Models::AIAIQueryParams::DataToExtract::DatapointObjectSchema}, nil]
  optional :datapoint_object_schema,
           -> { ContextDev::Internal::Type::HashOf[enum: ContextDev::AIAIQueryParams::DataToExtract::DatapointObjectSchema] }

  # @!method initialize(datapoint_description:, datapoint_example:, datapoint_name:, datapoint_type:, datapoint_list_type: nil, datapoint_object_schema: nil)
  #   Some parameter documentations has been truncated, see
  #   {ContextDev::Models::AIAIQueryParams::DataToExtract} for more details.
  #
  #   @param datapoint_description [String] Description of what to extract
  #
  #   @param datapoint_example [String] Example of the expected value
  #
  #   @param datapoint_name [String] Name of the data point to extract
  #
  #   @param datapoint_type [Symbol, ContextDev::Models::AIAIQueryParams::DataToExtract::DatapointType] Type of the data point
  #
  #   @param datapoint_list_type [Symbol, ContextDev::Models::AIAIQueryParams::DataToExtract::DatapointListType] Type of items in the list when datapoint_type is 'list'. Defaults to 'string'. U
  #
  #   @param datapoint_object_schema [Hash{Symbol=>Symbol, ContextDev::Models::AIAIQueryParams::DataToExtract::DatapointObjectSchema}] Schema definition for objects when datapoint_list_type is 'object'. Provide a ma

  # Type of the data point
  #
  # @see ContextDev::Models::AIAIQueryParams::DataToExtract#datapoint_type
  module DatapointType
    extend ContextDev::Internal::Type::Enum

    TEXT = :text
    NUMBER = :number
    DATE = :date
    BOOLEAN = :boolean
    LIST = :list
    URL = :url

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

  # Type of items in the list when datapoint_type is 'list'. Defaults to 'string'.
  # Use 'object' to extract an array of objects matching a schema.
  #
  # @see ContextDev::Models::AIAIQueryParams::DataToExtract#datapoint_list_type
  module DatapointListType
    extend ContextDev::Internal::Type::Enum

    STRING = :string
    TEXT = :text
    NUMBER = :number
    DATE = :date
    BOOLEAN = :boolean
    LIST = :list
    URL = :url
    OBJECT = :object

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

  module DatapointObjectSchema
    extend ContextDev::Internal::Type::Enum

    STRING = :string
    NUMBER = :number
    DATE = :date
    BOOLEAN = :boolean

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

Instance Attribute Details

#datapoint_descriptionString

Description of what to extract

Returns:

  • (String)


56
# File 'lib/context_dev/models/ai_ai_query_params.rb', line 56

required :datapoint_description, String

#datapoint_exampleString

Example of the expected value

Returns:

  • (String)


62
# File 'lib/context_dev/models/ai_ai_query_params.rb', line 62

required :datapoint_example, String

#datapoint_list_typeSymbol, ...

Type of items in the list when datapoint_type is ‘list’. Defaults to ‘string’. Use ‘object’ to extract an array of objects matching a schema.



81
# File 'lib/context_dev/models/ai_ai_query_params.rb', line 81

optional :datapoint_list_type, enum: -> { ContextDev::AIAIQueryParams::DataToExtract::DatapointListType }

#datapoint_nameString

Name of the data point to extract

Returns:

  • (String)


68
# File 'lib/context_dev/models/ai_ai_query_params.rb', line 68

required :datapoint_name, String

#datapoint_object_schemaHash{Symbol=>Symbol, ContextDev::Models::AIAIQueryParams::DataToExtract::DatapointObjectSchema}?

Schema definition for objects when datapoint_list_type is ‘object’. Provide a map of field names to their scalar types.



88
89
# File 'lib/context_dev/models/ai_ai_query_params.rb', line 88

optional :datapoint_object_schema,
-> { ContextDev::Internal::Type::HashOf[enum: ContextDev::AIAIQueryParams::DataToExtract::DatapointObjectSchema] }

#datapoint_typeSymbol, ContextDev::Models::AIAIQueryParams::DataToExtract::DatapointType

Type of the data point



74
# File 'lib/context_dev/models/ai_ai_query_params.rb', line 74

required :datapoint_type, enum: -> { ContextDev::AIAIQueryParams::DataToExtract::DatapointType }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/context_dev/models/ai_ai_query_params.rb', line 120