Class: Telnyx::Resources::AI::Conversations::Insights
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Conversations::Insights
- Defined in:
- lib/telnyx/resources/ai/conversations/insights.rb
Overview
Manage historical AI assistant conversations
Instance Method Summary collapse
-
#create(instructions:, name:, json_schema: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Create a new insight.
-
#delete(insight_id, request_options: {}) ⇒ nil
Delete insight by ID.
-
#initialize(client:) ⇒ Insights
constructor
private
A new instance of Insights.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::Conversations::InsightTemplate>
Get all insights.
-
#retrieve(insight_id, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Get insight by ID.
-
#update(insight_id, instructions: nil, json_schema: nil, name: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Update an insight template.
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.
134 135 136 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 134 def initialize(client:) @client = client end |
Instance Method Details
#create(instructions:, name:, json_schema: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Create a new insight
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 26 def create(params) parsed, = Telnyx::AI::Conversations::InsightCreateParams.dump_request(params) @client.request( method: :post, path: "ai/conversations/insights", body: parsed, model: Telnyx::AI::Conversations::InsightTemplateDetail, options: ) end |
#delete(insight_id, request_options: {}) ⇒ nil
Delete insight by ID
122 123 124 125 126 127 128 129 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 122 def delete(insight_id, params = {}) @client.request( method: :delete, path: ["ai/conversations/insights/%1$s", insight_id], model: NilClass, options: params[:request_options] ) end |
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::Conversations::InsightTemplate>
Get all insights
98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 98 def list(params = {}) parsed, = Telnyx::AI::Conversations::InsightListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "ai/conversations/insights", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::AI::Conversations::InsightTemplate, options: ) end |
#retrieve(insight_id, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Get insight by ID
48 49 50 51 52 53 54 55 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 48 def retrieve(insight_id, params = {}) @client.request( method: :get, path: ["ai/conversations/insights/%1$s", insight_id], model: Telnyx::AI::Conversations::InsightTemplateDetail, options: params[:request_options] ) end |
#update(insight_id, instructions: nil, json_schema: nil, name: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Update an insight template
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 76 def update(insight_id, params = {}) parsed, = Telnyx::AI::Conversations::InsightUpdateParams.dump_request(params) @client.request( method: :put, path: ["ai/conversations/insights/%1$s", insight_id], body: parsed, model: Telnyx::AI::Conversations::InsightTemplateDetail, options: ) end |