Class: Telnyx::Resources::AI::Tools
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Tools
- Defined in:
- lib/telnyx/resources/ai/tools.rb
Overview
Configure AI assistant specifications
Instance Method Summary collapse
-
#create(display_name:, type:, function: nil, handoff: nil, invite: nil, retrieval: nil, timeout_ms: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::ToolCreateResponse
Create Tool.
-
#delete(tool_id, request_options: {}) ⇒ Object
Delete Tool.
-
#initialize(client:) ⇒ Tools
constructor
private
A new instance of Tools.
-
#list(filter_name: nil, filter_type: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::ToolListResponse>
List Tools.
-
#retrieve(tool_id, request_options: {}) ⇒ Telnyx::Models::AI::ToolRetrieveResponse
Get Tool.
-
#update(tool_id, display_name: nil, function: nil, handoff: nil, invite: nil, retrieval: nil, timeout_ms: nil, type: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::ToolUpdateResponse
Update Tool.
Constructor Details
#initialize(client:) ⇒ Tools
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Tools.
137 138 139 |
# File 'lib/telnyx/resources/ai/tools.rb', line 137 def initialize(client:) @client = client end |
Instance Method Details
#create(display_name:, type:, function: nil, handoff: nil, invite: nil, retrieval: nil, timeout_ms: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::ToolCreateResponse
Create Tool
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/telnyx/resources/ai/tools.rb', line 25 def create(params) parsed, = Telnyx::AI::ToolCreateParams.dump_request(params) @client.request( method: :post, path: "ai/tools", body: parsed, model: Telnyx::Models::AI::ToolCreateResponse, options: ) end |
#delete(tool_id, request_options: {}) ⇒ Object
Delete Tool
125 126 127 128 129 130 131 132 |
# File 'lib/telnyx/resources/ai/tools.rb', line 125 def delete(tool_id, params = {}) @client.request( method: :delete, path: ["ai/tools/%1$s", tool_id], model: Telnyx::Internal::Type::Unknown, options: params[:request_options] ) end |
#list(filter_name: nil, filter_type: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::ToolListResponse>
List Tools
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/telnyx/resources/ai/tools.rb', line 97 def list(params = {}) parsed, = Telnyx::AI::ToolListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "ai/tools", query: query.transform_keys( filter_name: "filter[name]", filter_type: "filter[type]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::AI::ToolListResponse, options: ) end |
#retrieve(tool_id, request_options: {}) ⇒ Telnyx::Models::AI::ToolRetrieveResponse
Get Tool
46 47 48 49 50 51 52 53 |
# File 'lib/telnyx/resources/ai/tools.rb', line 46 def retrieve(tool_id, params = {}) @client.request( method: :get, path: ["ai/tools/%1$s", tool_id], model: Telnyx::Models::AI::ToolRetrieveResponse, options: params[:request_options] ) end |
#update(tool_id, display_name: nil, function: nil, handoff: nil, invite: nil, retrieval: nil, timeout_ms: nil, type: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::ToolUpdateResponse
Update Tool
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/telnyx/resources/ai/tools.rb', line 73 def update(tool_id, params = {}) parsed, = Telnyx::AI::ToolUpdateParams.dump_request(params) @client.request( method: :patch, path: ["ai/tools/%1$s", tool_id], body: parsed, model: Telnyx::Models::AI::ToolUpdateResponse, options: ) end |