telnyx 5.25.0 → 5.26.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 +32 -0
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +8 -0
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +8 -0
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js +8 -0
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs +8 -0
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/assistants/scheduled-events.d.mts +21 -0
- package/resources/ai/assistants/scheduled-events.d.mts.map +1 -1
- package/resources/ai/assistants/scheduled-events.d.ts +21 -0
- package/resources/ai/assistants/scheduled-events.d.ts.map +1 -1
- package/resources/ai/index.d.mts +2 -0
- package/resources/ai/index.d.mts.map +1 -1
- package/resources/ai/index.d.ts +2 -0
- package/resources/ai/index.d.ts.map +1 -1
- package/resources/ai/index.js +5 -1
- package/resources/ai/index.js.map +1 -1
- package/resources/ai/index.mjs +2 -0
- package/resources/ai/index.mjs.map +1 -1
- package/resources/ai/missions/index.d.mts +6 -0
- package/resources/ai/missions/index.d.mts.map +1 -0
- package/resources/ai/missions/index.d.ts +6 -0
- package/resources/ai/missions/index.d.ts.map +1 -0
- package/resources/ai/missions/index.js +15 -0
- package/resources/ai/missions/index.js.map +1 -0
- package/resources/ai/missions/index.mjs +7 -0
- package/resources/ai/missions/index.mjs.map +1 -0
- package/resources/ai/missions/knowledge-bases.d.mts +84 -0
- package/resources/ai/missions/knowledge-bases.d.mts.map +1 -0
- package/resources/ai/missions/knowledge-bases.d.ts +84 -0
- package/resources/ai/missions/knowledge-bases.d.ts.map +1 -0
- package/resources/ai/missions/knowledge-bases.js +89 -0
- package/resources/ai/missions/knowledge-bases.js.map +1 -0
- package/resources/ai/missions/knowledge-bases.mjs +85 -0
- package/resources/ai/missions/knowledge-bases.mjs.map +1 -0
- package/resources/ai/missions/mcp-servers.d.mts +84 -0
- package/resources/ai/missions/mcp-servers.d.mts.map +1 -0
- package/resources/ai/missions/mcp-servers.d.ts +84 -0
- package/resources/ai/missions/mcp-servers.d.ts.map +1 -0
- package/resources/ai/missions/mcp-servers.js +89 -0
- package/resources/ai/missions/mcp-servers.js.map +1 -0
- package/resources/ai/missions/mcp-servers.mjs +85 -0
- package/resources/ai/missions/mcp-servers.mjs.map +1 -0
- package/resources/ai/missions/missions.d.mts +168 -0
- package/resources/ai/missions/missions.d.mts.map +1 -0
- package/resources/ai/missions/missions.d.ts +168 -0
- package/resources/ai/missions/missions.d.ts.map +1 -0
- package/resources/ai/missions/missions.js +131 -0
- package/resources/ai/missions/missions.js.map +1 -0
- package/resources/ai/missions/missions.mjs +126 -0
- package/resources/ai/missions/missions.mjs.map +1 -0
- package/resources/ai/missions/runs/events.d.mts +161 -0
- package/resources/ai/missions/runs/events.d.mts.map +1 -0
- package/resources/ai/missions/runs/events.d.ts +161 -0
- package/resources/ai/missions/runs/events.d.ts.map +1 -0
- package/resources/ai/missions/runs/events.js +67 -0
- package/resources/ai/missions/runs/events.js.map +1 -0
- package/resources/ai/missions/runs/events.mjs +63 -0
- package/resources/ai/missions/runs/events.mjs.map +1 -0
- package/resources/ai/missions/runs/index.d.mts +5 -0
- package/resources/ai/missions/runs/index.d.mts.map +1 -0
- package/resources/ai/missions/runs/index.d.ts +5 -0
- package/resources/ai/missions/runs/index.d.ts.map +1 -0
- package/resources/ai/missions/runs/index.js +13 -0
- package/resources/ai/missions/runs/index.js.map +1 -0
- package/resources/ai/missions/runs/index.mjs +6 -0
- package/resources/ai/missions/runs/index.mjs.map +1 -0
- package/resources/ai/missions/runs/plan.d.mts +190 -0
- package/resources/ai/missions/runs/plan.d.mts.map +1 -0
- package/resources/ai/missions/runs/plan.d.ts +190 -0
- package/resources/ai/missions/runs/plan.d.ts.map +1 -0
- package/resources/ai/missions/runs/plan.js +112 -0
- package/resources/ai/missions/runs/plan.js.map +1 -0
- package/resources/ai/missions/runs/plan.mjs +108 -0
- package/resources/ai/missions/runs/plan.mjs.map +1 -0
- package/resources/ai/missions/runs/runs.d.mts +213 -0
- package/resources/ai/missions/runs/runs.d.mts.map +1 -0
- package/resources/ai/missions/runs/runs.d.ts +213 -0
- package/resources/ai/missions/runs/runs.d.ts.map +1 -0
- package/resources/ai/missions/runs/runs.js +148 -0
- package/resources/ai/missions/runs/runs.js.map +1 -0
- package/resources/ai/missions/runs/runs.mjs +143 -0
- package/resources/ai/missions/runs/runs.mjs.map +1 -0
- package/resources/ai/missions/runs/telnyx-agents.d.mts +90 -0
- package/resources/ai/missions/runs/telnyx-agents.d.mts.map +1 -0
- package/resources/ai/missions/runs/telnyx-agents.d.ts +90 -0
- package/resources/ai/missions/runs/telnyx-agents.d.ts.map +1 -0
- package/resources/ai/missions/runs/telnyx-agents.js +67 -0
- package/resources/ai/missions/runs/telnyx-agents.js.map +1 -0
- package/resources/ai/missions/runs/telnyx-agents.mjs +63 -0
- package/resources/ai/missions/runs/telnyx-agents.mjs.map +1 -0
- package/resources/ai/missions/runs.d.mts +2 -0
- package/resources/ai/missions/runs.d.mts.map +1 -0
- package/resources/ai/missions/runs.d.ts +2 -0
- package/resources/ai/missions/runs.d.ts.map +1 -0
- package/resources/ai/missions/runs.js +6 -0
- package/resources/ai/missions/runs.js.map +1 -0
- package/resources/ai/missions/runs.mjs +3 -0
- package/resources/ai/missions/runs.mjs.map +1 -0
- package/resources/ai/missions/tools.d.mts +79 -0
- package/resources/ai/missions/tools.d.mts.map +1 -0
- package/resources/ai/missions/tools.d.ts +79 -0
- package/resources/ai/missions/tools.d.ts.map +1 -0
- package/resources/ai/missions/tools.js +84 -0
- package/resources/ai/missions/tools.js.map +1 -0
- package/resources/ai/missions/tools.mjs +80 -0
- package/resources/ai/missions/tools.mjs.map +1 -0
- package/resources/ai/missions.d.mts +2 -0
- package/resources/ai/missions.d.mts.map +1 -0
- package/resources/ai/missions.d.ts +2 -0
- package/resources/ai/missions.d.ts.map +1 -0
- package/resources/ai/missions.js +6 -0
- package/resources/ai/missions.js.map +1 -0
- package/resources/ai/missions.mjs +3 -0
- package/resources/ai/missions.mjs.map +1 -0
- package/resources/ai/openai/embeddings.d.mts +133 -0
- package/resources/ai/openai/embeddings.d.mts.map +1 -0
- package/resources/ai/openai/embeddings.d.ts +133 -0
- package/resources/ai/openai/embeddings.d.ts.map +1 -0
- package/resources/ai/openai/embeddings.js +41 -0
- package/resources/ai/openai/embeddings.js.map +1 -0
- package/resources/ai/openai/embeddings.mjs +37 -0
- package/resources/ai/openai/embeddings.mjs.map +1 -0
- package/resources/ai/openai/index.d.mts +3 -0
- package/resources/ai/openai/index.d.mts.map +1 -0
- package/resources/ai/openai/index.d.ts +3 -0
- package/resources/ai/openai/index.d.ts.map +1 -0
- package/resources/ai/openai/index.js +9 -0
- package/resources/ai/openai/index.js.map +1 -0
- package/resources/ai/openai/index.mjs +4 -0
- package/resources/ai/openai/index.mjs.map +1 -0
- package/resources/ai/openai/openai.d.mts +10 -0
- package/resources/ai/openai/openai.d.mts.map +1 -0
- package/resources/ai/openai/openai.d.ts +10 -0
- package/resources/ai/openai/openai.d.ts.map +1 -0
- package/resources/ai/openai/openai.js +17 -0
- package/resources/ai/openai/openai.js.map +1 -0
- package/resources/ai/openai/openai.mjs +12 -0
- package/resources/ai/openai/openai.mjs.map +1 -0
- package/resources/ai/openai.d.mts +2 -0
- package/resources/ai/openai.d.mts.map +1 -0
- package/resources/ai/openai.d.ts +2 -0
- package/resources/ai/openai.d.ts.map +1 -0
- package/resources/ai/openai.js +6 -0
- package/resources/ai/openai.js.map +1 -0
- package/resources/ai/openai.mjs +3 -0
- package/resources/ai/openai.mjs.map +1 -0
- package/resources/shared.d.mts +4 -3
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +4 -3
- package/resources/shared.d.ts.map +1 -1
- package/src/client.ts +1 -1
- package/src/resources/ai/ai.ts +40 -0
- package/src/resources/ai/assistants/scheduled-events.ts +18 -0
- package/src/resources/ai/index.ts +16 -0
- package/src/resources/ai/missions/index.ts +66 -0
- package/src/resources/ai/missions/knowledge-bases.ts +136 -0
- package/src/resources/ai/missions/mcp-servers.ts +136 -0
- package/src/resources/ai/missions/missions.ts +365 -0
- package/src/resources/ai/missions/runs/events.ts +271 -0
- package/src/resources/ai/missions/runs/index.ts +53 -0
- package/src/resources/ai/missions/runs/plan.ts +271 -0
- package/src/resources/ai/missions/runs/runs.ts +384 -0
- package/src/resources/ai/missions/runs/telnyx-agents.ts +139 -0
- package/src/resources/ai/missions/runs.ts +3 -0
- package/src/resources/ai/missions/tools.ts +119 -0
- package/src/resources/ai/missions.ts +3 -0
- package/src/resources/ai/openai/embeddings.ts +168 -0
- package/src/resources/ai/openai/index.ts +9 -0
- package/src/resources/ai/openai/openai.ts +25 -0
- package/src/resources/ai/openai.ts +3 -0
- package/src/resources/shared.ts +5 -3
- 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
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class TelnyxAgents extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* List all Telnyx agents linked to a run
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const telnyxAgents =
|
|
16
|
+
* await client.ai.missions.runs.telnyxAgents.list(
|
|
17
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
18
|
+
* { mission_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
list(
|
|
23
|
+
runID: string,
|
|
24
|
+
params: TelnyxAgentListParams,
|
|
25
|
+
options?: RequestOptions,
|
|
26
|
+
): APIPromise<TelnyxAgentListResponse> {
|
|
27
|
+
const { mission_id } = params;
|
|
28
|
+
return this._client.get(path`/ai/missions/${mission_id}/runs/${runID}/telnyx-agents`, options);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Link a Telnyx AI agent (voice/messaging) to a run
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const response =
|
|
37
|
+
* await client.ai.missions.runs.telnyxAgents.link(
|
|
38
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
39
|
+
* {
|
|
40
|
+
* mission_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
41
|
+
* telnyx_agent_id: 'telnyx_agent_id',
|
|
42
|
+
* },
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
link(
|
|
47
|
+
runID: string,
|
|
48
|
+
params: TelnyxAgentLinkParams,
|
|
49
|
+
options?: RequestOptions,
|
|
50
|
+
): APIPromise<TelnyxAgentLinkResponse> {
|
|
51
|
+
const { mission_id, ...body } = params;
|
|
52
|
+
return this._client.post(path`/ai/missions/${mission_id}/runs/${runID}/telnyx-agents`, {
|
|
53
|
+
body,
|
|
54
|
+
...options,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Unlink a Telnyx agent from a run
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* await client.ai.missions.runs.telnyxAgents.unlink(
|
|
64
|
+
* 'telnyx_agent_id',
|
|
65
|
+
* {
|
|
66
|
+
* mission_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
67
|
+
* run_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
68
|
+
* },
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
unlink(telnyxAgentID: string, params: TelnyxAgentUnlinkParams, options?: RequestOptions): APIPromise<void> {
|
|
73
|
+
const { mission_id, run_id } = params;
|
|
74
|
+
return this._client.delete(
|
|
75
|
+
path`/ai/missions/${mission_id}/runs/${run_id}/telnyx-agents/${telnyxAgentID}`,
|
|
76
|
+
{ ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) },
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface TelnyxAgentListResponse {
|
|
82
|
+
data: Array<TelnyxAgentListResponse.Data>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export namespace TelnyxAgentListResponse {
|
|
86
|
+
export interface Data {
|
|
87
|
+
created_at: string;
|
|
88
|
+
|
|
89
|
+
run_id: string;
|
|
90
|
+
|
|
91
|
+
telnyx_agent_id: string;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface TelnyxAgentLinkResponse {
|
|
96
|
+
data: TelnyxAgentLinkResponse.Data;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export namespace TelnyxAgentLinkResponse {
|
|
100
|
+
export interface Data {
|
|
101
|
+
created_at: string;
|
|
102
|
+
|
|
103
|
+
run_id: string;
|
|
104
|
+
|
|
105
|
+
telnyx_agent_id: string;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface TelnyxAgentListParams {
|
|
110
|
+
mission_id: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface TelnyxAgentLinkParams {
|
|
114
|
+
/**
|
|
115
|
+
* Path param
|
|
116
|
+
*/
|
|
117
|
+
mission_id: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Body param: The Telnyx AI agent ID to link
|
|
121
|
+
*/
|
|
122
|
+
telnyx_agent_id: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface TelnyxAgentUnlinkParams {
|
|
126
|
+
mission_id: string;
|
|
127
|
+
|
|
128
|
+
run_id: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export declare namespace TelnyxAgents {
|
|
132
|
+
export {
|
|
133
|
+
type TelnyxAgentListResponse as TelnyxAgentListResponse,
|
|
134
|
+
type TelnyxAgentLinkResponse as TelnyxAgentLinkResponse,
|
|
135
|
+
type TelnyxAgentListParams as TelnyxAgentListParams,
|
|
136
|
+
type TelnyxAgentLinkParams as TelnyxAgentLinkParams,
|
|
137
|
+
type TelnyxAgentUnlinkParams as TelnyxAgentUnlinkParams,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Tools extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new tool for a mission
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const response = await client.ai.missions.tools.createTool(
|
|
16
|
+
* 'mission_id',
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
createTool(missionID: string, options?: RequestOptions): APIPromise<unknown> {
|
|
21
|
+
return this._client.post(path`/ai/missions/${missionID}/tools`, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Delete a tool from a mission
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* await client.ai.missions.tools.deleteTool('tool_id', {
|
|
30
|
+
* mission_id: 'mission_id',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
deleteTool(toolID: string, params: ToolDeleteToolParams, options?: RequestOptions): APIPromise<void> {
|
|
35
|
+
const { mission_id } = params;
|
|
36
|
+
return this._client.delete(path`/ai/missions/${mission_id}/tools/${toolID}`, {
|
|
37
|
+
...options,
|
|
38
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get a specific tool by ID
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const response = await client.ai.missions.tools.getTool(
|
|
48
|
+
* 'tool_id',
|
|
49
|
+
* { mission_id: 'mission_id' },
|
|
50
|
+
* );
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
getTool(toolID: string, params: ToolGetToolParams, options?: RequestOptions): APIPromise<unknown> {
|
|
54
|
+
const { mission_id } = params;
|
|
55
|
+
return this._client.get(path`/ai/missions/${mission_id}/tools/${toolID}`, options);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* List all tools for a mission
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const response = await client.ai.missions.tools.listTools(
|
|
64
|
+
* 'mission_id',
|
|
65
|
+
* );
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
listTools(missionID: string, options?: RequestOptions): APIPromise<unknown> {
|
|
69
|
+
return this._client.get(path`/ai/missions/${missionID}/tools`, options);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Update a tool definition
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const response = await client.ai.missions.tools.updateTool(
|
|
78
|
+
* 'tool_id',
|
|
79
|
+
* { mission_id: 'mission_id' },
|
|
80
|
+
* );
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
updateTool(toolID: string, params: ToolUpdateToolParams, options?: RequestOptions): APIPromise<unknown> {
|
|
84
|
+
const { mission_id } = params;
|
|
85
|
+
return this._client.put(path`/ai/missions/${mission_id}/tools/${toolID}`, options);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type ToolCreateToolResponse = unknown;
|
|
90
|
+
|
|
91
|
+
export type ToolGetToolResponse = unknown;
|
|
92
|
+
|
|
93
|
+
export type ToolListToolsResponse = unknown;
|
|
94
|
+
|
|
95
|
+
export type ToolUpdateToolResponse = unknown;
|
|
96
|
+
|
|
97
|
+
export interface ToolDeleteToolParams {
|
|
98
|
+
mission_id: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface ToolGetToolParams {
|
|
102
|
+
mission_id: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface ToolUpdateToolParams {
|
|
106
|
+
mission_id: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare namespace Tools {
|
|
110
|
+
export {
|
|
111
|
+
type ToolCreateToolResponse as ToolCreateToolResponse,
|
|
112
|
+
type ToolGetToolResponse as ToolGetToolResponse,
|
|
113
|
+
type ToolListToolsResponse as ToolListToolsResponse,
|
|
114
|
+
type ToolUpdateToolResponse as ToolUpdateToolResponse,
|
|
115
|
+
type ToolDeleteToolParams as ToolDeleteToolParams,
|
|
116
|
+
type ToolGetToolParams as ToolGetToolParams,
|
|
117
|
+
type ToolUpdateToolParams as ToolUpdateToolParams,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Embeddings extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Creates an embedding vector representing the input text. This endpoint is
|
|
10
|
+
* compatible with the
|
|
11
|
+
* [OpenAI Embeddings API](https://platform.openai.com/docs/api-reference/embeddings)
|
|
12
|
+
* and may be used with the OpenAI JS or Python SDK by setting the base URL to
|
|
13
|
+
* `https://api.telnyx.com/v2/ai/openai`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response =
|
|
18
|
+
* await client.ai.openai.embeddings.createEmbeddings({
|
|
19
|
+
* input: 'The quick brown fox jumps over the lazy dog',
|
|
20
|
+
* model: 'thenlper/gte-large',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
createEmbeddings(
|
|
25
|
+
body: EmbeddingCreateEmbeddingsParams,
|
|
26
|
+
options?: RequestOptions,
|
|
27
|
+
): APIPromise<EmbeddingCreateEmbeddingsResponse> {
|
|
28
|
+
return this._client.post('/ai/openai/embeddings', { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Returns a list of available embedding models. This endpoint is compatible with
|
|
33
|
+
* the OpenAI Models API format.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const response =
|
|
38
|
+
* await client.ai.openai.embeddings.listEmbeddingModels();
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
listEmbeddingModels(options?: RequestOptions): APIPromise<EmbeddingListEmbeddingModelsResponse> {
|
|
42
|
+
return this._client.get('/ai/openai/embeddings/models', options);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface EmbeddingCreateEmbeddingsResponse {
|
|
47
|
+
/**
|
|
48
|
+
* List of embedding objects
|
|
49
|
+
*/
|
|
50
|
+
data: Array<EmbeddingCreateEmbeddingsResponse.Data>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The model used for embedding
|
|
54
|
+
*/
|
|
55
|
+
model: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The object type, always 'list'
|
|
59
|
+
*/
|
|
60
|
+
object: string;
|
|
61
|
+
|
|
62
|
+
usage: EmbeddingCreateEmbeddingsResponse.Usage;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export namespace EmbeddingCreateEmbeddingsResponse {
|
|
66
|
+
export interface Data {
|
|
67
|
+
/**
|
|
68
|
+
* The embedding vector
|
|
69
|
+
*/
|
|
70
|
+
embedding: Array<number>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The index of the embedding in the list of embeddings
|
|
74
|
+
*/
|
|
75
|
+
index: number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The object type, always 'embedding'
|
|
79
|
+
*/
|
|
80
|
+
object: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface Usage {
|
|
84
|
+
/**
|
|
85
|
+
* Number of tokens in the input
|
|
86
|
+
*/
|
|
87
|
+
prompt_tokens: number;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Total number of tokens used
|
|
91
|
+
*/
|
|
92
|
+
total_tokens: number;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface EmbeddingListEmbeddingModelsResponse {
|
|
97
|
+
/**
|
|
98
|
+
* List of available embedding models
|
|
99
|
+
*/
|
|
100
|
+
data: Array<EmbeddingListEmbeddingModelsResponse.Data>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The object type, always 'list'
|
|
104
|
+
*/
|
|
105
|
+
object: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export namespace EmbeddingListEmbeddingModelsResponse {
|
|
109
|
+
export interface Data {
|
|
110
|
+
/**
|
|
111
|
+
* The model identifier
|
|
112
|
+
*/
|
|
113
|
+
id: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Unix timestamp of when the model was created
|
|
117
|
+
*/
|
|
118
|
+
created: number;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The object type, always 'model'
|
|
122
|
+
*/
|
|
123
|
+
object: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The organization that owns the model
|
|
127
|
+
*/
|
|
128
|
+
owned_by: string;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface EmbeddingCreateEmbeddingsParams {
|
|
133
|
+
/**
|
|
134
|
+
* Input text to embed. Can be a string or array of strings.
|
|
135
|
+
*/
|
|
136
|
+
input: string | Array<string>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* ID of the model to use. Use the List embedding models endpoint to see available
|
|
140
|
+
* models.
|
|
141
|
+
*/
|
|
142
|
+
model: string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The number of dimensions the resulting output embeddings should have. Only
|
|
146
|
+
* supported in some models.
|
|
147
|
+
*/
|
|
148
|
+
dimensions?: number;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The format to return the embeddings in.
|
|
152
|
+
*/
|
|
153
|
+
encoding_format?: 'float' | 'base64';
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* A unique identifier representing your end-user for monitoring and abuse
|
|
157
|
+
* detection.
|
|
158
|
+
*/
|
|
159
|
+
user?: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare namespace Embeddings {
|
|
163
|
+
export {
|
|
164
|
+
type EmbeddingCreateEmbeddingsResponse as EmbeddingCreateEmbeddingsResponse,
|
|
165
|
+
type EmbeddingListEmbeddingModelsResponse as EmbeddingListEmbeddingModelsResponse,
|
|
166
|
+
type EmbeddingCreateEmbeddingsParams as EmbeddingCreateEmbeddingsParams,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Embeddings,
|
|
5
|
+
type EmbeddingCreateEmbeddingsResponse,
|
|
6
|
+
type EmbeddingListEmbeddingModelsResponse,
|
|
7
|
+
type EmbeddingCreateEmbeddingsParams,
|
|
8
|
+
} from './embeddings';
|
|
9
|
+
export { OpenAI } from './openai';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as EmbeddingsAPI from './embeddings';
|
|
5
|
+
import {
|
|
6
|
+
EmbeddingCreateEmbeddingsParams,
|
|
7
|
+
EmbeddingCreateEmbeddingsResponse,
|
|
8
|
+
EmbeddingListEmbeddingModelsResponse,
|
|
9
|
+
Embeddings,
|
|
10
|
+
} from './embeddings';
|
|
11
|
+
|
|
12
|
+
export class OpenAI extends APIResource {
|
|
13
|
+
embeddings: EmbeddingsAPI.Embeddings = new EmbeddingsAPI.Embeddings(this._client);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
OpenAI.Embeddings = Embeddings;
|
|
17
|
+
|
|
18
|
+
export declare namespace OpenAI {
|
|
19
|
+
export {
|
|
20
|
+
Embeddings as Embeddings,
|
|
21
|
+
type EmbeddingCreateEmbeddingsResponse as EmbeddingCreateEmbeddingsResponse,
|
|
22
|
+
type EmbeddingListEmbeddingModelsResponse as EmbeddingListEmbeddingModelsResponse,
|
|
23
|
+
type EmbeddingCreateEmbeddingsParams as EmbeddingCreateEmbeddingsParams,
|
|
24
|
+
};
|
|
25
|
+
}
|
package/src/resources/shared.ts
CHANGED
|
@@ -74,7 +74,7 @@ export interface ConnectionNoiseSuppressionDetails {
|
|
|
74
74
|
* The attenuation limit value for the selected engine. Default values vary by
|
|
75
75
|
* engine: 0 for 'denoiser', 80 for 'deep_filter_net', 'deep_filter_net_large', and
|
|
76
76
|
* all Krisp engines ('krisp_viva_tel', 'krisp_viva_tel_lite',
|
|
77
|
-
* 'krisp_viva_promodel', 'krisp_viva_ss').
|
|
77
|
+
* 'krisp_viva_promodel', 'krisp_viva_ss'), 100 for 'quail_voice_focus'.
|
|
78
78
|
*/
|
|
79
79
|
attenuation_limit?: number;
|
|
80
80
|
|
|
@@ -83,7 +83,8 @@ export interface ConnectionNoiseSuppressionDetails {
|
|
|
83
83
|
* 'deep_filter_net' and 'deep_filter_net_large' are alternative engines with
|
|
84
84
|
* different performance characteristics. Krisp engines ('krisp_viva_tel',
|
|
85
85
|
* 'krisp_viva_tel_lite', 'krisp_viva_promodel', 'krisp_viva_ss') provide advanced
|
|
86
|
-
* noise suppression capabilities.
|
|
86
|
+
* noise suppression capabilities. 'quail_voice_focus' provides Quail-based voice
|
|
87
|
+
* focus noise suppression.
|
|
87
88
|
*/
|
|
88
89
|
engine?:
|
|
89
90
|
| 'denoiser'
|
|
@@ -92,7 +93,8 @@ export interface ConnectionNoiseSuppressionDetails {
|
|
|
92
93
|
| 'krisp_viva_tel'
|
|
93
94
|
| 'krisp_viva_tel_lite'
|
|
94
95
|
| 'krisp_viva_promodel'
|
|
95
|
-
| 'krisp_viva_ss'
|
|
96
|
+
| 'krisp_viva_ss'
|
|
97
|
+
| 'quail_voice_focus';
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
export interface ConnectionsPaginationMeta {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '5.
|
|
1
|
+
export const VERSION = '5.26.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "5.
|
|
1
|
+
export declare const VERSION = "5.26.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "5.
|
|
1
|
+
export declare const VERSION = "5.26.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '5.
|
|
1
|
+
export const VERSION = '5.26.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|