telnyx 5.130.1 → 5.131.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,6 +51,9 @@ module Telnyx
51
51
 
52
52
  AIRetrieveModelsParams = Telnyx::Models::AIRetrieveModelsParams
53
53
 
54
+ AISearchConversationHistoriesParams =
55
+ Telnyx::Models::AISearchConversationHistoriesParams
56
+
54
57
  AISummarizeParams = Telnyx::Models::AISummarizeParams
55
58
 
56
59
  AlphanumericSenderID = Telnyx::Models::AlphanumericSenderID
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Telnyx
4
4
  module Resources
5
- # Generate text with LLMs
6
5
  class AI
7
6
  # Configure AI assistant specifications
8
7
  sig { returns(Telnyx::Resources::AI::Assistants) }
@@ -78,6 +77,123 @@ module Telnyx
78
77
  def retrieve_models(request_options: {})
79
78
  end
80
79
 
80
+ # Performs semantic vector search across conversation history records.
81
+ #
82
+ # **How it works:**
83
+ #
84
+ # 1. The query text is embedded into a 1024-dimensional vector using the
85
+ # multilingual-e5-large model.
86
+ # 2. The vector is sent to regional OpenSearch clusters for kNN search using HNSW
87
+ # cosine similarity.
88
+ # 3. When no region is specified, all regions are queried in parallel (fan-out)
89
+ # and results are merged by score.
90
+ # 4. Results are ranked by cosine similarity score (descending) and truncated to
91
+ # `top_k`.
92
+ #
93
+ # **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
94
+ # Results are automatically scoped to the caller's organization —
95
+ # `organization_id` is injected from the auth token and cannot be overridden.
96
+ #
97
+ # **Chunking:** Records are split into chunks of up to 480 tokens with 64-token
98
+ # overlap at ingestion time. Each search result represents a single chunk, with
99
+ # `chunk_index` and `chunk_total` indicating its position within the original
100
+ # record.
101
+ #
102
+ # **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
103
+ # results before vector search.
104
+ #
105
+ # Top-level filterable fields: `user_id`, `record_type`, `region`, `document_id`,
106
+ # `record_id`, `record_created_at`, `ingested_at`, `retention`
107
+ #
108
+ # Note: `retention` is filter-only — it can be used to narrow results but is not
109
+ # returned in the response body.
110
+ #
111
+ # Metadata fields: any field not in the list above is resolved to
112
+ # `data.metadata.<field>` in OpenSearch (e.g., `filter[language]=en` →
113
+ # `data.metadata.language`).
114
+ #
115
+ # Supported filter operators:
116
+ #
117
+ # - `eq` — exact match (default when no operator specified)
118
+ # - `in` — match any of comma-separated values
119
+ # - `gte`, `gt`, `lte`, `lt` — range comparisons (useful for date filtering)
120
+ # - `contains` — wildcard substring match
121
+ #
122
+ # **Examples:**
123
+ #
124
+ # ```
125
+ # GET /v2/ai/conversation_histories?q=billing+issue&record_type=voice&top_k=10
126
+ # GET /v2/ai/conversation_histories?q=setup+guide&record_type=knowledge_base&region=USA&min_score=0.5
127
+ # GET /v2/ai/conversation_histories?q=refund&record_type=voice&filter[record_created_at][gte]=2026-01-01T00:00:00Z
128
+ # GET /v2/ai/conversation_histories?q=outage&record_type=voice&filter[region][in]=USA,DEU
129
+ # GET /v2/ai/conversation_histories?q=hold+time&record_type=voice&filter[language]=en
130
+ # ```
131
+ sig do
132
+ params(
133
+ q: String,
134
+ record_type:
135
+ Telnyx::AISearchConversationHistoriesParams::RecordType::OrSymbol,
136
+ filter_document_id: String,
137
+ filter_ingested_at_gte: Time,
138
+ filter_ingested_at_lte: Time,
139
+ filter_record_created_at_gte: Time,
140
+ filter_record_created_at_lte: Time,
141
+ filter_record_id: String,
142
+ filter_region_in: String,
143
+ filter_retention: String,
144
+ filter_user_id: String,
145
+ min_score: Float,
146
+ region: Telnyx::AISearchConversationHistoriesParams::Region::OrSymbol,
147
+ top_k: Integer,
148
+ request_options: Telnyx::RequestOptions::OrHash
149
+ ).returns(Telnyx::Models::AISearchConversationHistoriesResponse)
150
+ end
151
+ def search_conversation_histories(
152
+ # Natural language search query. The text is embedded into a 1024-dimensional
153
+ # vector and compared against indexed record chunks using kNN cosine similarity.
154
+ q:,
155
+ # The type of records to search. Each record type is stored in a separate vector
156
+ # index.
157
+ record_type:,
158
+ # Filter by document identifier (exact match). Populated for knowledge_base
159
+ # records.
160
+ filter_document_id: nil,
161
+ # Only include records ingested (chunked, embedded, and indexed) on or after this
162
+ # ISO 8601 timestamp.
163
+ filter_ingested_at_gte: nil,
164
+ # Only include records ingested (chunked, embedded, and indexed) on or before this
165
+ # ISO 8601 timestamp.
166
+ filter_ingested_at_lte: nil,
167
+ # Only include records whose original creation time is on or after this ISO 8601
168
+ # timestamp.
169
+ filter_record_created_at_gte: nil,
170
+ # Only include records whose original creation time is on or before this ISO 8601
171
+ # timestamp.
172
+ filter_record_created_at_lte: nil,
173
+ # Filter to chunks belonging to a specific parent record (exact match).
174
+ filter_record_id: nil,
175
+ # Filter by the region stored on the record. Comma-separated to match multiple
176
+ # regions (USA, DEU, AUS, UAE). Distinct from the `region` parameter, which
177
+ # selects which cluster(s) are queried.
178
+ filter_region_in: nil,
179
+ # Filter by retention policy (exact match). Filter-only: not returned in the
180
+ # response body.
181
+ filter_retention: nil,
182
+ # Filter to records owned by a specific user (exact match).
183
+ filter_user_id: nil,
184
+ # Minimum cosine similarity score threshold (0.0 to 1.0). Results below this
185
+ # threshold are excluded.
186
+ min_score: nil,
187
+ # Restrict search to a specific region's OpenSearch cluster. When omitted, all
188
+ # regions are queried in parallel (fan-out) and results are merged by cosine
189
+ # similarity score.
190
+ region: nil,
191
+ # Maximum number of results to return. Defaults to 20, maximum 100.
192
+ top_k: nil,
193
+ request_options: {}
194
+ )
195
+ end
196
+
81
197
  # Generate a summary of a file's contents.
82
198
  #
83
199
  # Supports the following text formats:
@@ -0,0 +1,144 @@
1
+ module Telnyx
2
+ module Models
3
+ type ai_search_conversation_histories_params =
4
+ {
5
+ q: String,
6
+ record_type: Telnyx::Models::AISearchConversationHistoriesParams::record_type,
7
+ filter_document_id: String,
8
+ filter_ingested_at_gte: Time,
9
+ filter_ingested_at_lte: Time,
10
+ filter_record_created_at_gte: Time,
11
+ filter_record_created_at_lte: Time,
12
+ filter_record_id: String,
13
+ filter_region_in: String,
14
+ filter_retention: String,
15
+ filter_user_id: String,
16
+ min_score: Float,
17
+ region: Telnyx::Models::AISearchConversationHistoriesParams::region,
18
+ top_k: Integer
19
+ }
20
+ & Telnyx::Internal::Type::request_parameters
21
+
22
+ class AISearchConversationHistoriesParams < Telnyx::Internal::Type::BaseModel
23
+ extend Telnyx::Internal::Type::RequestParameters::Converter
24
+ include Telnyx::Internal::Type::RequestParameters
25
+
26
+ attr_accessor q: String
27
+
28
+ attr_accessor record_type: Telnyx::Models::AISearchConversationHistoriesParams::record_type
29
+
30
+ attr_reader filter_document_id: String?
31
+
32
+ def filter_document_id=: (String) -> String
33
+
34
+ attr_reader filter_ingested_at_gte: Time?
35
+
36
+ def filter_ingested_at_gte=: (Time) -> Time
37
+
38
+ attr_reader filter_ingested_at_lte: Time?
39
+
40
+ def filter_ingested_at_lte=: (Time) -> Time
41
+
42
+ attr_reader filter_record_created_at_gte: Time?
43
+
44
+ def filter_record_created_at_gte=: (Time) -> Time
45
+
46
+ attr_reader filter_record_created_at_lte: Time?
47
+
48
+ def filter_record_created_at_lte=: (Time) -> Time
49
+
50
+ attr_reader filter_record_id: String?
51
+
52
+ def filter_record_id=: (String) -> String
53
+
54
+ attr_reader filter_region_in: String?
55
+
56
+ def filter_region_in=: (String) -> String
57
+
58
+ attr_reader filter_retention: String?
59
+
60
+ def filter_retention=: (String) -> String
61
+
62
+ attr_reader filter_user_id: String?
63
+
64
+ def filter_user_id=: (String) -> String
65
+
66
+ attr_reader min_score: Float?
67
+
68
+ def min_score=: (Float) -> Float
69
+
70
+ attr_reader region: Telnyx::Models::AISearchConversationHistoriesParams::region?
71
+
72
+ def region=: (
73
+ Telnyx::Models::AISearchConversationHistoriesParams::region
74
+ ) -> Telnyx::Models::AISearchConversationHistoriesParams::region
75
+
76
+ attr_reader top_k: Integer?
77
+
78
+ def top_k=: (Integer) -> Integer
79
+
80
+ def initialize: (
81
+ q: String,
82
+ record_type: Telnyx::Models::AISearchConversationHistoriesParams::record_type,
83
+ ?filter_document_id: String,
84
+ ?filter_ingested_at_gte: Time,
85
+ ?filter_ingested_at_lte: Time,
86
+ ?filter_record_created_at_gte: Time,
87
+ ?filter_record_created_at_lte: Time,
88
+ ?filter_record_id: String,
89
+ ?filter_region_in: String,
90
+ ?filter_retention: String,
91
+ ?filter_user_id: String,
92
+ ?min_score: Float,
93
+ ?region: Telnyx::Models::AISearchConversationHistoriesParams::region,
94
+ ?top_k: Integer,
95
+ ?request_options: Telnyx::request_opts
96
+ ) -> void
97
+
98
+ def to_hash: -> {
99
+ q: String,
100
+ record_type: Telnyx::Models::AISearchConversationHistoriesParams::record_type,
101
+ filter_document_id: String,
102
+ filter_ingested_at_gte: Time,
103
+ filter_ingested_at_lte: Time,
104
+ filter_record_created_at_gte: Time,
105
+ filter_record_created_at_lte: Time,
106
+ filter_record_id: String,
107
+ filter_region_in: String,
108
+ filter_retention: String,
109
+ filter_user_id: String,
110
+ min_score: Float,
111
+ region: Telnyx::Models::AISearchConversationHistoriesParams::region,
112
+ top_k: Integer,
113
+ request_options: Telnyx::RequestOptions
114
+ }
115
+
116
+ type record_type =
117
+ :voice | :message | :ai_pipeline_storage | :knowledge_base
118
+
119
+ module RecordType
120
+ extend Telnyx::Internal::Type::Enum
121
+
122
+ VOICE: :voice
123
+ MESSAGE: :message
124
+ AI_PIPELINE_STORAGE: :ai_pipeline_storage
125
+ KNOWLEDGE_BASE: :knowledge_base
126
+
127
+ def self?.values: -> ::Array[Telnyx::Models::AISearchConversationHistoriesParams::record_type]
128
+ end
129
+
130
+ type region = :USA | :DEU | :AUS | :UAE
131
+
132
+ module Region
133
+ extend Telnyx::Internal::Type::Enum
134
+
135
+ USA: :USA
136
+ DEU: :DEU
137
+ AUS: :AUS
138
+ UAE: :UAE
139
+
140
+ def self?.values: -> ::Array[Telnyx::Models::AISearchConversationHistoriesParams::region]
141
+ end
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,168 @@
1
+ module Telnyx
2
+ module Models
3
+ type ai_search_conversation_histories_response =
4
+ {
5
+ data: ::Array[Telnyx::Models::AISearchConversationHistoriesResponse::Data],
6
+ meta: Telnyx::Models::AISearchConversationHistoriesResponse::Meta
7
+ }
8
+
9
+ class AISearchConversationHistoriesResponse < Telnyx::Internal::Type::BaseModel
10
+ attr_accessor data: ::Array[Telnyx::Models::AISearchConversationHistoriesResponse::Data]
11
+
12
+ attr_accessor meta: Telnyx::Models::AISearchConversationHistoriesResponse::Meta
13
+
14
+ def initialize: (
15
+ data: ::Array[Telnyx::Models::AISearchConversationHistoriesResponse::Data],
16
+ meta: Telnyx::Models::AISearchConversationHistoriesResponse::Meta
17
+ ) -> void
18
+
19
+ def to_hash: -> {
20
+ data: ::Array[Telnyx::Models::AISearchConversationHistoriesResponse::Data],
21
+ meta: Telnyx::Models::AISearchConversationHistoriesResponse::Meta
22
+ }
23
+
24
+ type data =
25
+ {
26
+ id: String,
27
+ chunk_index: Integer,
28
+ chunk_total: Integer,
29
+ document_id: String?,
30
+ ingested_at: Time,
31
+ organization_id: String,
32
+ record_created_at: Time,
33
+ record_id: String,
34
+ record_type: Telnyx::Models::AISearchConversationHistoriesResponse::Data::record_type,
35
+ region: Telnyx::Models::AISearchConversationHistoriesResponse::Data::region,
36
+ score: Float,
37
+ text: String,
38
+ user_id: String,
39
+ metadata: ::Hash[Symbol, top]
40
+ }
41
+
42
+ class Data < Telnyx::Internal::Type::BaseModel
43
+ attr_accessor id: String
44
+
45
+ attr_accessor chunk_index: Integer
46
+
47
+ attr_accessor chunk_total: Integer
48
+
49
+ attr_accessor document_id: String?
50
+
51
+ attr_accessor ingested_at: Time
52
+
53
+ attr_accessor organization_id: String
54
+
55
+ attr_accessor record_created_at: Time
56
+
57
+ attr_accessor record_id: String
58
+
59
+ attr_accessor record_type: Telnyx::Models::AISearchConversationHistoriesResponse::Data::record_type
60
+
61
+ attr_accessor region: Telnyx::Models::AISearchConversationHistoriesResponse::Data::region
62
+
63
+ attr_accessor score: Float
64
+
65
+ attr_accessor text: String
66
+
67
+ attr_accessor user_id: String
68
+
69
+ attr_reader metadata: ::Hash[Symbol, top]?
70
+
71
+ def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
72
+
73
+ def initialize: (
74
+ id: String,
75
+ chunk_index: Integer,
76
+ chunk_total: Integer,
77
+ document_id: String?,
78
+ ingested_at: Time,
79
+ organization_id: String,
80
+ record_created_at: Time,
81
+ record_id: String,
82
+ record_type: Telnyx::Models::AISearchConversationHistoriesResponse::Data::record_type,
83
+ region: Telnyx::Models::AISearchConversationHistoriesResponse::Data::region,
84
+ score: Float,
85
+ text: String,
86
+ user_id: String,
87
+ ?metadata: ::Hash[Symbol, top]
88
+ ) -> void
89
+
90
+ def to_hash: -> {
91
+ id: String,
92
+ chunk_index: Integer,
93
+ chunk_total: Integer,
94
+ document_id: String?,
95
+ ingested_at: Time,
96
+ organization_id: String,
97
+ record_created_at: Time,
98
+ record_id: String,
99
+ record_type: Telnyx::Models::AISearchConversationHistoriesResponse::Data::record_type,
100
+ region: Telnyx::Models::AISearchConversationHistoriesResponse::Data::region,
101
+ score: Float,
102
+ text: String,
103
+ user_id: String,
104
+ metadata: ::Hash[Symbol, top]
105
+ }
106
+
107
+ type record_type =
108
+ :voice | :message | :ai_pipeline_storage | :knowledge_base
109
+
110
+ module RecordType
111
+ extend Telnyx::Internal::Type::Enum
112
+
113
+ VOICE: :voice
114
+ MESSAGE: :message
115
+ AI_PIPELINE_STORAGE: :ai_pipeline_storage
116
+ KNOWLEDGE_BASE: :knowledge_base
117
+
118
+ def self?.values: -> ::Array[Telnyx::Models::AISearchConversationHistoriesResponse::Data::record_type]
119
+ end
120
+
121
+ type region = :USA | :DEU | :AUS | :UAE
122
+
123
+ module Region
124
+ extend Telnyx::Internal::Type::Enum
125
+
126
+ USA: :USA
127
+ DEU: :DEU
128
+ AUS: :AUS
129
+ UAE: :UAE
130
+
131
+ def self?.values: -> ::Array[Telnyx::Models::AISearchConversationHistoriesResponse::Data::region]
132
+ end
133
+ end
134
+
135
+ type meta =
136
+ {
137
+ page_number: Integer,
138
+ page_size: Integer,
139
+ total_pages: Integer,
140
+ total_results: Integer
141
+ }
142
+
143
+ class Meta < Telnyx::Internal::Type::BaseModel
144
+ attr_accessor page_number: Integer
145
+
146
+ attr_accessor page_size: Integer
147
+
148
+ attr_accessor total_pages: Integer
149
+
150
+ attr_accessor total_results: Integer
151
+
152
+ def initialize: (
153
+ page_number: Integer,
154
+ page_size: Integer,
155
+ total_pages: Integer,
156
+ total_results: Integer
157
+ ) -> void
158
+
159
+ def to_hash: -> {
160
+ page_number: Integer,
161
+ page_size: Integer,
162
+ total_pages: Integer,
163
+ total_results: Integer
164
+ }
165
+ end
166
+ end
167
+ end
168
+ end
@@ -47,6 +47,8 @@ module Telnyx
47
47
 
48
48
  class AIRetrieveModelsParams = Telnyx::Models::AIRetrieveModelsParams
49
49
 
50
+ class AISearchConversationHistoriesParams = Telnyx::Models::AISearchConversationHistoriesParams
51
+
50
52
  class AISummarizeParams = Telnyx::Models::AISummarizeParams
51
53
 
52
54
  class AlphanumericSenderID = Telnyx::Models::AlphanumericSenderID
@@ -34,6 +34,24 @@ module Telnyx
34
34
  ?request_options: Telnyx::request_opts
35
35
  ) -> Telnyx::Models::AIRetrieveModelsResponse
36
36
 
37
+ def search_conversation_histories: (
38
+ q: String,
39
+ record_type: Telnyx::Models::AISearchConversationHistoriesParams::record_type,
40
+ ?filter_document_id: String,
41
+ ?filter_ingested_at_gte: Time,
42
+ ?filter_ingested_at_lte: Time,
43
+ ?filter_record_created_at_gte: Time,
44
+ ?filter_record_created_at_lte: Time,
45
+ ?filter_record_id: String,
46
+ ?filter_region_in: String,
47
+ ?filter_retention: String,
48
+ ?filter_user_id: String,
49
+ ?min_score: Float,
50
+ ?region: Telnyx::Models::AISearchConversationHistoriesParams::region,
51
+ ?top_k: Integer,
52
+ ?request_options: Telnyx::request_opts
53
+ ) -> Telnyx::Models::AISearchConversationHistoriesResponse
54
+
37
55
  def summarize: (
38
56
  bucket: String,
39
57
  filename: String,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telnyx
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.130.1
4
+ version: 5.131.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Telnyx
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-16 00:00:00.000000000 Z
11
+ date: 2026-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi
@@ -419,6 +419,8 @@ files:
419
419
  - lib/telnyx/models/ai_create_response_deprecated_response.rb
420
420
  - lib/telnyx/models/ai_retrieve_models_params.rb
421
421
  - lib/telnyx/models/ai_retrieve_models_response.rb
422
+ - lib/telnyx/models/ai_search_conversation_histories_params.rb
423
+ - lib/telnyx/models/ai_search_conversation_histories_response.rb
422
424
  - lib/telnyx/models/ai_summarize_params.rb
423
425
  - lib/telnyx/models/ai_summarize_response.rb
424
426
  - lib/telnyx/models/alphanumeric_sender_id.rb
@@ -3226,6 +3228,8 @@ files:
3226
3228
  - rbi/telnyx/models/ai_create_response_deprecated_response.rbi
3227
3229
  - rbi/telnyx/models/ai_retrieve_models_params.rbi
3228
3230
  - rbi/telnyx/models/ai_retrieve_models_response.rbi
3231
+ - rbi/telnyx/models/ai_search_conversation_histories_params.rbi
3232
+ - rbi/telnyx/models/ai_search_conversation_histories_response.rbi
3229
3233
  - rbi/telnyx/models/ai_summarize_params.rbi
3230
3234
  - rbi/telnyx/models/ai_summarize_response.rbi
3231
3235
  - rbi/telnyx/models/alphanumeric_sender_id.rbi
@@ -6024,6 +6028,8 @@ files:
6024
6028
  - sig/telnyx/models/ai_create_response_deprecated_response.rbs
6025
6029
  - sig/telnyx/models/ai_retrieve_models_params.rbs
6026
6030
  - sig/telnyx/models/ai_retrieve_models_response.rbs
6031
+ - sig/telnyx/models/ai_search_conversation_histories_params.rbs
6032
+ - sig/telnyx/models/ai_search_conversation_histories_response.rbs
6027
6033
  - sig/telnyx/models/ai_summarize_params.rbs
6028
6034
  - sig/telnyx/models/ai_summarize_response.rbs
6029
6035
  - sig/telnyx/models/alphanumeric_sender_id.rbs