Class: Telnyx::Resources::AI::Missions::Tools
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Missions::Tools
- Defined in:
- lib/telnyx/resources/ai/missions/tools.rb,
sig/telnyx/resources/ai/missions/tools.rbs
Instance Method Summary collapse
-
#create_tool(mission_id, request_options: {}) ⇒ Object
Adds a new tool to the specified mission, defining an action agents can invoke during runs of this mission.
-
#delete_tool(tool_id, mission_id:, request_options: {}) ⇒ nil
Removes the specified tool from the mission so agents can no longer invoke it in subsequent runs.
-
#get_tool(tool_id, mission_id:, request_options: {}) ⇒ Object
Returns the definition of a single tool configured on the specified mission.
-
#initialize(client:) ⇒ Tools
constructor
private
A new instance of Tools.
-
#list_tools(mission_id, request_options: {}) ⇒ Object
Returns the tools configured on the specified mission.
-
#update_tool(tool_id, mission_id:, request_options: {}) ⇒ Object
Replaces the definition of the specified tool on this mission.
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.
135 136 137 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 135 def initialize(client:) @client = client end |
Instance Method Details
#create_tool(mission_id, request_options: {}) ⇒ Object
Adds a new tool to the specified mission, defining an action agents can invoke during runs of this mission.
20 21 22 23 24 25 26 27 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 20 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
Removes the specified tool from the mission so agents can no longer invoke it in subsequent runs.
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 43 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
Returns the definition of a single tool configured on the specified mission.
70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 70 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
Returns the tools configured on the specified mission. Tools define the actions agents may invoke while executing the mission's runs.
96 97 98 99 100 101 102 103 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 96 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
Replaces the definition of the specified tool on this mission.
118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/telnyx/resources/ai/missions/tools.rb', line 118 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 |