falaai-api 1.21.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +205 -0
- data/docs/AnalysisApi.md +147 -0
- data/docs/AudioEvent.md +26 -0
- data/docs/AudioInputMeta.md +26 -0
- data/docs/AuditoriaRiscoAnalysisV2.md +22 -0
- data/docs/AuditoriaRiscoAppliedActionV2.md +32 -0
- data/docs/AuditoriaRiscoAudioEventModelV2.md +22 -0
- data/docs/AuditoriaRiscoAuditDecisionsV2.md +22 -0
- data/docs/AuditoriaRiscoConversationScoresV2.md +38 -0
- data/docs/AuditoriaRiscoDetectionItemV2.md +110 -0
- data/docs/AuditoriaRiscoDetectionsV2.md +26 -0
- data/docs/AuditoriaRiscoIndexerV2.md +18 -0
- data/docs/AuditoriaRiscoMetaV2.md +28 -0
- data/docs/AuditoriaRiscoParticipantV2.md +22 -0
- data/docs/AuditoriaRiscoParticipantsV2.md +26 -0
- data/docs/AuditoriaRiscoRequest.md +38 -0
- data/docs/AuditoriaRiscoScoresV2.md +20 -0
- data/docs/AuditoriaRiscoScoringExplanationV2.md +20 -0
- data/docs/AuditoriaRiscoSummaryV2.md +48 -0
- data/docs/AuditoriaRiscoTimelineV2.md +22 -0
- data/docs/AuditoriaRiscoUsageV2.md +22 -0
- data/docs/AuditoriaRiscoV2.md +46 -0
- data/docs/AuditoriaRiscoV2Response.md +18 -0
- data/docs/AuditoriaRiscoVerdictV2.md +30 -0
- data/docs/CreateEmailAlertRequest.md +22 -0
- data/docs/CreateWebhookRequest.md +24 -0
- data/docs/DiagnosticAnalysisMap.md +28 -0
- data/docs/DiagnosticAudioEvent.md +26 -0
- data/docs/DiagnosticCategoricalAnalysis.md +22 -0
- data/docs/DiagnosticRequest.md +30 -0
- data/docs/DiagnosticResponse.md +28 -0
- data/docs/DiagnosticTextAnalysis.md +18 -0
- data/docs/DiagnosticUsage.md +22 -0
- data/docs/EmailAlertItem.md +32 -0
- data/docs/EmailAlertListResponse.md +22 -0
- data/docs/EmailAlertMessageResponse.md +18 -0
- data/docs/EmailAlertsApi.md +285 -0
- data/docs/EmailEvent.md +15 -0
- data/docs/HTTPValidationError.md +18 -0
- data/docs/HealthApi.md +137 -0
- data/docs/HealthResponse.md +28 -0
- data/docs/LocationInner.md +15 -0
- data/docs/MessageResponse.md +18 -0
- data/docs/Participant.md +22 -0
- data/docs/ParticipantDiagnostic.md +26 -0
- data/docs/SpeechApi.md +85 -0
- data/docs/TranscriptionResponse.md +49 -0
- data/docs/TranscriptionUsage.md +22 -0
- data/docs/UpdateEmailAlertRequest.md +24 -0
- data/docs/UpdateWebhookRequest.md +26 -0
- data/docs/UsageApi.md +151 -0
- data/docs/UsageByKeyItem.md +26 -0
- data/docs/UsageLogItem.md +28 -0
- data/docs/UsageLogResponse.md +22 -0
- data/docs/ValidationError.md +26 -0
- data/docs/VersionApi.md +72 -0
- data/docs/VersionResponse.md +22 -0
- data/docs/WebhookEvent.md +15 -0
- data/docs/WebhookItem.md +42 -0
- data/docs/WebhookListResponse.md +22 -0
- data/docs/WebhooksApi.md +293 -0
- data/lib/falaai-api/api/analysis_api.rb +158 -0
- data/lib/falaai-api/api/email_alerts_api.rb +294 -0
- data/lib/falaai-api/api/health_api.rb +132 -0
- data/lib/falaai-api/api/speech_api.rb +100 -0
- data/lib/falaai-api/api/usage_api.rb +156 -0
- data/lib/falaai-api/api/version_api.rb +77 -0
- data/lib/falaai-api/api/webhooks_api.rb +302 -0
- data/lib/falaai-api/api_client.rb +397 -0
- data/lib/falaai-api/api_error.rb +58 -0
- data/lib/falaai-api/api_model_base.rb +88 -0
- data/lib/falaai-api/configuration.rb +309 -0
- data/lib/falaai-api/models/audio_event.rb +273 -0
- data/lib/falaai-api/models/audio_input_meta.rb +273 -0
- data/lib/falaai-api/models/auditoria_risco_analysis_v2.rb +174 -0
- data/lib/falaai-api/models/auditoria_risco_applied_action_v2.rb +292 -0
- data/lib/falaai-api/models/auditoria_risco_audio_event_model_v2.rb +174 -0
- data/lib/falaai-api/models/auditoria_risco_audit_decisions_v2.rb +170 -0
- data/lib/falaai-api/models/auditoria_risco_conversation_scores_v2.rb +251 -0
- data/lib/falaai-api/models/auditoria_risco_detection_item_v2.rb +651 -0
- data/lib/falaai-api/models/auditoria_risco_detections_v2.rb +198 -0
- data/lib/falaai-api/models/auditoria_risco_indexer_v2.rb +150 -0
- data/lib/falaai-api/models/auditoria_risco_meta_v2.rb +234 -0
- data/lib/falaai-api/models/auditoria_risco_participant_v2.rb +168 -0
- data/lib/falaai-api/models/auditoria_risco_participants_v2.rb +196 -0
- data/lib/falaai-api/models/auditoria_risco_request.rb +451 -0
- data/lib/falaai-api/models/auditoria_risco_scores_v2.rb +177 -0
- data/lib/falaai-api/models/auditoria_risco_scoring_explanation_v2.rb +160 -0
- data/lib/falaai-api/models/auditoria_risco_summary_v2.rb +300 -0
- data/lib/falaai-api/models/auditoria_risco_timeline_v2.rb +174 -0
- data/lib/falaai-api/models/auditoria_risco_usage_v2.rb +219 -0
- data/lib/falaai-api/models/auditoria_risco_v2.rb +548 -0
- data/lib/falaai-api/models/auditoria_risco_v2_response.rb +165 -0
- data/lib/falaai-api/models/auditoria_risco_verdict_v2.rb +213 -0
- data/lib/falaai-api/models/create_email_alert_request.rb +221 -0
- data/lib/falaai-api/models/create_webhook_request.rb +233 -0
- data/lib/falaai-api/models/diagnostic_analysis_map.rb +285 -0
- data/lib/falaai-api/models/diagnostic_audio_event.rb +205 -0
- data/lib/falaai-api/models/diagnostic_categorical_analysis.rb +170 -0
- data/lib/falaai-api/models/diagnostic_request.rb +316 -0
- data/lib/falaai-api/models/diagnostic_response.rb +283 -0
- data/lib/falaai-api/models/diagnostic_text_analysis.rb +148 -0
- data/lib/falaai-api/models/diagnostic_usage.rb +219 -0
- data/lib/falaai-api/models/email_alert_item.rb +356 -0
- data/lib/falaai-api/models/email_alert_list_response.rb +218 -0
- data/lib/falaai-api/models/email_alert_message_response.rb +165 -0
- data/lib/falaai-api/models/email_event.rb +47 -0
- data/lib/falaai-api/models/health_response.rb +300 -0
- data/lib/falaai-api/models/http_validation_error.rb +149 -0
- data/lib/falaai-api/models/location_inner.rb +103 -0
- data/lib/falaai-api/models/message_response.rb +165 -0
- data/lib/falaai-api/models/participant.rb +226 -0
- data/lib/falaai-api/models/participant_diagnostic.rb +222 -0
- data/lib/falaai-api/models/transcription_response.rb +540 -0
- data/lib/falaai-api/models/transcription_usage.rb +219 -0
- data/lib/falaai-api/models/update_email_alert_request.rb +176 -0
- data/lib/falaai-api/models/update_webhook_request.rb +190 -0
- data/lib/falaai-api/models/usage_by_key_item.rb +256 -0
- data/lib/falaai-api/models/usage_log_item.rb +300 -0
- data/lib/falaai-api/models/usage_log_response.rb +218 -0
- data/lib/falaai-api/models/validation_error.rb +237 -0
- data/lib/falaai-api/models/version_response.rb +219 -0
- data/lib/falaai-api/models/webhook_event.rb +48 -0
- data/lib/falaai-api/models/webhook_item.rb +442 -0
- data/lib/falaai-api/models/webhook_list_response.rb +218 -0
- data/lib/falaai-api/version.rb +15 -0
- data/lib/falaai-api.rb +100 -0
- metadata +229 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FalaAI API
|
|
3
|
+
|
|
4
|
+
#Transcribe, diagnose and score calls with 3 simple endpoints. **Endpoints:** - `POST /v1/audio/transcriptions` — Audio to text - `POST /v1/analyze/diagnostic` — Conversation analysis - `POST /v1/analyze/auditoriaRisco` — Compliance audit **Complete flow (Python):** ```python import httpx API = 'https://api.fala.ai' KEY = 'fai_xxx' HD = {'Authorization': f'Bearer {KEY}'} # 1. Transcribe files = {'file': open('call.mp3', 'rb')} resp = httpx.post(f'{API}/v1/audio/transcriptions', headers=HD, files=files, data={'model': 'falaai-transcribe-1', 'language': 'pt'}) tr = resp.json() print(f'Text: {tr[\"text\"][:100]}...') # 2. Diagnose resp = httpx.post(f'{API}/v1/analyze/diagnostic', headers=HD, json={'dialog': tr['dialog'], 'language': 'pt-BR', 'duration_seconds': tr['duration_seconds']}) diag = resp.json() print(f'Sentiment: {diag[\"analysis\"][\"sentiment\"][\"list_choice\"]}') print(f'Summary: {diag[\"analysis\"][\"dialogue_summary\"][\"explanation\"][:100]}...') # 3. Audit resp = httpx.post(f'{API}/v1/analyze/auditoriaRisco', headers=HD, json={'dialogo': tr['dialog'], 'duration_seconds': tr['duration_seconds']}) audit = resp.json() print(f'Score: {audit[\"audit_score\"]} | Verdict: {audit[\"verdict\"]}') print(f'Detections: {audit[\"total_detections\"]} | Violations: {len(audit[\"violations\"])} | Positives: {len(audit[\"positives\"])}') ``` **Authentication:** All endpoints require an API Key in the `Authorization` header: `Bearer fai_xxx` Get your API Key at [falaai.action.tec.br/api](https://falaai.action.tec.br/api)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.21.47
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FalaAI
|
|
17
|
+
class CreateWebhookRequest < ApiModelBase
|
|
18
|
+
# Nome identificador do webhook
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# URL HTTPS que recebera POST com HMAC FalaAI-Signature
|
|
22
|
+
attr_accessor :url
|
|
23
|
+
|
|
24
|
+
# Eventos subscritos (10 alertas)
|
|
25
|
+
attr_accessor :events
|
|
26
|
+
|
|
27
|
+
# Retry exponencial 5 tentativas quando true (false=1 tentativa)
|
|
28
|
+
attr_accessor :retry_enabled
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'name' => :'name',
|
|
34
|
+
:'url' => :'url',
|
|
35
|
+
:'events' => :'events',
|
|
36
|
+
:'retry_enabled' => :'retry_enabled'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'name' => :'String',
|
|
54
|
+
:'url' => :'String',
|
|
55
|
+
:'events' => :'Array<WebhookEvent>',
|
|
56
|
+
:'retry_enabled' => :'Boolean'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::CreateWebhookRequest` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::CreateWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
|
+
end
|
|
79
|
+
h[k.to_sym] = v
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'name')
|
|
83
|
+
self.name = attributes[:'name']
|
|
84
|
+
else
|
|
85
|
+
self.name = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'url')
|
|
89
|
+
self.url = attributes[:'url']
|
|
90
|
+
else
|
|
91
|
+
self.url = nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'events')
|
|
95
|
+
if (value = attributes[:'events']).is_a?(Array)
|
|
96
|
+
self.events = value
|
|
97
|
+
end
|
|
98
|
+
else
|
|
99
|
+
self.events = nil
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'retry_enabled')
|
|
103
|
+
self.retry_enabled = attributes[:'retry_enabled']
|
|
104
|
+
else
|
|
105
|
+
self.retry_enabled = false
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properties with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
113
|
+
invalid_properties = Array.new
|
|
114
|
+
if @name.nil?
|
|
115
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if @url.nil?
|
|
119
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if @events.nil?
|
|
123
|
+
invalid_properties.push('invalid value for "events", events cannot be nil.')
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
invalid_properties
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Check to see if the all the properties in the model are valid
|
|
130
|
+
# @return true if the model is valid
|
|
131
|
+
def valid?
|
|
132
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
133
|
+
return false if @name.nil?
|
|
134
|
+
return false if @url.nil?
|
|
135
|
+
return false if @events.nil?
|
|
136
|
+
true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] name Value to be assigned
|
|
141
|
+
def name=(name)
|
|
142
|
+
if name.nil?
|
|
143
|
+
fail ArgumentError, 'name cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@name = name
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] url Value to be assigned
|
|
151
|
+
def url=(url)
|
|
152
|
+
if url.nil?
|
|
153
|
+
fail ArgumentError, 'url cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@url = url
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Custom attribute writer method with validation
|
|
160
|
+
# @param [Object] events Value to be assigned
|
|
161
|
+
def events=(events)
|
|
162
|
+
if events.nil?
|
|
163
|
+
fail ArgumentError, 'events cannot be nil'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
@events = events
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Checks equality by comparing each attribute.
|
|
170
|
+
# @param [Object] Object to be compared
|
|
171
|
+
def ==(o)
|
|
172
|
+
return true if self.equal?(o)
|
|
173
|
+
self.class == o.class &&
|
|
174
|
+
name == o.name &&
|
|
175
|
+
url == o.url &&
|
|
176
|
+
events == o.events &&
|
|
177
|
+
retry_enabled == o.retry_enabled
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# @see the `==` method
|
|
181
|
+
# @param [Object] Object to be compared
|
|
182
|
+
def eql?(o)
|
|
183
|
+
self == o
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Calculates hash code according to all attributes.
|
|
187
|
+
# @return [Integer] Hash code
|
|
188
|
+
def hash
|
|
189
|
+
[name, url, events, retry_enabled].hash
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Builds the object from hash
|
|
193
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
194
|
+
# @return [Object] Returns the model itself
|
|
195
|
+
def self.build_from_hash(attributes)
|
|
196
|
+
return nil unless attributes.is_a?(Hash)
|
|
197
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
198
|
+
transformed_hash = {}
|
|
199
|
+
openapi_types.each_pair do |key, type|
|
|
200
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
201
|
+
transformed_hash["#{key}"] = nil
|
|
202
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
203
|
+
# check to ensure the input is an array given that the attribute
|
|
204
|
+
# is documented as an array but the input is not
|
|
205
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
206
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
207
|
+
end
|
|
208
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
209
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
new(transformed_hash)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Returns the object in the form of hash
|
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
|
217
|
+
def to_hash
|
|
218
|
+
hash = {}
|
|
219
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
220
|
+
value = self.send(attr)
|
|
221
|
+
if value.nil?
|
|
222
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
223
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
hash[param] = _to_hash(value)
|
|
227
|
+
end
|
|
228
|
+
hash
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
end
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FalaAI API
|
|
3
|
+
|
|
4
|
+
#Transcribe, diagnose and score calls with 3 simple endpoints. **Endpoints:** - `POST /v1/audio/transcriptions` — Audio to text - `POST /v1/analyze/diagnostic` — Conversation analysis - `POST /v1/analyze/auditoriaRisco` — Compliance audit **Complete flow (Python):** ```python import httpx API = 'https://api.fala.ai' KEY = 'fai_xxx' HD = {'Authorization': f'Bearer {KEY}'} # 1. Transcribe files = {'file': open('call.mp3', 'rb')} resp = httpx.post(f'{API}/v1/audio/transcriptions', headers=HD, files=files, data={'model': 'falaai-transcribe-1', 'language': 'pt'}) tr = resp.json() print(f'Text: {tr[\"text\"][:100]}...') # 2. Diagnose resp = httpx.post(f'{API}/v1/analyze/diagnostic', headers=HD, json={'dialog': tr['dialog'], 'language': 'pt-BR', 'duration_seconds': tr['duration_seconds']}) diag = resp.json() print(f'Sentiment: {diag[\"analysis\"][\"sentiment\"][\"list_choice\"]}') print(f'Summary: {diag[\"analysis\"][\"dialogue_summary\"][\"explanation\"][:100]}...') # 3. Audit resp = httpx.post(f'{API}/v1/analyze/auditoriaRisco', headers=HD, json={'dialogo': tr['dialog'], 'duration_seconds': tr['duration_seconds']}) audit = resp.json() print(f'Score: {audit[\"audit_score\"]} | Verdict: {audit[\"verdict\"]}') print(f'Detections: {audit[\"total_detections\"]} | Violations: {len(audit[\"violations\"])} | Positives: {len(audit[\"positives\"])}') ``` **Authentication:** All endpoints require an API Key in the `Authorization` header: `Bearer fai_xxx` Get your API Key at [falaai.action.tec.br/api](https://falaai.action.tec.br/api)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.21.47
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FalaAI
|
|
17
|
+
class DiagnosticAnalysisMap < ApiModelBase
|
|
18
|
+
# Detailed conversation summary
|
|
19
|
+
attr_accessor :dialogue_summary
|
|
20
|
+
|
|
21
|
+
# Initial contact reason
|
|
22
|
+
attr_accessor :contact_reason
|
|
23
|
+
|
|
24
|
+
# Action taken / resolution
|
|
25
|
+
attr_accessor :identified_action
|
|
26
|
+
|
|
27
|
+
# Theme classification
|
|
28
|
+
attr_accessor :identified_label
|
|
29
|
+
|
|
30
|
+
# Predominant sentiment
|
|
31
|
+
attr_accessor :sentiment
|
|
32
|
+
|
|
33
|
+
# Identified participants and roles (same field names as auditoria)
|
|
34
|
+
attr_accessor :participants_identified
|
|
35
|
+
|
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
+
def self.attribute_map
|
|
38
|
+
{
|
|
39
|
+
:'dialogue_summary' => :'dialogue_summary',
|
|
40
|
+
:'contact_reason' => :'contact_reason',
|
|
41
|
+
:'identified_action' => :'identified_action',
|
|
42
|
+
:'identified_label' => :'identified_label',
|
|
43
|
+
:'sentiment' => :'sentiment',
|
|
44
|
+
:'participants_identified' => :'participants_identified'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns all the JSON keys this model knows about
|
|
54
|
+
def self.acceptable_attributes
|
|
55
|
+
acceptable_attribute_map.values
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute type mapping.
|
|
59
|
+
def self.openapi_types
|
|
60
|
+
{
|
|
61
|
+
:'dialogue_summary' => :'DiagnosticTextAnalysis',
|
|
62
|
+
:'contact_reason' => :'DiagnosticTextAnalysis',
|
|
63
|
+
:'identified_action' => :'DiagnosticCategoricalAnalysis',
|
|
64
|
+
:'identified_label' => :'DiagnosticCategoricalAnalysis',
|
|
65
|
+
:'sentiment' => :'DiagnosticCategoricalAnalysis',
|
|
66
|
+
:'participants_identified' => :'Array<ParticipantDiagnostic>'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::DiagnosticAnalysisMap` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::DiagnosticAnalysisMap`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
|
+
end
|
|
89
|
+
h[k.to_sym] = v
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'dialogue_summary')
|
|
93
|
+
self.dialogue_summary = attributes[:'dialogue_summary']
|
|
94
|
+
else
|
|
95
|
+
self.dialogue_summary = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'contact_reason')
|
|
99
|
+
self.contact_reason = attributes[:'contact_reason']
|
|
100
|
+
else
|
|
101
|
+
self.contact_reason = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'identified_action')
|
|
105
|
+
self.identified_action = attributes[:'identified_action']
|
|
106
|
+
else
|
|
107
|
+
self.identified_action = nil
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'identified_label')
|
|
111
|
+
self.identified_label = attributes[:'identified_label']
|
|
112
|
+
else
|
|
113
|
+
self.identified_label = nil
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'sentiment')
|
|
117
|
+
self.sentiment = attributes[:'sentiment']
|
|
118
|
+
else
|
|
119
|
+
self.sentiment = nil
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'participants_identified')
|
|
123
|
+
if (value = attributes[:'participants_identified']).is_a?(Array)
|
|
124
|
+
self.participants_identified = value
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
130
|
+
# @return Array for valid properties with the reasons
|
|
131
|
+
def list_invalid_properties
|
|
132
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
133
|
+
invalid_properties = Array.new
|
|
134
|
+
if @dialogue_summary.nil?
|
|
135
|
+
invalid_properties.push('invalid value for "dialogue_summary", dialogue_summary cannot be nil.')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if @contact_reason.nil?
|
|
139
|
+
invalid_properties.push('invalid value for "contact_reason", contact_reason cannot be nil.')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if @identified_action.nil?
|
|
143
|
+
invalid_properties.push('invalid value for "identified_action", identified_action cannot be nil.')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if @identified_label.nil?
|
|
147
|
+
invalid_properties.push('invalid value for "identified_label", identified_label cannot be nil.')
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if @sentiment.nil?
|
|
151
|
+
invalid_properties.push('invalid value for "sentiment", sentiment cannot be nil.')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
invalid_properties
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Check to see if the all the properties in the model are valid
|
|
158
|
+
# @return true if the model is valid
|
|
159
|
+
def valid?
|
|
160
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
161
|
+
return false if @dialogue_summary.nil?
|
|
162
|
+
return false if @contact_reason.nil?
|
|
163
|
+
return false if @identified_action.nil?
|
|
164
|
+
return false if @identified_label.nil?
|
|
165
|
+
return false if @sentiment.nil?
|
|
166
|
+
true
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] dialogue_summary Value to be assigned
|
|
171
|
+
def dialogue_summary=(dialogue_summary)
|
|
172
|
+
if dialogue_summary.nil?
|
|
173
|
+
fail ArgumentError, 'dialogue_summary cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@dialogue_summary = dialogue_summary
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Custom attribute writer method with validation
|
|
180
|
+
# @param [Object] contact_reason Value to be assigned
|
|
181
|
+
def contact_reason=(contact_reason)
|
|
182
|
+
if contact_reason.nil?
|
|
183
|
+
fail ArgumentError, 'contact_reason cannot be nil'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
@contact_reason = contact_reason
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method with validation
|
|
190
|
+
# @param [Object] identified_action Value to be assigned
|
|
191
|
+
def identified_action=(identified_action)
|
|
192
|
+
if identified_action.nil?
|
|
193
|
+
fail ArgumentError, 'identified_action cannot be nil'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@identified_action = identified_action
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Custom attribute writer method with validation
|
|
200
|
+
# @param [Object] identified_label Value to be assigned
|
|
201
|
+
def identified_label=(identified_label)
|
|
202
|
+
if identified_label.nil?
|
|
203
|
+
fail ArgumentError, 'identified_label cannot be nil'
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
@identified_label = identified_label
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Custom attribute writer method with validation
|
|
210
|
+
# @param [Object] sentiment Value to be assigned
|
|
211
|
+
def sentiment=(sentiment)
|
|
212
|
+
if sentiment.nil?
|
|
213
|
+
fail ArgumentError, 'sentiment cannot be nil'
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
@sentiment = sentiment
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Checks equality by comparing each attribute.
|
|
220
|
+
# @param [Object] Object to be compared
|
|
221
|
+
def ==(o)
|
|
222
|
+
return true if self.equal?(o)
|
|
223
|
+
self.class == o.class &&
|
|
224
|
+
dialogue_summary == o.dialogue_summary &&
|
|
225
|
+
contact_reason == o.contact_reason &&
|
|
226
|
+
identified_action == o.identified_action &&
|
|
227
|
+
identified_label == o.identified_label &&
|
|
228
|
+
sentiment == o.sentiment &&
|
|
229
|
+
participants_identified == o.participants_identified
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# @see the `==` method
|
|
233
|
+
# @param [Object] Object to be compared
|
|
234
|
+
def eql?(o)
|
|
235
|
+
self == o
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Calculates hash code according to all attributes.
|
|
239
|
+
# @return [Integer] Hash code
|
|
240
|
+
def hash
|
|
241
|
+
[dialogue_summary, contact_reason, identified_action, identified_label, sentiment, participants_identified].hash
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Builds the object from hash
|
|
245
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
246
|
+
# @return [Object] Returns the model itself
|
|
247
|
+
def self.build_from_hash(attributes)
|
|
248
|
+
return nil unless attributes.is_a?(Hash)
|
|
249
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
250
|
+
transformed_hash = {}
|
|
251
|
+
openapi_types.each_pair do |key, type|
|
|
252
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
253
|
+
transformed_hash["#{key}"] = nil
|
|
254
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
255
|
+
# check to ensure the input is an array given that the attribute
|
|
256
|
+
# is documented as an array but the input is not
|
|
257
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
258
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
259
|
+
end
|
|
260
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
261
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
new(transformed_hash)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Returns the object in the form of hash
|
|
268
|
+
# @return [Hash] Returns the object in the form of hash
|
|
269
|
+
def to_hash
|
|
270
|
+
hash = {}
|
|
271
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
272
|
+
value = self.send(attr)
|
|
273
|
+
if value.nil?
|
|
274
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
275
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
hash[param] = _to_hash(value)
|
|
279
|
+
end
|
|
280
|
+
hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
end
|