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.
Files changed (130) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +205 -0
  4. data/docs/AnalysisApi.md +147 -0
  5. data/docs/AudioEvent.md +26 -0
  6. data/docs/AudioInputMeta.md +26 -0
  7. data/docs/AuditoriaRiscoAnalysisV2.md +22 -0
  8. data/docs/AuditoriaRiscoAppliedActionV2.md +32 -0
  9. data/docs/AuditoriaRiscoAudioEventModelV2.md +22 -0
  10. data/docs/AuditoriaRiscoAuditDecisionsV2.md +22 -0
  11. data/docs/AuditoriaRiscoConversationScoresV2.md +38 -0
  12. data/docs/AuditoriaRiscoDetectionItemV2.md +110 -0
  13. data/docs/AuditoriaRiscoDetectionsV2.md +26 -0
  14. data/docs/AuditoriaRiscoIndexerV2.md +18 -0
  15. data/docs/AuditoriaRiscoMetaV2.md +28 -0
  16. data/docs/AuditoriaRiscoParticipantV2.md +22 -0
  17. data/docs/AuditoriaRiscoParticipantsV2.md +26 -0
  18. data/docs/AuditoriaRiscoRequest.md +38 -0
  19. data/docs/AuditoriaRiscoScoresV2.md +20 -0
  20. data/docs/AuditoriaRiscoScoringExplanationV2.md +20 -0
  21. data/docs/AuditoriaRiscoSummaryV2.md +48 -0
  22. data/docs/AuditoriaRiscoTimelineV2.md +22 -0
  23. data/docs/AuditoriaRiscoUsageV2.md +22 -0
  24. data/docs/AuditoriaRiscoV2.md +46 -0
  25. data/docs/AuditoriaRiscoV2Response.md +18 -0
  26. data/docs/AuditoriaRiscoVerdictV2.md +30 -0
  27. data/docs/CreateEmailAlertRequest.md +22 -0
  28. data/docs/CreateWebhookRequest.md +24 -0
  29. data/docs/DiagnosticAnalysisMap.md +28 -0
  30. data/docs/DiagnosticAudioEvent.md +26 -0
  31. data/docs/DiagnosticCategoricalAnalysis.md +22 -0
  32. data/docs/DiagnosticRequest.md +30 -0
  33. data/docs/DiagnosticResponse.md +28 -0
  34. data/docs/DiagnosticTextAnalysis.md +18 -0
  35. data/docs/DiagnosticUsage.md +22 -0
  36. data/docs/EmailAlertItem.md +32 -0
  37. data/docs/EmailAlertListResponse.md +22 -0
  38. data/docs/EmailAlertMessageResponse.md +18 -0
  39. data/docs/EmailAlertsApi.md +285 -0
  40. data/docs/EmailEvent.md +15 -0
  41. data/docs/HTTPValidationError.md +18 -0
  42. data/docs/HealthApi.md +137 -0
  43. data/docs/HealthResponse.md +28 -0
  44. data/docs/LocationInner.md +15 -0
  45. data/docs/MessageResponse.md +18 -0
  46. data/docs/Participant.md +22 -0
  47. data/docs/ParticipantDiagnostic.md +26 -0
  48. data/docs/SpeechApi.md +85 -0
  49. data/docs/TranscriptionResponse.md +49 -0
  50. data/docs/TranscriptionUsage.md +22 -0
  51. data/docs/UpdateEmailAlertRequest.md +24 -0
  52. data/docs/UpdateWebhookRequest.md +26 -0
  53. data/docs/UsageApi.md +151 -0
  54. data/docs/UsageByKeyItem.md +26 -0
  55. data/docs/UsageLogItem.md +28 -0
  56. data/docs/UsageLogResponse.md +22 -0
  57. data/docs/ValidationError.md +26 -0
  58. data/docs/VersionApi.md +72 -0
  59. data/docs/VersionResponse.md +22 -0
  60. data/docs/WebhookEvent.md +15 -0
  61. data/docs/WebhookItem.md +42 -0
  62. data/docs/WebhookListResponse.md +22 -0
  63. data/docs/WebhooksApi.md +293 -0
  64. data/lib/falaai-api/api/analysis_api.rb +158 -0
  65. data/lib/falaai-api/api/email_alerts_api.rb +294 -0
  66. data/lib/falaai-api/api/health_api.rb +132 -0
  67. data/lib/falaai-api/api/speech_api.rb +100 -0
  68. data/lib/falaai-api/api/usage_api.rb +156 -0
  69. data/lib/falaai-api/api/version_api.rb +77 -0
  70. data/lib/falaai-api/api/webhooks_api.rb +302 -0
  71. data/lib/falaai-api/api_client.rb +397 -0
  72. data/lib/falaai-api/api_error.rb +58 -0
  73. data/lib/falaai-api/api_model_base.rb +88 -0
  74. data/lib/falaai-api/configuration.rb +309 -0
  75. data/lib/falaai-api/models/audio_event.rb +273 -0
  76. data/lib/falaai-api/models/audio_input_meta.rb +273 -0
  77. data/lib/falaai-api/models/auditoria_risco_analysis_v2.rb +174 -0
  78. data/lib/falaai-api/models/auditoria_risco_applied_action_v2.rb +292 -0
  79. data/lib/falaai-api/models/auditoria_risco_audio_event_model_v2.rb +174 -0
  80. data/lib/falaai-api/models/auditoria_risco_audit_decisions_v2.rb +170 -0
  81. data/lib/falaai-api/models/auditoria_risco_conversation_scores_v2.rb +251 -0
  82. data/lib/falaai-api/models/auditoria_risco_detection_item_v2.rb +651 -0
  83. data/lib/falaai-api/models/auditoria_risco_detections_v2.rb +198 -0
  84. data/lib/falaai-api/models/auditoria_risco_indexer_v2.rb +150 -0
  85. data/lib/falaai-api/models/auditoria_risco_meta_v2.rb +234 -0
  86. data/lib/falaai-api/models/auditoria_risco_participant_v2.rb +168 -0
  87. data/lib/falaai-api/models/auditoria_risco_participants_v2.rb +196 -0
  88. data/lib/falaai-api/models/auditoria_risco_request.rb +451 -0
  89. data/lib/falaai-api/models/auditoria_risco_scores_v2.rb +177 -0
  90. data/lib/falaai-api/models/auditoria_risco_scoring_explanation_v2.rb +160 -0
  91. data/lib/falaai-api/models/auditoria_risco_summary_v2.rb +300 -0
  92. data/lib/falaai-api/models/auditoria_risco_timeline_v2.rb +174 -0
  93. data/lib/falaai-api/models/auditoria_risco_usage_v2.rb +219 -0
  94. data/lib/falaai-api/models/auditoria_risco_v2.rb +548 -0
  95. data/lib/falaai-api/models/auditoria_risco_v2_response.rb +165 -0
  96. data/lib/falaai-api/models/auditoria_risco_verdict_v2.rb +213 -0
  97. data/lib/falaai-api/models/create_email_alert_request.rb +221 -0
  98. data/lib/falaai-api/models/create_webhook_request.rb +233 -0
  99. data/lib/falaai-api/models/diagnostic_analysis_map.rb +285 -0
  100. data/lib/falaai-api/models/diagnostic_audio_event.rb +205 -0
  101. data/lib/falaai-api/models/diagnostic_categorical_analysis.rb +170 -0
  102. data/lib/falaai-api/models/diagnostic_request.rb +316 -0
  103. data/lib/falaai-api/models/diagnostic_response.rb +283 -0
  104. data/lib/falaai-api/models/diagnostic_text_analysis.rb +148 -0
  105. data/lib/falaai-api/models/diagnostic_usage.rb +219 -0
  106. data/lib/falaai-api/models/email_alert_item.rb +356 -0
  107. data/lib/falaai-api/models/email_alert_list_response.rb +218 -0
  108. data/lib/falaai-api/models/email_alert_message_response.rb +165 -0
  109. data/lib/falaai-api/models/email_event.rb +47 -0
  110. data/lib/falaai-api/models/health_response.rb +300 -0
  111. data/lib/falaai-api/models/http_validation_error.rb +149 -0
  112. data/lib/falaai-api/models/location_inner.rb +103 -0
  113. data/lib/falaai-api/models/message_response.rb +165 -0
  114. data/lib/falaai-api/models/participant.rb +226 -0
  115. data/lib/falaai-api/models/participant_diagnostic.rb +222 -0
  116. data/lib/falaai-api/models/transcription_response.rb +540 -0
  117. data/lib/falaai-api/models/transcription_usage.rb +219 -0
  118. data/lib/falaai-api/models/update_email_alert_request.rb +176 -0
  119. data/lib/falaai-api/models/update_webhook_request.rb +190 -0
  120. data/lib/falaai-api/models/usage_by_key_item.rb +256 -0
  121. data/lib/falaai-api/models/usage_log_item.rb +300 -0
  122. data/lib/falaai-api/models/usage_log_response.rb +218 -0
  123. data/lib/falaai-api/models/validation_error.rb +237 -0
  124. data/lib/falaai-api/models/version_response.rb +219 -0
  125. data/lib/falaai-api/models/webhook_event.rb +48 -0
  126. data/lib/falaai-api/models/webhook_item.rb +442 -0
  127. data/lib/falaai-api/models/webhook_list_response.rb +218 -0
  128. data/lib/falaai-api/version.rb +15 -0
  129. data/lib/falaai-api.rb +100 -0
  130. metadata +229 -0
@@ -0,0 +1,292 @@
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 AuditoriaRiscoAppliedActionV2 < ApiModelBase
18
+ # Action type code
19
+ attr_accessor :action_type
20
+
21
+ # Action label
22
+ attr_accessor :label
23
+
24
+ # Action description
25
+ attr_accessor :description
26
+
27
+ # CRITICO/ALTO/MEDIO/BAIXO
28
+ attr_accessor :priority
29
+
30
+ # Color
31
+ attr_accessor :color
32
+
33
+ # Icon
34
+ attr_accessor :icon
35
+
36
+ # Condition
37
+ attr_accessor :condition
38
+
39
+ # Reason
40
+ attr_accessor :reason
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'action_type' => :'action_type',
46
+ :'label' => :'label',
47
+ :'description' => :'description',
48
+ :'priority' => :'priority',
49
+ :'color' => :'color',
50
+ :'icon' => :'icon',
51
+ :'condition' => :'condition',
52
+ :'reason' => :'reason'
53
+ }
54
+ end
55
+
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ acceptable_attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'action_type' => :'String',
70
+ :'label' => :'String',
71
+ :'description' => :'String',
72
+ :'priority' => :'String',
73
+ :'color' => :'String',
74
+ :'icon' => :'String',
75
+ :'condition' => :'String',
76
+ :'reason' => :'String'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::AuditoriaRiscoAppliedActionV2` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::AuditoriaRiscoAppliedActionV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'action_type')
103
+ self.action_type = attributes[:'action_type']
104
+ else
105
+ self.action_type = nil
106
+ end
107
+
108
+ if attributes.key?(:'label')
109
+ self.label = attributes[:'label']
110
+ else
111
+ self.label = nil
112
+ end
113
+
114
+ if attributes.key?(:'description')
115
+ self.description = attributes[:'description']
116
+ else
117
+ self.description = nil
118
+ end
119
+
120
+ if attributes.key?(:'priority')
121
+ self.priority = attributes[:'priority']
122
+ else
123
+ self.priority = nil
124
+ end
125
+
126
+ if attributes.key?(:'color')
127
+ self.color = attributes[:'color']
128
+ else
129
+ self.color = ''
130
+ end
131
+
132
+ if attributes.key?(:'icon')
133
+ self.icon = attributes[:'icon']
134
+ else
135
+ self.icon = ''
136
+ end
137
+
138
+ if attributes.key?(:'condition')
139
+ self.condition = attributes[:'condition']
140
+ end
141
+
142
+ if attributes.key?(:'reason')
143
+ self.reason = attributes[:'reason']
144
+ else
145
+ self.reason = ''
146
+ end
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
153
+ invalid_properties = Array.new
154
+ if @action_type.nil?
155
+ invalid_properties.push('invalid value for "action_type", action_type cannot be nil.')
156
+ end
157
+
158
+ if @label.nil?
159
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
160
+ end
161
+
162
+ if @description.nil?
163
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
164
+ end
165
+
166
+ if @priority.nil?
167
+ invalid_properties.push('invalid value for "priority", priority cannot be nil.')
168
+ end
169
+
170
+ invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ warn '[DEPRECATED] the `valid?` method is obsolete'
177
+ return false if @action_type.nil?
178
+ return false if @label.nil?
179
+ return false if @description.nil?
180
+ return false if @priority.nil?
181
+ true
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] action_type Value to be assigned
186
+ def action_type=(action_type)
187
+ if action_type.nil?
188
+ fail ArgumentError, 'action_type cannot be nil'
189
+ end
190
+
191
+ @action_type = action_type
192
+ end
193
+
194
+ # Custom attribute writer method with validation
195
+ # @param [Object] label Value to be assigned
196
+ def label=(label)
197
+ if label.nil?
198
+ fail ArgumentError, 'label cannot be nil'
199
+ end
200
+
201
+ @label = label
202
+ end
203
+
204
+ # Custom attribute writer method with validation
205
+ # @param [Object] description Value to be assigned
206
+ def description=(description)
207
+ if description.nil?
208
+ fail ArgumentError, 'description cannot be nil'
209
+ end
210
+
211
+ @description = description
212
+ end
213
+
214
+ # Custom attribute writer method with validation
215
+ # @param [Object] priority Value to be assigned
216
+ def priority=(priority)
217
+ if priority.nil?
218
+ fail ArgumentError, 'priority cannot be nil'
219
+ end
220
+
221
+ @priority = priority
222
+ end
223
+
224
+ # Checks equality by comparing each attribute.
225
+ # @param [Object] Object to be compared
226
+ def ==(o)
227
+ return true if self.equal?(o)
228
+ self.class == o.class &&
229
+ action_type == o.action_type &&
230
+ label == o.label &&
231
+ description == o.description &&
232
+ priority == o.priority &&
233
+ color == o.color &&
234
+ icon == o.icon &&
235
+ condition == o.condition &&
236
+ reason == o.reason
237
+ end
238
+
239
+ # @see the `==` method
240
+ # @param [Object] Object to be compared
241
+ def eql?(o)
242
+ self == o
243
+ end
244
+
245
+ # Calculates hash code according to all attributes.
246
+ # @return [Integer] Hash code
247
+ def hash
248
+ [action_type, label, description, priority, color, icon, condition, reason].hash
249
+ end
250
+
251
+ # Builds the object from hash
252
+ # @param [Hash] attributes Model attributes in the form of hash
253
+ # @return [Object] Returns the model itself
254
+ def self.build_from_hash(attributes)
255
+ return nil unless attributes.is_a?(Hash)
256
+ attributes = attributes.transform_keys(&:to_sym)
257
+ transformed_hash = {}
258
+ openapi_types.each_pair do |key, type|
259
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
260
+ transformed_hash["#{key}"] = nil
261
+ elsif type =~ /\AArray<(.*)>/i
262
+ # check to ensure the input is an array given that the attribute
263
+ # is documented as an array but the input is not
264
+ if attributes[attribute_map[key]].is_a?(Array)
265
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
266
+ end
267
+ elsif !attributes[attribute_map[key]].nil?
268
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
269
+ end
270
+ end
271
+ new(transformed_hash)
272
+ end
273
+
274
+ # Returns the object in the form of hash
275
+ # @return [Hash] Returns the object in the form of hash
276
+ def to_hash
277
+ hash = {}
278
+ self.class.attribute_map.each_pair do |attr, param|
279
+ value = self.send(attr)
280
+ if value.nil?
281
+ is_nullable = self.class.openapi_nullable.include?(attr)
282
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
283
+ end
284
+
285
+ hash[param] = _to_hash(value)
286
+ end
287
+ hash
288
+ end
289
+
290
+ end
291
+
292
+ end
@@ -0,0 +1,174 @@
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 AuditoriaRiscoAudioEventModelV2 < ApiModelBase
18
+ # MAC model text (i18n)
19
+ attr_accessor :model
20
+
21
+ # MAC description (i18n)
22
+ attr_accessor :description
23
+
24
+ # Temporal windows (s)
25
+ attr_accessor :windows_s
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'model' => :'model',
31
+ :'description' => :'description',
32
+ :'windows_s' => :'windows_s'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'model' => :'String',
50
+ :'description' => :'String',
51
+ :'windows_s' => :'Hash<String, Object>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::AuditoriaRiscoAudioEventModelV2` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::AuditoriaRiscoAudioEventModelV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'model')
78
+ self.model = attributes[:'model']
79
+ else
80
+ self.model = ''
81
+ end
82
+
83
+ if attributes.key?(:'description')
84
+ self.description = attributes[:'description']
85
+ else
86
+ self.description = ''
87
+ end
88
+
89
+ if attributes.key?(:'windows_s')
90
+ if (value = attributes[:'windows_s']).is_a?(Hash)
91
+ self.windows_s = value
92
+ end
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ model == o.model &&
117
+ description == o.description &&
118
+ windows_s == o.windows_s
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [model, description, windows_s].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[attribute_map[key]].is_a?(Array)
147
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
+ end
149
+ elsif !attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
+ end
152
+ end
153
+ new(transformed_hash)
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ if value.nil?
163
+ is_nullable = self.class.openapi_nullable.include?(attr)
164
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
165
+ end
166
+
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ end
173
+
174
+ end
@@ -0,0 +1,170 @@
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 AuditoriaRiscoAuditDecisionsV2 < ApiModelBase
18
+ # Risk origin
19
+ attr_accessor :risk_origin
20
+
21
+ # Has zero-tolerance violation
22
+ attr_accessor :has_zero_tolerance_violation
23
+
24
+ # Deterministic validator changes
25
+ attr_accessor :deterministic_validator_changes
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'risk_origin' => :'risk_origin',
31
+ :'has_zero_tolerance_violation' => :'has_zero_tolerance_violation',
32
+ :'deterministic_validator_changes' => :'deterministic_validator_changes'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'risk_origin' => :'String',
50
+ :'has_zero_tolerance_violation' => :'Boolean',
51
+ :'deterministic_validator_changes' => :'Array<Object>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::AuditoriaRiscoAuditDecisionsV2` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::AuditoriaRiscoAuditDecisionsV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'risk_origin')
78
+ self.risk_origin = attributes[:'risk_origin']
79
+ end
80
+
81
+ if attributes.key?(:'has_zero_tolerance_violation')
82
+ self.has_zero_tolerance_violation = attributes[:'has_zero_tolerance_violation']
83
+ end
84
+
85
+ if attributes.key?(:'deterministic_validator_changes')
86
+ if (value = attributes[:'deterministic_validator_changes']).is_a?(Array)
87
+ self.deterministic_validator_changes = value
88
+ end
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ risk_origin == o.risk_origin &&
113
+ has_zero_tolerance_violation == o.has_zero_tolerance_violation &&
114
+ deterministic_validator_changes == o.deterministic_validator_changes
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [risk_origin, has_zero_tolerance_violation, deterministic_validator_changes].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ attributes = attributes.transform_keys(&:to_sym)
135
+ transformed_hash = {}
136
+ openapi_types.each_pair do |key, type|
137
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
138
+ transformed_hash["#{key}"] = nil
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[attribute_map[key]].is_a?(Array)
143
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
144
+ end
145
+ elsif !attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
147
+ end
148
+ end
149
+ new(transformed_hash)
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ if value.nil?
159
+ is_nullable = self.class.openapi_nullable.include?(attr)
160
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
161
+ end
162
+
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ end
169
+
170
+ end