Class: Telnyx::Resources::AI::Assistants::Tools
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Assistants::Tools
- Defined in:
- lib/telnyx/resources/ai/assistants/tools.rb
Overview
Configure AI assistant specifications
Instance Method Summary collapse
-
#add(tool_id, assistant_id:, request_options: {}) ⇒ Object
Add Assistant Tool.
-
#initialize(client:) ⇒ Tools
constructor
private
A new instance of Tools.
-
#remove(tool_id, assistant_id:, request_options: {}) ⇒ Object
Remove Assistant Tool.
-
#test_(tool_id, assistant_id:, arguments: nil, dynamic_variables: nil, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::ToolTestResponse
Test a webhook tool for an assistant.
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.
94 95 96 |
# File 'lib/telnyx/resources/ai/assistants/tools.rb', line 94 def initialize(client:) @client = client end |
Instance Method Details
#add(tool_id, assistant_id:, request_options: {}) ⇒ Object
Add Assistant Tool
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/telnyx/resources/ai/assistants/tools.rb', line 20 def add(tool_id, params) parsed, = Telnyx::AI::Assistants::ToolAddParams.dump_request(params) assistant_id = parsed.delete(:assistant_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :put, path: ["ai/assistants/%1$s/tools/%2$s", assistant_id, tool_id], model: Telnyx::Internal::Type::Unknown, options: ) end |
#remove(tool_id, assistant_id:, request_options: {}) ⇒ Object
Remove Assistant Tool
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/telnyx/resources/ai/assistants/tools.rb', line 45 def remove(tool_id, params) parsed, = Telnyx::AI::Assistants::ToolRemoveParams.dump_request(params) assistant_id = parsed.delete(:assistant_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["ai/assistants/%1$s/tools/%2$s", assistant_id, tool_id], model: Telnyx::Internal::Type::Unknown, options: ) end |
#test_(tool_id, assistant_id:, arguments: nil, dynamic_variables: nil, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::ToolTestResponse
Test a webhook tool for an assistant
76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/telnyx/resources/ai/assistants/tools.rb', line 76 def test_(tool_id, params) parsed, = Telnyx::AI::Assistants::ToolTestParams.dump_request(params) assistant_id = parsed.delete(:assistant_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["ai/assistants/%1$s/tools/%2$s/test", assistant_id, tool_id], body: parsed, model: Telnyx::Models::AI::Assistants::ToolTestResponse, options: ) end |