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,219 @@
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 TranscriptionUsage < ApiModelBase
18
+ # Actual audio duration processed in seconds
19
+ attr_accessor :audio_seconds
20
+
21
+ # Number of credits consumed in this request
22
+ attr_accessor :credits_consumed
23
+
24
+ # Total processing time in milliseconds
25
+ attr_accessor :processing_ms
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'audio_seconds' => :'audio_seconds',
31
+ :'credits_consumed' => :'credits_consumed',
32
+ :'processing_ms' => :'processing_ms'
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
+ :'audio_seconds' => :'Float',
50
+ :'credits_consumed' => :'Integer',
51
+ :'processing_ms' => :'Integer'
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::TranscriptionUsage` 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::TranscriptionUsage`. 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?(:'audio_seconds')
78
+ self.audio_seconds = attributes[:'audio_seconds']
79
+ else
80
+ self.audio_seconds = nil
81
+ end
82
+
83
+ if attributes.key?(:'credits_consumed')
84
+ self.credits_consumed = attributes[:'credits_consumed']
85
+ else
86
+ self.credits_consumed = nil
87
+ end
88
+
89
+ if attributes.key?(:'processing_ms')
90
+ self.processing_ms = attributes[:'processing_ms']
91
+ else
92
+ self.processing_ms = nil
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
+ if @audio_seconds.nil?
102
+ invalid_properties.push('invalid value for "audio_seconds", audio_seconds cannot be nil.')
103
+ end
104
+
105
+ if @credits_consumed.nil?
106
+ invalid_properties.push('invalid value for "credits_consumed", credits_consumed cannot be nil.')
107
+ end
108
+
109
+ if @processing_ms.nil?
110
+ invalid_properties.push('invalid value for "processing_ms", processing_ms cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @audio_seconds.nil?
121
+ return false if @credits_consumed.nil?
122
+ return false if @processing_ms.nil?
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] audio_seconds Value to be assigned
128
+ def audio_seconds=(audio_seconds)
129
+ if audio_seconds.nil?
130
+ fail ArgumentError, 'audio_seconds cannot be nil'
131
+ end
132
+
133
+ @audio_seconds = audio_seconds
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] credits_consumed Value to be assigned
138
+ def credits_consumed=(credits_consumed)
139
+ if credits_consumed.nil?
140
+ fail ArgumentError, 'credits_consumed cannot be nil'
141
+ end
142
+
143
+ @credits_consumed = credits_consumed
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] processing_ms Value to be assigned
148
+ def processing_ms=(processing_ms)
149
+ if processing_ms.nil?
150
+ fail ArgumentError, 'processing_ms cannot be nil'
151
+ end
152
+
153
+ @processing_ms = processing_ms
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ audio_seconds == o.audio_seconds &&
162
+ credits_consumed == o.credits_consumed &&
163
+ processing_ms == o.processing_ms
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [audio_seconds, credits_consumed, processing_ms].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -0,0 +1,176 @@
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 UpdateEmailAlertRequest < ApiModelBase
18
+ attr_accessor :name
19
+
20
+ attr_accessor :email
21
+
22
+ attr_accessor :events
23
+
24
+ attr_accessor :active
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'name' => :'name',
30
+ :'email' => :'email',
31
+ :'events' => :'events',
32
+ :'active' => :'active'
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
+ :'name' => :'String',
50
+ :'email' => :'String',
51
+ :'events' => :'Array<EmailEvent>',
52
+ :'active' => :'Boolean'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::UpdateEmailAlertRequest` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::UpdateEmailAlertRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'name')
79
+ self.name = attributes[:'name']
80
+ end
81
+
82
+ if attributes.key?(:'email')
83
+ self.email = attributes[:'email']
84
+ end
85
+
86
+ if attributes.key?(:'events')
87
+ if (value = attributes[:'events']).is_a?(Array)
88
+ self.events = value
89
+ end
90
+ end
91
+
92
+ if attributes.key?(:'active')
93
+ self.active = attributes[:'active']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ name == o.name &&
118
+ email == o.email &&
119
+ events == o.events &&
120
+ active == o.active
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [name, email, events, active].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ attributes = attributes.transform_keys(&:to_sym)
141
+ transformed_hash = {}
142
+ openapi_types.each_pair do |key, type|
143
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = nil
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[attribute_map[key]].is_a?(Array)
149
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
+ end
151
+ elsif !attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ if value.nil?
165
+ is_nullable = self.class.openapi_nullable.include?(attr)
166
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
167
+ end
168
+
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ hash
172
+ end
173
+
174
+ end
175
+
176
+ end
@@ -0,0 +1,190 @@
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 UpdateWebhookRequest < ApiModelBase
18
+ # Nome identificador
19
+ attr_accessor :name
20
+
21
+ # URL HTTPS destino
22
+ attr_accessor :url
23
+
24
+ # Eventos subscritos
25
+ attr_accessor :events
26
+
27
+ # Habilita retry exponencial
28
+ attr_accessor :retry_enabled
29
+
30
+ # Ativa/desativa sem deletar
31
+ attr_accessor :active
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'name' => :'name',
37
+ :'url' => :'url',
38
+ :'events' => :'events',
39
+ :'retry_enabled' => :'retry_enabled',
40
+ :'active' => :'active'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'name' => :'String',
58
+ :'url' => :'String',
59
+ :'events' => :'Array<WebhookEvent>',
60
+ :'retry_enabled' => :'Boolean',
61
+ :'active' => :'Boolean'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::UpdateWebhookRequest` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::UpdateWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'name')
88
+ self.name = attributes[:'name']
89
+ end
90
+
91
+ if attributes.key?(:'url')
92
+ self.url = attributes[:'url']
93
+ end
94
+
95
+ if attributes.key?(:'events')
96
+ if (value = attributes[:'events']).is_a?(Array)
97
+ self.events = value
98
+ end
99
+ end
100
+
101
+ if attributes.key?(:'retry_enabled')
102
+ self.retry_enabled = attributes[:'retry_enabled']
103
+ end
104
+
105
+ if attributes.key?(:'active')
106
+ self.active = attributes[:'active']
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
+ invalid_properties = Array.new
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ warn '[DEPRECATED] the `valid?` method is obsolete'
122
+ true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ name == o.name &&
131
+ url == o.url &&
132
+ events == o.events &&
133
+ retry_enabled == o.retry_enabled &&
134
+ active == o.active
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [name, url, events, retry_enabled, active].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end