telnyx 5.130.0 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/telnyx/client.rb +0 -1
- data/lib/telnyx/internal/transport/base_client.rb +4 -1
- data/lib/telnyx/models/ai_search_conversation_histories_params.rb +171 -0
- data/lib/telnyx/models/ai_search_conversation_histories_response.rb +233 -0
- data/lib/telnyx/models.rb +2 -0
- data/lib/telnyx/resources/ai.rb +112 -1
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +2 -0
- data/rbi/telnyx/client.rbi +0 -1
- data/rbi/telnyx/models/ai_search_conversation_histories_params.rbi +319 -0
- data/rbi/telnyx/models/ai_search_conversation_histories_response.rbi +393 -0
- data/rbi/telnyx/models.rbi +3 -0
- data/rbi/telnyx/resources/ai.rbi +117 -1
- data/sig/telnyx/models/ai_search_conversation_histories_params.rbs +144 -0
- data/sig/telnyx/models/ai_search_conversation_histories_response.rbs +168 -0
- data/sig/telnyx/models.rbs +2 -0
- data/sig/telnyx/resources/ai.rbs +18 -0
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 73131dbc369d6c33a4f6e65b18e8ddbd47926435cddb70fb43ea8bd13d857112
|
|
4
|
+
data.tar.gz: f3e5435f05230963682b2ae8635867781ffed007c9951e2abc8ccfe6690b6812
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97cdbbacb6a720ce2ca843f62a050117f805188ee1f431485bb776c449820465d58717ce5aea3df27919ffb19252d12ca2c23925dadecd6d1bf7e1f410c85bb6
|
|
7
|
+
data.tar.gz: a797fe358bb7fd3019ce6111126d2d417ec2e503042f73262a2e8c07d2553c8fceec674c098c132522272488a8e59e869b72d6640d03490fabef0fc13a61bb94
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.131.0 (2026-06-18)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v5.130.1...v5.131.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.130.1...v5.131.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* add transcriptions-search API spec (dev/external) ([b1cda17](https://github.com/team-telnyx/telnyx-ruby/commit/b1cda17c4f29a9398b7a785b2e8cd3645ff80b63))
|
|
10
|
+
|
|
11
|
+
## 5.130.1 (2026-06-16)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v5.130.0...v5.130.1](https://github.com/team-telnyx/telnyx-ruby/compare/v5.130.0...v5.130.1)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **client:** send content-type header for requests with an omitted optional body ([b4e3271](https://github.com/team-telnyx/telnyx-ruby/commit/b4e327110e5529b70e53a7437223eee156597f78))
|
|
18
|
+
|
|
3
19
|
## 5.130.0 (2026-06-16)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v5.129.0...v5.130.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.129.0...v5.130.0)
|
data/README.md
CHANGED
data/lib/telnyx/client.rb
CHANGED
|
@@ -306,7 +306,10 @@ module Telnyx
|
|
|
306
306
|
Telnyx::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
|
|
307
307
|
end
|
|
308
308
|
|
|
309
|
-
|
|
309
|
+
# Generated methods always pass `req[:body]` for operations that define a
|
|
310
|
+
# request body, so only elide the content-type header when the operation
|
|
311
|
+
# has no body at all, not when an optional body param was omitted.
|
|
312
|
+
headers.delete("content-type") if body.nil? && !req.key?(:body)
|
|
310
313
|
|
|
311
314
|
url = Telnyx::Internal::Util.join_parsed_uri(
|
|
312
315
|
@base_url_components,
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
# @see Telnyx::Resources::AI#search_conversation_histories
|
|
6
|
+
class AISearchConversationHistoriesParams < Telnyx::Internal::Type::BaseModel
|
|
7
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute q
|
|
11
|
+
# Natural language search query. The text is embedded into a 1024-dimensional
|
|
12
|
+
# vector and compared against indexed record chunks using kNN cosine similarity.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :q, String
|
|
16
|
+
|
|
17
|
+
# @!attribute record_type
|
|
18
|
+
# The type of records to search. Each record type is stored in a separate vector
|
|
19
|
+
# index.
|
|
20
|
+
#
|
|
21
|
+
# @return [Symbol, Telnyx::Models::AISearchConversationHistoriesParams::RecordType]
|
|
22
|
+
required :record_type, enum: -> { Telnyx::AISearchConversationHistoriesParams::RecordType }
|
|
23
|
+
|
|
24
|
+
# @!attribute filter_document_id
|
|
25
|
+
# Filter by document identifier (exact match). Populated for knowledge_base
|
|
26
|
+
# records.
|
|
27
|
+
#
|
|
28
|
+
# @return [String, nil]
|
|
29
|
+
optional :filter_document_id, String
|
|
30
|
+
|
|
31
|
+
# @!attribute filter_ingested_at_gte
|
|
32
|
+
# Only include records ingested (chunked, embedded, and indexed) on or after this
|
|
33
|
+
# ISO 8601 timestamp.
|
|
34
|
+
#
|
|
35
|
+
# @return [Time, nil]
|
|
36
|
+
optional :filter_ingested_at_gte, Time
|
|
37
|
+
|
|
38
|
+
# @!attribute filter_ingested_at_lte
|
|
39
|
+
# Only include records ingested (chunked, embedded, and indexed) on or before this
|
|
40
|
+
# ISO 8601 timestamp.
|
|
41
|
+
#
|
|
42
|
+
# @return [Time, nil]
|
|
43
|
+
optional :filter_ingested_at_lte, Time
|
|
44
|
+
|
|
45
|
+
# @!attribute filter_record_created_at_gte
|
|
46
|
+
# Only include records whose original creation time is on or after this ISO 8601
|
|
47
|
+
# timestamp.
|
|
48
|
+
#
|
|
49
|
+
# @return [Time, nil]
|
|
50
|
+
optional :filter_record_created_at_gte, Time
|
|
51
|
+
|
|
52
|
+
# @!attribute filter_record_created_at_lte
|
|
53
|
+
# Only include records whose original creation time is on or before this ISO 8601
|
|
54
|
+
# timestamp.
|
|
55
|
+
#
|
|
56
|
+
# @return [Time, nil]
|
|
57
|
+
optional :filter_record_created_at_lte, Time
|
|
58
|
+
|
|
59
|
+
# @!attribute filter_record_id
|
|
60
|
+
# Filter to chunks belonging to a specific parent record (exact match).
|
|
61
|
+
#
|
|
62
|
+
# @return [String, nil]
|
|
63
|
+
optional :filter_record_id, String
|
|
64
|
+
|
|
65
|
+
# @!attribute filter_region_in
|
|
66
|
+
# Filter by the region stored on the record. Comma-separated to match multiple
|
|
67
|
+
# regions (USA, DEU, AUS, UAE). Distinct from the `region` parameter, which
|
|
68
|
+
# selects which cluster(s) are queried.
|
|
69
|
+
#
|
|
70
|
+
# @return [String, nil]
|
|
71
|
+
optional :filter_region_in, String
|
|
72
|
+
|
|
73
|
+
# @!attribute filter_retention
|
|
74
|
+
# Filter by retention policy (exact match). Filter-only: not returned in the
|
|
75
|
+
# response body.
|
|
76
|
+
#
|
|
77
|
+
# @return [String, nil]
|
|
78
|
+
optional :filter_retention, String
|
|
79
|
+
|
|
80
|
+
# @!attribute filter_user_id
|
|
81
|
+
# Filter to records owned by a specific user (exact match).
|
|
82
|
+
#
|
|
83
|
+
# @return [String, nil]
|
|
84
|
+
optional :filter_user_id, String
|
|
85
|
+
|
|
86
|
+
# @!attribute min_score
|
|
87
|
+
# Minimum cosine similarity score threshold (0.0 to 1.0). Results below this
|
|
88
|
+
# threshold are excluded.
|
|
89
|
+
#
|
|
90
|
+
# @return [Float, nil]
|
|
91
|
+
optional :min_score, Float
|
|
92
|
+
|
|
93
|
+
# @!attribute region
|
|
94
|
+
# Restrict search to a specific region's OpenSearch cluster. When omitted, all
|
|
95
|
+
# regions are queried in parallel (fan-out) and results are merged by cosine
|
|
96
|
+
# similarity score.
|
|
97
|
+
#
|
|
98
|
+
# @return [Symbol, Telnyx::Models::AISearchConversationHistoriesParams::Region, nil]
|
|
99
|
+
optional :region, enum: -> { Telnyx::AISearchConversationHistoriesParams::Region }
|
|
100
|
+
|
|
101
|
+
# @!attribute top_k
|
|
102
|
+
# Maximum number of results to return. Defaults to 20, maximum 100.
|
|
103
|
+
#
|
|
104
|
+
# @return [Integer, nil]
|
|
105
|
+
optional :top_k, Integer
|
|
106
|
+
|
|
107
|
+
# @!method initialize(q:, record_type:, filter_document_id: nil, filter_ingested_at_gte: nil, filter_ingested_at_lte: nil, filter_record_created_at_gte: nil, filter_record_created_at_lte: nil, filter_record_id: nil, filter_region_in: nil, filter_retention: nil, filter_user_id: nil, min_score: nil, region: nil, top_k: nil, request_options: {})
|
|
108
|
+
# Some parameter documentations has been truncated, see
|
|
109
|
+
# {Telnyx::Models::AISearchConversationHistoriesParams} for more details.
|
|
110
|
+
#
|
|
111
|
+
# @param q [String] Natural language search query. The text is embedded into a 1024-dimensional vect
|
|
112
|
+
#
|
|
113
|
+
# @param record_type [Symbol, Telnyx::Models::AISearchConversationHistoriesParams::RecordType] The type of records to search. Each record type is stored in a separate vector i
|
|
114
|
+
#
|
|
115
|
+
# @param filter_document_id [String] Filter by document identifier (exact match). Populated for knowledge_base record
|
|
116
|
+
#
|
|
117
|
+
# @param filter_ingested_at_gte [Time] Only include records ingested (chunked, embedded, and indexed) on or after this
|
|
118
|
+
#
|
|
119
|
+
# @param filter_ingested_at_lte [Time] Only include records ingested (chunked, embedded, and indexed) on or before this
|
|
120
|
+
#
|
|
121
|
+
# @param filter_record_created_at_gte [Time] Only include records whose original creation time is on or after this ISO 8601 t
|
|
122
|
+
#
|
|
123
|
+
# @param filter_record_created_at_lte [Time] Only include records whose original creation time is on or before this ISO 8601
|
|
124
|
+
#
|
|
125
|
+
# @param filter_record_id [String] Filter to chunks belonging to a specific parent record (exact match).
|
|
126
|
+
#
|
|
127
|
+
# @param filter_region_in [String] Filter by the region stored on the record. Comma-separated to match multiple reg
|
|
128
|
+
#
|
|
129
|
+
# @param filter_retention [String] Filter by retention policy (exact match). Filter-only: not returned in the respo
|
|
130
|
+
#
|
|
131
|
+
# @param filter_user_id [String] Filter to records owned by a specific user (exact match).
|
|
132
|
+
#
|
|
133
|
+
# @param min_score [Float] Minimum cosine similarity score threshold (0.0 to 1.0). Results below this thres
|
|
134
|
+
#
|
|
135
|
+
# @param region [Symbol, Telnyx::Models::AISearchConversationHistoriesParams::Region] Restrict search to a specific region's OpenSearch cluster. When omitted, all reg
|
|
136
|
+
#
|
|
137
|
+
# @param top_k [Integer] Maximum number of results to return. Defaults to 20, maximum 100.
|
|
138
|
+
#
|
|
139
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
|
|
140
|
+
|
|
141
|
+
# The type of records to search. Each record type is stored in a separate vector
|
|
142
|
+
# index.
|
|
143
|
+
module RecordType
|
|
144
|
+
extend Telnyx::Internal::Type::Enum
|
|
145
|
+
|
|
146
|
+
VOICE = :voice
|
|
147
|
+
MESSAGE = :message
|
|
148
|
+
AI_PIPELINE_STORAGE = :ai_pipeline_storage
|
|
149
|
+
KNOWLEDGE_BASE = :knowledge_base
|
|
150
|
+
|
|
151
|
+
# @!method self.values
|
|
152
|
+
# @return [Array<Symbol>]
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Restrict search to a specific region's OpenSearch cluster. When omitted, all
|
|
156
|
+
# regions are queried in parallel (fan-out) and results are merged by cosine
|
|
157
|
+
# similarity score.
|
|
158
|
+
module Region
|
|
159
|
+
extend Telnyx::Internal::Type::Enum
|
|
160
|
+
|
|
161
|
+
USA = :USA
|
|
162
|
+
DEU = :DEU
|
|
163
|
+
AUS = :AUS
|
|
164
|
+
UAE = :UAE
|
|
165
|
+
|
|
166
|
+
# @!method self.values
|
|
167
|
+
# @return [Array<Symbol>]
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
# @see Telnyx::Resources::AI#search_conversation_histories
|
|
6
|
+
class AISearchConversationHistoriesResponse < Telnyx::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute data
|
|
8
|
+
# Ranked list of matching text chunks, sorted by cosine similarity score
|
|
9
|
+
# descending.
|
|
10
|
+
#
|
|
11
|
+
# @return [Array<Telnyx::Models::AISearchConversationHistoriesResponse::Data>]
|
|
12
|
+
required :data,
|
|
13
|
+
-> { Telnyx::Internal::Type::ArrayOf[Telnyx::Models::AISearchConversationHistoriesResponse::Data] }
|
|
14
|
+
|
|
15
|
+
# @!attribute meta
|
|
16
|
+
# Pagination metadata following the standard Telnyx V2 API format.
|
|
17
|
+
#
|
|
18
|
+
# @return [Telnyx::Models::AISearchConversationHistoriesResponse::Meta]
|
|
19
|
+
required :meta, -> { Telnyx::Models::AISearchConversationHistoriesResponse::Meta }
|
|
20
|
+
|
|
21
|
+
# @!method initialize(data:, meta:)
|
|
22
|
+
# Some parameter documentations has been truncated, see
|
|
23
|
+
# {Telnyx::Models::AISearchConversationHistoriesResponse} for more details.
|
|
24
|
+
#
|
|
25
|
+
# Search response following the standard Telnyx V2 API format.
|
|
26
|
+
#
|
|
27
|
+
# @param data [Array<Telnyx::Models::AISearchConversationHistoriesResponse::Data>] Ranked list of matching text chunks, sorted by cosine similarity score descendin
|
|
28
|
+
#
|
|
29
|
+
# @param meta [Telnyx::Models::AISearchConversationHistoriesResponse::Meta] Pagination metadata following the standard Telnyx V2 API format.
|
|
30
|
+
|
|
31
|
+
class Data < Telnyx::Internal::Type::BaseModel
|
|
32
|
+
# @!attribute id
|
|
33
|
+
# Unique chunk identifier.
|
|
34
|
+
#
|
|
35
|
+
# @return [String]
|
|
36
|
+
required :id, String
|
|
37
|
+
|
|
38
|
+
# @!attribute chunk_index
|
|
39
|
+
# Zero-based index of this chunk within the parent record.
|
|
40
|
+
#
|
|
41
|
+
# @return [Integer]
|
|
42
|
+
required :chunk_index, Integer
|
|
43
|
+
|
|
44
|
+
# @!attribute chunk_total
|
|
45
|
+
# Total number of chunks the parent record was split into.
|
|
46
|
+
#
|
|
47
|
+
# @return [Integer]
|
|
48
|
+
required :chunk_total, Integer
|
|
49
|
+
|
|
50
|
+
# @!attribute document_id
|
|
51
|
+
# Document identifier. Present only for knowledge_base records; null for all other
|
|
52
|
+
# record types.
|
|
53
|
+
#
|
|
54
|
+
# @return [String, nil]
|
|
55
|
+
required :document_id, String, nil?: true
|
|
56
|
+
|
|
57
|
+
# @!attribute ingested_at
|
|
58
|
+
# When the record was chunked, embedded, and indexed (ISO 8601).
|
|
59
|
+
#
|
|
60
|
+
# @return [Time]
|
|
61
|
+
required :ingested_at, Time
|
|
62
|
+
|
|
63
|
+
# @!attribute organization_id
|
|
64
|
+
# Identifier of the organization that owns this record.
|
|
65
|
+
#
|
|
66
|
+
# @return [String]
|
|
67
|
+
required :organization_id, String
|
|
68
|
+
|
|
69
|
+
# @!attribute record_created_at
|
|
70
|
+
# When the original record was created (ISO 8601).
|
|
71
|
+
#
|
|
72
|
+
# @return [Time]
|
|
73
|
+
required :record_created_at, Time
|
|
74
|
+
|
|
75
|
+
# @!attribute record_id
|
|
76
|
+
# Identifier of the parent record. Multiple chunks from the same record share this
|
|
77
|
+
# ID.
|
|
78
|
+
#
|
|
79
|
+
# @return [String]
|
|
80
|
+
required :record_id, String
|
|
81
|
+
|
|
82
|
+
# @!attribute record_type
|
|
83
|
+
# Type of the record.
|
|
84
|
+
#
|
|
85
|
+
# @return [Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::RecordType]
|
|
86
|
+
required :record_type,
|
|
87
|
+
enum: -> { Telnyx::Models::AISearchConversationHistoriesResponse::Data::RecordType }
|
|
88
|
+
|
|
89
|
+
# @!attribute region
|
|
90
|
+
# The region where this record is stored.
|
|
91
|
+
#
|
|
92
|
+
# @return [Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::Region]
|
|
93
|
+
required :region, enum: -> { Telnyx::Models::AISearchConversationHistoriesResponse::Data::Region }
|
|
94
|
+
|
|
95
|
+
# @!attribute score
|
|
96
|
+
# Cosine similarity score between the query vector and this chunk's vector. Higher
|
|
97
|
+
# values indicate greater semantic relevance.
|
|
98
|
+
#
|
|
99
|
+
# @return [Float]
|
|
100
|
+
required :score, Float
|
|
101
|
+
|
|
102
|
+
# @!attribute text
|
|
103
|
+
# The text content of this chunk (up to 480 tokens).
|
|
104
|
+
#
|
|
105
|
+
# @return [String]
|
|
106
|
+
required :text, String
|
|
107
|
+
|
|
108
|
+
# @!attribute user_id
|
|
109
|
+
# Identifier of the user who owns this record.
|
|
110
|
+
#
|
|
111
|
+
# @return [String]
|
|
112
|
+
required :user_id, String
|
|
113
|
+
|
|
114
|
+
# @!attribute metadata
|
|
115
|
+
# Arbitrary metadata attached to the record at ingestion time. Stored as a
|
|
116
|
+
# flat_object in OpenSearch and filterable via filter[field]=value query
|
|
117
|
+
# parameters.
|
|
118
|
+
#
|
|
119
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
120
|
+
optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
|
|
121
|
+
|
|
122
|
+
# @!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)
|
|
123
|
+
# Some parameter documentations has been truncated, see
|
|
124
|
+
# {Telnyx::Models::AISearchConversationHistoriesResponse::Data} for more details.
|
|
125
|
+
#
|
|
126
|
+
# A single search result representing one chunk of a conversation history record.
|
|
127
|
+
# Records are split into chunks of up to 480 tokens with 64-token overlap at
|
|
128
|
+
# ingestion time.
|
|
129
|
+
#
|
|
130
|
+
# @param id [String] Unique chunk identifier.
|
|
131
|
+
#
|
|
132
|
+
# @param chunk_index [Integer] Zero-based index of this chunk within the parent record.
|
|
133
|
+
#
|
|
134
|
+
# @param chunk_total [Integer] Total number of chunks the parent record was split into.
|
|
135
|
+
#
|
|
136
|
+
# @param document_id [String, nil] Document identifier. Present only for knowledge_base records; null for all other
|
|
137
|
+
#
|
|
138
|
+
# @param ingested_at [Time] When the record was chunked, embedded, and indexed (ISO 8601).
|
|
139
|
+
#
|
|
140
|
+
# @param organization_id [String] Identifier of the organization that owns this record.
|
|
141
|
+
#
|
|
142
|
+
# @param record_created_at [Time] When the original record was created (ISO 8601).
|
|
143
|
+
#
|
|
144
|
+
# @param record_id [String] Identifier of the parent record. Multiple chunks from the same record share this
|
|
145
|
+
#
|
|
146
|
+
# @param record_type [Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::RecordType] Type of the record.
|
|
147
|
+
#
|
|
148
|
+
# @param region [Symbol, Telnyx::Models::AISearchConversationHistoriesResponse::Data::Region] The region where this record is stored.
|
|
149
|
+
#
|
|
150
|
+
# @param score [Float] Cosine similarity score between the query vector and this chunk's vector. Higher
|
|
151
|
+
#
|
|
152
|
+
# @param text [String] The text content of this chunk (up to 480 tokens).
|
|
153
|
+
#
|
|
154
|
+
# @param user_id [String] Identifier of the user who owns this record.
|
|
155
|
+
#
|
|
156
|
+
# @param metadata [Hash{Symbol=>Object}] Arbitrary metadata attached to the record at ingestion time. Stored as a flat_ob
|
|
157
|
+
|
|
158
|
+
# Type of the record.
|
|
159
|
+
#
|
|
160
|
+
# @see Telnyx::Models::AISearchConversationHistoriesResponse::Data#record_type
|
|
161
|
+
module RecordType
|
|
162
|
+
extend Telnyx::Internal::Type::Enum
|
|
163
|
+
|
|
164
|
+
VOICE = :voice
|
|
165
|
+
MESSAGE = :message
|
|
166
|
+
AI_PIPELINE_STORAGE = :ai_pipeline_storage
|
|
167
|
+
KNOWLEDGE_BASE = :knowledge_base
|
|
168
|
+
|
|
169
|
+
# @!method self.values
|
|
170
|
+
# @return [Array<Symbol>]
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# The region where this record is stored.
|
|
174
|
+
#
|
|
175
|
+
# @see Telnyx::Models::AISearchConversationHistoriesResponse::Data#region
|
|
176
|
+
module Region
|
|
177
|
+
extend Telnyx::Internal::Type::Enum
|
|
178
|
+
|
|
179
|
+
USA = :USA
|
|
180
|
+
DEU = :DEU
|
|
181
|
+
AUS = :AUS
|
|
182
|
+
UAE = :UAE
|
|
183
|
+
|
|
184
|
+
# @!method self.values
|
|
185
|
+
# @return [Array<Symbol>]
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# @see Telnyx::Models::AISearchConversationHistoriesResponse#meta
|
|
190
|
+
class Meta < Telnyx::Internal::Type::BaseModel
|
|
191
|
+
# @!attribute page_number
|
|
192
|
+
# Current page number (always 1 — this API does not support pagination, use top_k
|
|
193
|
+
# instead).
|
|
194
|
+
#
|
|
195
|
+
# @return [Integer]
|
|
196
|
+
required :page_number, Integer
|
|
197
|
+
|
|
198
|
+
# @!attribute page_size
|
|
199
|
+
# Number of results per page (equals the effective top_k value).
|
|
200
|
+
#
|
|
201
|
+
# @return [Integer]
|
|
202
|
+
required :page_size, Integer
|
|
203
|
+
|
|
204
|
+
# @!attribute total_pages
|
|
205
|
+
# Total number of pages.
|
|
206
|
+
#
|
|
207
|
+
# @return [Integer]
|
|
208
|
+
required :total_pages, Integer
|
|
209
|
+
|
|
210
|
+
# @!attribute total_results
|
|
211
|
+
# Total number of matching results across all queried regions (before top_k
|
|
212
|
+
# truncation).
|
|
213
|
+
#
|
|
214
|
+
# @return [Integer]
|
|
215
|
+
required :total_results, Integer
|
|
216
|
+
|
|
217
|
+
# @!method initialize(page_number:, page_size:, total_pages:, total_results:)
|
|
218
|
+
# Some parameter documentations has been truncated, see
|
|
219
|
+
# {Telnyx::Models::AISearchConversationHistoriesResponse::Meta} for more details.
|
|
220
|
+
#
|
|
221
|
+
# Pagination metadata following the standard Telnyx V2 API format.
|
|
222
|
+
#
|
|
223
|
+
# @param page_number [Integer] Current page number (always 1 — this API does not support pagination, use top_k
|
|
224
|
+
#
|
|
225
|
+
# @param page_size [Integer] Number of results per page (equals the effective top_k value).
|
|
226
|
+
#
|
|
227
|
+
# @param total_pages [Integer] Total number of pages.
|
|
228
|
+
#
|
|
229
|
+
# @param total_results [Integer] Total number of matching results across all queried regions (before top_k trunca
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|
data/lib/telnyx/models.rb
CHANGED
|
@@ -87,6 +87,8 @@ module Telnyx
|
|
|
87
87
|
|
|
88
88
|
AIRetrieveModelsParams = Telnyx::Models::AIRetrieveModelsParams
|
|
89
89
|
|
|
90
|
+
AISearchConversationHistoriesParams = Telnyx::Models::AISearchConversationHistoriesParams
|
|
91
|
+
|
|
90
92
|
AISummarizeParams = Telnyx::Models::AISummarizeParams
|
|
91
93
|
|
|
92
94
|
AlphanumericSenderID = Telnyx::Models::AlphanumericSenderID
|
data/lib/telnyx/resources/ai.rb
CHANGED
|
@@ -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
|
# @return [Telnyx::Resources::AI::Assistants]
|
|
@@ -102,6 +101,118 @@ module Telnyx
|
|
|
102
101
|
)
|
|
103
102
|
end
|
|
104
103
|
|
|
104
|
+
# Some parameter documentations has been truncated, see
|
|
105
|
+
# {Telnyx::Models::AISearchConversationHistoriesParams} for more details.
|
|
106
|
+
#
|
|
107
|
+
# Performs semantic vector search across conversation history records.
|
|
108
|
+
#
|
|
109
|
+
# **How it works:**
|
|
110
|
+
#
|
|
111
|
+
# 1. The query text is embedded into a 1024-dimensional vector using the
|
|
112
|
+
# multilingual-e5-large model.
|
|
113
|
+
# 2. The vector is sent to regional OpenSearch clusters for kNN search using HNSW
|
|
114
|
+
# cosine similarity.
|
|
115
|
+
# 3. When no region is specified, all regions are queried in parallel (fan-out)
|
|
116
|
+
# and results are merged by score.
|
|
117
|
+
# 4. Results are ranked by cosine similarity score (descending) and truncated to
|
|
118
|
+
# `top_k`.
|
|
119
|
+
#
|
|
120
|
+
# **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
|
|
121
|
+
# Results are automatically scoped to the caller's organization —
|
|
122
|
+
# `organization_id` is injected from the auth token and cannot be overridden.
|
|
123
|
+
#
|
|
124
|
+
# **Chunking:** Records are split into chunks of up to 480 tokens with 64-token
|
|
125
|
+
# overlap at ingestion time. Each search result represents a single chunk, with
|
|
126
|
+
# `chunk_index` and `chunk_total` indicating its position within the original
|
|
127
|
+
# record.
|
|
128
|
+
#
|
|
129
|
+
# **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
|
|
130
|
+
# results before vector search.
|
|
131
|
+
#
|
|
132
|
+
# Top-level filterable fields: `user_id`, `record_type`, `region`, `document_id`,
|
|
133
|
+
# `record_id`, `record_created_at`, `ingested_at`, `retention`
|
|
134
|
+
#
|
|
135
|
+
# Note: `retention` is filter-only — it can be used to narrow results but is not
|
|
136
|
+
# returned in the response body.
|
|
137
|
+
#
|
|
138
|
+
# Metadata fields: any field not in the list above is resolved to
|
|
139
|
+
# `data.metadata.<field>` in OpenSearch (e.g., `filter[language]=en` →
|
|
140
|
+
# `data.metadata.language`).
|
|
141
|
+
#
|
|
142
|
+
# Supported filter operators:
|
|
143
|
+
#
|
|
144
|
+
# - `eq` — exact match (default when no operator specified)
|
|
145
|
+
# - `in` — match any of comma-separated values
|
|
146
|
+
# - `gte`, `gt`, `lte`, `lt` — range comparisons (useful for date filtering)
|
|
147
|
+
# - `contains` — wildcard substring match
|
|
148
|
+
#
|
|
149
|
+
# **Examples:**
|
|
150
|
+
#
|
|
151
|
+
# ```
|
|
152
|
+
# GET /v2/ai/conversation_histories?q=billing+issue&record_type=voice&top_k=10
|
|
153
|
+
# GET /v2/ai/conversation_histories?q=setup+guide&record_type=knowledge_base®ion=USA&min_score=0.5
|
|
154
|
+
# GET /v2/ai/conversation_histories?q=refund&record_type=voice&filter[record_created_at][gte]=2026-01-01T00:00:00Z
|
|
155
|
+
# GET /v2/ai/conversation_histories?q=outage&record_type=voice&filter[region][in]=USA,DEU
|
|
156
|
+
# GET /v2/ai/conversation_histories?q=hold+time&record_type=voice&filter[language]=en
|
|
157
|
+
# ```
|
|
158
|
+
#
|
|
159
|
+
# @overload search_conversation_histories(q:, record_type:, filter_document_id: nil, filter_ingested_at_gte: nil, filter_ingested_at_lte: nil, filter_record_created_at_gte: nil, filter_record_created_at_lte: nil, filter_record_id: nil, filter_region_in: nil, filter_retention: nil, filter_user_id: nil, min_score: nil, region: nil, top_k: nil, request_options: {})
|
|
160
|
+
#
|
|
161
|
+
# @param q [String] Natural language search query. The text is embedded into a 1024-dimensional vect
|
|
162
|
+
#
|
|
163
|
+
# @param record_type [Symbol, Telnyx::Models::AISearchConversationHistoriesParams::RecordType] The type of records to search. Each record type is stored in a separate vector i
|
|
164
|
+
#
|
|
165
|
+
# @param filter_document_id [String] Filter by document identifier (exact match). Populated for knowledge_base record
|
|
166
|
+
#
|
|
167
|
+
# @param filter_ingested_at_gte [Time] Only include records ingested (chunked, embedded, and indexed) on or after this
|
|
168
|
+
#
|
|
169
|
+
# @param filter_ingested_at_lte [Time] Only include records ingested (chunked, embedded, and indexed) on or before this
|
|
170
|
+
#
|
|
171
|
+
# @param filter_record_created_at_gte [Time] Only include records whose original creation time is on or after this ISO 8601 t
|
|
172
|
+
#
|
|
173
|
+
# @param filter_record_created_at_lte [Time] Only include records whose original creation time is on or before this ISO 8601
|
|
174
|
+
#
|
|
175
|
+
# @param filter_record_id [String] Filter to chunks belonging to a specific parent record (exact match).
|
|
176
|
+
#
|
|
177
|
+
# @param filter_region_in [String] Filter by the region stored on the record. Comma-separated to match multiple reg
|
|
178
|
+
#
|
|
179
|
+
# @param filter_retention [String] Filter by retention policy (exact match). Filter-only: not returned in the respo
|
|
180
|
+
#
|
|
181
|
+
# @param filter_user_id [String] Filter to records owned by a specific user (exact match).
|
|
182
|
+
#
|
|
183
|
+
# @param min_score [Float] Minimum cosine similarity score threshold (0.0 to 1.0). Results below this thres
|
|
184
|
+
#
|
|
185
|
+
# @param region [Symbol, Telnyx::Models::AISearchConversationHistoriesParams::Region] Restrict search to a specific region's OpenSearch cluster. When omitted, all reg
|
|
186
|
+
#
|
|
187
|
+
# @param top_k [Integer] Maximum number of results to return. Defaults to 20, maximum 100.
|
|
188
|
+
#
|
|
189
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
190
|
+
#
|
|
191
|
+
# @return [Telnyx::Models::AISearchConversationHistoriesResponse]
|
|
192
|
+
#
|
|
193
|
+
# @see Telnyx::Models::AISearchConversationHistoriesParams
|
|
194
|
+
def search_conversation_histories(params)
|
|
195
|
+
parsed, options = Telnyx::AISearchConversationHistoriesParams.dump_request(params)
|
|
196
|
+
query = Telnyx::Internal::Util.encode_query_params(parsed)
|
|
197
|
+
@client.request(
|
|
198
|
+
method: :get,
|
|
199
|
+
path: "ai/conversation_histories",
|
|
200
|
+
query: query.transform_keys(
|
|
201
|
+
filter_document_id: "filter[document_id]",
|
|
202
|
+
filter_ingested_at_gte: "filter[ingested_at][gte]",
|
|
203
|
+
filter_ingested_at_lte: "filter[ingested_at][lte]",
|
|
204
|
+
filter_record_created_at_gte: "filter[record_created_at][gte]",
|
|
205
|
+
filter_record_created_at_lte: "filter[record_created_at][lte]",
|
|
206
|
+
filter_record_id: "filter[record_id]",
|
|
207
|
+
filter_region_in: "filter[region][in]",
|
|
208
|
+
filter_retention: "filter[retention]",
|
|
209
|
+
filter_user_id: "filter[user_id]"
|
|
210
|
+
),
|
|
211
|
+
model: Telnyx::Models::AISearchConversationHistoriesResponse,
|
|
212
|
+
options: options
|
|
213
|
+
)
|
|
214
|
+
end
|
|
215
|
+
|
|
105
216
|
# Generate a summary of a file's contents.
|
|
106
217
|
#
|
|
107
218
|
# Supports the following text formats:
|
data/lib/telnyx/version.rb
CHANGED
data/lib/telnyx.rb
CHANGED
|
@@ -402,6 +402,8 @@ require_relative "telnyx/models/ai_create_response_deprecated_params"
|
|
|
402
402
|
require_relative "telnyx/models/ai_create_response_deprecated_response"
|
|
403
403
|
require_relative "telnyx/models/ai_retrieve_models_params"
|
|
404
404
|
require_relative "telnyx/models/ai_retrieve_models_response"
|
|
405
|
+
require_relative "telnyx/models/ai_search_conversation_histories_params"
|
|
406
|
+
require_relative "telnyx/models/ai_search_conversation_histories_response"
|
|
405
407
|
require_relative "telnyx/models/ai_summarize_params"
|
|
406
408
|
require_relative "telnyx/models/ai_summarize_response"
|
|
407
409
|
require_relative "telnyx/models/alphanumeric_sender_id"
|