Class: Telnyx::Resources::AI::Missions::Tools
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Missions::Tools
- Defined in:
- lib/telnyx/resources/ai/missions/tools.rb
Instance Method Summary collapse
-
#create_tool(mission_id, request_options: {}) ⇒ Object
Create a new tool for a mission.
-
#delete_tool(tool_id, mission_id:, request_options: {}) ⇒ nil
Delete a tool from a mission.
-
#get_tool(tool_id, mission_id:, request_options: {}) ⇒ Object
Get a specific tool by ID.
-
#initialize(client:) ⇒ Tools
constructor
private
A new instance of Tools.
-
#list_tools(mission_id, request_options: {}) ⇒ Object
List all tools for a mission.
-
#update_tool(tool_id, mission_id:, request_options: {}) ⇒ Object
Update a tool definition.
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.
124 125 126 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 124 def initialize(client:) @client = client end |
Instance Method Details
#create_tool(mission_id, request_options: {}) ⇒ Object
Create a new tool for a mission
18 19 20 21 22 23 24 25 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 18 def create_tool(mission_id, params = {}) @client.request( method: :post, path: ["ai/missions/%1$s/tools", mission_id], model: Telnyx::Internal::Type::Unknown, options: params[:request_options] ) end |
#delete_tool(tool_id, mission_id:, request_options: {}) ⇒ nil
Delete a tool from a mission
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 38 def delete_tool(tool_id, params) parsed, = Telnyx::AI::Missions::ToolDeleteToolParams.dump_request(params) mission_id = parsed.delete(:mission_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["ai/missions/%1$s/tools/%2$s", mission_id, tool_id], model: NilClass, options: ) end |
#get_tool(tool_id, mission_id:, request_options: {}) ⇒ Object
Get a specific tool by ID
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 63 def get_tool(tool_id, params) parsed, = Telnyx::AI::Missions::ToolGetToolParams.dump_request(params) mission_id = parsed.delete(:mission_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["ai/missions/%1$s/tools/%2$s", mission_id, tool_id], model: Telnyx::Internal::Type::Unknown, options: ) end |
#list_tools(mission_id, request_options: {}) ⇒ Object
List all tools for a mission
87 88 89 90 91 92 93 94 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 87 def list_tools(mission_id, params = {}) @client.request( method: :get, path: ["ai/missions/%1$s/tools", mission_id], model: Telnyx::Internal::Type::Unknown, options: params[:request_options] ) end |
#update_tool(tool_id, mission_id:, request_options: {}) ⇒ Object
Update a tool definition
107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 107 def update_tool(tool_id, params) parsed, = Telnyx::AI::Missions::ToolUpdateToolParams.dump_request(params) mission_id = parsed.delete(:mission_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :put, path: ["ai/missions/%1$s/tools/%2$s", mission_id, tool_id], model: Telnyx::Internal::Type::Unknown, options: ) end |