telnyx 7.17.0 → 7.19.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.
- package/CHANGELOG.md +27 -0
- package/client.d.mts +5 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -2
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/lib/webhooks.d.mts +1 -1
- package/lib/webhooks.d.mts.map +1 -1
- package/lib/webhooks.d.ts +1 -1
- package/lib/webhooks.d.ts.map +1 -1
- package/lib/webhooks.js +74 -39
- package/lib/webhooks.js.map +1 -1
- package/lib/webhooks.mjs +52 -17
- package/lib/webhooks.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +6 -2
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +6 -2
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js +4 -0
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs +4 -0
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/anthropic/v1.d.mts +4 -3
- package/resources/ai/anthropic/v1.d.mts.map +1 -1
- package/resources/ai/anthropic/v1.d.ts +4 -3
- package/resources/ai/anthropic/v1.d.ts.map +1 -1
- package/resources/ai/anthropic/v1.js +1 -1
- package/resources/ai/anthropic/v1.mjs +1 -1
- package/resources/ai/assistants/assistants.d.mts +124 -18
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +124 -18
- package/resources/ai/assistants/assistants.d.ts.map +1 -1
- package/resources/ai/assistants/assistants.js.map +1 -1
- package/resources/ai/assistants/assistants.mjs.map +1 -1
- package/resources/ai/chat.d.mts +8 -0
- package/resources/ai/chat.d.mts.map +1 -1
- package/resources/ai/chat.d.ts +8 -0
- package/resources/ai/chat.d.ts.map +1 -1
- package/resources/ai/collections/collections.d.mts +1 -102
- package/resources/ai/collections/collections.d.mts.map +1 -1
- package/resources/ai/collections/collections.d.ts +1 -102
- package/resources/ai/collections/collections.d.ts.map +1 -1
- package/resources/ai/collections/collections.js +0 -44
- package/resources/ai/collections/collections.js.map +1 -1
- package/resources/ai/collections/collections.mjs +0 -44
- package/resources/ai/collections/collections.mjs.map +1 -1
- package/resources/ai/collections/index.d.mts +1 -1
- package/resources/ai/collections/index.d.mts.map +1 -1
- package/resources/ai/collections/index.d.ts +1 -1
- package/resources/ai/collections/index.d.ts.map +1 -1
- package/resources/ai/collections/index.js.map +1 -1
- package/resources/ai/collections/index.mjs.map +1 -1
- package/resources/ai/collections/settings.d.mts +4 -1
- package/resources/ai/collections/settings.d.mts.map +1 -1
- package/resources/ai/collections/settings.d.ts +4 -1
- package/resources/ai/collections/settings.d.ts.map +1 -1
- package/resources/ai/index.d.mts +2 -1
- package/resources/ai/index.d.mts.map +1 -1
- package/resources/ai/index.d.ts +2 -1
- package/resources/ai/index.d.ts.map +1 -1
- package/resources/ai/index.js +7 -5
- package/resources/ai/index.js.map +1 -1
- package/resources/ai/index.mjs +1 -0
- package/resources/ai/index.mjs.map +1 -1
- package/resources/ai/knowledge/collections.d.mts +140 -0
- package/resources/ai/knowledge/collections.d.mts.map +1 -0
- package/resources/ai/knowledge/collections.d.ts +140 -0
- package/resources/ai/knowledge/collections.d.ts.map +1 -0
- package/resources/ai/knowledge/collections.js +58 -0
- package/resources/ai/knowledge/collections.js.map +1 -0
- package/resources/ai/knowledge/collections.mjs +54 -0
- package/resources/ai/knowledge/collections.mjs.map +1 -0
- package/resources/ai/knowledge/index.d.mts +3 -0
- package/resources/ai/knowledge/index.d.mts.map +1 -0
- package/resources/ai/knowledge/index.d.ts +3 -0
- package/resources/ai/knowledge/index.d.ts.map +1 -0
- package/resources/ai/knowledge/index.js +9 -0
- package/resources/ai/knowledge/index.js.map +1 -0
- package/resources/ai/knowledge/index.mjs +4 -0
- package/resources/ai/knowledge/index.mjs.map +1 -0
- package/resources/ai/knowledge/knowledge.d.mts +10 -0
- package/resources/ai/knowledge/knowledge.d.mts.map +1 -0
- package/resources/ai/knowledge/knowledge.d.ts +10 -0
- package/resources/ai/knowledge/knowledge.d.ts.map +1 -0
- package/resources/ai/knowledge/knowledge.js +17 -0
- package/resources/ai/knowledge/knowledge.js.map +1 -0
- package/resources/ai/knowledge/knowledge.mjs +12 -0
- package/resources/ai/knowledge/knowledge.mjs.map +1 -0
- package/resources/ai/knowledge.d.mts +2 -0
- package/resources/ai/knowledge.d.mts.map +1 -0
- package/resources/ai/knowledge.d.ts +2 -0
- package/resources/ai/knowledge.d.ts.map +1 -0
- package/resources/ai/knowledge.js +6 -0
- package/resources/ai/knowledge.js.map +1 -0
- package/resources/ai/knowledge.mjs +3 -0
- package/resources/ai/knowledge.mjs.map +1 -0
- package/resources/ai/openai/chat.d.mts +8 -0
- package/resources/ai/openai/chat.d.mts.map +1 -1
- package/resources/ai/openai/chat.d.ts +8 -0
- package/resources/ai/openai/chat.d.ts.map +1 -1
- package/resources/ai/openai/openai.d.mts +10 -0
- package/resources/ai/openai/openai.d.mts.map +1 -1
- package/resources/ai/openai/openai.d.ts +10 -0
- package/resources/ai/openai/openai.d.ts.map +1 -1
- package/resources/ai/openai/openai.js.map +1 -1
- package/resources/ai/openai/openai.mjs.map +1 -1
- package/resources/calls/actions.d.mts +35 -12
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +35 -12
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/calls.d.mts +2 -2
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +2 -2
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/calls/calls.js.map +1 -1
- package/resources/calls/calls.mjs.map +1 -1
- package/resources/calls/index.d.mts +1 -1
- package/resources/calls/index.d.mts.map +1 -1
- package/resources/calls/index.d.ts +1 -1
- package/resources/calls/index.d.ts.map +1 -1
- package/resources/calls/index.js.map +1 -1
- package/resources/calls/index.mjs.map +1 -1
- package/resources/conferences/actions.d.mts +3 -1
- package/resources/conferences/actions.d.mts.map +1 -1
- package/resources/conferences/actions.d.ts +3 -1
- package/resources/conferences/actions.d.ts.map +1 -1
- package/resources/credential-connections/credential-connections.d.mts +2 -2
- package/resources/credential-connections/credential-connections.d.ts +2 -2
- package/resources/external-requirements/external-requirements.d.mts +10 -0
- package/resources/external-requirements/external-requirements.d.mts.map +1 -0
- package/resources/external-requirements/external-requirements.d.ts +10 -0
- package/resources/external-requirements/external-requirements.d.ts.map +1 -0
- package/resources/external-requirements/external-requirements.js +17 -0
- package/resources/external-requirements/external-requirements.js.map +1 -0
- package/resources/external-requirements/external-requirements.mjs +12 -0
- package/resources/external-requirements/external-requirements.mjs.map +1 -0
- package/resources/external-requirements/index.d.mts +3 -0
- package/resources/external-requirements/index.d.mts.map +1 -0
- package/resources/external-requirements/index.d.ts +3 -0
- package/resources/external-requirements/index.d.ts.map +1 -0
- package/resources/external-requirements/index.js +9 -0
- package/resources/external-requirements/index.js.map +1 -0
- package/resources/external-requirements/index.mjs +4 -0
- package/resources/external-requirements/index.mjs.map +1 -0
- package/resources/external-requirements/sub-number-orders.d.mts +151 -0
- package/resources/external-requirements/sub-number-orders.d.mts.map +1 -0
- package/resources/external-requirements/sub-number-orders.d.ts +151 -0
- package/resources/external-requirements/sub-number-orders.d.ts.map +1 -0
- package/resources/external-requirements/sub-number-orders.js +61 -0
- package/resources/external-requirements/sub-number-orders.js.map +1 -0
- package/resources/external-requirements/sub-number-orders.mjs +57 -0
- package/resources/external-requirements/sub-number-orders.mjs.map +1 -0
- package/resources/external-requirements.d.mts +2 -0
- package/resources/external-requirements.d.mts.map +1 -0
- package/resources/external-requirements.d.ts +2 -0
- package/resources/external-requirements.d.ts.map +1 -0
- package/resources/external-requirements.js +6 -0
- package/resources/external-requirements.js.map +1 -0
- package/resources/external-requirements.mjs +3 -0
- package/resources/external-requirements.mjs.map +1 -0
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +6 -4
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/outbound-voice-profiles.d.mts +30 -30
- package/resources/outbound-voice-profiles.d.ts +30 -30
- package/resources/phone-numbers/jobs.d.mts +21 -4
- package/resources/phone-numbers/jobs.d.mts.map +1 -1
- package/resources/phone-numbers/jobs.d.ts +21 -4
- package/resources/phone-numbers/jobs.d.ts.map +1 -1
- package/resources/phone-numbers/jobs.js +4 -2
- package/resources/phone-numbers/jobs.js.map +1 -1
- package/resources/phone-numbers/jobs.mjs +4 -2
- package/resources/phone-numbers/jobs.mjs.map +1 -1
- package/resources/sim-card-groups/actions.d.mts +10 -4
- package/resources/sim-card-groups/actions.d.mts.map +1 -1
- package/resources/sim-card-groups/actions.d.ts +10 -4
- package/resources/sim-card-groups/actions.d.ts.map +1 -1
- package/resources/sim-card-groups/actions.js +6 -4
- package/resources/sim-card-groups/actions.js.map +1 -1
- package/resources/sim-card-groups/actions.mjs +6 -4
- package/resources/sim-card-groups/actions.mjs.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.mts +20 -10
- package/resources/speech-to-text/speech-to-text.d.mts.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.ts +20 -10
- package/resources/speech-to-text/speech-to-text.d.ts.map +1 -1
- package/resources/speech-to-text/speech-to-text.js +3 -2
- package/resources/speech-to-text/speech-to-text.js.map +1 -1
- package/resources/speech-to-text/speech-to-text.mjs +3 -2
- package/resources/speech-to-text/speech-to-text.mjs.map +1 -1
- package/resources/webhooks.d.mts +4 -3
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +4 -3
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +4 -11
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +4 -11
- package/resources/webhooks.mjs.map +1 -1
- package/resources/wireless-blocklist-values.d.mts +6 -19
- package/resources/wireless-blocklist-values.d.mts.map +1 -1
- package/resources/wireless-blocklist-values.d.ts +6 -19
- package/resources/wireless-blocklist-values.d.ts.map +1 -1
- package/resources/wireless-blocklist-values.js +2 -1
- package/resources/wireless-blocklist-values.js.map +1 -1
- package/resources/wireless-blocklist-values.mjs +2 -1
- package/resources/wireless-blocklist-values.mjs.map +1 -1
- package/resources/wireless-blocklists.d.mts +40 -20
- package/resources/wireless-blocklists.d.mts.map +1 -1
- package/resources/wireless-blocklists.d.ts +40 -20
- package/resources/wireless-blocklists.d.ts.map +1 -1
- package/resources/wireless-blocklists.js +12 -7
- package/resources/wireless-blocklists.js.map +1 -1
- package/resources/wireless-blocklists.mjs +12 -7
- package/resources/wireless-blocklists.mjs.map +1 -1
- package/src/client.ts +9 -4
- package/src/lib/webhooks.ts +59 -18
- package/src/resources/ai/ai.ts +6 -6
- package/src/resources/ai/anthropic/v1.ts +4 -3
- package/src/resources/ai/assistants/assistants.ts +130 -17
- package/src/resources/ai/chat.ts +9 -0
- package/src/resources/ai/collections/collections.ts +0 -134
- package/src/resources/ai/collections/index.ts +0 -3
- package/src/resources/ai/collections/settings.ts +4 -1
- package/src/resources/ai/index.ts +1 -3
- package/src/resources/ai/knowledge/collections.ts +179 -0
- package/src/resources/ai/knowledge/index.ts +8 -0
- package/src/resources/ai/knowledge/knowledge.ts +23 -0
- package/src/resources/ai/knowledge.ts +3 -0
- package/src/resources/ai/openai/chat.ts +9 -0
- package/src/resources/ai/openai/openai.ts +12 -0
- package/src/resources/calls/actions.ts +38 -6
- package/src/resources/calls/calls.ts +2 -0
- package/src/resources/calls/index.ts +1 -0
- package/src/resources/conferences/actions.ts +3 -1
- package/src/resources/credential-connections/credential-connections.ts +2 -2
- package/src/resources/external-requirements/external-requirements.ts +27 -0
- package/src/resources/external-requirements/index.ts +10 -0
- package/src/resources/external-requirements/sub-number-orders.ts +202 -0
- package/src/resources/external-requirements.ts +3 -0
- package/src/resources/index.ts +3 -2
- package/src/resources/outbound-voice-profiles.ts +30 -30
- package/src/resources/phone-numbers/jobs.ts +23 -4
- package/src/resources/sim-card-groups/actions.ts +11 -4
- package/src/resources/speech-to-text/speech-to-text.ts +23 -9
- package/src/resources/webhooks.ts +8 -13
- package/src/resources/wireless-blocklist-values.ts +6 -23
- package/src/resources/wireless-blocklists.ts +54 -25
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/ai/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Tools = exports.OpenAI = exports.Missions = exports.McpServers = exports.Integrations = exports.FineTuning = exports.Embeddings = exports.Conversations = exports.Collections = exports.Clusters = exports.Chat = exports.Audio = exports.Assistants = exports.Anthropic = exports.AI = void 0;
|
|
4
|
+
exports.Tools = exports.OpenAI = exports.Missions = exports.McpServers = exports.Knowledge = exports.Integrations = exports.FineTuning = exports.Embeddings = exports.Conversations = exports.Collections = exports.Clusters = exports.Chat = exports.Audio = exports.Assistants = exports.Anthropic = exports.AI = void 0;
|
|
5
5
|
var ai_1 = require("./ai.js");
|
|
6
6
|
Object.defineProperty(exports, "AI", { enumerable: true, get: function () { return ai_1.AI; } });
|
|
7
7
|
var index_1 = require("./anthropic/index.js");
|
|
@@ -24,12 +24,14 @@ var index_6 = require("./fine-tuning/index.js");
|
|
|
24
24
|
Object.defineProperty(exports, "FineTuning", { enumerable: true, get: function () { return index_6.FineTuning; } });
|
|
25
25
|
var index_7 = require("./integrations/index.js");
|
|
26
26
|
Object.defineProperty(exports, "Integrations", { enumerable: true, get: function () { return index_7.Integrations; } });
|
|
27
|
+
var index_8 = require("./knowledge/index.js");
|
|
28
|
+
Object.defineProperty(exports, "Knowledge", { enumerable: true, get: function () { return index_8.Knowledge; } });
|
|
27
29
|
var mcp_servers_1 = require("./mcp-servers.js");
|
|
28
30
|
Object.defineProperty(exports, "McpServers", { enumerable: true, get: function () { return mcp_servers_1.McpServers; } });
|
|
29
|
-
var
|
|
30
|
-
Object.defineProperty(exports, "Missions", { enumerable: true, get: function () { return
|
|
31
|
-
var
|
|
32
|
-
Object.defineProperty(exports, "OpenAI", { enumerable: true, get: function () { return
|
|
31
|
+
var index_9 = require("./missions/index.js");
|
|
32
|
+
Object.defineProperty(exports, "Missions", { enumerable: true, get: function () { return index_9.Missions; } });
|
|
33
|
+
var index_10 = require("./openai/index.js");
|
|
34
|
+
Object.defineProperty(exports, "OpenAI", { enumerable: true, get: function () { return index_10.OpenAI; } });
|
|
33
35
|
var tools_1 = require("./tools.js");
|
|
34
36
|
Object.defineProperty(exports, "Tools", { enumerable: true, get: function () { return tools_1.Tools; } });
|
|
35
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/ai/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8BASc;AARZ,wFAAA,EAAE,OAAA;AASJ,8CAA8C;AAArC,kGAAA,SAAS,OAAA;AAClB,+CAgE4B;AA/D1B,mGAAA,UAAU,OAAA;AAgEZ,oCAA0F;AAAjF,8FAAA,KAAK,OAAA;AACd,kCAA0E;AAAjE,4FAAA,IAAI,OAAA;AACb,0CAWoB;AAVlB,oGAAA,QAAQ,OAAA;AAWV,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/ai/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8BASc;AARZ,wFAAA,EAAE,OAAA;AASJ,8CAA8C;AAArC,kGAAA,SAAS,OAAA;AAClB,+CAgE4B;AA/D1B,mGAAA,UAAU,OAAA;AAgEZ,oCAA0F;AAAjF,8FAAA,KAAK,OAAA;AACd,kCAA0E;AAAjE,4FAAA,IAAI,OAAA;AACb,0CAWoB;AAVlB,oGAAA,QAAQ,OAAA;AAWV,gDAQ6B;AAP3B,oGAAA,WAAW,OAAA;AAQb,kDAW+B;AAV7B,sGAAA,aAAa,OAAA;AAWf,+CAW4B;AAV1B,mGAAA,UAAU,OAAA;AAWZ,gDAAiD;AAAxC,mGAAA,UAAU,OAAA;AACnB,iDAAoG;AAA3F,qGAAA,YAAY,OAAA;AACrB,8CAA8C;AAArC,kGAAA,SAAS,OAAA;AAClB,gDAOuB;AANrB,yGAAA,UAAU,OAAA;AAOZ,6CAY0B;AAXxB,iGAAA,QAAQ,OAAA;AAYV,4CAA4G;AAAnG,gGAAA,MAAM,OAAA;AACf,oCAUiB;AATf,8FAAA,KAAK,OAAA"}
|
package/resources/ai/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@ export { Conversations, } from "./conversations/index.mjs";
|
|
|
10
10
|
export { Embeddings, } from "./embeddings/index.mjs";
|
|
11
11
|
export { FineTuning } from "./fine-tuning/index.mjs";
|
|
12
12
|
export { Integrations } from "./integrations/index.mjs";
|
|
13
|
+
export { Knowledge } from "./knowledge/index.mjs";
|
|
13
14
|
export { McpServers, } from "./mcp-servers.mjs";
|
|
14
15
|
export { Missions, } from "./missions/index.mjs";
|
|
15
16
|
export { OpenAI } from "./openai/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/ai/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,EAAE,GAQH,iBAAa;AACd,OAAO,EAAE,SAAS,EAAE,8BAA0B;AAC9C,OAAO,EACL,UAAU,GA+DX,+BAA2B;AAC5B,OAAO,EAAE,KAAK,EAA4D,oBAAgB;AAC1F,OAAO,EAAE,IAAI,EAA8C,mBAAe;AAC1E,OAAO,EACL,QAAQ,GAUT,uBAAmB;AACpB,OAAO,EACL,WAAW,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/ai/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,EAAE,GAQH,iBAAa;AACd,OAAO,EAAE,SAAS,EAAE,8BAA0B;AAC9C,OAAO,EACL,UAAU,GA+DX,+BAA2B;AAC5B,OAAO,EAAE,KAAK,EAA4D,oBAAgB;AAC1F,OAAO,EAAE,IAAI,EAA8C,mBAAe;AAC1E,OAAO,EACL,QAAQ,GAUT,uBAAmB;AACpB,OAAO,EACL,WAAW,GAOZ,gCAA4B;AAC7B,OAAO,EACL,aAAa,GAUd,kCAA8B;AAC/B,OAAO,EACL,UAAU,GAUX,+BAA2B;AAC5B,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,YAAY,EAAkD,iCAA6B;AACpG,OAAO,EAAE,SAAS,EAAE,8BAA0B;AAC9C,OAAO,EACL,UAAU,GAMX,0BAAsB;AACvB,OAAO,EACL,QAAQ,GAWT,6BAAyB;AAC1B,OAAO,EAAE,MAAM,EAAsE,2BAAuB;AAC5G,OAAO,EACL,KAAK,GASN,oBAAgB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Create and manage logical collections of your Telnyx data, tune retrieval settings, manage sources, and run collection-scoped semantic search.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Collections extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Runs search over the documents in a collection, ranked by relevance to `query`.
|
|
10
|
+
* Searches currently run `vector` retrieval (semantic similarity). The
|
|
11
|
+
* collection's `retrieval_type` setting is the forward-compatible selector:
|
|
12
|
+
* `hybrid` (vector similarity fused with keyword matching) can be set but cannot
|
|
13
|
+
* be searched yet, and `keyword` (lexical BM25 matching) is not accepted yet --
|
|
14
|
+
* setting it returns 422 `unsupported_retrieval_type`. A per-request
|
|
15
|
+
* `retrieval_type` is accepted but ignored; `meta.retrieval_type` echoes the mode
|
|
16
|
+
* that actually ran. When `query` is omitted, returns a plain catalog listing of
|
|
17
|
+
* the collection's documents.
|
|
18
|
+
*
|
|
19
|
+
* **How it works:**
|
|
20
|
+
*
|
|
21
|
+
* 1. The `query` text is embedded into a 1024-dimensional vector using the
|
|
22
|
+
* multilingual-e5-large model.
|
|
23
|
+
* 2. The embedding is compared against the collection's indexed document chunks
|
|
24
|
+
* using semantic similarity. When `hybrid` and `keyword` execution ship, those
|
|
25
|
+
* scores will be fused with, or replaced by, lexical BM25 matching.
|
|
26
|
+
* 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
|
|
27
|
+
* `page[size]`.
|
|
28
|
+
*
|
|
29
|
+
* **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
|
|
30
|
+
* Results are automatically scoped to your organization and cannot be overridden.
|
|
31
|
+
*
|
|
32
|
+
* **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
|
|
33
|
+
* results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
|
|
34
|
+
* `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
|
|
35
|
+
*
|
|
36
|
+
* **Examples:**
|
|
37
|
+
*
|
|
38
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=billing+issue&top_k=10`
|
|
39
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=refund&sources=voice,message`
|
|
40
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response =
|
|
45
|
+
* await client.ai.knowledge.collections.retrieveDocuments(
|
|
46
|
+
* 'support-transcripts',
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
retrieveDocuments(slug: string, query?: CollectionRetrieveDocumentsParams | null | undefined, options?: RequestOptions): APIPromise<CollectionRetrieveDocumentsResponse>;
|
|
51
|
+
}
|
|
52
|
+
export interface CollectionRetrieveDocumentsResponse {
|
|
53
|
+
data?: Array<CollectionRetrieveDocumentsResponse.Data>;
|
|
54
|
+
meta?: CollectionRetrieveDocumentsResponse.Meta;
|
|
55
|
+
}
|
|
56
|
+
export declare namespace CollectionRetrieveDocumentsResponse {
|
|
57
|
+
interface Data {
|
|
58
|
+
id?: string;
|
|
59
|
+
chunk_index?: number;
|
|
60
|
+
chunk_total?: number;
|
|
61
|
+
ingested_at?: string;
|
|
62
|
+
metadata?: {
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
};
|
|
65
|
+
organization_id?: string;
|
|
66
|
+
record_created_at?: string;
|
|
67
|
+
record_id?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The source record kind this chunk came from (e.g. `voice`, `meeting_bot`,
|
|
70
|
+
* `message`).
|
|
71
|
+
*/
|
|
72
|
+
record_type?: string;
|
|
73
|
+
region?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Relevance score (higher = more relevant) for ranked search. `0.0` for plain
|
|
76
|
+
* catalog listings (when `query` is omitted).
|
|
77
|
+
*/
|
|
78
|
+
score?: number;
|
|
79
|
+
text?: string;
|
|
80
|
+
user_id?: string;
|
|
81
|
+
}
|
|
82
|
+
interface Meta {
|
|
83
|
+
collection_slug?: string;
|
|
84
|
+
page_number?: number;
|
|
85
|
+
page_size?: number;
|
|
86
|
+
retrieval_type?: string;
|
|
87
|
+
searched_sources?: Array<string>;
|
|
88
|
+
top_k?: number;
|
|
89
|
+
total_pages?: number;
|
|
90
|
+
total_results?: number;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export interface CollectionRetrieveDocumentsParams {
|
|
94
|
+
/**
|
|
95
|
+
* Field filters applied before ranking, using `filter[field][operator]=value`.
|
|
96
|
+
* Supported operators: `eq` (default), `in`, `gte`, `gt`, `lte`, `lt`, `contains`.
|
|
97
|
+
* Known fields: `record_type`, `record_id`, `user_id`, `record_created_at`,
|
|
98
|
+
* `ingested_at`; any other name resolves to a `metadata.<field>` filter. Example:
|
|
99
|
+
* `filter[record_id][eq]=rec_123`.
|
|
100
|
+
*/
|
|
101
|
+
filter?: {
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Page number to return (1-based). Defaults to 1.
|
|
106
|
+
*/
|
|
107
|
+
'page[number]'?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Number of results per page. Defaults to 20.
|
|
110
|
+
*/
|
|
111
|
+
'page[size]'?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Natural-language search query. When provided, the text is matched against the
|
|
114
|
+
* collection's document chunks using the collection's `retrieval_type` (vector or
|
|
115
|
+
* hybrid). When omitted, documents are returned as a plain catalog listing.
|
|
116
|
+
*/
|
|
117
|
+
query?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Reserved; not yet functional. A value supplied here is accepted but ignored — it
|
|
120
|
+
* does not override the collection's configured strategy, and it is not echoed
|
|
121
|
+
* back. Searches run `vector` retrieval, and `meta.retrieval_type` reports the
|
|
122
|
+
* mode that actually ran. To change retrieval strategy, set it on the collection's
|
|
123
|
+
* settings subresource.
|
|
124
|
+
*/
|
|
125
|
+
retrieval_type?: 'vector' | 'hybrid' | 'keyword';
|
|
126
|
+
/**
|
|
127
|
+
* Comma-separated list of source types to restrict the search to. When omitted,
|
|
128
|
+
* all of the collection's sources are searched.
|
|
129
|
+
*/
|
|
130
|
+
sources?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Maximum number of ranked results to consider. When omitted, the collection's
|
|
133
|
+
* configured `top_k` setting is used.
|
|
134
|
+
*/
|
|
135
|
+
top_k?: number;
|
|
136
|
+
}
|
|
137
|
+
export declare namespace Collections {
|
|
138
|
+
export { type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams, };
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=collections.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,iBAAiB,CACf,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,iCAAiC,GAAG,IAAI,GAAG,SAAc,EAChE,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mCAAmC,CAAC;CAGnD;AAED,MAAM,WAAW,mCAAmC;IAClD,IAAI,CAAC,EAAE,KAAK,CAAC,mCAAmC,CAAC,IAAI,CAAC,CAAC;IAEvD,IAAI,CAAC,EAAE,mCAAmC,CAAC,IAAI,CAAC;CACjD;AAED,yBAAiB,mCAAmC,CAAC;IACnD,UAAiB,IAAI;QACnB,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,QAAQ,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QAEtC,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAE3B,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED,UAAiB,IAAI;QACnB,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEjC,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,iCAAiC;IAChD;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEpC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAEjD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Create and manage logical collections of your Telnyx data, tune retrieval settings, manage sources, and run collection-scoped semantic search.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Collections extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Runs search over the documents in a collection, ranked by relevance to `query`.
|
|
10
|
+
* Searches currently run `vector` retrieval (semantic similarity). The
|
|
11
|
+
* collection's `retrieval_type` setting is the forward-compatible selector:
|
|
12
|
+
* `hybrid` (vector similarity fused with keyword matching) can be set but cannot
|
|
13
|
+
* be searched yet, and `keyword` (lexical BM25 matching) is not accepted yet --
|
|
14
|
+
* setting it returns 422 `unsupported_retrieval_type`. A per-request
|
|
15
|
+
* `retrieval_type` is accepted but ignored; `meta.retrieval_type` echoes the mode
|
|
16
|
+
* that actually ran. When `query` is omitted, returns a plain catalog listing of
|
|
17
|
+
* the collection's documents.
|
|
18
|
+
*
|
|
19
|
+
* **How it works:**
|
|
20
|
+
*
|
|
21
|
+
* 1. The `query` text is embedded into a 1024-dimensional vector using the
|
|
22
|
+
* multilingual-e5-large model.
|
|
23
|
+
* 2. The embedding is compared against the collection's indexed document chunks
|
|
24
|
+
* using semantic similarity. When `hybrid` and `keyword` execution ship, those
|
|
25
|
+
* scores will be fused with, or replaced by, lexical BM25 matching.
|
|
26
|
+
* 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
|
|
27
|
+
* `page[size]`.
|
|
28
|
+
*
|
|
29
|
+
* **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
|
|
30
|
+
* Results are automatically scoped to your organization and cannot be overridden.
|
|
31
|
+
*
|
|
32
|
+
* **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
|
|
33
|
+
* results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
|
|
34
|
+
* `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
|
|
35
|
+
*
|
|
36
|
+
* **Examples:**
|
|
37
|
+
*
|
|
38
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=billing+issue&top_k=10`
|
|
39
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=refund&sources=voice,message`
|
|
40
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response =
|
|
45
|
+
* await client.ai.knowledge.collections.retrieveDocuments(
|
|
46
|
+
* 'support-transcripts',
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
retrieveDocuments(slug: string, query?: CollectionRetrieveDocumentsParams | null | undefined, options?: RequestOptions): APIPromise<CollectionRetrieveDocumentsResponse>;
|
|
51
|
+
}
|
|
52
|
+
export interface CollectionRetrieveDocumentsResponse {
|
|
53
|
+
data?: Array<CollectionRetrieveDocumentsResponse.Data>;
|
|
54
|
+
meta?: CollectionRetrieveDocumentsResponse.Meta;
|
|
55
|
+
}
|
|
56
|
+
export declare namespace CollectionRetrieveDocumentsResponse {
|
|
57
|
+
interface Data {
|
|
58
|
+
id?: string;
|
|
59
|
+
chunk_index?: number;
|
|
60
|
+
chunk_total?: number;
|
|
61
|
+
ingested_at?: string;
|
|
62
|
+
metadata?: {
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
};
|
|
65
|
+
organization_id?: string;
|
|
66
|
+
record_created_at?: string;
|
|
67
|
+
record_id?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The source record kind this chunk came from (e.g. `voice`, `meeting_bot`,
|
|
70
|
+
* `message`).
|
|
71
|
+
*/
|
|
72
|
+
record_type?: string;
|
|
73
|
+
region?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Relevance score (higher = more relevant) for ranked search. `0.0` for plain
|
|
76
|
+
* catalog listings (when `query` is omitted).
|
|
77
|
+
*/
|
|
78
|
+
score?: number;
|
|
79
|
+
text?: string;
|
|
80
|
+
user_id?: string;
|
|
81
|
+
}
|
|
82
|
+
interface Meta {
|
|
83
|
+
collection_slug?: string;
|
|
84
|
+
page_number?: number;
|
|
85
|
+
page_size?: number;
|
|
86
|
+
retrieval_type?: string;
|
|
87
|
+
searched_sources?: Array<string>;
|
|
88
|
+
top_k?: number;
|
|
89
|
+
total_pages?: number;
|
|
90
|
+
total_results?: number;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export interface CollectionRetrieveDocumentsParams {
|
|
94
|
+
/**
|
|
95
|
+
* Field filters applied before ranking, using `filter[field][operator]=value`.
|
|
96
|
+
* Supported operators: `eq` (default), `in`, `gte`, `gt`, `lte`, `lt`, `contains`.
|
|
97
|
+
* Known fields: `record_type`, `record_id`, `user_id`, `record_created_at`,
|
|
98
|
+
* `ingested_at`; any other name resolves to a `metadata.<field>` filter. Example:
|
|
99
|
+
* `filter[record_id][eq]=rec_123`.
|
|
100
|
+
*/
|
|
101
|
+
filter?: {
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Page number to return (1-based). Defaults to 1.
|
|
106
|
+
*/
|
|
107
|
+
'page[number]'?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Number of results per page. Defaults to 20.
|
|
110
|
+
*/
|
|
111
|
+
'page[size]'?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Natural-language search query. When provided, the text is matched against the
|
|
114
|
+
* collection's document chunks using the collection's `retrieval_type` (vector or
|
|
115
|
+
* hybrid). When omitted, documents are returned as a plain catalog listing.
|
|
116
|
+
*/
|
|
117
|
+
query?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Reserved; not yet functional. A value supplied here is accepted but ignored — it
|
|
120
|
+
* does not override the collection's configured strategy, and it is not echoed
|
|
121
|
+
* back. Searches run `vector` retrieval, and `meta.retrieval_type` reports the
|
|
122
|
+
* mode that actually ran. To change retrieval strategy, set it on the collection's
|
|
123
|
+
* settings subresource.
|
|
124
|
+
*/
|
|
125
|
+
retrieval_type?: 'vector' | 'hybrid' | 'keyword';
|
|
126
|
+
/**
|
|
127
|
+
* Comma-separated list of source types to restrict the search to. When omitted,
|
|
128
|
+
* all of the collection's sources are searched.
|
|
129
|
+
*/
|
|
130
|
+
sources?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Maximum number of ranked results to consider. When omitted, the collection's
|
|
133
|
+
* configured `top_k` setting is used.
|
|
134
|
+
*/
|
|
135
|
+
top_k?: number;
|
|
136
|
+
}
|
|
137
|
+
export declare namespace Collections {
|
|
138
|
+
export { type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams, };
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,iBAAiB,CACf,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,iCAAiC,GAAG,IAAI,GAAG,SAAc,EAChE,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mCAAmC,CAAC;CAGnD;AAED,MAAM,WAAW,mCAAmC;IAClD,IAAI,CAAC,EAAE,KAAK,CAAC,mCAAmC,CAAC,IAAI,CAAC,CAAC;IAEvD,IAAI,CAAC,EAAE,mCAAmC,CAAC,IAAI,CAAC;CACjD;AAED,yBAAiB,mCAAmC,CAAC;IACnD,UAAiB,IAAI;QACnB,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,QAAQ,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QAEtC,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAE3B,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED,UAAiB,IAAI;QACnB,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEjC,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,iCAAiC;IAChD;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEpC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAEjD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Collections = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
7
|
+
/**
|
|
8
|
+
* Create and manage logical collections of your Telnyx data, tune retrieval settings, manage sources, and run collection-scoped semantic search.
|
|
9
|
+
*/
|
|
10
|
+
class Collections extends resource_1.APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Runs search over the documents in a collection, ranked by relevance to `query`.
|
|
13
|
+
* Searches currently run `vector` retrieval (semantic similarity). The
|
|
14
|
+
* collection's `retrieval_type` setting is the forward-compatible selector:
|
|
15
|
+
* `hybrid` (vector similarity fused with keyword matching) can be set but cannot
|
|
16
|
+
* be searched yet, and `keyword` (lexical BM25 matching) is not accepted yet --
|
|
17
|
+
* setting it returns 422 `unsupported_retrieval_type`. A per-request
|
|
18
|
+
* `retrieval_type` is accepted but ignored; `meta.retrieval_type` echoes the mode
|
|
19
|
+
* that actually ran. When `query` is omitted, returns a plain catalog listing of
|
|
20
|
+
* the collection's documents.
|
|
21
|
+
*
|
|
22
|
+
* **How it works:**
|
|
23
|
+
*
|
|
24
|
+
* 1. The `query` text is embedded into a 1024-dimensional vector using the
|
|
25
|
+
* multilingual-e5-large model.
|
|
26
|
+
* 2. The embedding is compared against the collection's indexed document chunks
|
|
27
|
+
* using semantic similarity. When `hybrid` and `keyword` execution ship, those
|
|
28
|
+
* scores will be fused with, or replaced by, lexical BM25 matching.
|
|
29
|
+
* 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
|
|
30
|
+
* `page[size]`.
|
|
31
|
+
*
|
|
32
|
+
* **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
|
|
33
|
+
* Results are automatically scoped to your organization and cannot be overridden.
|
|
34
|
+
*
|
|
35
|
+
* **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
|
|
36
|
+
* results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
|
|
37
|
+
* `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
|
|
38
|
+
*
|
|
39
|
+
* **Examples:**
|
|
40
|
+
*
|
|
41
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=billing+issue&top_k=10`
|
|
42
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=refund&sources=voice,message`
|
|
43
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const response =
|
|
48
|
+
* await client.ai.knowledge.collections.retrieveDocuments(
|
|
49
|
+
* 'support-transcripts',
|
|
50
|
+
* );
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
retrieveDocuments(slug, query = {}, options) {
|
|
54
|
+
return this._client.get((0, path_1.path) `/ai/knowledge/collections/${slug}/documents`, { query, ...options });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.Collections = Collections;
|
|
58
|
+
//# sourceMappingURL=collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/collections.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,iBAAiB,CACf,IAAY,EACZ,QAA8D,EAAE,EAChE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,6BAA6B,IAAI,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;CACF;AAlDD,kCAkDC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Create and manage logical collections of your Telnyx data, tune retrieval settings, manage sources, and run collection-scoped semantic search.
|
|
6
|
+
*/
|
|
7
|
+
export class Collections extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Runs search over the documents in a collection, ranked by relevance to `query`.
|
|
10
|
+
* Searches currently run `vector` retrieval (semantic similarity). The
|
|
11
|
+
* collection's `retrieval_type` setting is the forward-compatible selector:
|
|
12
|
+
* `hybrid` (vector similarity fused with keyword matching) can be set but cannot
|
|
13
|
+
* be searched yet, and `keyword` (lexical BM25 matching) is not accepted yet --
|
|
14
|
+
* setting it returns 422 `unsupported_retrieval_type`. A per-request
|
|
15
|
+
* `retrieval_type` is accepted but ignored; `meta.retrieval_type` echoes the mode
|
|
16
|
+
* that actually ran. When `query` is omitted, returns a plain catalog listing of
|
|
17
|
+
* the collection's documents.
|
|
18
|
+
*
|
|
19
|
+
* **How it works:**
|
|
20
|
+
*
|
|
21
|
+
* 1. The `query` text is embedded into a 1024-dimensional vector using the
|
|
22
|
+
* multilingual-e5-large model.
|
|
23
|
+
* 2. The embedding is compared against the collection's indexed document chunks
|
|
24
|
+
* using semantic similarity. When `hybrid` and `keyword` execution ship, those
|
|
25
|
+
* scores will be fused with, or replaced by, lexical BM25 matching.
|
|
26
|
+
* 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
|
|
27
|
+
* `page[size]`.
|
|
28
|
+
*
|
|
29
|
+
* **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
|
|
30
|
+
* Results are automatically scoped to your organization and cannot be overridden.
|
|
31
|
+
*
|
|
32
|
+
* **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
|
|
33
|
+
* results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
|
|
34
|
+
* `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
|
|
35
|
+
*
|
|
36
|
+
* **Examples:**
|
|
37
|
+
*
|
|
38
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=billing+issue&top_k=10`
|
|
39
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=refund&sources=voice,message`
|
|
40
|
+
* - `GET /v2/ai/knowledge/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response =
|
|
45
|
+
* await client.ai.knowledge.collections.retrieveDocuments(
|
|
46
|
+
* 'support-transcripts',
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
retrieveDocuments(slug, query = {}, options) {
|
|
51
|
+
return this._client.get(path `/ai/knowledge/collections/${slug}/documents`, { query, ...options });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=collections.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.mjs","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/collections.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAGrD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,iBAAiB,CACf,IAAY,EACZ,QAA8D,EAAE,EAChE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,6BAA6B,IAAI,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,GACvC,0BAAsB;AACvB,OAAO,EAAE,SAAS,EAAE,wBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,GACvC,yBAAsB;AACvB,OAAO,EAAE,SAAS,EAAE,uBAAoB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Knowledge = exports.Collections = void 0;
|
|
5
|
+
var collections_1 = require("./collections.js");
|
|
6
|
+
Object.defineProperty(exports, "Collections", { enumerable: true, get: function () { return collections_1.Collections; } });
|
|
7
|
+
var knowledge_1 = require("./knowledge.js");
|
|
8
|
+
Object.defineProperty(exports, "Knowledge", { enumerable: true, get: function () { return knowledge_1.Knowledge; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAIuB;AAHrB,0GAAA,WAAW,OAAA;AAIb,4CAAwC;AAA/B,sGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,WAAW,GAGZ,0BAAsB;AACvB,OAAO,EAAE,SAAS,EAAE,wBAAoB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as CollectionsAPI from "./collections.mjs";
|
|
3
|
+
import { CollectionRetrieveDocumentsParams, CollectionRetrieveDocumentsResponse, Collections } from "./collections.mjs";
|
|
4
|
+
export declare class Knowledge extends APIResource {
|
|
5
|
+
collections: CollectionsAPI.Collections;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Knowledge {
|
|
8
|
+
export { Collections as Collections, type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams, };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=knowledge.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/knowledge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,cAAc,0BAAsB;AAChD,OAAO,EACL,iCAAiC,EACjC,mCAAmC,EACnC,WAAW,EACZ,0BAAsB;AAEvB,qBAAa,SAAU,SAAQ,WAAW;IACxC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;CACxF;AAID,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as CollectionsAPI from "./collections.js";
|
|
3
|
+
import { CollectionRetrieveDocumentsParams, CollectionRetrieveDocumentsResponse, Collections } from "./collections.js";
|
|
4
|
+
export declare class Knowledge extends APIResource {
|
|
5
|
+
collections: CollectionsAPI.Collections;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Knowledge {
|
|
8
|
+
export { Collections as Collections, type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams, };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=knowledge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/knowledge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,cAAc,yBAAsB;AAChD,OAAO,EACL,iCAAiC,EACjC,mCAAmC,EACnC,WAAW,EACZ,yBAAsB;AAEvB,qBAAa,SAAU,SAAQ,WAAW;IACxC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;CACxF;AAID,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Knowledge = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const CollectionsAPI = tslib_1.__importStar(require("./collections.js"));
|
|
8
|
+
const collections_1 = require("./collections.js");
|
|
9
|
+
class Knowledge extends resource_1.APIResource {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.collections = new CollectionsAPI.Collections(this._client);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Knowledge = Knowledge;
|
|
16
|
+
Knowledge.Collections = collections_1.Collections;
|
|
17
|
+
//# sourceMappingURL=knowledge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/knowledge.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,yEAAgD;AAChD,kDAIuB;AAEvB,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAFD,8BAEC;AAED,SAAS,CAAC,WAAW,GAAG,yBAAW,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as CollectionsAPI from "./collections.mjs";
|
|
4
|
+
import { Collections, } from "./collections.mjs";
|
|
5
|
+
export class Knowledge extends APIResource {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.collections = new CollectionsAPI.Collections(this._client);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
Knowledge.Collections = Collections;
|
|
12
|
+
//# sourceMappingURL=knowledge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.mjs","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/knowledge.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,cAAc,0BAAsB;AAChD,OAAO,EAGL,WAAW,GACZ,0BAAsB;AAEvB,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAED,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.mts","sourceRoot":"","sources":["../../src/resources/ai/knowledge.ts"],"names":[],"mappings":"AAEA,sCAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../src/resources/ai/knowledge.ts"],"names":[],"mappings":"AAEA,qCAAkC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./knowledge/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=knowledge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../../src/resources/ai/knowledge.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,+DAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.mjs","sourceRoot":"","sources":["../../src/resources/ai/knowledge.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,sCAAkC"}
|
|
@@ -108,6 +108,14 @@ export interface ChatCreateCompletionParams {
|
|
|
108
108
|
* Higher values will penalize the model from repeating the same output tokens.
|
|
109
109
|
*/
|
|
110
110
|
presence_penalty?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Controls the reasoning effort for models that support it. When set, the model
|
|
113
|
+
* spends more or less compute on internal reasoning before generating its
|
|
114
|
+
* response. Supported values: none, minimal, low, medium, high, xhigh, max. Not
|
|
115
|
+
* all models support all values; unsupported values are rejected with a 400 error.
|
|
116
|
+
* When omitted, reasoning models use their default effort level.
|
|
117
|
+
*/
|
|
118
|
+
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
111
119
|
/**
|
|
112
120
|
* Use this is you want to guarantee a JSON output without defining a schema. For
|
|
113
121
|
* control over the schema, use `guided_json`.
|