Class: Telnyx::Resources::AI::Conversations::InsightGroups::Insights

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/ai/conversations/insight_groups/insights.rb

Overview

Manage historical AI assistant conversations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Insights

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

Parameters:



68
69
70
# File 'lib/telnyx/resources/ai/conversations/insight_groups/insights.rb', line 68

def initialize(client:)
  @client = client
end

Instance Method Details

#assign(insight_id, group_id:, request_options: {}) ⇒ nil

Assign an insight to a group

Parameters:

  • insight_id (String)

    The ID of the insight

  • group_id (String)

    The ID of the insight group

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

Returns:

  • (nil)

See Also:



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/telnyx/resources/ai/conversations/insight_groups/insights.rb', line 23

def assign(insight_id, params)
  parsed, options = Telnyx::AI::Conversations::InsightGroups::InsightAssignParams.dump_request(params)
  group_id =
    parsed.delete(:group_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["ai/conversations/insight-groups/%1$s/insights/%2$s/assign", group_id, insight_id],
    model: NilClass,
    options: options
  )
end

#delete_unassign(insight_id, group_id:, request_options: {}) ⇒ nil

Remove an insight from a group

Parameters:

  • insight_id (String)

    The ID of the insight

  • group_id (String)

    The ID of the insight group

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

Returns:

  • (nil)

See Also:



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/telnyx/resources/ai/conversations/insight_groups/insights.rb', line 50

def delete_unassign(insight_id, params)
  parsed, options =
    Telnyx::AI::Conversations::InsightGroups::InsightDeleteUnassignParams.dump_request(params)
  group_id =
    parsed.delete(:group_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["ai/conversations/insight-groups/%1$s/insights/%2$s/unassign", group_id, insight_id],
    model: NilClass,
    options: options
  )
end