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
data/docs/WebhooksApi.md
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
# FalaAI::WebhooksApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**create_webhook_v1_webhooks_post**](WebhooksApi.md#create_webhook_v1_webhooks_post) | **POST** /v1/webhooks | Criar webhook de alertas |
|
|
8
|
+
| [**delete_webhook_v1_webhooks_webhook_id_delete**](WebhooksApi.md#delete_webhook_v1_webhooks_webhook_id_delete) | **DELETE** /v1/webhooks/{webhook_id} | Remover webhook |
|
|
9
|
+
| [**list_webhooks_v1_webhooks_get**](WebhooksApi.md#list_webhooks_v1_webhooks_get) | **GET** /v1/webhooks | Listar webhooks de alertas |
|
|
10
|
+
| [**update_webhook_v1_webhooks_webhook_id_put**](WebhooksApi.md#update_webhook_v1_webhooks_webhook_id_put) | **PUT** /v1/webhooks/{webhook_id} | Atualizar webhook |
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## create_webhook_v1_webhooks_post
|
|
14
|
+
|
|
15
|
+
> <WebhookItem> create_webhook_v1_webhooks_post(create_webhook_request)
|
|
16
|
+
|
|
17
|
+
Criar webhook de alertas
|
|
18
|
+
|
|
19
|
+
Cria inscricao para eventos de alerta (10 alertas). Payload enviado: WebhookPayload(event, data, timestamp) com HMAC FalaAI-Signature. Para comprovar a origem, recalcule HMAC-SHA256 de \"timestamp.body\" com seu secret (exemplos: /examples/download/python.zip e nodejs.zip, arquivo webhook_verify).
|
|
20
|
+
|
|
21
|
+
### Examples
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
require 'time'
|
|
25
|
+
require 'falaai-api'
|
|
26
|
+
# setup authorization
|
|
27
|
+
FalaAI.configure do |config|
|
|
28
|
+
# Configure Bearer authorization (fai_xxx): ApiKeyAuth
|
|
29
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
api_instance = FalaAI::WebhooksApi.new
|
|
33
|
+
create_webhook_request = FalaAI::CreateWebhookRequest.new({name: 'Alertas FalaAI', url: 'https://webhook.site/00000000-0000-0000-0000-000000000000', events: [credits.low, credits.exhausted, payment.failed]}) # CreateWebhookRequest |
|
|
34
|
+
|
|
35
|
+
begin
|
|
36
|
+
# Criar webhook de alertas
|
|
37
|
+
result = api_instance.create_webhook_v1_webhooks_post(create_webhook_request)
|
|
38
|
+
p result
|
|
39
|
+
rescue FalaAI::ApiError => e
|
|
40
|
+
puts "Error when calling WebhooksApi->create_webhook_v1_webhooks_post: #{e}"
|
|
41
|
+
end
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
#### Using the create_webhook_v1_webhooks_post_with_http_info variant
|
|
45
|
+
|
|
46
|
+
This returns an Array which contains the response data, status code and headers.
|
|
47
|
+
|
|
48
|
+
> <Array(<WebhookItem>, Integer, Hash)> create_webhook_v1_webhooks_post_with_http_info(create_webhook_request)
|
|
49
|
+
|
|
50
|
+
```ruby
|
|
51
|
+
begin
|
|
52
|
+
# Criar webhook de alertas
|
|
53
|
+
data, status_code, headers = api_instance.create_webhook_v1_webhooks_post_with_http_info(create_webhook_request)
|
|
54
|
+
p status_code # => 2xx
|
|
55
|
+
p headers # => { ... }
|
|
56
|
+
p data # => <WebhookItem>
|
|
57
|
+
rescue FalaAI::ApiError => e
|
|
58
|
+
puts "Error when calling WebhooksApi->create_webhook_v1_webhooks_post_with_http_info: #{e}"
|
|
59
|
+
end
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Parameters
|
|
63
|
+
|
|
64
|
+
| Name | Type | Description | Notes |
|
|
65
|
+
| ---- | ---- | ----------- | ----- |
|
|
66
|
+
| **create_webhook_request** | [**CreateWebhookRequest**](CreateWebhookRequest.md) | | |
|
|
67
|
+
|
|
68
|
+
### Return type
|
|
69
|
+
|
|
70
|
+
[**WebhookItem**](WebhookItem.md)
|
|
71
|
+
|
|
72
|
+
### Authorization
|
|
73
|
+
|
|
74
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
75
|
+
|
|
76
|
+
### HTTP request headers
|
|
77
|
+
|
|
78
|
+
- **Content-Type**: application/json
|
|
79
|
+
- **Accept**: application/json
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## delete_webhook_v1_webhooks_webhook_id_delete
|
|
83
|
+
|
|
84
|
+
> <MessageResponse> delete_webhook_v1_webhooks_webhook_id_delete(webhook_id)
|
|
85
|
+
|
|
86
|
+
Remover webhook
|
|
87
|
+
|
|
88
|
+
Remove inscricao de webhook por ID.
|
|
89
|
+
|
|
90
|
+
### Examples
|
|
91
|
+
|
|
92
|
+
```ruby
|
|
93
|
+
require 'time'
|
|
94
|
+
require 'falaai-api'
|
|
95
|
+
# setup authorization
|
|
96
|
+
FalaAI.configure do |config|
|
|
97
|
+
# Configure Bearer authorization (fai_xxx): ApiKeyAuth
|
|
98
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
api_instance = FalaAI::WebhooksApi.new
|
|
102
|
+
webhook_id = 'webhook_id_example' # String |
|
|
103
|
+
|
|
104
|
+
begin
|
|
105
|
+
# Remover webhook
|
|
106
|
+
result = api_instance.delete_webhook_v1_webhooks_webhook_id_delete(webhook_id)
|
|
107
|
+
p result
|
|
108
|
+
rescue FalaAI::ApiError => e
|
|
109
|
+
puts "Error when calling WebhooksApi->delete_webhook_v1_webhooks_webhook_id_delete: #{e}"
|
|
110
|
+
end
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### Using the delete_webhook_v1_webhooks_webhook_id_delete_with_http_info variant
|
|
114
|
+
|
|
115
|
+
This returns an Array which contains the response data, status code and headers.
|
|
116
|
+
|
|
117
|
+
> <Array(<MessageResponse>, Integer, Hash)> delete_webhook_v1_webhooks_webhook_id_delete_with_http_info(webhook_id)
|
|
118
|
+
|
|
119
|
+
```ruby
|
|
120
|
+
begin
|
|
121
|
+
# Remover webhook
|
|
122
|
+
data, status_code, headers = api_instance.delete_webhook_v1_webhooks_webhook_id_delete_with_http_info(webhook_id)
|
|
123
|
+
p status_code # => 2xx
|
|
124
|
+
p headers # => { ... }
|
|
125
|
+
p data # => <MessageResponse>
|
|
126
|
+
rescue FalaAI::ApiError => e
|
|
127
|
+
puts "Error when calling WebhooksApi->delete_webhook_v1_webhooks_webhook_id_delete_with_http_info: #{e}"
|
|
128
|
+
end
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Parameters
|
|
132
|
+
|
|
133
|
+
| Name | Type | Description | Notes |
|
|
134
|
+
| ---- | ---- | ----------- | ----- |
|
|
135
|
+
| **webhook_id** | **String** | | |
|
|
136
|
+
|
|
137
|
+
### Return type
|
|
138
|
+
|
|
139
|
+
[**MessageResponse**](MessageResponse.md)
|
|
140
|
+
|
|
141
|
+
### Authorization
|
|
142
|
+
|
|
143
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
144
|
+
|
|
145
|
+
### HTTP request headers
|
|
146
|
+
|
|
147
|
+
- **Content-Type**: Not defined
|
|
148
|
+
- **Accept**: application/json
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
## list_webhooks_v1_webhooks_get
|
|
152
|
+
|
|
153
|
+
> <WebhookListResponse> list_webhooks_v1_webhooks_get(opts)
|
|
154
|
+
|
|
155
|
+
Listar webhooks de alertas
|
|
156
|
+
|
|
157
|
+
Lista webhooks do usuario autenticado (10 alertas). Paginado. Inclui o secret da assinatura da URL (sempre visivel ao dono).
|
|
158
|
+
|
|
159
|
+
### Examples
|
|
160
|
+
|
|
161
|
+
```ruby
|
|
162
|
+
require 'time'
|
|
163
|
+
require 'falaai-api'
|
|
164
|
+
# setup authorization
|
|
165
|
+
FalaAI.configure do |config|
|
|
166
|
+
# Configure Bearer authorization (fai_xxx): ApiKeyAuth
|
|
167
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
api_instance = FalaAI::WebhooksApi.new
|
|
171
|
+
opts = {
|
|
172
|
+
page: 56, # Integer | Pagina (1-indexed)
|
|
173
|
+
limit: 56 # Integer | Itens por pagina (max 100)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
begin
|
|
177
|
+
# Listar webhooks de alertas
|
|
178
|
+
result = api_instance.list_webhooks_v1_webhooks_get(opts)
|
|
179
|
+
p result
|
|
180
|
+
rescue FalaAI::ApiError => e
|
|
181
|
+
puts "Error when calling WebhooksApi->list_webhooks_v1_webhooks_get: #{e}"
|
|
182
|
+
end
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
#### Using the list_webhooks_v1_webhooks_get_with_http_info variant
|
|
186
|
+
|
|
187
|
+
This returns an Array which contains the response data, status code and headers.
|
|
188
|
+
|
|
189
|
+
> <Array(<WebhookListResponse>, Integer, Hash)> list_webhooks_v1_webhooks_get_with_http_info(opts)
|
|
190
|
+
|
|
191
|
+
```ruby
|
|
192
|
+
begin
|
|
193
|
+
# Listar webhooks de alertas
|
|
194
|
+
data, status_code, headers = api_instance.list_webhooks_v1_webhooks_get_with_http_info(opts)
|
|
195
|
+
p status_code # => 2xx
|
|
196
|
+
p headers # => { ... }
|
|
197
|
+
p data # => <WebhookListResponse>
|
|
198
|
+
rescue FalaAI::ApiError => e
|
|
199
|
+
puts "Error when calling WebhooksApi->list_webhooks_v1_webhooks_get_with_http_info: #{e}"
|
|
200
|
+
end
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Parameters
|
|
204
|
+
|
|
205
|
+
| Name | Type | Description | Notes |
|
|
206
|
+
| ---- | ---- | ----------- | ----- |
|
|
207
|
+
| **page** | **Integer** | Pagina (1-indexed) | [optional][default to 1] |
|
|
208
|
+
| **limit** | **Integer** | Itens por pagina (max 100) | [optional][default to 20] |
|
|
209
|
+
|
|
210
|
+
### Return type
|
|
211
|
+
|
|
212
|
+
[**WebhookListResponse**](WebhookListResponse.md)
|
|
213
|
+
|
|
214
|
+
### Authorization
|
|
215
|
+
|
|
216
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
217
|
+
|
|
218
|
+
### HTTP request headers
|
|
219
|
+
|
|
220
|
+
- **Content-Type**: Not defined
|
|
221
|
+
- **Accept**: application/json
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
## update_webhook_v1_webhooks_webhook_id_put
|
|
225
|
+
|
|
226
|
+
> <MessageResponse> update_webhook_v1_webhooks_webhook_id_put(webhook_id, update_webhook_request)
|
|
227
|
+
|
|
228
|
+
Atualizar webhook
|
|
229
|
+
|
|
230
|
+
Atualiza name/url/events/retry_enabled/active do webhook. Eventos validos: 10 alertas.
|
|
231
|
+
|
|
232
|
+
### Examples
|
|
233
|
+
|
|
234
|
+
```ruby
|
|
235
|
+
require 'time'
|
|
236
|
+
require 'falaai-api'
|
|
237
|
+
# setup authorization
|
|
238
|
+
FalaAI.configure do |config|
|
|
239
|
+
# Configure Bearer authorization (fai_xxx): ApiKeyAuth
|
|
240
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
api_instance = FalaAI::WebhooksApi.new
|
|
244
|
+
webhook_id = 'webhook_id_example' # String |
|
|
245
|
+
update_webhook_request = FalaAI::UpdateWebhookRequest.new # UpdateWebhookRequest |
|
|
246
|
+
|
|
247
|
+
begin
|
|
248
|
+
# Atualizar webhook
|
|
249
|
+
result = api_instance.update_webhook_v1_webhooks_webhook_id_put(webhook_id, update_webhook_request)
|
|
250
|
+
p result
|
|
251
|
+
rescue FalaAI::ApiError => e
|
|
252
|
+
puts "Error when calling WebhooksApi->update_webhook_v1_webhooks_webhook_id_put: #{e}"
|
|
253
|
+
end
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
#### Using the update_webhook_v1_webhooks_webhook_id_put_with_http_info variant
|
|
257
|
+
|
|
258
|
+
This returns an Array which contains the response data, status code and headers.
|
|
259
|
+
|
|
260
|
+
> <Array(<MessageResponse>, Integer, Hash)> update_webhook_v1_webhooks_webhook_id_put_with_http_info(webhook_id, update_webhook_request)
|
|
261
|
+
|
|
262
|
+
```ruby
|
|
263
|
+
begin
|
|
264
|
+
# Atualizar webhook
|
|
265
|
+
data, status_code, headers = api_instance.update_webhook_v1_webhooks_webhook_id_put_with_http_info(webhook_id, update_webhook_request)
|
|
266
|
+
p status_code # => 2xx
|
|
267
|
+
p headers # => { ... }
|
|
268
|
+
p data # => <MessageResponse>
|
|
269
|
+
rescue FalaAI::ApiError => e
|
|
270
|
+
puts "Error when calling WebhooksApi->update_webhook_v1_webhooks_webhook_id_put_with_http_info: #{e}"
|
|
271
|
+
end
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Parameters
|
|
275
|
+
|
|
276
|
+
| Name | Type | Description | Notes |
|
|
277
|
+
| ---- | ---- | ----------- | ----- |
|
|
278
|
+
| **webhook_id** | **String** | | |
|
|
279
|
+
| **update_webhook_request** | [**UpdateWebhookRequest**](UpdateWebhookRequest.md) | | |
|
|
280
|
+
|
|
281
|
+
### Return type
|
|
282
|
+
|
|
283
|
+
[**MessageResponse**](MessageResponse.md)
|
|
284
|
+
|
|
285
|
+
### Authorization
|
|
286
|
+
|
|
287
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
288
|
+
|
|
289
|
+
### HTTP request headers
|
|
290
|
+
|
|
291
|
+
- **Content-Type**: application/json
|
|
292
|
+
- **Accept**: application/json
|
|
293
|
+
|
|
@@ -0,0 +1,158 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module FalaAI
|
|
16
|
+
class AnalysisApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Compliance Risk Audit — conversation compliance analysis
|
|
23
|
+
# Analyzes a call transcript for compliance risks. Returns a score (0-100), classification level, violations, positives, and a detailed HTML report. **Python:** ```python import httpx response = httpx.post( 'https://api.fala.ai/v1/analyze/auditoriaRisco', headers={'Authorization': 'Bearer fai_xxx'}, json={ 'dialog': 'Speaker 1: [00:00:00.540 - 00:00:01.139] Hi, Alex.', 'duration_seconds': 151.0, 'language': 'pt-BR', 'response_language': 'en-US' } ) print(response.json()) ``` **cURL:** ```bash curl https://api.fala.ai/v1/analyze/auditoriaRisco \\ -H 'Authorization: Bearer fai_xxx' \\ -H 'Content-Type: application/json' \\ -d '{ \"dialog\": \"Speaker 1: [00:00:00.540 - 00:00:01.139] Hi, Alex.\", \"duration_seconds\": 151.0, \"language\": \"pt-BR\", \"response_language\": \"en-US\" }' ```
|
|
24
|
+
# @param auditoria_risco_request [AuditoriaRiscoRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [AuditoriaRiscoV2Response]
|
|
27
|
+
def create_auditoria_risco_v1_analyze_auditoria_risco_post(auditoria_risco_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_auditoria_risco_v1_analyze_auditoria_risco_post_with_http_info(auditoria_risco_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Compliance Risk Audit — conversation compliance analysis
|
|
33
|
+
# Analyzes a call transcript for compliance risks. Returns a score (0-100), classification level, violations, positives, and a detailed HTML report. **Python:** ```python import httpx response = httpx.post( 'https://api.fala.ai/v1/analyze/auditoriaRisco', headers={'Authorization': 'Bearer fai_xxx'}, json={ 'dialog': 'Speaker 1: [00:00:00.540 - 00:00:01.139] Hi, Alex.', 'duration_seconds': 151.0, 'language': 'pt-BR', 'response_language': 'en-US' } ) print(response.json()) ``` **cURL:** ```bash curl https://api.fala.ai/v1/analyze/auditoriaRisco \\ -H 'Authorization: Bearer fai_xxx' \\ -H 'Content-Type: application/json' \\ -d '{ \"dialog\": \"Speaker 1: [00:00:00.540 - 00:00:01.139] Hi, Alex.\", \"duration_seconds\": 151.0, \"language\": \"pt-BR\", \"response_language\": \"en-US\" }' ```
|
|
34
|
+
# @param auditoria_risco_request [AuditoriaRiscoRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(AuditoriaRiscoV2Response, Integer, Hash)>] AuditoriaRiscoV2Response data, response status code and response headers
|
|
37
|
+
def create_auditoria_risco_v1_analyze_auditoria_risco_post_with_http_info(auditoria_risco_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: AnalysisApi.create_auditoria_risco_v1_analyze_auditoria_risco_post ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'auditoria_risco_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && auditoria_risco_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'auditoria_risco_request' when calling AnalysisApi.create_auditoria_risco_v1_analyze_auditoria_risco_post"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/analyze/auditoriaRisco'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(auditoria_risco_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'AuditoriaRiscoV2Response'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"AnalysisApi.create_auditoria_risco_v1_analyze_auditoria_risco_post",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: AnalysisApi#create_auditoria_risco_v1_analyze_auditoria_risco_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Analyze a call transcript — 5 parallel analyses
|
|
91
|
+
# Runs 5 independent analyses on a call transcript: dialogue summary, contact reason, identified action, label classification, and sentiment. **Python:** ```python import httpx response = httpx.post( 'https://api.fala.ai/v1/analyze/diagnostic', headers={'Authorization': 'Bearer fai_xxx'}, json={ 'dialog': 'Speaker 1: [00:00:00.540 - 00:00:01.139] Hi, Alex.', 'language': 'pt-BR', 'duration_seconds': 151.0 } ) print(response.json()) ``` **cURL:** ```bash curl https://api.fala.ai/v1/analyze/diagnostic \\ -H 'Authorization: Bearer fai_xxx' \\ -H 'Content-Type: application/json' \\ -d '{ \"dialog\": \"Speaker 1: [00:00:00.540 - 00:00:01.139] Hi, Alex.\", \"language\": \"pt-BR\", \"duration_seconds\": 151.0 }' ```
|
|
92
|
+
# @param diagnostic_request [DiagnosticRequest]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [DiagnosticResponse]
|
|
95
|
+
def create_diagnostic_v1_analyze_diagnostic_post(diagnostic_request, opts = {})
|
|
96
|
+
data, _status_code, _headers = create_diagnostic_v1_analyze_diagnostic_post_with_http_info(diagnostic_request, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Analyze a call transcript — 5 parallel analyses
|
|
101
|
+
# Runs 5 independent analyses on a call transcript: dialogue summary, contact reason, identified action, label classification, and sentiment. **Python:** ```python import httpx response = httpx.post( 'https://api.fala.ai/v1/analyze/diagnostic', headers={'Authorization': 'Bearer fai_xxx'}, json={ 'dialog': 'Speaker 1: [00:00:00.540 - 00:00:01.139] Hi, Alex.', 'language': 'pt-BR', 'duration_seconds': 151.0 } ) print(response.json()) ``` **cURL:** ```bash curl https://api.fala.ai/v1/analyze/diagnostic \\ -H 'Authorization: Bearer fai_xxx' \\ -H 'Content-Type: application/json' \\ -d '{ \"dialog\": \"Speaker 1: [00:00:00.540 - 00:00:01.139] Hi, Alex.\", \"language\": \"pt-BR\", \"duration_seconds\": 151.0 }' ```
|
|
102
|
+
# @param diagnostic_request [DiagnosticRequest]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(DiagnosticResponse, Integer, Hash)>] DiagnosticResponse data, response status code and response headers
|
|
105
|
+
def create_diagnostic_v1_analyze_diagnostic_post_with_http_info(diagnostic_request, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: AnalysisApi.create_diagnostic_v1_analyze_diagnostic_post ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'diagnostic_request' is set
|
|
110
|
+
if @api_client.config.client_side_validation && diagnostic_request.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'diagnostic_request' when calling AnalysisApi.create_diagnostic_v1_analyze_diagnostic_post"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/v1/analyze/diagnostic'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
# HTTP header 'Content-Type'
|
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
125
|
+
if !content_type.nil?
|
|
126
|
+
header_params['Content-Type'] = content_type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(diagnostic_request)
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type] || 'DiagnosticResponse'
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"AnalysisApi.create_diagnostic_v1_analyze_diagnostic_post",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: AnalysisApi#create_diagnostic_v1_analyze_diagnostic_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|