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

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

Overview

Manage historical AI assistant conversations

Defined Under Namespace

Classes: Insights

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ InsightGroups

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

Parameters:



131
132
133
134
# File 'lib/telnyx/resources/ai/conversations/insight_groups.rb', line 131

def initialize(client:)
  @client = client
  @insights = Telnyx::Resources::AI::Conversations::InsightGroups::Insights.new(client: client)
end

Instance Attribute Details

#insightsTelnyx::Resources::AI::Conversations::InsightGroups::Insights (readonly)

Manage historical AI assistant conversations



11
12
13
# File 'lib/telnyx/resources/ai/conversations/insight_groups.rb', line 11

def insights
  @insights
end

Instance Method Details

#delete(group_id, request_options: {}) ⇒ nil

Delete insight group by ID

Parameters:

  • group_id (String)

    The ID of the insight group

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

Returns:

  • (nil)

See Also:



72
73
74
75
76
77
78
79
# File 'lib/telnyx/resources/ai/conversations/insight_groups.rb', line 72

def delete(group_id, params = {})
  @client.request(
    method: :delete,
    path: ["ai/conversations/insight-groups/%1$s", group_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#insight_groups(name:, description: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateGroupDetail

Create a new insight group

Parameters:

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

Returns:

See Also:



93
94
95
96
97
98
99
100
101
102
# File 'lib/telnyx/resources/ai/conversations/insight_groups.rb', line 93

def insight_groups(params)
  parsed, options = Telnyx::AI::Conversations::InsightGroupInsightGroupsParams.dump_request(params)
  @client.request(
    method: :post,
    path: "ai/conversations/insight-groups",
    body: parsed,
    model: Telnyx::AI::Conversations::InsightTemplateGroupDetail,
    options: options
  )
end

#retrieve(group_id, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateGroupDetail

Get insight group by ID

Parameters:

  • group_id (String)

    The ID of the insight group

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

Returns:

See Also:



24
25
26
27
28
29
30
31
# File 'lib/telnyx/resources/ai/conversations/insight_groups.rb', line 24

def retrieve(group_id, params = {})
  @client.request(
    method: :get,
    path: ["ai/conversations/insight-groups/%1$s", group_id],
    model: Telnyx::AI::Conversations::InsightTemplateGroupDetail,
    options: params[:request_options]
  )
end

#retrieve_insight_groups(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::Conversations::InsightTemplateGroup>

Get all insight groups

Parameters:

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

Returns:

See Also:



115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/telnyx/resources/ai/conversations/insight_groups.rb', line 115

def retrieve_insight_groups(params = {})
  parsed, options = Telnyx::AI::Conversations::InsightGroupRetrieveInsightGroupsParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "ai/conversations/insight-groups",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::AI::Conversations::InsightTemplateGroup,
    options: options
  )
end

#update(group_id, description: nil, name: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateGroupDetail

Update an insight template group

Parameters:

  • group_id (String)

    The ID of the insight group

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

Returns:

See Also:



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

def update(group_id, params = {})
  parsed, options = Telnyx::AI::Conversations::InsightGroupUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["ai/conversations/insight-groups/%1$s", group_id],
    body: parsed,
    model: Telnyx::AI::Conversations::InsightTemplateGroupDetail,
    options: options
  )
end