Class: Telnyx::Resources::AI::Clusters
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Clusters
- Defined in:
- lib/telnyx/resources/ai/clusters.rb,
sig/telnyx/resources/ai/clusters.rbs
Overview
Identify common themes and patterns in your embedded documents
Instance Method Summary collapse
-
#compute(bucket:, files: nil, min_cluster_size: nil, min_subcluster_size: nil, prefix: nil, request_options: {}) ⇒ Telnyx::Models::AI::ClusterComputeResponse
Some parameter documentations has been truncated, see Models::AI::ClusterComputeParams for more details.
-
#delete(task_id, request_options: {}) ⇒ nil
Delete a clustering task and its computed results.
-
#fetch_graph(task_id, cluster_id: nil, request_options: {}) ⇒ StringIO
Fetch a visualization image of the clusters computed by a clustering task.
-
#initialize(client:) ⇒ Clusters
constructor
private
A new instance of Clusters.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::ClusterListResponse>
Retrieve a paginated list of clustering tasks and their statuses.
-
#retrieve(task_id, show_subclusters: nil, top_n_nodes: nil, request_options: {}) ⇒ Telnyx::Models::AI::ClusterRetrieveResponse
Some parameter documentations has been truncated, see Models::AI::ClusterRetrieveParams for more details.
Constructor Details
#initialize(client:) ⇒ Clusters
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 Clusters.
146 147 148 |
# File 'lib/telnyx/resources/ai/clusters.rb', line 146 def initialize(client:) @client = client end |
Instance Method Details
#compute(bucket:, files: nil, min_cluster_size: nil, min_subcluster_size: nil, prefix: nil, request_options: {}) ⇒ Telnyx::Models::AI::ClusterComputeResponse
Some parameter documentations has been truncated, see Models::AI::ClusterComputeParams for more details.
Starts a background task to compute how the data in an embedded storage bucket is clustered. This helps identify common themes and patterns in the data.
106 107 108 109 110 111 112 113 114 115 |
# File 'lib/telnyx/resources/ai/clusters.rb', line 106 def compute(params) parsed, = Telnyx::AI::ClusterComputeParams.dump_request(params) @client.request( method: :post, path: "ai/clusters", body: parsed, model: Telnyx::Models::AI::ClusterComputeResponse, options: ) end |
#delete(task_id, request_options: {}) ⇒ nil
Delete a clustering task and its computed results.
73 74 75 76 77 78 79 80 |
# File 'lib/telnyx/resources/ai/clusters.rb', line 73 def delete(task_id, params = {}) @client.request( method: :delete, path: ["ai/clusters/%1$s", task_id], model: NilClass, options: params[:request_options] ) end |
#fetch_graph(task_id, cluster_id: nil, request_options: {}) ⇒ StringIO
Fetch a visualization image of the clusters computed by a clustering task.
130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/telnyx/resources/ai/clusters.rb', line 130 def fetch_graph(task_id, params = {}) parsed, = Telnyx::AI::ClusterFetchGraphParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["ai/clusters/%1$s/graph", task_id], query: query, headers: {"accept" => "image/png"}, model: StringIO, options: ) end |
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::ClusterListResponse>
Retrieve a paginated list of clustering tasks and their statuses.
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/telnyx/resources/ai/clusters.rb', line 49 def list(params = {}) parsed, = Telnyx::AI::ClusterListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "ai/clusters", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::AI::ClusterListResponse, options: ) end |
#retrieve(task_id, show_subclusters: nil, top_n_nodes: nil, request_options: {}) ⇒ Telnyx::Models::AI::ClusterRetrieveResponse
Some parameter documentations has been truncated, see Models::AI::ClusterRetrieveParams for more details.
Fetch the results of a clustering task, including the discovered clusters.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/telnyx/resources/ai/clusters.rb', line 26 def retrieve(task_id, params = {}) parsed, = Telnyx::AI::ClusterRetrieveParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["ai/clusters/%1$s", task_id], query: query, model: Telnyx::Models::AI::ClusterRetrieveResponse, options: ) end |