telnyx 7.7.0 → 7.9.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 +17 -0
- package/client.d.mts +9 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -6
- 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/package.json +1 -1
- package/resources/ai/ai.d.mts +9 -38
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +9 -38
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js +4 -30
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs +5 -31
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/anthropic/anthropic.d.mts +10 -0
- package/resources/ai/anthropic/anthropic.d.mts.map +1 -0
- package/resources/ai/anthropic/anthropic.d.ts +10 -0
- package/resources/ai/anthropic/anthropic.d.ts.map +1 -0
- package/resources/ai/anthropic/anthropic.js +17 -0
- package/resources/ai/anthropic/anthropic.js.map +1 -0
- package/resources/ai/anthropic/anthropic.mjs +12 -0
- package/resources/ai/anthropic/anthropic.mjs.map +1 -0
- package/resources/ai/anthropic/index.d.mts +3 -0
- package/resources/ai/anthropic/index.d.mts.map +1 -0
- package/resources/ai/anthropic/index.d.ts +3 -0
- package/resources/ai/anthropic/index.d.ts.map +1 -0
- package/resources/ai/anthropic/index.js +9 -0
- package/resources/ai/anthropic/index.js.map +1 -0
- package/resources/ai/anthropic/index.mjs +4 -0
- package/resources/ai/anthropic/index.mjs.map +1 -0
- package/resources/ai/anthropic/v1.d.mts +148 -0
- package/resources/ai/anthropic/v1.d.mts.map +1 -0
- package/resources/ai/anthropic/v1.d.ts +148 -0
- package/resources/ai/anthropic/v1.d.ts.map +1 -0
- package/resources/ai/anthropic/v1.js +35 -0
- package/resources/ai/anthropic/v1.js.map +1 -0
- package/resources/ai/anthropic/v1.mjs +31 -0
- package/resources/ai/anthropic/v1.mjs.map +1 -0
- package/resources/ai/anthropic.d.mts +2 -0
- package/resources/ai/anthropic.d.mts.map +1 -0
- package/resources/ai/anthropic.d.ts +2 -0
- package/resources/ai/anthropic.d.ts.map +1 -0
- package/resources/ai/anthropic.js +6 -0
- package/resources/ai/anthropic.js.map +1 -0
- package/resources/ai/anthropic.mjs +3 -0
- package/resources/ai/anthropic.mjs.map +1 -0
- package/resources/ai/assistants/assistants.d.mts +58 -5
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +58 -5
- package/resources/ai/assistants/assistants.d.ts.map +1 -1
- package/resources/ai/assistants/assistants.js +2 -2
- package/resources/ai/assistants/assistants.js.map +1 -1
- package/resources/ai/assistants/assistants.mjs +2 -2
- package/resources/ai/assistants/assistants.mjs.map +1 -1
- package/resources/ai/chat.d.mts +1 -188
- package/resources/ai/chat.d.mts.map +1 -1
- package/resources/ai/chat.d.ts +1 -188
- package/resources/ai/chat.d.ts.map +1 -1
- package/resources/ai/chat.js +0 -14
- package/resources/ai/chat.js.map +1 -1
- package/resources/ai/chat.mjs +0 -14
- package/resources/ai/chat.mjs.map +1 -1
- package/resources/ai/conversations/conversation-insights.d.mts +105 -0
- package/resources/ai/conversations/conversation-insights.d.mts.map +1 -0
- package/resources/ai/conversations/conversation-insights.d.ts +105 -0
- package/resources/ai/conversations/conversation-insights.d.ts.map +1 -0
- package/resources/ai/conversations/conversation-insights.js +24 -0
- package/resources/ai/conversations/conversation-insights.js.map +1 -0
- package/resources/ai/conversations/conversation-insights.mjs +20 -0
- package/resources/ai/conversations/conversation-insights.mjs.map +1 -0
- package/resources/ai/conversations/conversations.d.mts +4 -0
- package/resources/ai/conversations/conversations.d.mts.map +1 -1
- package/resources/ai/conversations/conversations.d.ts +4 -0
- package/resources/ai/conversations/conversations.d.ts.map +1 -1
- package/resources/ai/conversations/conversations.js +4 -0
- package/resources/ai/conversations/conversations.js.map +1 -1
- package/resources/ai/conversations/conversations.mjs +4 -0
- package/resources/ai/conversations/conversations.mjs.map +1 -1
- package/resources/ai/conversations/index.d.mts +1 -0
- package/resources/ai/conversations/index.d.mts.map +1 -1
- package/resources/ai/conversations/index.d.ts +1 -0
- package/resources/ai/conversations/index.d.ts.map +1 -1
- package/resources/ai/conversations/index.js +3 -1
- package/resources/ai/conversations/index.js.map +1 -1
- package/resources/ai/conversations/index.mjs +1 -0
- package/resources/ai/conversations/index.mjs.map +1 -1
- package/resources/ai/index.d.mts +4 -3
- package/resources/ai/index.d.mts.map +1 -1
- package/resources/ai/index.d.ts +4 -3
- package/resources/ai/index.d.ts.map +1 -1
- package/resources/ai/index.js +17 -15
- package/resources/ai/index.js.map +1 -1
- package/resources/ai/index.mjs +2 -1
- package/resources/ai/index.mjs.map +1 -1
- package/resources/ai/tools.d.mts +28 -1
- package/resources/ai/tools.d.mts.map +1 -1
- package/resources/ai/tools.d.ts +28 -1
- package/resources/ai/tools.d.ts.map +1 -1
- package/resources/calls/actions.d.mts +31 -5
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +31 -5
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/calls.d.mts +11 -0
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +11 -0
- 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/conferences/actions.d.mts +6 -0
- package/resources/conferences/actions.d.mts.map +1 -1
- package/resources/conferences/actions.d.ts +6 -0
- package/resources/conferences/actions.d.ts.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/managed-accounts/managed-accounts.d.mts +11 -2
- package/resources/managed-accounts/managed-accounts.d.mts.map +1 -1
- package/resources/managed-accounts/managed-accounts.d.ts +11 -2
- package/resources/managed-accounts/managed-accounts.d.ts.map +1 -1
- package/resources/managed-accounts/managed-accounts.js.map +1 -1
- package/resources/managed-accounts/managed-accounts.mjs.map +1 -1
- package/resources/messages/index.d.mts +1 -1
- package/resources/messages/index.d.mts.map +1 -1
- package/resources/messages/index.d.ts +1 -1
- package/resources/messages/index.d.ts.map +1 -1
- package/resources/messages/index.js.map +1 -1
- package/resources/messages/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +4 -82
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +4 -82
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +3 -15
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +3 -15
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/phone-numbers/phone-numbers.d.mts +21 -0
- package/resources/phone-numbers/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers/phone-numbers.d.ts +21 -0
- package/resources/phone-numbers/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers/phone-numbers.js.map +1 -1
- package/resources/phone-numbers/phone-numbers.mjs.map +1 -1
- package/resources/requirements.d.mts +28 -3
- package/resources/requirements.d.mts.map +1 -1
- package/resources/requirements.d.ts +28 -3
- package/resources/requirements.d.ts.map +1 -1
- package/resources/requirements.js +2 -2
- package/resources/requirements.js.map +1 -1
- package/resources/requirements.mjs +2 -2
- package/resources/requirements.mjs.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.mts +1 -1
- package/resources/speech-to-text/speech-to-text.d.mts.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.ts +1 -1
- package/resources/speech-to-text/speech-to-text.d.ts.map +1 -1
- package/resources/storage/cloudfs/actions.d.mts +43 -0
- package/resources/storage/cloudfs/actions.d.mts.map +1 -0
- package/resources/storage/cloudfs/actions.d.ts +43 -0
- package/resources/storage/cloudfs/actions.d.ts.map +1 -0
- package/resources/storage/cloudfs/actions.js +39 -0
- package/resources/storage/cloudfs/actions.js.map +1 -0
- package/resources/storage/cloudfs/actions.mjs +35 -0
- package/resources/storage/cloudfs/actions.mjs.map +1 -0
- package/resources/storage/cloudfs/cloudfs.d.mts +345 -0
- package/resources/storage/cloudfs/cloudfs.d.mts.map +1 -0
- package/resources/storage/cloudfs/cloudfs.d.ts +345 -0
- package/resources/storage/cloudfs/cloudfs.d.ts.map +1 -0
- package/resources/storage/cloudfs/cloudfs.js +116 -0
- package/resources/storage/cloudfs/cloudfs.js.map +1 -0
- package/resources/storage/cloudfs/cloudfs.mjs +111 -0
- package/resources/storage/cloudfs/cloudfs.mjs.map +1 -0
- package/resources/storage/cloudfs/index.d.mts +3 -0
- package/resources/storage/cloudfs/index.d.mts.map +1 -0
- package/resources/storage/cloudfs/index.d.ts +3 -0
- package/resources/storage/cloudfs/index.d.ts.map +1 -0
- package/resources/storage/cloudfs/index.js +9 -0
- package/resources/storage/cloudfs/index.js.map +1 -0
- package/resources/storage/cloudfs/index.mjs +4 -0
- package/resources/storage/cloudfs/index.mjs.map +1 -0
- package/resources/storage/cloudfs.d.mts +2 -0
- package/resources/storage/cloudfs.d.mts.map +1 -0
- package/resources/storage/cloudfs.d.ts +2 -0
- package/resources/storage/cloudfs.d.ts.map +1 -0
- package/resources/storage/cloudfs.js +6 -0
- package/resources/storage/cloudfs.js.map +1 -0
- package/resources/storage/cloudfs.mjs +3 -0
- package/resources/storage/cloudfs.mjs.map +1 -0
- package/resources/storage/index.d.mts +1 -0
- package/resources/storage/index.d.mts.map +1 -1
- package/resources/storage/index.d.ts +1 -0
- package/resources/storage/index.d.ts.map +1 -1
- package/resources/storage/index.js +7 -5
- package/resources/storage/index.js.map +1 -1
- package/resources/storage/index.mjs +1 -0
- package/resources/storage/index.mjs.map +1 -1
- package/resources/storage/storage.d.mts +4 -0
- package/resources/storage/storage.d.mts.map +1 -1
- package/resources/storage/storage.d.ts +4 -0
- package/resources/storage/storage.d.ts.map +1 -1
- package/resources/storage/storage.js +4 -0
- package/resources/storage/storage.js.map +1 -1
- package/resources/storage/storage.mjs +4 -0
- package/resources/storage/storage.mjs.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.mts +16 -11
- package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.ts +16 -11
- package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
- package/resources/verify-profiles.d.mts +3 -3
- package/resources/verify-profiles.d.ts +3 -3
- package/resources/webhooks.d.mts +125 -19
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +125 -19
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +5 -8
- package/src/resources/ai/ai.ts +10 -57
- package/src/resources/ai/anthropic/anthropic.ts +19 -0
- package/src/resources/ai/anthropic/index.ts +4 -0
- package/src/resources/ai/anthropic/v1.ts +157 -0
- package/src/resources/ai/anthropic.ts +3 -0
- package/src/resources/ai/assistants/assistants.ts +68 -5
- package/src/resources/ai/chat.ts +2 -234
- package/src/resources/ai/conversations/conversation-insights.ts +125 -0
- package/src/resources/ai/conversations/conversations.ts +15 -0
- package/src/resources/ai/conversations/index.ts +5 -0
- package/src/resources/ai/index.ts +3 -9
- package/src/resources/ai/tools.ts +32 -0
- package/src/resources/calls/actions.ts +31 -5
- package/src/resources/calls/calls.ts +12 -0
- package/src/resources/conferences/actions.ts +6 -0
- package/src/resources/index.ts +1 -4
- package/src/resources/managed-accounts/managed-accounts.ts +13 -2
- package/src/resources/messages/index.ts +0 -2
- package/src/resources/messages/messages.ts +3 -112
- package/src/resources/phone-numbers/phone-numbers.ts +24 -0
- package/src/resources/requirements.ts +38 -3
- package/src/resources/speech-to-text/speech-to-text.ts +1 -1
- package/src/resources/storage/cloudfs/actions.ts +59 -0
- package/src/resources/storage/cloudfs/cloudfs.ts +446 -0
- package/src/resources/storage/cloudfs/index.ts +13 -0
- package/src/resources/storage/cloudfs.ts +3 -0
- package/src/resources/storage/index.ts +10 -0
- package/src/resources/storage/storage.ts +24 -0
- package/src/resources/text-to-speech/text-to-speech.ts +16 -11
- package/src/resources/verify-profiles.ts +3 -3
- package/src/resources/webhooks.ts +152 -11
- 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/ai.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../../src/resources/ai/ai.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6DAAoC;AACpC,sCAAgF;AAChF,2DAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../../src/resources/ai/ai.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6DAAoC;AACpC,sCAAgF;AAChF,2DAAkC;AAClC,oCAAgE;AAChE,mEAA0C;AAC1C,4CAWoB;AACpB,wEAA+C;AAC/C,kDAOuB;AACvB,6DAAoC;AACpC,sCASiB;AACjB,+EAAsD;AACtD,wDAAkD;AAClD,kFAAyD;AACzD,2DAwDiC;AACjC,2FAAkE;AAClE,oEAWuC;AACvC,kFAAyD;AACzD,2DAWiC;AACjC,oFAA2D;AAC3D,8DAAuD;AACvD,wFAA+D;AAC/D,iEAAiG;AACjG,4EAAmD;AACnD,qDAY6B;AAC7B,sEAA6C;AAC7C,+CAAmG;AAInG,MAAa,EAAG,SAAQ,sBAAW;IAAnC;;QACE,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClF,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,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C;AAiWD,EAAE,CAAC,UAAU,GAAG,uBAAU,CAAC;AAC3B,EAAE,CAAC,KAAK,GAAG,aAAK,CAAC;AACjB,EAAE,CAAC,IAAI,GAAG,WAAI,CAAC;AACf,EAAE,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AACvB,EAAE,CAAC,aAAa,GAAG,6BAAa,CAAC;AACjC,EAAE,CAAC,UAAU,GAAG,uBAAU,CAAC;AAC3B,EAAE,CAAC,UAAU,GAAG,wBAAU,CAAC;AAC3B,EAAE,CAAC,YAAY,GAAG,2BAAY,CAAC;AAC/B,EAAE,CAAC,UAAU,GAAG,wBAAU,CAAC;AAC3B,EAAE,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AACvB,EAAE,CAAC,MAAM,GAAG,eAAM,CAAC;AACnB,EAAE,CAAC,KAAK,GAAG,aAAK,CAAC;AACjB,EAAE,CAAC,SAAS,GAAG,qBAAS,CAAC"}
|
package/resources/ai/ai.mjs
CHANGED
|
@@ -3,13 +3,15 @@ import { APIResource } from "../../core/resource.mjs";
|
|
|
3
3
|
import * as AudioAPI from "./audio.mjs";
|
|
4
4
|
import { Audio } from "./audio.mjs";
|
|
5
5
|
import * as ChatAPI from "./chat.mjs";
|
|
6
|
-
import { Chat
|
|
6
|
+
import { Chat } from "./chat.mjs";
|
|
7
7
|
import * as ClustersAPI from "./clusters.mjs";
|
|
8
8
|
import { Clusters, } from "./clusters.mjs";
|
|
9
9
|
import * as McpServersAPI from "./mcp-servers.mjs";
|
|
10
10
|
import { McpServers, } from "./mcp-servers.mjs";
|
|
11
11
|
import * as ToolsAPI from "./tools.mjs";
|
|
12
12
|
import { Tools, } from "./tools.mjs";
|
|
13
|
+
import * as AnthropicAPI from "./anthropic/anthropic.mjs";
|
|
14
|
+
import { Anthropic } from "./anthropic/anthropic.mjs";
|
|
13
15
|
import * as AssistantsAPI from "./assistants/assistants.mjs";
|
|
14
16
|
import { Assistants, } from "./assistants/assistants.mjs";
|
|
15
17
|
import * as ConversationsAPI from "./conversations/conversations.mjs";
|
|
@@ -39,22 +41,7 @@ export class AI extends APIResource {
|
|
|
39
41
|
this.missions = new MissionsAPI.Missions(this._client);
|
|
40
42
|
this.openai = new OpenAIAPI.OpenAI(this._client);
|
|
41
43
|
this.tools = new ToolsAPI.Tools(this._client);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* **Deprecated**: Use `GET /v2/ai/openai/models` instead.
|
|
45
|
-
*
|
|
46
|
-
* Returns the same `ModelsResponse` payload as the OpenAI-compatible endpoint —
|
|
47
|
-
* open-source LLMs hosted on Telnyx (e.g. `moonshotai/Kimi-K2.6`,
|
|
48
|
-
* `zai-org/GLM-5.1-FP8`, `MiniMaxAI/MiniMax-M2.7`), embedding models, and
|
|
49
|
-
* fine-tuned models — kept around for backwards compatibility. New integrations
|
|
50
|
-
* should use `/v2/ai/openai/models`.
|
|
51
|
-
*
|
|
52
|
-
* Model ids follow the `{organization}/{model_name}` convention from Hugging Face.
|
|
53
|
-
*
|
|
54
|
-
* @deprecated
|
|
55
|
-
*/
|
|
56
|
-
retrieveModels(options) {
|
|
57
|
-
return this._client.get('/ai/models', options);
|
|
44
|
+
this.anthropic = new AnthropicAPI.Anthropic(this._client);
|
|
58
45
|
}
|
|
59
46
|
/**
|
|
60
47
|
* Generate a summary of a file's contents.
|
|
@@ -80,20 +67,6 @@ export class AI extends APIResource {
|
|
|
80
67
|
summarize(body, options) {
|
|
81
68
|
return this._client.post('/ai/summarize', { body, ...options });
|
|
82
69
|
}
|
|
83
|
-
/**
|
|
84
|
-
* **Deprecated**: Use `POST /v2/ai/openai/responses` instead. This endpoint is
|
|
85
|
-
* compatible with the
|
|
86
|
-
* [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview)
|
|
87
|
-
* and may be used with the OpenAI JS or Python SDK. Response id parameter is not
|
|
88
|
-
* supported at the moment. Use the `conversation` parameter with a Telnyx
|
|
89
|
-
* Conversation ID to leverage persistent conversations.
|
|
90
|
-
*
|
|
91
|
-
* @deprecated
|
|
92
|
-
*/
|
|
93
|
-
createResponseDeprecated(params, options) {
|
|
94
|
-
const { response_request } = params;
|
|
95
|
-
return this._client.post('/ai/responses', { body: response_request, ...options });
|
|
96
|
-
}
|
|
97
70
|
/**
|
|
98
71
|
* Performs semantic vector search across conversation history records.
|
|
99
72
|
*
|
|
@@ -171,4 +144,5 @@ AI.McpServers = McpServers;
|
|
|
171
144
|
AI.Missions = Missions;
|
|
172
145
|
AI.OpenAI = OpenAI;
|
|
173
146
|
AI.Tools = Tools;
|
|
147
|
+
AI.Anthropic = Anthropic;
|
|
174
148
|
//# sourceMappingURL=ai.mjs.map
|
package/resources/ai/ai.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.mjs","sourceRoot":"","sources":["../../src/resources/ai/ai.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAAE,KAAK,EAAkD,oBAAgB;AAChF,OAAO,KAAK,OAAO,mBAAe;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"ai.mjs","sourceRoot":"","sources":["../../src/resources/ai/ai.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAAE,KAAK,EAAkD,oBAAgB;AAChF,OAAO,KAAK,OAAO,mBAAe;AAClC,OAAO,EAAa,IAAI,EAAyB,mBAAe;AAChE,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EASL,QAAQ,GAET,uBAAmB;AACpB,OAAO,KAAK,aAAa,0BAAsB;AAC/C,OAAO,EAKL,UAAU,GAEX,0BAAsB;AACvB,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAQL,KAAK,GACN,oBAAgB;AACjB,OAAO,KAAK,YAAY,kCAA8B;AACtD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AAG,UAAU,CAAC;AAC3B,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACvB,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;AACnB,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC;AACjB,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as V1API from "./v1.mjs";
|
|
3
|
+
import { V1, V1MessagesParams, V1MessagesResponse } from "./v1.mjs";
|
|
4
|
+
export declare class Anthropic extends APIResource {
|
|
5
|
+
v1: V1API.V1;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Anthropic {
|
|
8
|
+
export { V1 as V1, type V1MessagesResponse as V1MessagesResponse, type V1MessagesParams as V1MessagesParams, };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=anthropic.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/anthropic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,KAAK,iBAAa;AAC9B,OAAO,EAAE,EAAE,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAa;AAEhE,qBAAa,SAAU,SAAQ,WAAW;IACxC,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;CAC3C;AAID,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,EAAE,IAAI,EAAE,EACR,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as V1API from "./v1.js";
|
|
3
|
+
import { V1, V1MessagesParams, V1MessagesResponse } from "./v1.js";
|
|
4
|
+
export declare class Anthropic extends APIResource {
|
|
5
|
+
v1: V1API.V1;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Anthropic {
|
|
8
|
+
export { V1 as V1, type V1MessagesResponse as V1MessagesResponse, type V1MessagesParams as V1MessagesParams, };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=anthropic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/anthropic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,KAAK,gBAAa;AAC9B,OAAO,EAAE,EAAE,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAa;AAEhE,qBAAa,SAAU,SAAQ,WAAW;IACxC,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;CAC3C;AAID,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,EAAE,IAAI,EAAE,EACR,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,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.Anthropic = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const V1API = tslib_1.__importStar(require("./v1.js"));
|
|
8
|
+
const v1_1 = require("./v1.js");
|
|
9
|
+
class Anthropic extends resource_1.APIResource {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.v1 = new V1API.V1(this._client);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Anthropic = Anthropic;
|
|
16
|
+
Anthropic.V1 = v1_1.V1;
|
|
17
|
+
//# sourceMappingURL=anthropic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/anthropic.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,uDAA8B;AAC9B,gCAAgE;AAEhE,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACE,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;CAAA;AAFD,8BAEC;AAED,SAAS,CAAC,EAAE,GAAG,OAAE,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 V1API from "./v1.mjs";
|
|
4
|
+
import { V1 } from "./v1.mjs";
|
|
5
|
+
export class Anthropic extends APIResource {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.v1 = new V1API.V1(this._client);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
Anthropic.V1 = V1;
|
|
12
|
+
//# sourceMappingURL=anthropic.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.mjs","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/anthropic.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,KAAK,iBAAa;AAC9B,OAAO,EAAE,EAAE,EAAwC,iBAAa;AAEhE,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;CAAA;AAED,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,wBAAoB;AACxC,OAAO,EAAE,EAAE,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,iBAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,uBAAoB;AACxC,OAAO,EAAE,EAAE,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,gBAAa"}
|
|
@@ -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.V1 = exports.Anthropic = void 0;
|
|
5
|
+
var anthropic_1 = require("./anthropic.js");
|
|
6
|
+
Object.defineProperty(exports, "Anthropic", { enumerable: true, get: function () { return anthropic_1.Anthropic; } });
|
|
7
|
+
var v1_1 = require("./v1.js");
|
|
8
|
+
Object.defineProperty(exports, "V1", { enumerable: true, get: function () { return v1_1.V1; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4CAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,8BAA0E;AAAjE,wFAAA,EAAE,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,SAAS,EAAE,wBAAoB;AACxC,OAAO,EAAE,EAAE,EAAkD,iBAAa"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
4
|
+
export declare class V1 extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Send a message to a language model using the Anthropic Messages API format. This
|
|
7
|
+
* endpoint is compatible with the
|
|
8
|
+
* [Anthropic Messages API](https://docs.anthropic.com/en/api/messages) and may be
|
|
9
|
+
* used with the Anthropic JS or Python SDK by setting the base URL to
|
|
10
|
+
* `https://api.telnyx.com/v2/ai/anthropic`.
|
|
11
|
+
*
|
|
12
|
+
* The endpoint translates Anthropic-format requests into Telnyx's inference
|
|
13
|
+
* internals, then translates the response back to the Anthropic message shape.
|
|
14
|
+
* Streaming responses use Anthropic SSE event types (`message_start`,
|
|
15
|
+
* `content_block_start`, `content_block_delta`, `content_block_stop`,
|
|
16
|
+
* `message_delta`, `message_stop`).
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const response = await client.ai.anthropic.v1.messages({
|
|
21
|
+
* max_tokens: 1024,
|
|
22
|
+
* messages: [{ role: 'user', content: 'Hello, world!' }],
|
|
23
|
+
* model: 'zai-org/GLM-5.2',
|
|
24
|
+
* system: 'You are a friendly chatbot.',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
messages(body: V1MessagesParams, options?: RequestOptions): APIPromise<V1MessagesResponse>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An Anthropic-format message response with `type: "message"`, `role`, `content`,
|
|
32
|
+
* `stop_reason`, `stop_sequence`, and `usage`. When `stream` is true, the response
|
|
33
|
+
* is a text/event-stream of Anthropic SSE events.
|
|
34
|
+
*/
|
|
35
|
+
export type V1MessagesResponse = {
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
};
|
|
38
|
+
export interface V1MessagesParams {
|
|
39
|
+
/**
|
|
40
|
+
* The maximum number of tokens to generate in the response.
|
|
41
|
+
*/
|
|
42
|
+
max_tokens: number;
|
|
43
|
+
/**
|
|
44
|
+
* The messages to send to the model, following the
|
|
45
|
+
* [Anthropic Messages API](https://docs.anthropic.com/en/api/messages) format.
|
|
46
|
+
*/
|
|
47
|
+
messages: Array<{
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* The model to use for generating the response, for example `zai-org/GLM-5.2` or
|
|
52
|
+
* another model available from the Telnyx models endpoint.
|
|
53
|
+
*/
|
|
54
|
+
model: string;
|
|
55
|
+
/**
|
|
56
|
+
* If you are using an external inference provider, this field allows you to pass
|
|
57
|
+
* along a reference to your API key. After creating an
|
|
58
|
+
* [integration secret](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
59
|
+
* for your API key, pass the secret's `identifier` in this field.
|
|
60
|
+
*/
|
|
61
|
+
api_key_ref?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The billing group ID to associate with this request.
|
|
64
|
+
*/
|
|
65
|
+
billing_group_id?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Configuration for model fallback behavior when the primary model is unavailable.
|
|
68
|
+
*/
|
|
69
|
+
fallback_config?: {
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Maximum number of retries for the request.
|
|
74
|
+
*/
|
|
75
|
+
max_retries?: number;
|
|
76
|
+
/**
|
|
77
|
+
* List of MCP (Model Context Protocol) servers to make available to the model.
|
|
78
|
+
*/
|
|
79
|
+
mcp_servers?: Array<{
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* An object describing metadata about the request.
|
|
84
|
+
*/
|
|
85
|
+
metadata?: {
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Service tier for the request.
|
|
90
|
+
*/
|
|
91
|
+
service_tier?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Custom sequences that will cause the model to stop generating.
|
|
94
|
+
*/
|
|
95
|
+
stop_sequences?: Array<string>;
|
|
96
|
+
/**
|
|
97
|
+
* Whether to stream the response as Anthropic-format Server-Sent Events.
|
|
98
|
+
*/
|
|
99
|
+
stream?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* System prompt. Can be a string or an array of content blocks following the
|
|
102
|
+
* Anthropic API format.
|
|
103
|
+
*/
|
|
104
|
+
system?: string | Array<{
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* Amount of randomness injected into the response. Ranges from 0 to 1.
|
|
109
|
+
*/
|
|
110
|
+
temperature?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Extended thinking configuration for models that support it. Set `type` to
|
|
113
|
+
* `enabled` to turn on extended thinking.
|
|
114
|
+
*/
|
|
115
|
+
thinking?: {
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Request timeout in seconds.
|
|
120
|
+
*/
|
|
121
|
+
timeout?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Controls how the model uses tools, following the Anthropic API format.
|
|
124
|
+
*/
|
|
125
|
+
tool_choice?: {
|
|
126
|
+
[key: string]: unknown;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Definitions of tools that the model may use, following the Anthropic API format.
|
|
130
|
+
*/
|
|
131
|
+
tools?: Array<{
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
}>;
|
|
134
|
+
/**
|
|
135
|
+
* Top-k sampling parameter. Only sample from the top K options for each subsequent
|
|
136
|
+
* token.
|
|
137
|
+
*/
|
|
138
|
+
top_k?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Nucleus sampling parameter. Use temperature or top_p, but not both.
|
|
141
|
+
*/
|
|
142
|
+
top_p?: number;
|
|
143
|
+
[k: string]: unknown;
|
|
144
|
+
}
|
|
145
|
+
export declare namespace V1 {
|
|
146
|
+
export { type V1MessagesResponse as V1MessagesResponse, type V1MessagesParams as V1MessagesParams };
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=v1.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/v1.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAEnE,qBAAa,EAAG,SAAQ,WAAW;IACjC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;CAG3F;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IAE5C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAA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+1,148 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
4
|
+
export declare class V1 extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Send a message to a language model using the Anthropic Messages API format. This
|
|
7
|
+
* endpoint is compatible with the
|
|
8
|
+
* [Anthropic Messages API](https://docs.anthropic.com/en/api/messages) and may be
|
|
9
|
+
* used with the Anthropic JS or Python SDK by setting the base URL to
|
|
10
|
+
* `https://api.telnyx.com/v2/ai/anthropic`.
|
|
11
|
+
*
|
|
12
|
+
* The endpoint translates Anthropic-format requests into Telnyx's inference
|
|
13
|
+
* internals, then translates the response back to the Anthropic message shape.
|
|
14
|
+
* Streaming responses use Anthropic SSE event types (`message_start`,
|
|
15
|
+
* `content_block_start`, `content_block_delta`, `content_block_stop`,
|
|
16
|
+
* `message_delta`, `message_stop`).
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const response = await client.ai.anthropic.v1.messages({
|
|
21
|
+
* max_tokens: 1024,
|
|
22
|
+
* messages: [{ role: 'user', content: 'Hello, world!' }],
|
|
23
|
+
* model: 'zai-org/GLM-5.2',
|
|
24
|
+
* system: 'You are a friendly chatbot.',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
messages(body: V1MessagesParams, options?: RequestOptions): APIPromise<V1MessagesResponse>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An Anthropic-format message response with `type: "message"`, `role`, `content`,
|
|
32
|
+
* `stop_reason`, `stop_sequence`, and `usage`. When `stream` is true, the response
|
|
33
|
+
* is a text/event-stream of Anthropic SSE events.
|
|
34
|
+
*/
|
|
35
|
+
export type V1MessagesResponse = {
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
};
|
|
38
|
+
export interface V1MessagesParams {
|
|
39
|
+
/**
|
|
40
|
+
* The maximum number of tokens to generate in the response.
|
|
41
|
+
*/
|
|
42
|
+
max_tokens: number;
|
|
43
|
+
/**
|
|
44
|
+
* The messages to send to the model, following the
|
|
45
|
+
* [Anthropic Messages API](https://docs.anthropic.com/en/api/messages) format.
|
|
46
|
+
*/
|
|
47
|
+
messages: Array<{
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* The model to use for generating the response, for example `zai-org/GLM-5.2` or
|
|
52
|
+
* another model available from the Telnyx models endpoint.
|
|
53
|
+
*/
|
|
54
|
+
model: string;
|
|
55
|
+
/**
|
|
56
|
+
* If you are using an external inference provider, this field allows you to pass
|
|
57
|
+
* along a reference to your API key. After creating an
|
|
58
|
+
* [integration secret](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
59
|
+
* for your API key, pass the secret's `identifier` in this field.
|
|
60
|
+
*/
|
|
61
|
+
api_key_ref?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The billing group ID to associate with this request.
|
|
64
|
+
*/
|
|
65
|
+
billing_group_id?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Configuration for model fallback behavior when the primary model is unavailable.
|
|
68
|
+
*/
|
|
69
|
+
fallback_config?: {
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Maximum number of retries for the request.
|
|
74
|
+
*/
|
|
75
|
+
max_retries?: number;
|
|
76
|
+
/**
|
|
77
|
+
* List of MCP (Model Context Protocol) servers to make available to the model.
|
|
78
|
+
*/
|
|
79
|
+
mcp_servers?: Array<{
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* An object describing metadata about the request.
|
|
84
|
+
*/
|
|
85
|
+
metadata?: {
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Service tier for the request.
|
|
90
|
+
*/
|
|
91
|
+
service_tier?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Custom sequences that will cause the model to stop generating.
|
|
94
|
+
*/
|
|
95
|
+
stop_sequences?: Array<string>;
|
|
96
|
+
/**
|
|
97
|
+
* Whether to stream the response as Anthropic-format Server-Sent Events.
|
|
98
|
+
*/
|
|
99
|
+
stream?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* System prompt. Can be a string or an array of content blocks following the
|
|
102
|
+
* Anthropic API format.
|
|
103
|
+
*/
|
|
104
|
+
system?: string | Array<{
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* Amount of randomness injected into the response. Ranges from 0 to 1.
|
|
109
|
+
*/
|
|
110
|
+
temperature?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Extended thinking configuration for models that support it. Set `type` to
|
|
113
|
+
* `enabled` to turn on extended thinking.
|
|
114
|
+
*/
|
|
115
|
+
thinking?: {
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Request timeout in seconds.
|
|
120
|
+
*/
|
|
121
|
+
timeout?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Controls how the model uses tools, following the Anthropic API format.
|
|
124
|
+
*/
|
|
125
|
+
tool_choice?: {
|
|
126
|
+
[key: string]: unknown;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Definitions of tools that the model may use, following the Anthropic API format.
|
|
130
|
+
*/
|
|
131
|
+
tools?: Array<{
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
}>;
|
|
134
|
+
/**
|
|
135
|
+
* Top-k sampling parameter. Only sample from the top K options for each subsequent
|
|
136
|
+
* token.
|
|
137
|
+
*/
|
|
138
|
+
top_k?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Nucleus sampling parameter. Use temperature or top_p, but not both.
|
|
141
|
+
*/
|
|
142
|
+
top_p?: number;
|
|
143
|
+
[k: string]: unknown;
|
|
144
|
+
}
|
|
145
|
+
export declare namespace V1 {
|
|
146
|
+
export { type V1MessagesResponse as V1MessagesResponse, type V1MessagesParams as V1MessagesParams };
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=v1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/v1.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAEnE,qBAAa,EAAG,SAAQ,WAAW;IACjC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;CAG3F;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IAE5C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.V1 = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
class V1 extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Send a message to a language model using the Anthropic Messages API format. This
|
|
9
|
+
* endpoint is compatible with the
|
|
10
|
+
* [Anthropic Messages API](https://docs.anthropic.com/en/api/messages) and may be
|
|
11
|
+
* used with the Anthropic JS or Python SDK by setting the base URL to
|
|
12
|
+
* `https://api.telnyx.com/v2/ai/anthropic`.
|
|
13
|
+
*
|
|
14
|
+
* The endpoint translates Anthropic-format requests into Telnyx's inference
|
|
15
|
+
* internals, then translates the response back to the Anthropic message shape.
|
|
16
|
+
* Streaming responses use Anthropic SSE event types (`message_start`,
|
|
17
|
+
* `content_block_start`, `content_block_delta`, `content_block_stop`,
|
|
18
|
+
* `message_delta`, `message_stop`).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const response = await client.ai.anthropic.v1.messages({
|
|
23
|
+
* max_tokens: 1024,
|
|
24
|
+
* messages: [{ role: 'user', content: 'Hello, world!' }],
|
|
25
|
+
* model: 'zai-org/GLM-5.2',
|
|
26
|
+
* system: 'You are a friendly chatbot.',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
messages(body, options) {
|
|
31
|
+
return this._client.post('/ai/anthropic/v1/messages', { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.V1 = V1;
|
|
35
|
+
//# sourceMappingURL=v1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/v1.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAIrD,MAAa,EAAG,SAAQ,sBAAW;IACjC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,IAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF;AA3BD,gBA2BC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
export class V1 extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Send a message to a language model using the Anthropic Messages API format. This
|
|
6
|
+
* endpoint is compatible with the
|
|
7
|
+
* [Anthropic Messages API](https://docs.anthropic.com/en/api/messages) and may be
|
|
8
|
+
* used with the Anthropic JS or Python SDK by setting the base URL to
|
|
9
|
+
* `https://api.telnyx.com/v2/ai/anthropic`.
|
|
10
|
+
*
|
|
11
|
+
* The endpoint translates Anthropic-format requests into Telnyx's inference
|
|
12
|
+
* internals, then translates the response back to the Anthropic message shape.
|
|
13
|
+
* Streaming responses use Anthropic SSE event types (`message_start`,
|
|
14
|
+
* `content_block_start`, `content_block_delta`, `content_block_stop`,
|
|
15
|
+
* `message_delta`, `message_stop`).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const response = await client.ai.anthropic.v1.messages({
|
|
20
|
+
* max_tokens: 1024,
|
|
21
|
+
* messages: [{ role: 'user', content: 'Hello, world!' }],
|
|
22
|
+
* model: 'zai-org/GLM-5.2',
|
|
23
|
+
* system: 'You are a friendly chatbot.',
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
messages(body, options) {
|
|
28
|
+
return this._client.post('/ai/anthropic/v1/messages', { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=v1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../../src/resources/ai/anthropic/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAIrD,MAAM,OAAO,EAAG,SAAQ,WAAW;IACjC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,IAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.d.mts","sourceRoot":"","sources":["../../src/resources/ai/anthropic.ts"],"names":[],"mappings":"AAEA,sCAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/resources/ai/anthropic.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("./anthropic/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=anthropic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/resources/ai/anthropic.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,+DAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.mjs","sourceRoot":"","sources":["../../src/resources/ai/anthropic.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,sCAAkC"}
|