Class: Telnyx::Resources::AI::Assistants::Tools

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/ai/assistants/tools.rb

Instance Method Summary collapse

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.

Parameters:



43
44
45
# File 'lib/telnyx/resources/ai/assistants/tools.rb', line 43

def initialize(client:)
  @client = client
end

Instance Method Details

#test_(tool_id, assistant_id:, arguments: nil, dynamic_variables: nil, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::ToolTestResponse

Test a webhook tool for an assistant

Parameters:

  • tool_id (String)

    Path param

  • assistant_id (String)

    Path param

  • arguments (Hash{Symbol=>Object})

    Body param: Key-value arguments to use for the webhook test

  • dynamic_variables (Hash{Symbol=>Object})

    Body param: Key-value dynamic variables to use for the webhook test

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/telnyx/resources/ai/assistants/tools.rb', line 25

def test_(tool_id, params)
  parsed, options = 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: options
  )
end