Class: Telnyx::Resources::AI::Assistants::Tests::Runs

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

Overview

Configure AI assistant specifications

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Runs

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 Runs.

Parameters:



96
97
98
# File 'lib/telnyx/resources/ai/assistants/tests/runs.rb', line 96

def initialize(client:)
  @client = client
end

Instance Method Details

#list(test_id, page_number: nil, page_size: nil, status: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::Assistants::Tests::TestRunResponse>

Retrieves paginated execution history for a specific assistant test with filtering options

Parameters:

  • test_id (String)
  • page_number (Integer)
  • page_size (Integer)
  • status (String)

    Filter runs by execution status (pending, running, completed, failed, timeout)

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

Returns:

See Also:



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/telnyx/resources/ai/assistants/tests/runs.rb', line 53

def list(test_id, params = {})
  parsed, options = Telnyx::AI::Assistants::Tests::RunListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["ai/assistants/tests/%1$s/runs", test_id],
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::AI::Assistants::Tests::TestRunResponse,
    options: options
  )
end

#retrieve(run_id, test_id:, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::Tests::TestRunResponse

Retrieves detailed information about a specific test run execution

Parameters:

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/telnyx/resources/ai/assistants/tests/runs.rb', line 21

def retrieve(run_id, params)
  parsed, options = Telnyx::AI::Assistants::Tests::RunRetrieveParams.dump_request(params)
  test_id =
    parsed.delete(:test_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["ai/assistants/tests/%1$s/runs/%2$s", test_id, run_id],
    model: Telnyx::AI::Assistants::Tests::TestRunResponse,
    options: options
  )
end

#trigger(test_id, destination_version_id: nil, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::Tests::TestRunResponse

Some parameter documentations has been truncated, see Models::AI::Assistants::Tests::RunTriggerParams for more details.

Initiates immediate execution of a specific assistant test

Parameters:

  • test_id (String)
  • destination_version_id (String)

    Optional assistant version ID to use for this test run. If provided, the version

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

Returns:

See Also:



82
83
84
85
86
87
88
89
90
91
# File 'lib/telnyx/resources/ai/assistants/tests/runs.rb', line 82

def trigger(test_id, params = {})
  parsed, options = Telnyx::AI::Assistants::Tests::RunTriggerParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["ai/assistants/tests/%1$s/runs", test_id],
    body: parsed,
    model: Telnyx::AI::Assistants::Tests::TestRunResponse,
    options: options
  )
end