telnyx 5.63.0 → 5.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/telnyx/models/ai/assistant_create_params.rb +8 -1
- data/lib/telnyx/models/ai/assistant_update_params.rb +8 -1
- data/lib/telnyx/models/ai/assistants/tool_add_params.rb +30 -0
- data/lib/telnyx/models/ai/assistants/tool_add_response.rb +12 -0
- data/lib/telnyx/models/ai/assistants/tool_remove_params.rb +30 -0
- data/lib/telnyx/models/ai/assistants/tool_remove_response.rb +12 -0
- data/lib/telnyx/models/ai/assistants/update_assistant.rb +8 -1
- data/lib/telnyx/models/ai/inference_embedding_webhook_tool_params.rb +36 -1
- data/lib/telnyx/models/ai/tool_create_params.rb +64 -0
- data/lib/telnyx/models/ai/tool_create_response.rb +48 -0
- data/lib/telnyx/models/ai/tool_delete_params.rb +22 -0
- data/lib/telnyx/models/ai/tool_delete_response.rb +10 -0
- data/lib/telnyx/models/ai/tool_list_params.rb +40 -0
- data/lib/telnyx/models/ai/tool_list_response.rb +48 -0
- data/lib/telnyx/models/ai/tool_retrieve_params.rb +22 -0
- data/lib/telnyx/models/ai/tool_retrieve_response.rb +48 -0
- data/lib/telnyx/models/ai/tool_update_params.rb +70 -0
- data/lib/telnyx/models/ai/tool_update_response.rb +48 -0
- data/lib/telnyx/resources/ai/assistants/tools.rb +50 -0
- data/lib/telnyx/resources/ai/assistants/versions.rb +3 -1
- data/lib/telnyx/resources/ai/assistants.rb +6 -2
- data/lib/telnyx/resources/ai/tools.rb +143 -0
- data/lib/telnyx/resources/ai.rb +5 -0
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +15 -0
- data/rbi/telnyx/models/ai/assistant_create_params.rbi +9 -0
- data/rbi/telnyx/models/ai/assistant_update_params.rbi +9 -0
- data/rbi/telnyx/models/ai/assistants/tool_add_params.rbi +50 -0
- data/rbi/telnyx/models/ai/assistants/tool_add_response.rbi +11 -0
- data/rbi/telnyx/models/ai/assistants/tool_remove_params.rbi +50 -0
- data/rbi/telnyx/models/ai/assistants/tool_remove_response.rbi +12 -0
- data/rbi/telnyx/models/ai/assistants/update_assistant.rbi +9 -0
- data/rbi/telnyx/models/ai/inference_embedding_webhook_tool_params.rbi +71 -0
- data/rbi/telnyx/models/ai/tool_create_params.rbi +103 -0
- data/rbi/telnyx/models/ai/tool_create_response.rbi +79 -0
- data/rbi/telnyx/models/ai/tool_delete_params.rbi +37 -0
- data/rbi/telnyx/models/ai/tool_delete_response.rbi +9 -0
- data/rbi/telnyx/models/ai/tool_list_params.rbi +73 -0
- data/rbi/telnyx/models/ai/tool_list_response.rbi +79 -0
- data/rbi/telnyx/models/ai/tool_retrieve_params.rbi +37 -0
- data/rbi/telnyx/models/ai/tool_retrieve_response.rbi +79 -0
- data/rbi/telnyx/models/ai/tool_update_params.rbi +115 -0
- data/rbi/telnyx/models/ai/tool_update_response.rbi +79 -0
- data/rbi/telnyx/resources/ai/assistants/tools.rbi +22 -0
- data/rbi/telnyx/resources/ai/assistants/versions.rbi +3 -0
- data/rbi/telnyx/resources/ai/assistants.rbi +4 -0
- data/rbi/telnyx/resources/ai/tools.rbi +114 -0
- data/rbi/telnyx/resources/ai.rbi +4 -0
- data/sig/telnyx/models/ai/assistant_create_params.rbs +7 -0
- data/sig/telnyx/models/ai/assistant_update_params.rbs +7 -0
- data/sig/telnyx/models/ai/assistants/tool_add_params.rbs +32 -0
- data/sig/telnyx/models/ai/assistants/tool_add_response.rbs +9 -0
- data/sig/telnyx/models/ai/assistants/tool_remove_params.rbs +32 -0
- data/sig/telnyx/models/ai/assistants/tool_remove_response.rbs +9 -0
- data/sig/telnyx/models/ai/assistants/update_assistant.rbs +7 -0
- data/sig/telnyx/models/ai/inference_embedding_webhook_tool_params.rbs +21 -0
- data/sig/telnyx/models/ai/tool_create_params.rbs +75 -0
- data/sig/telnyx/models/ai/tool_create_response.rbs +53 -0
- data/sig/telnyx/models/ai/tool_delete_params.rbs +25 -0
- data/sig/telnyx/models/ai/tool_delete_response.rbs +7 -0
- data/sig/telnyx/models/ai/tool_list_params.rbs +51 -0
- data/sig/telnyx/models/ai/tool_list_response.rbs +53 -0
- data/sig/telnyx/models/ai/tool_retrieve_params.rbs +25 -0
- data/sig/telnyx/models/ai/tool_retrieve_response.rbs +53 -0
- data/sig/telnyx/models/ai/tool_update_params.rbs +84 -0
- data/sig/telnyx/models/ai/tool_update_response.rbs +53 -0
- data/sig/telnyx/resources/ai/assistants/tools.rbs +12 -0
- data/sig/telnyx/resources/ai/assistants/versions.rbs +1 -0
- data/sig/telnyx/resources/ai/assistants.rbs +2 -0
- data/sig/telnyx/resources/ai/tools.rbs +52 -0
- data/sig/telnyx/resources/ai.rbs +2 -0
- metadata +46 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
module AI
|
|
6
|
+
# @see Telnyx::Resources::AI::Tools#update
|
|
7
|
+
class ToolUpdateResponse < Telnyx::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute id
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute tool_definition
|
|
14
|
+
#
|
|
15
|
+
# @return [Hash{Symbol=>Object}]
|
|
16
|
+
required :tool_definition, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
|
|
17
|
+
|
|
18
|
+
# @!attribute type
|
|
19
|
+
#
|
|
20
|
+
# @return [String]
|
|
21
|
+
required :type, String
|
|
22
|
+
|
|
23
|
+
# @!attribute created_at
|
|
24
|
+
#
|
|
25
|
+
# @return [String, nil]
|
|
26
|
+
optional :created_at, String
|
|
27
|
+
|
|
28
|
+
# @!attribute display_name
|
|
29
|
+
#
|
|
30
|
+
# @return [String, nil]
|
|
31
|
+
optional :display_name, String
|
|
32
|
+
|
|
33
|
+
# @!attribute timeout_ms
|
|
34
|
+
#
|
|
35
|
+
# @return [Integer, nil]
|
|
36
|
+
optional :timeout_ms, Integer
|
|
37
|
+
|
|
38
|
+
# @!method initialize(id:, tool_definition:, type:, created_at: nil, display_name: nil, timeout_ms: nil)
|
|
39
|
+
# @param id [String]
|
|
40
|
+
# @param tool_definition [Hash{Symbol=>Object}]
|
|
41
|
+
# @param type [String]
|
|
42
|
+
# @param created_at [String]
|
|
43
|
+
# @param display_name [String]
|
|
44
|
+
# @param timeout_ms [Integer]
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -6,6 +6,56 @@ module Telnyx
|
|
|
6
6
|
class Assistants
|
|
7
7
|
# Configure AI assistant specifications
|
|
8
8
|
class Tools
|
|
9
|
+
# Add Assistant Tool
|
|
10
|
+
#
|
|
11
|
+
# @overload add(tool_id, assistant_id:, request_options: {})
|
|
12
|
+
#
|
|
13
|
+
# @param tool_id [String]
|
|
14
|
+
# @param assistant_id [String]
|
|
15
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
16
|
+
#
|
|
17
|
+
# @return [Object]
|
|
18
|
+
#
|
|
19
|
+
# @see Telnyx::Models::AI::Assistants::ToolAddParams
|
|
20
|
+
def add(tool_id, params)
|
|
21
|
+
parsed, options = Telnyx::AI::Assistants::ToolAddParams.dump_request(params)
|
|
22
|
+
assistant_id =
|
|
23
|
+
parsed.delete(:assistant_id) do
|
|
24
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
25
|
+
end
|
|
26
|
+
@client.request(
|
|
27
|
+
method: :put,
|
|
28
|
+
path: ["ai/assistants/%1$s/tools/%2$s", assistant_id, tool_id],
|
|
29
|
+
model: Telnyx::Internal::Type::Unknown,
|
|
30
|
+
options: options
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Remove Assistant Tool
|
|
35
|
+
#
|
|
36
|
+
# @overload remove(tool_id, assistant_id:, request_options: {})
|
|
37
|
+
#
|
|
38
|
+
# @param tool_id [String]
|
|
39
|
+
# @param assistant_id [String]
|
|
40
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
41
|
+
#
|
|
42
|
+
# @return [Object]
|
|
43
|
+
#
|
|
44
|
+
# @see Telnyx::Models::AI::Assistants::ToolRemoveParams
|
|
45
|
+
def remove(tool_id, params)
|
|
46
|
+
parsed, options = Telnyx::AI::Assistants::ToolRemoveParams.dump_request(params)
|
|
47
|
+
assistant_id =
|
|
48
|
+
parsed.delete(:assistant_id) do
|
|
49
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
50
|
+
end
|
|
51
|
+
@client.request(
|
|
52
|
+
method: :delete,
|
|
53
|
+
path: ["ai/assistants/%1$s/tools/%2$s", assistant_id, tool_id],
|
|
54
|
+
model: Telnyx::Internal::Type::Unknown,
|
|
55
|
+
options: options
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
9
59
|
# Test a webhook tool for an assistant
|
|
10
60
|
#
|
|
11
61
|
# @overload test_(tool_id, assistant_id:, arguments: nil, dynamic_variables: nil, request_options: {})
|
|
@@ -43,7 +43,7 @@ module Telnyx
|
|
|
43
43
|
# Updates the configuration of a specific assistant version. Can not update main
|
|
44
44
|
# version
|
|
45
45
|
#
|
|
46
|
-
# @overload update(version_id, assistant_id:, description: nil, dynamic_variables: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, greeting: nil, insight_settings: nil, instructions: nil, llm_api_key_ref: nil, messaging_settings: nil, model: nil, name: nil, privacy_settings: nil, telephony_settings: nil, tools: nil, transcription: nil, voice_settings: nil, widget_settings: nil, request_options: {})
|
|
46
|
+
# @overload update(version_id, assistant_id:, description: nil, dynamic_variables: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, greeting: nil, insight_settings: nil, instructions: nil, llm_api_key_ref: nil, messaging_settings: nil, model: nil, name: nil, privacy_settings: nil, telephony_settings: nil, tool_ids: nil, tools: nil, transcription: nil, voice_settings: nil, widget_settings: nil, request_options: {})
|
|
47
47
|
#
|
|
48
48
|
# @param version_id [String] Path param
|
|
49
49
|
#
|
|
@@ -75,6 +75,8 @@ module Telnyx
|
|
|
75
75
|
#
|
|
76
76
|
# @param telephony_settings [Telnyx::Models::AI::TelephonySettings] Body param
|
|
77
77
|
#
|
|
78
|
+
# @param tool_ids [Array<String>] Body param
|
|
79
|
+
#
|
|
78
80
|
# @param tools [Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>] Body param: The tools that the assistant can use. These may be templated with [d
|
|
79
81
|
#
|
|
80
82
|
# @param transcription [Telnyx::Models::AI::TranscriptionSettings] Body param
|
|
@@ -34,7 +34,7 @@ module Telnyx
|
|
|
34
34
|
#
|
|
35
35
|
# Create a new AI Assistant.
|
|
36
36
|
#
|
|
37
|
-
# @overload create(instructions:, model:, name:, description: nil, dynamic_variables: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, greeting: nil, insight_settings: nil, llm_api_key_ref: nil, messaging_settings: nil, privacy_settings: nil, telephony_settings: nil, tools: nil, transcription: nil, voice_settings: nil, widget_settings: nil, request_options: {})
|
|
37
|
+
# @overload create(instructions:, model:, name:, description: nil, dynamic_variables: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, greeting: nil, insight_settings: nil, llm_api_key_ref: nil, messaging_settings: nil, privacy_settings: nil, telephony_settings: nil, tool_ids: nil, tools: nil, transcription: nil, voice_settings: nil, widget_settings: nil, request_options: {})
|
|
38
38
|
#
|
|
39
39
|
# @param instructions [String] System instructions for the assistant. These may be templated with [dynamic vari
|
|
40
40
|
#
|
|
@@ -62,6 +62,8 @@ module Telnyx
|
|
|
62
62
|
#
|
|
63
63
|
# @param telephony_settings [Telnyx::Models::AI::TelephonySettings]
|
|
64
64
|
#
|
|
65
|
+
# @param tool_ids [Array<String>]
|
|
66
|
+
#
|
|
65
67
|
# @param tools [Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>] The tools that the assistant can use. These may be templated with [dynamic varia
|
|
66
68
|
#
|
|
67
69
|
# @param transcription [Telnyx::Models::AI::TranscriptionSettings]
|
|
@@ -117,7 +119,7 @@ module Telnyx
|
|
|
117
119
|
#
|
|
118
120
|
# Update an AI Assistant's attributes.
|
|
119
121
|
#
|
|
120
|
-
# @overload update(assistant_id, description: nil, dynamic_variables: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, greeting: nil, insight_settings: nil, instructions: nil, llm_api_key_ref: nil, messaging_settings: nil, model: nil, name: nil, privacy_settings: nil, promote_to_main: nil, telephony_settings: nil, tools: nil, transcription: nil, voice_settings: nil, widget_settings: nil, request_options: {})
|
|
122
|
+
# @overload update(assistant_id, description: nil, dynamic_variables: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, greeting: nil, insight_settings: nil, instructions: nil, llm_api_key_ref: nil, messaging_settings: nil, model: nil, name: nil, privacy_settings: nil, promote_to_main: nil, telephony_settings: nil, tool_ids: nil, tools: nil, transcription: nil, voice_settings: nil, widget_settings: nil, request_options: {})
|
|
121
123
|
#
|
|
122
124
|
# @param assistant_id [String]
|
|
123
125
|
#
|
|
@@ -149,6 +151,8 @@ module Telnyx
|
|
|
149
151
|
#
|
|
150
152
|
# @param telephony_settings [Telnyx::Models::AI::TelephonySettings]
|
|
151
153
|
#
|
|
154
|
+
# @param tool_ids [Array<String>]
|
|
155
|
+
#
|
|
152
156
|
# @param tools [Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>] The tools that the assistant can use. These may be templated with [dynamic varia
|
|
153
157
|
#
|
|
154
158
|
# @param transcription [Telnyx::Models::AI::TranscriptionSettings]
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Resources
|
|
5
|
+
class AI
|
|
6
|
+
# Configure AI assistant specifications
|
|
7
|
+
class Tools
|
|
8
|
+
# Create Tool
|
|
9
|
+
#
|
|
10
|
+
# @overload create(display_name:, type:, function: nil, handoff: nil, invite: nil, retrieval: nil, timeout_ms: nil, webhook: nil, request_options: {})
|
|
11
|
+
#
|
|
12
|
+
# @param display_name [String]
|
|
13
|
+
# @param type [String]
|
|
14
|
+
# @param function [Hash{Symbol=>Object}]
|
|
15
|
+
# @param handoff [Hash{Symbol=>Object}]
|
|
16
|
+
# @param invite [Hash{Symbol=>Object}]
|
|
17
|
+
# @param retrieval [Hash{Symbol=>Object}]
|
|
18
|
+
# @param timeout_ms [Integer]
|
|
19
|
+
# @param webhook [Hash{Symbol=>Object}]
|
|
20
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
21
|
+
#
|
|
22
|
+
# @return [Telnyx::Models::AI::ToolCreateResponse]
|
|
23
|
+
#
|
|
24
|
+
# @see Telnyx::Models::AI::ToolCreateParams
|
|
25
|
+
def create(params)
|
|
26
|
+
parsed, options = Telnyx::AI::ToolCreateParams.dump_request(params)
|
|
27
|
+
@client.request(
|
|
28
|
+
method: :post,
|
|
29
|
+
path: "ai/tools",
|
|
30
|
+
body: parsed,
|
|
31
|
+
model: Telnyx::Models::AI::ToolCreateResponse,
|
|
32
|
+
options: options
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Get Tool
|
|
37
|
+
#
|
|
38
|
+
# @overload retrieve(tool_id, request_options: {})
|
|
39
|
+
#
|
|
40
|
+
# @param tool_id [String]
|
|
41
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
42
|
+
#
|
|
43
|
+
# @return [Telnyx::Models::AI::ToolRetrieveResponse]
|
|
44
|
+
#
|
|
45
|
+
# @see Telnyx::Models::AI::ToolRetrieveParams
|
|
46
|
+
def retrieve(tool_id, params = {})
|
|
47
|
+
@client.request(
|
|
48
|
+
method: :get,
|
|
49
|
+
path: ["ai/tools/%1$s", tool_id],
|
|
50
|
+
model: Telnyx::Models::AI::ToolRetrieveResponse,
|
|
51
|
+
options: params[:request_options]
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Update Tool
|
|
56
|
+
#
|
|
57
|
+
# @overload update(tool_id, display_name: nil, function: nil, handoff: nil, invite: nil, retrieval: nil, timeout_ms: nil, type: nil, webhook: nil, request_options: {})
|
|
58
|
+
#
|
|
59
|
+
# @param tool_id [String]
|
|
60
|
+
# @param display_name [String]
|
|
61
|
+
# @param function [Hash{Symbol=>Object}]
|
|
62
|
+
# @param handoff [Hash{Symbol=>Object}]
|
|
63
|
+
# @param invite [Hash{Symbol=>Object}]
|
|
64
|
+
# @param retrieval [Hash{Symbol=>Object}]
|
|
65
|
+
# @param timeout_ms [Integer]
|
|
66
|
+
# @param type [String]
|
|
67
|
+
# @param webhook [Hash{Symbol=>Object}]
|
|
68
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
69
|
+
#
|
|
70
|
+
# @return [Telnyx::Models::AI::ToolUpdateResponse]
|
|
71
|
+
#
|
|
72
|
+
# @see Telnyx::Models::AI::ToolUpdateParams
|
|
73
|
+
def update(tool_id, params = {})
|
|
74
|
+
parsed, options = Telnyx::AI::ToolUpdateParams.dump_request(params)
|
|
75
|
+
@client.request(
|
|
76
|
+
method: :patch,
|
|
77
|
+
path: ["ai/tools/%1$s", tool_id],
|
|
78
|
+
body: parsed,
|
|
79
|
+
model: Telnyx::Models::AI::ToolUpdateResponse,
|
|
80
|
+
options: options
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# List Tools
|
|
85
|
+
#
|
|
86
|
+
# @overload list(filter_name: nil, filter_type: nil, page_number: nil, page_size: nil, request_options: {})
|
|
87
|
+
#
|
|
88
|
+
# @param filter_name [String]
|
|
89
|
+
# @param filter_type [String]
|
|
90
|
+
# @param page_number [Integer]
|
|
91
|
+
# @param page_size [Integer]
|
|
92
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
93
|
+
#
|
|
94
|
+
# @return [Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::ToolListResponse>]
|
|
95
|
+
#
|
|
96
|
+
# @see Telnyx::Models::AI::ToolListParams
|
|
97
|
+
def list(params = {})
|
|
98
|
+
parsed, options = Telnyx::AI::ToolListParams.dump_request(params)
|
|
99
|
+
query = Telnyx::Internal::Util.encode_query_params(parsed)
|
|
100
|
+
@client.request(
|
|
101
|
+
method: :get,
|
|
102
|
+
path: "ai/tools",
|
|
103
|
+
query: query.transform_keys(
|
|
104
|
+
filter_name: "filter[name]",
|
|
105
|
+
filter_type: "filter[type]",
|
|
106
|
+
page_number: "page[number]",
|
|
107
|
+
page_size: "page[size]"
|
|
108
|
+
),
|
|
109
|
+
page: Telnyx::Internal::DefaultFlatPagination,
|
|
110
|
+
model: Telnyx::Models::AI::ToolListResponse,
|
|
111
|
+
options: options
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Delete Tool
|
|
116
|
+
#
|
|
117
|
+
# @overload delete(tool_id, request_options: {})
|
|
118
|
+
#
|
|
119
|
+
# @param tool_id [String]
|
|
120
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
121
|
+
#
|
|
122
|
+
# @return [Object]
|
|
123
|
+
#
|
|
124
|
+
# @see Telnyx::Models::AI::ToolDeleteParams
|
|
125
|
+
def delete(tool_id, params = {})
|
|
126
|
+
@client.request(
|
|
127
|
+
method: :delete,
|
|
128
|
+
path: ["ai/tools/%1$s", tool_id],
|
|
129
|
+
model: Telnyx::Internal::Type::Unknown,
|
|
130
|
+
options: params[:request_options]
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# @api private
|
|
135
|
+
#
|
|
136
|
+
# @param client [Telnyx::Client]
|
|
137
|
+
def initialize(client:)
|
|
138
|
+
@client = client
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
data/lib/telnyx/resources/ai.rb
CHANGED
|
@@ -42,6 +42,10 @@ module Telnyx
|
|
|
42
42
|
# @return [Telnyx::Resources::AI::OpenAI]
|
|
43
43
|
attr_reader :openai
|
|
44
44
|
|
|
45
|
+
# Configure AI assistant specifications
|
|
46
|
+
# @return [Telnyx::Resources::AI::Tools]
|
|
47
|
+
attr_reader :tools
|
|
48
|
+
|
|
45
49
|
# This endpoint returns a list of Open Source and OpenAI models that are available
|
|
46
50
|
# for use. <br /><br /> **Note**: Model `id`'s will be in the form
|
|
47
51
|
# `{source}/{model_name}`. For example `openai/gpt-4` or
|
|
@@ -116,6 +120,7 @@ module Telnyx
|
|
|
116
120
|
@mcp_servers = Telnyx::Resources::AI::McpServers.new(client: client)
|
|
117
121
|
@missions = Telnyx::Resources::AI::Missions.new(client: client)
|
|
118
122
|
@openai = Telnyx::Resources::AI::OpenAI.new(client: client)
|
|
123
|
+
@tools = Telnyx::Resources::AI::Tools.new(client: client)
|
|
119
124
|
end
|
|
120
125
|
end
|
|
121
126
|
end
|
data/lib/telnyx/version.rb
CHANGED
data/lib/telnyx.rb
CHANGED
|
@@ -179,6 +179,10 @@ require_relative "telnyx/models/ai/assistants/tests/test_suites/run_list_params"
|
|
|
179
179
|
require_relative "telnyx/models/ai/assistants/tests/test_suites/run_trigger_params"
|
|
180
180
|
require_relative "telnyx/models/ai/assistants/tests/test_suites/run_trigger_response"
|
|
181
181
|
require_relative "telnyx/models/ai/assistants/test_update_params"
|
|
182
|
+
require_relative "telnyx/models/ai/assistants/tool_add_params"
|
|
183
|
+
require_relative "telnyx/models/ai/assistants/tool_add_response"
|
|
184
|
+
require_relative "telnyx/models/ai/assistants/tool_remove_params"
|
|
185
|
+
require_relative "telnyx/models/ai/assistants/tool_remove_response"
|
|
182
186
|
require_relative "telnyx/models/ai/assistants/tool_test_params"
|
|
183
187
|
require_relative "telnyx/models/ai/assistants/tool_test_response"
|
|
184
188
|
require_relative "telnyx/models/ai/assistants/version_config"
|
|
@@ -369,6 +373,16 @@ require_relative "telnyx/models/ai/privacy_settings"
|
|
|
369
373
|
require_relative "telnyx/models/ai/recursive_cluster"
|
|
370
374
|
require_relative "telnyx/models/ai/retrieval_tool"
|
|
371
375
|
require_relative "telnyx/models/ai/telephony_settings"
|
|
376
|
+
require_relative "telnyx/models/ai/tool_create_params"
|
|
377
|
+
require_relative "telnyx/models/ai/tool_create_response"
|
|
378
|
+
require_relative "telnyx/models/ai/tool_delete_params"
|
|
379
|
+
require_relative "telnyx/models/ai/tool_delete_response"
|
|
380
|
+
require_relative "telnyx/models/ai/tool_list_params"
|
|
381
|
+
require_relative "telnyx/models/ai/tool_list_response"
|
|
382
|
+
require_relative "telnyx/models/ai/tool_retrieve_params"
|
|
383
|
+
require_relative "telnyx/models/ai/tool_retrieve_response"
|
|
384
|
+
require_relative "telnyx/models/ai/tool_update_params"
|
|
385
|
+
require_relative "telnyx/models/ai/tool_update_response"
|
|
372
386
|
require_relative "telnyx/models/ai/transcription_settings"
|
|
373
387
|
require_relative "telnyx/models/ai/transcription_settings_config"
|
|
374
388
|
require_relative "telnyx/models/ai/transfer_tool"
|
|
@@ -2354,6 +2368,7 @@ require_relative "telnyx/resources/ai/missions/runs/telnyx_agents"
|
|
|
2354
2368
|
require_relative "telnyx/resources/ai/missions/tools"
|
|
2355
2369
|
require_relative "telnyx/resources/ai/openai"
|
|
2356
2370
|
require_relative "telnyx/resources/ai/openai/embeddings"
|
|
2371
|
+
require_relative "telnyx/resources/ai/tools"
|
|
2357
2372
|
require_relative "telnyx/resources/alphanumeric_sender_ids"
|
|
2358
2373
|
require_relative "telnyx/resources/audit_events"
|
|
2359
2374
|
require_relative "telnyx/resources/authentication_providers"
|
|
@@ -116,6 +116,12 @@ module Telnyx
|
|
|
116
116
|
end
|
|
117
117
|
attr_writer :telephony_settings
|
|
118
118
|
|
|
119
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
120
|
+
attr_reader :tool_ids
|
|
121
|
+
|
|
122
|
+
sig { params(tool_ids: T::Array[String]).void }
|
|
123
|
+
attr_writer :tool_ids
|
|
124
|
+
|
|
119
125
|
# The tools that the assistant can use. These may be templated with
|
|
120
126
|
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
121
127
|
sig do
|
|
@@ -197,6 +203,7 @@ module Telnyx
|
|
|
197
203
|
messaging_settings: Telnyx::AI::MessagingSettings::OrHash,
|
|
198
204
|
privacy_settings: Telnyx::AI::PrivacySettings::OrHash,
|
|
199
205
|
telephony_settings: Telnyx::AI::TelephonySettings::OrHash,
|
|
206
|
+
tool_ids: T::Array[String],
|
|
200
207
|
tools:
|
|
201
208
|
T::Array[
|
|
202
209
|
T.any(
|
|
@@ -253,6 +260,7 @@ module Telnyx
|
|
|
253
260
|
messaging_settings: nil,
|
|
254
261
|
privacy_settings: nil,
|
|
255
262
|
telephony_settings: nil,
|
|
263
|
+
tool_ids: nil,
|
|
256
264
|
# The tools that the assistant can use. These may be templated with
|
|
257
265
|
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
258
266
|
tools: nil,
|
|
@@ -280,6 +288,7 @@ module Telnyx
|
|
|
280
288
|
messaging_settings: Telnyx::AI::MessagingSettings,
|
|
281
289
|
privacy_settings: Telnyx::AI::PrivacySettings,
|
|
282
290
|
telephony_settings: Telnyx::AI::TelephonySettings,
|
|
291
|
+
tool_ids: T::Array[String],
|
|
283
292
|
tools:
|
|
284
293
|
T::Array[
|
|
285
294
|
T.any(
|
|
@@ -136,6 +136,12 @@ module Telnyx
|
|
|
136
136
|
end
|
|
137
137
|
attr_writer :telephony_settings
|
|
138
138
|
|
|
139
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
140
|
+
attr_reader :tool_ids
|
|
141
|
+
|
|
142
|
+
sig { params(tool_ids: T::Array[String]).void }
|
|
143
|
+
attr_writer :tool_ids
|
|
144
|
+
|
|
139
145
|
# The tools that the assistant can use. These may be templated with
|
|
140
146
|
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
141
147
|
sig do
|
|
@@ -219,6 +225,7 @@ module Telnyx
|
|
|
219
225
|
privacy_settings: Telnyx::AI::PrivacySettings::OrHash,
|
|
220
226
|
promote_to_main: T::Boolean,
|
|
221
227
|
telephony_settings: Telnyx::AI::TelephonySettings::OrHash,
|
|
228
|
+
tool_ids: T::Array[String],
|
|
222
229
|
tools:
|
|
223
230
|
T::Array[
|
|
224
231
|
T.any(
|
|
@@ -279,6 +286,7 @@ module Telnyx
|
|
|
279
286
|
# to true.
|
|
280
287
|
promote_to_main: nil,
|
|
281
288
|
telephony_settings: nil,
|
|
289
|
+
tool_ids: nil,
|
|
282
290
|
# The tools that the assistant can use. These may be templated with
|
|
283
291
|
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
284
292
|
tools: nil,
|
|
@@ -308,6 +316,7 @@ module Telnyx
|
|
|
308
316
|
privacy_settings: Telnyx::AI::PrivacySettings,
|
|
309
317
|
promote_to_main: T::Boolean,
|
|
310
318
|
telephony_settings: Telnyx::AI::TelephonySettings,
|
|
319
|
+
tool_ids: T::Array[String],
|
|
311
320
|
tools:
|
|
312
321
|
T::Array[
|
|
313
322
|
T.any(
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
module AI
|
|
6
|
+
module Assistants
|
|
7
|
+
class ToolAddParams < Telnyx::Internal::Type::BaseModel
|
|
8
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
OrHash =
|
|
12
|
+
T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
Telnyx::AI::Assistants::ToolAddParams,
|
|
15
|
+
Telnyx::Internal::AnyHash
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :assistant_id
|
|
21
|
+
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :tool_id
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
assistant_id: String,
|
|
28
|
+
tool_id: String,
|
|
29
|
+
request_options: Telnyx::RequestOptions::OrHash
|
|
30
|
+
).returns(T.attached_class)
|
|
31
|
+
end
|
|
32
|
+
def self.new(assistant_id:, tool_id:, request_options: {})
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
override.returns(
|
|
37
|
+
{
|
|
38
|
+
assistant_id: String,
|
|
39
|
+
tool_id: String,
|
|
40
|
+
request_options: Telnyx::RequestOptions
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
def to_hash
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
module AI
|
|
6
|
+
module Assistants
|
|
7
|
+
class ToolRemoveParams < Telnyx::Internal::Type::BaseModel
|
|
8
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
OrHash =
|
|
12
|
+
T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
Telnyx::AI::Assistants::ToolRemoveParams,
|
|
15
|
+
Telnyx::Internal::AnyHash
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :assistant_id
|
|
21
|
+
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :tool_id
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
assistant_id: String,
|
|
28
|
+
tool_id: String,
|
|
29
|
+
request_options: Telnyx::RequestOptions::OrHash
|
|
30
|
+
).returns(T.attached_class)
|
|
31
|
+
end
|
|
32
|
+
def self.new(assistant_id:, tool_id:, request_options: {})
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
override.returns(
|
|
37
|
+
{
|
|
38
|
+
assistant_id: String,
|
|
39
|
+
tool_id: String,
|
|
40
|
+
request_options: Telnyx::RequestOptions
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
def to_hash
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -132,6 +132,12 @@ module Telnyx
|
|
|
132
132
|
end
|
|
133
133
|
attr_writer :telephony_settings
|
|
134
134
|
|
|
135
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
136
|
+
attr_reader :tool_ids
|
|
137
|
+
|
|
138
|
+
sig { params(tool_ids: T::Array[String]).void }
|
|
139
|
+
attr_writer :tool_ids
|
|
140
|
+
|
|
135
141
|
# The tools that the assistant can use. These may be templated with
|
|
136
142
|
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
137
143
|
sig do
|
|
@@ -217,6 +223,7 @@ module Telnyx
|
|
|
217
223
|
name: String,
|
|
218
224
|
privacy_settings: Telnyx::AI::PrivacySettings::OrHash,
|
|
219
225
|
telephony_settings: Telnyx::AI::TelephonySettings::OrHash,
|
|
226
|
+
tool_ids: T::Array[String],
|
|
220
227
|
tools:
|
|
221
228
|
T::Array[
|
|
222
229
|
T.any(
|
|
@@ -272,6 +279,7 @@ module Telnyx
|
|
|
272
279
|
name: nil,
|
|
273
280
|
privacy_settings: nil,
|
|
274
281
|
telephony_settings: nil,
|
|
282
|
+
tool_ids: nil,
|
|
275
283
|
# The tools that the assistant can use. These may be templated with
|
|
276
284
|
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
277
285
|
tools: nil,
|
|
@@ -299,6 +307,7 @@ module Telnyx
|
|
|
299
307
|
name: String,
|
|
300
308
|
privacy_settings: Telnyx::AI::PrivacySettings,
|
|
301
309
|
telephony_settings: Telnyx::AI::TelephonySettings,
|
|
310
|
+
tool_ids: T::Array[String],
|
|
302
311
|
tools:
|
|
303
312
|
T::Array[
|
|
304
313
|
T.any(
|