telnyx 6.62.0 → 6.63.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 +8 -0
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +5 -5
- package/resources/ai/ai.d.ts +5 -5
- package/resources/ai/ai.js +5 -5
- package/resources/ai/ai.mjs +5 -5
- package/resources/ai/openai/openai.d.mts +68 -10
- package/resources/ai/openai/openai.d.mts.map +1 -1
- package/resources/ai/openai/openai.d.ts +68 -10
- package/resources/ai/openai/openai.d.ts.map +1 -1
- package/resources/ai/openai/openai.js +41 -9
- package/resources/ai/openai/openai.js.map +1 -1
- package/resources/ai/openai/openai.mjs +41 -9
- package/resources/ai/openai/openai.mjs.map +1 -1
- package/src/resources/ai/ai.ts +5 -5
- package/src/resources/ai/openai/openai.ts +74 -10
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.63.0 (2026-05-11)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v6.62.0...v6.63.0](https://github.com/team-telnyx/telnyx-node/compare/v6.62.0...v6.63.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Document OpenAI responses conversation flow ([21116f6](https://github.com/team-telnyx/telnyx-node/commit/21116f6b969903a70e45c8bdb7c2843d0599c052))
|
|
10
|
+
|
|
3
11
|
## 6.62.0 (2026-05-11)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v6.61.0...v6.62.0](https://github.com/team-telnyx/telnyx-node/compare/v6.61.0...v6.62.0)
|
package/package.json
CHANGED
package/resources/ai/ai.d.mts
CHANGED
|
@@ -42,12 +42,12 @@ export declare class AI extends APIResource {
|
|
|
42
42
|
openai: OpenAIAPI.OpenAI;
|
|
43
43
|
tools: ToolsAPI.Tools;
|
|
44
44
|
/**
|
|
45
|
-
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead.
|
|
46
|
-
*
|
|
47
|
-
* [OpenAI Responses API](https://
|
|
45
|
+
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead. This endpoint is
|
|
46
|
+
* compatible with the
|
|
47
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
48
48
|
* and may be used with the OpenAI JS or Python SDK. Response id parameter is not
|
|
49
|
-
* supported at the moment. Use
|
|
50
|
-
* conversations
|
|
49
|
+
* supported at the moment. Use the `conversation` parameter with a Telnyx
|
|
50
|
+
* Conversation ID to leverage persistent conversations.
|
|
51
51
|
*
|
|
52
52
|
* @deprecated
|
|
53
53
|
*/
|
package/resources/ai/ai.d.ts
CHANGED
|
@@ -42,12 +42,12 @@ export declare class AI extends APIResource {
|
|
|
42
42
|
openai: OpenAIAPI.OpenAI;
|
|
43
43
|
tools: ToolsAPI.Tools;
|
|
44
44
|
/**
|
|
45
|
-
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead.
|
|
46
|
-
*
|
|
47
|
-
* [OpenAI Responses API](https://
|
|
45
|
+
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead. This endpoint is
|
|
46
|
+
* compatible with the
|
|
47
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
48
48
|
* and may be used with the OpenAI JS or Python SDK. Response id parameter is not
|
|
49
|
-
* supported at the moment. Use
|
|
50
|
-
* conversations
|
|
49
|
+
* supported at the moment. Use the `conversation` parameter with a Telnyx
|
|
50
|
+
* Conversation ID to leverage persistent conversations.
|
|
51
51
|
*
|
|
52
52
|
* @deprecated
|
|
53
53
|
*/
|
package/resources/ai/ai.js
CHANGED
|
@@ -48,12 +48,12 @@ class AI extends resource_1.APIResource {
|
|
|
48
48
|
this.tools = new ToolsAPI.Tools(this._client);
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead.
|
|
52
|
-
*
|
|
53
|
-
* [OpenAI Responses API](https://
|
|
51
|
+
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead. This endpoint is
|
|
52
|
+
* compatible with the
|
|
53
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
54
54
|
* and may be used with the OpenAI JS or Python SDK. Response id parameter is not
|
|
55
|
-
* supported at the moment. Use
|
|
56
|
-
* conversations
|
|
55
|
+
* supported at the moment. Use the `conversation` parameter with a Telnyx
|
|
56
|
+
* Conversation ID to leverage persistent conversations.
|
|
57
57
|
*
|
|
58
58
|
* @deprecated
|
|
59
59
|
*/
|
package/resources/ai/ai.mjs
CHANGED
|
@@ -44,12 +44,12 @@ export class AI extends APIResource {
|
|
|
44
44
|
this.tools = new ToolsAPI.Tools(this._client);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead.
|
|
48
|
-
*
|
|
49
|
-
* [OpenAI Responses API](https://
|
|
47
|
+
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead. This endpoint is
|
|
48
|
+
* compatible with the
|
|
49
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
50
50
|
* and may be used with the OpenAI JS or Python SDK. Response id parameter is not
|
|
51
|
-
* supported at the moment. Use
|
|
52
|
-
* conversations
|
|
51
|
+
* supported at the moment. Use the `conversation` parameter with a Telnyx
|
|
52
|
+
* Conversation ID to leverage persistent conversations.
|
|
53
53
|
*
|
|
54
54
|
* @deprecated
|
|
55
55
|
*/
|
|
@@ -10,20 +10,53 @@ export declare class OpenAI extends APIResource {
|
|
|
10
10
|
embeddings: EmbeddingsAPI.Embeddings;
|
|
11
11
|
chat: ChatAPI.Chat;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* Create a response using Telnyx's OpenAI-compatible Responses API. This endpoint
|
|
14
|
+
* is compatible with the
|
|
15
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
16
|
+
* and may be used with the OpenAI JS or Python SDK by setting the base URL to
|
|
17
|
+
* `https://api.telnyx.com/v2/ai/openai`.
|
|
18
|
+
*
|
|
19
|
+
* The `conversation` parameter refers to a Telnyx Conversation rather than an
|
|
20
|
+
* OpenAI-hosted conversation object. To persist a thread across turns, first
|
|
21
|
+
* [create a conversation](https://developers.telnyx.com/api-reference/conversations/create-a-conversation)
|
|
22
|
+
* with `POST /ai/conversations`, then pass that conversation's `id` in the
|
|
23
|
+
* Responses request as `conversation`. The endpoint appends the new input,
|
|
24
|
+
* assistant output, reasoning, and tool-call messages to that conversation. Reuse
|
|
25
|
+
* the same `conversation` id on subsequent Responses requests, including
|
|
26
|
+
* tool-result followups, so the model receives the prior context.
|
|
27
|
+
*
|
|
28
|
+
* If `conversation` is omitted, the request is processed without persisting
|
|
29
|
+
* messages to a Telnyx conversation. Use the Conversations API to manage history:
|
|
30
|
+
* [list conversations](https://developers.telnyx.com/api-reference/conversations/list-conversations)
|
|
31
|
+
* (optionally filtered by metadata),
|
|
32
|
+
* [fetch messages](https://developers.telnyx.com/api-reference/conversations/get-conversation-messages)
|
|
33
|
+
* for a conversation, and optionally
|
|
34
|
+
* [add messages](https://developers.telnyx.com/api-reference/conversations/create-message)
|
|
35
|
+
* outside the Responses flow.
|
|
36
|
+
*
|
|
37
|
+
* You can attach arbitrary metadata when creating a conversation (for example to
|
|
38
|
+
* tag the conversation's source, channel, or user) and later filter by it when
|
|
39
|
+
* listing conversations.
|
|
18
40
|
*
|
|
19
41
|
* @example
|
|
20
42
|
* ```ts
|
|
21
43
|
* const response = await client.ai.openai.createResponse({
|
|
22
|
-
*
|
|
44
|
+
* conversation: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
|
|
45
|
+
* input: [
|
|
46
|
+
* {
|
|
47
|
+
* role: 'user',
|
|
48
|
+
* content: [
|
|
49
|
+
* { type: 'input_text', text: 'Hello, world!' },
|
|
50
|
+
* ],
|
|
51
|
+
* },
|
|
52
|
+
* ],
|
|
53
|
+
* instructions: 'You are a friendly chatbot.',
|
|
54
|
+
* model: 'zai-org/GLM-5.1-FP8',
|
|
55
|
+
* stream: true,
|
|
23
56
|
* });
|
|
24
57
|
* ```
|
|
25
58
|
*/
|
|
26
|
-
createResponse(
|
|
59
|
+
createResponse(body: OpenAICreateResponseParams, options?: RequestOptions): APIPromise<OpenAICreateResponseResponse>;
|
|
27
60
|
/**
|
|
28
61
|
* Lists every model currently available to your account on Telnyx Inference,
|
|
29
62
|
* including SOTA open-source LLMs hosted on Telnyx GPUs (for example
|
|
@@ -56,9 +89,34 @@ export interface OpenAIListModelsResponse {
|
|
|
56
89
|
object?: string;
|
|
57
90
|
}
|
|
58
91
|
export interface OpenAICreateResponseParams {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Optional Telnyx Conversation ID from `POST /ai/conversations`. When provided,
|
|
94
|
+
* Telnyx stores this turn on that conversation and uses the conversation's prior
|
|
95
|
+
* messages as context. Reuse the same ID for subsequent turns and tool-result
|
|
96
|
+
* followups. Omit it for a non-persisted, stateless response.
|
|
97
|
+
*/
|
|
98
|
+
conversation?: string;
|
|
99
|
+
/**
|
|
100
|
+
* The input items for this turn, using the OpenAI Responses API input format.
|
|
101
|
+
*/
|
|
102
|
+
input?: unknown;
|
|
103
|
+
/**
|
|
104
|
+
* Optional system/developer instructions for the model. When used with a persisted
|
|
105
|
+
* `conversation`, send these on the first request that creates the thread;
|
|
106
|
+
* subsequent turns can rely on the stored history.
|
|
107
|
+
*/
|
|
108
|
+
instructions?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Model identifier to use for the response, for example `zai-org/GLM-5.1-FP8` or
|
|
111
|
+
* another model available from the Telnyx OpenAI-compatible models endpoint.
|
|
112
|
+
*/
|
|
113
|
+
model?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Set to `true` to stream Server-Sent Events, matching OpenAI's Responses
|
|
116
|
+
* streaming format.
|
|
117
|
+
*/
|
|
118
|
+
stream?: boolean;
|
|
119
|
+
[k: string]: unknown;
|
|
62
120
|
}
|
|
63
121
|
export declare namespace OpenAI {
|
|
64
122
|
export { type OpenAICreateResponseResponse as OpenAICreateResponseResponse, type OpenAIListModelsResponse as OpenAIListModelsResponse, type OpenAICreateResponseParams as OpenAICreateResponseParams, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/openai/openai.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,KAAK,OAAO;OACZ,EAAE,IAAI,EAAE,0BAA0B,EAAE,4BAA4B,EAAE;OAClE,KAAK,aAAa;OAClB,EACL,+BAA+B,EAC/B,iCAAiC,EACjC,oCAAoC,EACpC,UAAU,EACX;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,UAAU,EAAE,aAAa,CAAC,UAAU,CAA8C;IAClF,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;IAEpD
|
|
1
|
+
{"version":3,"file":"openai.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/openai/openai.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,KAAK,OAAO;OACZ,EAAE,IAAI,EAAE,0BAA0B,EAAE,4BAA4B,EAAE;OAClE,KAAK,aAAa;OAClB,EACL,+BAA+B,EAC/B,iCAAiC,EACjC,oCAAoC,EACpC,UAAU,EACX;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,UAAU,EAAE,aAAa,CAAC,UAAU,CAA8C;IAClF,IAAI,EAAE,OAAO,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K,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
|
|
@@ -10,20 +10,53 @@ export declare class OpenAI extends APIResource {
|
|
|
10
10
|
embeddings: EmbeddingsAPI.Embeddings;
|
|
11
11
|
chat: ChatAPI.Chat;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* Create a response using Telnyx's OpenAI-compatible Responses API. This endpoint
|
|
14
|
+
* is compatible with the
|
|
15
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
16
|
+
* and may be used with the OpenAI JS or Python SDK by setting the base URL to
|
|
17
|
+
* `https://api.telnyx.com/v2/ai/openai`.
|
|
18
|
+
*
|
|
19
|
+
* The `conversation` parameter refers to a Telnyx Conversation rather than an
|
|
20
|
+
* OpenAI-hosted conversation object. To persist a thread across turns, first
|
|
21
|
+
* [create a conversation](https://developers.telnyx.com/api-reference/conversations/create-a-conversation)
|
|
22
|
+
* with `POST /ai/conversations`, then pass that conversation's `id` in the
|
|
23
|
+
* Responses request as `conversation`. The endpoint appends the new input,
|
|
24
|
+
* assistant output, reasoning, and tool-call messages to that conversation. Reuse
|
|
25
|
+
* the same `conversation` id on subsequent Responses requests, including
|
|
26
|
+
* tool-result followups, so the model receives the prior context.
|
|
27
|
+
*
|
|
28
|
+
* If `conversation` is omitted, the request is processed without persisting
|
|
29
|
+
* messages to a Telnyx conversation. Use the Conversations API to manage history:
|
|
30
|
+
* [list conversations](https://developers.telnyx.com/api-reference/conversations/list-conversations)
|
|
31
|
+
* (optionally filtered by metadata),
|
|
32
|
+
* [fetch messages](https://developers.telnyx.com/api-reference/conversations/get-conversation-messages)
|
|
33
|
+
* for a conversation, and optionally
|
|
34
|
+
* [add messages](https://developers.telnyx.com/api-reference/conversations/create-message)
|
|
35
|
+
* outside the Responses flow.
|
|
36
|
+
*
|
|
37
|
+
* You can attach arbitrary metadata when creating a conversation (for example to
|
|
38
|
+
* tag the conversation's source, channel, or user) and later filter by it when
|
|
39
|
+
* listing conversations.
|
|
18
40
|
*
|
|
19
41
|
* @example
|
|
20
42
|
* ```ts
|
|
21
43
|
* const response = await client.ai.openai.createResponse({
|
|
22
|
-
*
|
|
44
|
+
* conversation: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
|
|
45
|
+
* input: [
|
|
46
|
+
* {
|
|
47
|
+
* role: 'user',
|
|
48
|
+
* content: [
|
|
49
|
+
* { type: 'input_text', text: 'Hello, world!' },
|
|
50
|
+
* ],
|
|
51
|
+
* },
|
|
52
|
+
* ],
|
|
53
|
+
* instructions: 'You are a friendly chatbot.',
|
|
54
|
+
* model: 'zai-org/GLM-5.1-FP8',
|
|
55
|
+
* stream: true,
|
|
23
56
|
* });
|
|
24
57
|
* ```
|
|
25
58
|
*/
|
|
26
|
-
createResponse(
|
|
59
|
+
createResponse(body: OpenAICreateResponseParams, options?: RequestOptions): APIPromise<OpenAICreateResponseResponse>;
|
|
27
60
|
/**
|
|
28
61
|
* Lists every model currently available to your account on Telnyx Inference,
|
|
29
62
|
* including SOTA open-source LLMs hosted on Telnyx GPUs (for example
|
|
@@ -56,9 +89,34 @@ export interface OpenAIListModelsResponse {
|
|
|
56
89
|
object?: string;
|
|
57
90
|
}
|
|
58
91
|
export interface OpenAICreateResponseParams {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Optional Telnyx Conversation ID from `POST /ai/conversations`. When provided,
|
|
94
|
+
* Telnyx stores this turn on that conversation and uses the conversation's prior
|
|
95
|
+
* messages as context. Reuse the same ID for subsequent turns and tool-result
|
|
96
|
+
* followups. Omit it for a non-persisted, stateless response.
|
|
97
|
+
*/
|
|
98
|
+
conversation?: string;
|
|
99
|
+
/**
|
|
100
|
+
* The input items for this turn, using the OpenAI Responses API input format.
|
|
101
|
+
*/
|
|
102
|
+
input?: unknown;
|
|
103
|
+
/**
|
|
104
|
+
* Optional system/developer instructions for the model. When used with a persisted
|
|
105
|
+
* `conversation`, send these on the first request that creates the thread;
|
|
106
|
+
* subsequent turns can rely on the stored history.
|
|
107
|
+
*/
|
|
108
|
+
instructions?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Model identifier to use for the response, for example `zai-org/GLM-5.1-FP8` or
|
|
111
|
+
* another model available from the Telnyx OpenAI-compatible models endpoint.
|
|
112
|
+
*/
|
|
113
|
+
model?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Set to `true` to stream Server-Sent Events, matching OpenAI's Responses
|
|
116
|
+
* streaming format.
|
|
117
|
+
*/
|
|
118
|
+
stream?: boolean;
|
|
119
|
+
[k: string]: unknown;
|
|
62
120
|
}
|
|
63
121
|
export declare namespace OpenAI {
|
|
64
122
|
export { type OpenAICreateResponseResponse as OpenAICreateResponseResponse, type OpenAIListModelsResponse as OpenAIListModelsResponse, type OpenAICreateResponseParams as OpenAICreateResponseParams, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/openai/openai.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,KAAK,OAAO;OACZ,EAAE,IAAI,EAAE,0BAA0B,EAAE,4BAA4B,EAAE;OAClE,KAAK,aAAa;OAClB,EACL,+BAA+B,EAC/B,iCAAiC,EACjC,oCAAoC,EACpC,UAAU,EACX;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,UAAU,EAAE,aAAa,CAAC,UAAU,CAA8C;IAClF,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;IAEpD
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/openai/openai.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,KAA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AI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;IAEF,OAAO,EACL,UAAU,IAAI,UAAU,EACxB,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;IAEF,OAAO,EACL,IAAI,IAAI,IAAI,EACZ,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
|
|
@@ -15,22 +15,54 @@ class OpenAI extends resource_1.APIResource {
|
|
|
15
15
|
this.chat = new ChatAPI.Chat(this._client);
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* Create a response using Telnyx's OpenAI-compatible Responses API. This endpoint
|
|
19
|
+
* is compatible with the
|
|
20
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
21
|
+
* and may be used with the OpenAI JS or Python SDK by setting the base URL to
|
|
22
|
+
* `https://api.telnyx.com/v2/ai/openai`.
|
|
23
|
+
*
|
|
24
|
+
* The `conversation` parameter refers to a Telnyx Conversation rather than an
|
|
25
|
+
* OpenAI-hosted conversation object. To persist a thread across turns, first
|
|
26
|
+
* [create a conversation](https://developers.telnyx.com/api-reference/conversations/create-a-conversation)
|
|
27
|
+
* with `POST /ai/conversations`, then pass that conversation's `id` in the
|
|
28
|
+
* Responses request as `conversation`. The endpoint appends the new input,
|
|
29
|
+
* assistant output, reasoning, and tool-call messages to that conversation. Reuse
|
|
30
|
+
* the same `conversation` id on subsequent Responses requests, including
|
|
31
|
+
* tool-result followups, so the model receives the prior context.
|
|
32
|
+
*
|
|
33
|
+
* If `conversation` is omitted, the request is processed without persisting
|
|
34
|
+
* messages to a Telnyx conversation. Use the Conversations API to manage history:
|
|
35
|
+
* [list conversations](https://developers.telnyx.com/api-reference/conversations/list-conversations)
|
|
36
|
+
* (optionally filtered by metadata),
|
|
37
|
+
* [fetch messages](https://developers.telnyx.com/api-reference/conversations/get-conversation-messages)
|
|
38
|
+
* for a conversation, and optionally
|
|
39
|
+
* [add messages](https://developers.telnyx.com/api-reference/conversations/create-message)
|
|
40
|
+
* outside the Responses flow.
|
|
41
|
+
*
|
|
42
|
+
* You can attach arbitrary metadata when creating a conversation (for example to
|
|
43
|
+
* tag the conversation's source, channel, or user) and later filter by it when
|
|
44
|
+
* listing conversations.
|
|
23
45
|
*
|
|
24
46
|
* @example
|
|
25
47
|
* ```ts
|
|
26
48
|
* const response = await client.ai.openai.createResponse({
|
|
27
|
-
*
|
|
49
|
+
* conversation: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
|
|
50
|
+
* input: [
|
|
51
|
+
* {
|
|
52
|
+
* role: 'user',
|
|
53
|
+
* content: [
|
|
54
|
+
* { type: 'input_text', text: 'Hello, world!' },
|
|
55
|
+
* ],
|
|
56
|
+
* },
|
|
57
|
+
* ],
|
|
58
|
+
* instructions: 'You are a friendly chatbot.',
|
|
59
|
+
* model: 'zai-org/GLM-5.1-FP8',
|
|
60
|
+
* stream: true,
|
|
28
61
|
* });
|
|
29
62
|
* ```
|
|
30
63
|
*/
|
|
31
|
-
createResponse(
|
|
32
|
-
|
|
33
|
-
return this._client.post('/ai/openai/responses', { body: body, ...options });
|
|
64
|
+
createResponse(body, options) {
|
|
65
|
+
return this._client.post('/ai/openai/responses', { body, ...options });
|
|
34
66
|
}
|
|
35
67
|
/**
|
|
36
68
|
* Lists every model currently available to your account on Telnyx Inference,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../../src/resources/ai/openai/openai.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AAErD,2DAAkC;AAClC,oCAAwF;AACxF,uEAA8C;AAC9C,gDAKsB;AAItB,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClF,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../../src/resources/ai/openai/openai.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AAErD,2DAAkC;AAClC,oCAAwF;AACxF,uEAA8C;AAC9C,gDAKsB;AAItB,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClF,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAiFtD,CAAC;IA/EC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,cAAc,CACZ,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,UAAU,CAAC,OAAwB;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;AAnFD,wBAmFC;AA8CD,MAAM,CAAC,UAAU,GAAG,uBAAU,CAAC;AAC/B,MAAM,CAAC,IAAI,GAAG,WAAI,CAAC"}
|
|
@@ -11,22 +11,54 @@ export class OpenAI extends APIResource {
|
|
|
11
11
|
this.chat = new ChatAPI.Chat(this._client);
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* Create a response using Telnyx's OpenAI-compatible Responses API. This endpoint
|
|
15
|
+
* is compatible with the
|
|
16
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
17
|
+
* and may be used with the OpenAI JS or Python SDK by setting the base URL to
|
|
18
|
+
* `https://api.telnyx.com/v2/ai/openai`.
|
|
19
|
+
*
|
|
20
|
+
* The `conversation` parameter refers to a Telnyx Conversation rather than an
|
|
21
|
+
* OpenAI-hosted conversation object. To persist a thread across turns, first
|
|
22
|
+
* [create a conversation](https://developers.telnyx.com/api-reference/conversations/create-a-conversation)
|
|
23
|
+
* with `POST /ai/conversations`, then pass that conversation's `id` in the
|
|
24
|
+
* Responses request as `conversation`. The endpoint appends the new input,
|
|
25
|
+
* assistant output, reasoning, and tool-call messages to that conversation. Reuse
|
|
26
|
+
* the same `conversation` id on subsequent Responses requests, including
|
|
27
|
+
* tool-result followups, so the model receives the prior context.
|
|
28
|
+
*
|
|
29
|
+
* If `conversation` is omitted, the request is processed without persisting
|
|
30
|
+
* messages to a Telnyx conversation. Use the Conversations API to manage history:
|
|
31
|
+
* [list conversations](https://developers.telnyx.com/api-reference/conversations/list-conversations)
|
|
32
|
+
* (optionally filtered by metadata),
|
|
33
|
+
* [fetch messages](https://developers.telnyx.com/api-reference/conversations/get-conversation-messages)
|
|
34
|
+
* for a conversation, and optionally
|
|
35
|
+
* [add messages](https://developers.telnyx.com/api-reference/conversations/create-message)
|
|
36
|
+
* outside the Responses flow.
|
|
37
|
+
*
|
|
38
|
+
* You can attach arbitrary metadata when creating a conversation (for example to
|
|
39
|
+
* tag the conversation's source, channel, or user) and later filter by it when
|
|
40
|
+
* listing conversations.
|
|
19
41
|
*
|
|
20
42
|
* @example
|
|
21
43
|
* ```ts
|
|
22
44
|
* const response = await client.ai.openai.createResponse({
|
|
23
|
-
*
|
|
45
|
+
* conversation: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
|
|
46
|
+
* input: [
|
|
47
|
+
* {
|
|
48
|
+
* role: 'user',
|
|
49
|
+
* content: [
|
|
50
|
+
* { type: 'input_text', text: 'Hello, world!' },
|
|
51
|
+
* ],
|
|
52
|
+
* },
|
|
53
|
+
* ],
|
|
54
|
+
* instructions: 'You are a friendly chatbot.',
|
|
55
|
+
* model: 'zai-org/GLM-5.1-FP8',
|
|
56
|
+
* stream: true,
|
|
24
57
|
* });
|
|
25
58
|
* ```
|
|
26
59
|
*/
|
|
27
|
-
createResponse(
|
|
28
|
-
|
|
29
|
-
return this._client.post('/ai/openai/responses', { body: body, ...options });
|
|
60
|
+
createResponse(body, options) {
|
|
61
|
+
return this._client.post('/ai/openai/responses', { body, ...options });
|
|
30
62
|
}
|
|
31
63
|
/**
|
|
32
64
|
* Lists every model currently available to your account on Telnyx Inference,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.mjs","sourceRoot":"","sources":["../../../src/resources/ai/openai/openai.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,OAAO;OACZ,EAAE,IAAI,EAA4D;OAClE,KAAK,aAAa;OAClB,EAIL,UAAU,GACX;AAID,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClF,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"openai.mjs","sourceRoot":"","sources":["../../../src/resources/ai/openai/openai.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,OAAO;OACZ,EAAE,IAAI,EAA4D;OAClE,KAAK,aAAa;OAClB,EAIL,UAAU,GACX;AAID,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClF,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAiFtD,CAAC;IA/EC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,cAAc,CACZ,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,UAAU,CAAC,OAAwB;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;AA8CD,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AAC/B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC"}
|
package/src/resources/ai/ai.ts
CHANGED
|
@@ -167,12 +167,12 @@ export class AI extends APIResource {
|
|
|
167
167
|
tools: ToolsAPI.Tools = new ToolsAPI.Tools(this._client);
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
|
-
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead.
|
|
171
|
-
*
|
|
172
|
-
* [OpenAI Responses API](https://
|
|
170
|
+
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead. This endpoint is
|
|
171
|
+
* compatible with the
|
|
172
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
173
173
|
* and may be used with the OpenAI JS or Python SDK. Response id parameter is not
|
|
174
|
-
* supported at the moment. Use
|
|
175
|
-
* conversations
|
|
174
|
+
* supported at the moment. Use the `conversation` parameter with a Telnyx
|
|
175
|
+
* Conversation ID to leverage persistent conversations.
|
|
176
176
|
*
|
|
177
177
|
* @deprecated
|
|
178
178
|
*/
|
|
@@ -19,25 +19,57 @@ export class OpenAI extends APIResource {
|
|
|
19
19
|
chat: ChatAPI.Chat = new ChatAPI.Chat(this._client);
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
22
|
+
* Create a response using Telnyx's OpenAI-compatible Responses API. This endpoint
|
|
23
|
+
* is compatible with the
|
|
24
|
+
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
25
|
+
* and may be used with the OpenAI JS or Python SDK by setting the base URL to
|
|
26
|
+
* `https://api.telnyx.com/v2/ai/openai`.
|
|
27
|
+
*
|
|
28
|
+
* The `conversation` parameter refers to a Telnyx Conversation rather than an
|
|
29
|
+
* OpenAI-hosted conversation object. To persist a thread across turns, first
|
|
30
|
+
* [create a conversation](https://developers.telnyx.com/api-reference/conversations/create-a-conversation)
|
|
31
|
+
* with `POST /ai/conversations`, then pass that conversation's `id` in the
|
|
32
|
+
* Responses request as `conversation`. The endpoint appends the new input,
|
|
33
|
+
* assistant output, reasoning, and tool-call messages to that conversation. Reuse
|
|
34
|
+
* the same `conversation` id on subsequent Responses requests, including
|
|
35
|
+
* tool-result followups, so the model receives the prior context.
|
|
36
|
+
*
|
|
37
|
+
* If `conversation` is omitted, the request is processed without persisting
|
|
38
|
+
* messages to a Telnyx conversation. Use the Conversations API to manage history:
|
|
39
|
+
* [list conversations](https://developers.telnyx.com/api-reference/conversations/list-conversations)
|
|
40
|
+
* (optionally filtered by metadata),
|
|
41
|
+
* [fetch messages](https://developers.telnyx.com/api-reference/conversations/get-conversation-messages)
|
|
42
|
+
* for a conversation, and optionally
|
|
43
|
+
* [add messages](https://developers.telnyx.com/api-reference/conversations/create-message)
|
|
44
|
+
* outside the Responses flow.
|
|
45
|
+
*
|
|
46
|
+
* You can attach arbitrary metadata when creating a conversation (for example to
|
|
47
|
+
* tag the conversation's source, channel, or user) and later filter by it when
|
|
48
|
+
* listing conversations.
|
|
27
49
|
*
|
|
28
50
|
* @example
|
|
29
51
|
* ```ts
|
|
30
52
|
* const response = await client.ai.openai.createResponse({
|
|
31
|
-
*
|
|
53
|
+
* conversation: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
|
|
54
|
+
* input: [
|
|
55
|
+
* {
|
|
56
|
+
* role: 'user',
|
|
57
|
+
* content: [
|
|
58
|
+
* { type: 'input_text', text: 'Hello, world!' },
|
|
59
|
+
* ],
|
|
60
|
+
* },
|
|
61
|
+
* ],
|
|
62
|
+
* instructions: 'You are a friendly chatbot.',
|
|
63
|
+
* model: 'zai-org/GLM-5.1-FP8',
|
|
64
|
+
* stream: true,
|
|
32
65
|
* });
|
|
33
66
|
* ```
|
|
34
67
|
*/
|
|
35
68
|
createResponse(
|
|
36
|
-
|
|
69
|
+
body: OpenAICreateResponseParams,
|
|
37
70
|
options?: RequestOptions,
|
|
38
71
|
): APIPromise<OpenAICreateResponseResponse> {
|
|
39
|
-
|
|
40
|
-
return this._client.post('/ai/openai/responses', { body: body, ...options });
|
|
72
|
+
return this._client.post('/ai/openai/responses', { body, ...options });
|
|
41
73
|
}
|
|
42
74
|
|
|
43
75
|
/**
|
|
@@ -76,7 +108,39 @@ export interface OpenAIListModelsResponse {
|
|
|
76
108
|
}
|
|
77
109
|
|
|
78
110
|
export interface OpenAICreateResponseParams {
|
|
79
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Optional Telnyx Conversation ID from `POST /ai/conversations`. When provided,
|
|
113
|
+
* Telnyx stores this turn on that conversation and uses the conversation's prior
|
|
114
|
+
* messages as context. Reuse the same ID for subsequent turns and tool-result
|
|
115
|
+
* followups. Omit it for a non-persisted, stateless response.
|
|
116
|
+
*/
|
|
117
|
+
conversation?: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The input items for this turn, using the OpenAI Responses API input format.
|
|
121
|
+
*/
|
|
122
|
+
input?: unknown;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Optional system/developer instructions for the model. When used with a persisted
|
|
126
|
+
* `conversation`, send these on the first request that creates the thread;
|
|
127
|
+
* subsequent turns can rely on the stored history.
|
|
128
|
+
*/
|
|
129
|
+
instructions?: string;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Model identifier to use for the response, for example `zai-org/GLM-5.1-FP8` or
|
|
133
|
+
* another model available from the Telnyx OpenAI-compatible models endpoint.
|
|
134
|
+
*/
|
|
135
|
+
model?: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Set to `true` to stream Server-Sent Events, matching OpenAI's Responses
|
|
139
|
+
* streaming format.
|
|
140
|
+
*/
|
|
141
|
+
stream?: boolean;
|
|
142
|
+
|
|
143
|
+
[k: string]: unknown;
|
|
80
144
|
}
|
|
81
145
|
|
|
82
146
|
OpenAI.Embeddings = Embeddings;
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.63.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "6.
|
|
1
|
+
export declare const VERSION = "6.63.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "6.
|
|
1
|
+
export declare const VERSION = "6.63.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.63.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|