Class: Telnyx::Models::AISearchConversationHistoriesResponse::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/ai_search_conversation_histories_response.rb

Defined Under Namespace

Modules: RecordType, Region

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(id:, chunk_index:, chunk_total:, document_id:, ingested_at:, organization_id:, record_created_at:, record_id:, record_type:, region:, score:, text:, user_id:, metadata: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::AISearchConversationHistoriesResponse::Data for more details.

A single search result representing one chunk of a conversation history record. Records are split into chunks of up to 480 tokens with 64-token overlap at ingestion time.

Parameters:

  • id (String)

    Unique chunk identifier.

  • chunk_index (Integer)

    Zero-based index of this chunk within the parent record.

  • chunk_total (Integer)

    Total number of chunks the parent record was split into.

  • document_id (String, nil)

    Document identifier. Present only for knowledge_base records; null for all other

  • ingested_at (Time)

    When the record was chunked, embedded, and indexed (ISO 8601).

  • organization_id (String)

    Identifier of the organization that owns this record.

  • record_created_at (Time)

    When the original record was created (ISO 8601).

  • record_id (String)

    Identifier of the parent record. Multiple chunks from the same record share this

  • record_type (Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::RecordType)

    Type of the record.

  • region (Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::Region)

    The region where this record is stored.

  • score (Float)

    Cosine similarity score between the query vector and this chunk’s vector. Higher

  • text (String)

    The text content of this chunk (up to 480 tokens).

  • user_id (String)

    Identifier of the user who owns this record.

  • metadata (Hash{Symbol=>Object}) (defaults to: nil)

    Arbitrary metadata attached to the record at ingestion time. Stored as a flat_ob



31
32
33
34
35
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 31

class Data < Telnyx::Internal::Type::BaseModel
  # @!attribute id
  #   Unique chunk identifier.
  #
  #   @return [String]
  required :id, String

  # @!attribute chunk_index
  #   Zero-based index of this chunk within the parent record.
  #
  #   @return [Integer]
  required :chunk_index, Integer

  # @!attribute chunk_total
  #   Total number of chunks the parent record was split into.
  #
  #   @return [Integer]
  required :chunk_total, Integer

  # @!attribute document_id
  #   Document identifier. Present only for knowledge_base records; null for all other
  #   record types.
  #
  #   @return [String, nil]
  required :document_id, String, nil?: true

  # @!attribute ingested_at
  #   When the record was chunked, embedded, and indexed (ISO 8601).
  #
  #   @return [Time]
  required :ingested_at, Time

  # @!attribute organization_id
  #   Identifier of the organization that owns this record.
  #
  #   @return [String]
  required :organization_id, String

  # @!attribute record_created_at
  #   When the original record was created (ISO 8601).
  #
  #   @return [Time]
  required :record_created_at, Time

  # @!attribute record_id
  #   Identifier of the parent record. Multiple chunks from the same record share this
  #   ID.
  #
  #   @return [String]
  required :record_id, String

  # @!attribute record_type
  #   Type of the record.
  #
  #   @return [Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::RecordType]
  required :record_type,
           enum: -> { Telnyx::Models::AISearchConversationHistoriesResponse::Data::RecordType }

  # @!attribute region
  #   The region where this record is stored.
  #
  #   @return [Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::Region]
  required :region, enum: -> { Telnyx::Models::AISearchConversationHistoriesResponse::Data::Region }

  # @!attribute score
  #   Cosine similarity score between the query vector and this chunk's vector. Higher
  #   values indicate greater semantic relevance.
  #
  #   @return [Float]
  required :score, Float

  # @!attribute text
  #   The text content of this chunk (up to 480 tokens).
  #
  #   @return [String]
  required :text, String

  # @!attribute user_id
  #   Identifier of the user who owns this record.
  #
  #   @return [String]
  required :user_id, String

  # @!attribute metadata
  #   Arbitrary metadata attached to the record at ingestion time. Stored as a
  #   flat_object in OpenSearch and filterable via filter[field]=value query
  #   parameters.
  #
  #   @return [Hash{Symbol=>Object}, nil]
  optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

  # @!method initialize(id:, chunk_index:, chunk_total:, document_id:, ingested_at:, organization_id:, record_created_at:, record_id:, record_type:, region:, score:, text:, user_id:, metadata: nil)
  #   Some parameter documentations has been truncated, see
  #   {Telnyx::Models::AISearchConversationHistoriesResponse::Data} for more details.
  #
  #   A single search result representing one chunk of a conversation history record.
  #   Records are split into chunks of up to 480 tokens with 64-token overlap at
  #   ingestion time.
  #
  #   @param id [String] Unique chunk identifier.
  #
  #   @param chunk_index [Integer] Zero-based index of this chunk within the parent record.
  #
  #   @param chunk_total [Integer] Total number of chunks the parent record was split into.
  #
  #   @param document_id [String, nil] Document identifier. Present only for knowledge_base records; null for all other
  #
  #   @param ingested_at [Time] When the record was chunked, embedded, and indexed (ISO 8601).
  #
  #   @param organization_id [String] Identifier of the organization that owns this record.
  #
  #   @param record_created_at [Time] When the original record was created (ISO 8601).
  #
  #   @param record_id [String] Identifier of the parent record. Multiple chunks from the same record share this
  #
  #   @param record_type [Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::RecordType] Type of the record.
  #
  #   @param region [Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::Region] The region where this record is stored.
  #
  #   @param score [Float] Cosine similarity score between the query vector and this chunk's vector. Higher
  #
  #   @param text [String] The text content of this chunk (up to 480 tokens).
  #
  #   @param user_id [String] Identifier of the user who owns this record.
  #
  #   @param metadata [Hash{Symbol=>Object}] Arbitrary metadata attached to the record at ingestion time. Stored as a flat_ob

  # Type of the record.
  #
  # @see Telnyx::Models::AISearchConversationHistoriesResponse::Data#record_type
  module RecordType
    extend Telnyx::Internal::Type::Enum

    VOICE = :voice
    MESSAGE = :message
    AI_PIPELINE_STORAGE = :ai_pipeline_storage
    KNOWLEDGE_BASE = :knowledge_base

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

  # The region where this record is stored.
  #
  # @see Telnyx::Models::AISearchConversationHistoriesResponse::Data#region
  module Region
    extend Telnyx::Internal::Type::Enum

    USA = :USA
    DEU = :DEU
    AUS = :AUS
    UAE = :UAE

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

Instance Attribute Details

#chunk_indexInteger

Zero-based index of this chunk within the parent record.

Returns:

  • (Integer)


42
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 42

required :chunk_index, Integer

#chunk_totalInteger

Total number of chunks the parent record was split into.

Returns:

  • (Integer)


48
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 48

required :chunk_total, Integer

#document_idString?

Document identifier. Present only for knowledge_base records; null for all other record types.

Returns:

  • (String, nil)


55
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 55

required :document_id, String, nil?: true

#idString

Unique chunk identifier.

Returns:

  • (String)


36
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 36

required :id, String

#ingested_atTime

When the record was chunked, embedded, and indexed (ISO 8601).

Returns:

  • (Time)


61
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 61

required :ingested_at, Time

#metadataHash{Symbol=>Object}?

Arbitrary metadata attached to the record at ingestion time. Stored as a flat_object in OpenSearch and filterable via filter=value query parameters.

Returns:

  • (Hash{Symbol=>Object}, nil)


120
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 120

optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

#organization_idString

Identifier of the organization that owns this record.

Returns:

  • (String)


67
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 67

required :organization_id, String

#record_created_atTime

When the original record was created (ISO 8601).

Returns:

  • (Time)


73
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 73

required :record_created_at, Time

#record_idString

Identifier of the parent record. Multiple chunks from the same record share this ID.

Returns:

  • (String)


80
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 80

required :record_id, String

#record_typeSymbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::RecordType

Type of the record.



86
87
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 86

required :record_type,
enum: -> { Telnyx::Models::AISearchConversationHistoriesResponse::Data::RecordType }

#regionSymbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::Region

The region where this record is stored.



93
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 93

required :region, enum: -> { Telnyx::Models::AISearchConversationHistoriesResponse::Data::Region }

#scoreFloat

Cosine similarity score between the query vector and this chunk’s vector. Higher values indicate greater semantic relevance.

Returns:

  • (Float)


100
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 100

required :score, Float

#textString

The text content of this chunk (up to 480 tokens).

Returns:

  • (String)


106
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 106

required :text, String

#user_idString

Identifier of the user who owns this record.

Returns:

  • (String)


112
# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 112

required :user_id, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/telnyx/models/ai_search_conversation_histories_response.rb', line 169