Class: Telnyx::Resources::AI::Conversations::Insights
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Conversations::Insights
- Defined in:
- lib/telnyx/resources/ai/conversations/insights.rb,
sig/telnyx/resources/ai/conversations/insights.rbs
Overview
Manage historical AI assistant conversations
Instance Method Summary collapse
-
#create(instructions:, name:, json_schema: nil, webhook: nil, idempotency_key: nil, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Some parameter documentations has been truncated, see Models::AI::Conversations::InsightCreateParams for more details.
-
#delete(insight_id, request_options: {}) ⇒ nil
Permanently deletes the specified insight template by its 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>
Returns a paginated list of your insight templates.
-
#retrieve(insight_id, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Returns the details of a single insight template by its ID, including its configuration.
-
#update(insight_id, instructions: nil, json_schema: nil, name: nil, webhook: nil, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Updates the specified insight template and returns the updated 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.
144 145 146 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 144 def initialize(client:) @client = client end |
Instance Method Details
#create(instructions:, name:, json_schema: nil, webhook: nil, idempotency_key: nil, request_options: {}) ⇒ Telnyx::Models::AI::Conversations::InsightTemplateDetail
Some parameter documentations has been truncated, see Models::AI::Conversations::InsightCreateParams for more details.
Creates a new insight template defining an analysis to run over conversations, and returns the created template.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 32 def create(params) parsed, = Telnyx::AI::Conversations::InsightCreateParams.dump_request(params) header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: "ai/conversations/insights", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Telnyx::AI::Conversations::InsightTemplateDetail, options: ) end |
#delete(insight_id, request_options: {}) ⇒ nil
Permanently deletes the specified insight template by its ID.
132 133 134 135 136 137 138 139 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 132 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>
Returns a paginated list of your insight templates. Insight templates define analyses that run over AI conversations to extract structured findings.
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 108 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
Returns the details of a single insight template by its ID, including its configuration.
57 58 59 60 61 62 63 64 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 57 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
Updates the specified insight template and returns the updated template.
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/telnyx/resources/ai/conversations/insights.rb', line 85 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 |