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,294 @@
|
|
|
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 EmailAlertsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Criar email de alerta
|
|
23
|
+
# @param create_email_alert_request [CreateEmailAlertRequest]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [EmailAlertItem]
|
|
26
|
+
def create_email_alert_v1_email_alerts_post(create_email_alert_request, opts = {})
|
|
27
|
+
data, _status_code, _headers = create_email_alert_v1_email_alerts_post_with_http_info(create_email_alert_request, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Criar email de alerta
|
|
32
|
+
# @param create_email_alert_request [CreateEmailAlertRequest]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(EmailAlertItem, Integer, Hash)>] EmailAlertItem data, response status code and response headers
|
|
35
|
+
def create_email_alert_v1_email_alerts_post_with_http_info(create_email_alert_request, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: EmailAlertsApi.create_email_alert_v1_email_alerts_post ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'create_email_alert_request' is set
|
|
40
|
+
if @api_client.config.client_side_validation && create_email_alert_request.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'create_email_alert_request' when calling EmailAlertsApi.create_email_alert_v1_email_alerts_post"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/v1/email-alerts'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
# HTTP header 'Content-Type'
|
|
54
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
55
|
+
if !content_type.nil?
|
|
56
|
+
header_params['Content-Type'] = content_type
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_email_alert_request)
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'EmailAlertItem'
|
|
67
|
+
|
|
68
|
+
# auth_names
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"EmailAlertsApi.create_email_alert_v1_email_alerts_post",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: EmailAlertsApi#create_email_alert_v1_email_alerts_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Remover email de alerta
|
|
89
|
+
# @param alert_id [String]
|
|
90
|
+
# @param [Hash] opts the optional parameters
|
|
91
|
+
# @return [EmailAlertMessageResponse]
|
|
92
|
+
def delete_email_alert_v1_email_alerts_alert_id_delete(alert_id, opts = {})
|
|
93
|
+
data, _status_code, _headers = delete_email_alert_v1_email_alerts_alert_id_delete_with_http_info(alert_id, opts)
|
|
94
|
+
data
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Remover email de alerta
|
|
98
|
+
# @param alert_id [String]
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @return [Array<(EmailAlertMessageResponse, Integer, Hash)>] EmailAlertMessageResponse data, response status code and response headers
|
|
101
|
+
def delete_email_alert_v1_email_alerts_alert_id_delete_with_http_info(alert_id, opts = {})
|
|
102
|
+
if @api_client.config.debugging
|
|
103
|
+
@api_client.config.logger.debug 'Calling API: EmailAlertsApi.delete_email_alert_v1_email_alerts_alert_id_delete ...'
|
|
104
|
+
end
|
|
105
|
+
# verify the required parameter 'alert_id' is set
|
|
106
|
+
if @api_client.config.client_side_validation && alert_id.nil?
|
|
107
|
+
fail ArgumentError, "Missing the required parameter 'alert_id' when calling EmailAlertsApi.delete_email_alert_v1_email_alerts_alert_id_delete"
|
|
108
|
+
end
|
|
109
|
+
# resource path
|
|
110
|
+
local_var_path = '/v1/email-alerts/{alert_id}'.sub('{alert_id}', CGI.escape(alert_id.to_s))
|
|
111
|
+
|
|
112
|
+
# query parameters
|
|
113
|
+
query_params = opts[:query_params] || {}
|
|
114
|
+
|
|
115
|
+
# header parameters
|
|
116
|
+
header_params = opts[:header_params] || {}
|
|
117
|
+
# HTTP header 'Accept' (if needed)
|
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
119
|
+
|
|
120
|
+
# form parameters
|
|
121
|
+
form_params = opts[:form_params] || {}
|
|
122
|
+
|
|
123
|
+
# http body (model)
|
|
124
|
+
post_body = opts[:debug_body]
|
|
125
|
+
|
|
126
|
+
# return_type
|
|
127
|
+
return_type = opts[:debug_return_type] || 'EmailAlertMessageResponse'
|
|
128
|
+
|
|
129
|
+
# auth_names
|
|
130
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
131
|
+
|
|
132
|
+
new_options = opts.merge(
|
|
133
|
+
:operation => :"EmailAlertsApi.delete_email_alert_v1_email_alerts_alert_id_delete",
|
|
134
|
+
:header_params => header_params,
|
|
135
|
+
:query_params => query_params,
|
|
136
|
+
:form_params => form_params,
|
|
137
|
+
:body => post_body,
|
|
138
|
+
:auth_names => auth_names,
|
|
139
|
+
:return_type => return_type
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
143
|
+
if @api_client.config.debugging
|
|
144
|
+
@api_client.config.logger.debug "API called: EmailAlertsApi#delete_email_alert_v1_email_alerts_alert_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
145
|
+
end
|
|
146
|
+
return data, status_code, headers
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Listar emails de alerta
|
|
150
|
+
# @param [Hash] opts the optional parameters
|
|
151
|
+
# @option opts [Integer] :page (default to 1)
|
|
152
|
+
# @option opts [Integer] :limit (default to 20)
|
|
153
|
+
# @return [EmailAlertListResponse]
|
|
154
|
+
def list_email_alerts_v1_email_alerts_get(opts = {})
|
|
155
|
+
data, _status_code, _headers = list_email_alerts_v1_email_alerts_get_with_http_info(opts)
|
|
156
|
+
data
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Listar emails de alerta
|
|
160
|
+
# @param [Hash] opts the optional parameters
|
|
161
|
+
# @option opts [Integer] :page (default to 1)
|
|
162
|
+
# @option opts [Integer] :limit (default to 20)
|
|
163
|
+
# @return [Array<(EmailAlertListResponse, Integer, Hash)>] EmailAlertListResponse data, response status code and response headers
|
|
164
|
+
def list_email_alerts_v1_email_alerts_get_with_http_info(opts = {})
|
|
165
|
+
if @api_client.config.debugging
|
|
166
|
+
@api_client.config.logger.debug 'Calling API: EmailAlertsApi.list_email_alerts_v1_email_alerts_get ...'
|
|
167
|
+
end
|
|
168
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
169
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling EmailAlertsApi.list_email_alerts_v1_email_alerts_get, must be greater than or equal to 1.'
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
173
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EmailAlertsApi.list_email_alerts_v1_email_alerts_get, must be smaller than or equal to 100.'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
177
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EmailAlertsApi.list_email_alerts_v1_email_alerts_get, must be greater than or equal to 1.'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# resource path
|
|
181
|
+
local_var_path = '/v1/email-alerts'
|
|
182
|
+
|
|
183
|
+
# query parameters
|
|
184
|
+
query_params = opts[:query_params] || {}
|
|
185
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
186
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
187
|
+
|
|
188
|
+
# header parameters
|
|
189
|
+
header_params = opts[:header_params] || {}
|
|
190
|
+
# HTTP header 'Accept' (if needed)
|
|
191
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
192
|
+
|
|
193
|
+
# form parameters
|
|
194
|
+
form_params = opts[:form_params] || {}
|
|
195
|
+
|
|
196
|
+
# http body (model)
|
|
197
|
+
post_body = opts[:debug_body]
|
|
198
|
+
|
|
199
|
+
# return_type
|
|
200
|
+
return_type = opts[:debug_return_type] || 'EmailAlertListResponse'
|
|
201
|
+
|
|
202
|
+
# auth_names
|
|
203
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
204
|
+
|
|
205
|
+
new_options = opts.merge(
|
|
206
|
+
:operation => :"EmailAlertsApi.list_email_alerts_v1_email_alerts_get",
|
|
207
|
+
:header_params => header_params,
|
|
208
|
+
:query_params => query_params,
|
|
209
|
+
:form_params => form_params,
|
|
210
|
+
:body => post_body,
|
|
211
|
+
:auth_names => auth_names,
|
|
212
|
+
:return_type => return_type
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
216
|
+
if @api_client.config.debugging
|
|
217
|
+
@api_client.config.logger.debug "API called: EmailAlertsApi#list_email_alerts_v1_email_alerts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
218
|
+
end
|
|
219
|
+
return data, status_code, headers
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Atualizar email de alerta
|
|
223
|
+
# @param alert_id [String]
|
|
224
|
+
# @param update_email_alert_request [UpdateEmailAlertRequest]
|
|
225
|
+
# @param [Hash] opts the optional parameters
|
|
226
|
+
# @return [EmailAlertMessageResponse]
|
|
227
|
+
def update_email_alert_v1_email_alerts_alert_id_put(alert_id, update_email_alert_request, opts = {})
|
|
228
|
+
data, _status_code, _headers = update_email_alert_v1_email_alerts_alert_id_put_with_http_info(alert_id, update_email_alert_request, opts)
|
|
229
|
+
data
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Atualizar email de alerta
|
|
233
|
+
# @param alert_id [String]
|
|
234
|
+
# @param update_email_alert_request [UpdateEmailAlertRequest]
|
|
235
|
+
# @param [Hash] opts the optional parameters
|
|
236
|
+
# @return [Array<(EmailAlertMessageResponse, Integer, Hash)>] EmailAlertMessageResponse data, response status code and response headers
|
|
237
|
+
def update_email_alert_v1_email_alerts_alert_id_put_with_http_info(alert_id, update_email_alert_request, opts = {})
|
|
238
|
+
if @api_client.config.debugging
|
|
239
|
+
@api_client.config.logger.debug 'Calling API: EmailAlertsApi.update_email_alert_v1_email_alerts_alert_id_put ...'
|
|
240
|
+
end
|
|
241
|
+
# verify the required parameter 'alert_id' is set
|
|
242
|
+
if @api_client.config.client_side_validation && alert_id.nil?
|
|
243
|
+
fail ArgumentError, "Missing the required parameter 'alert_id' when calling EmailAlertsApi.update_email_alert_v1_email_alerts_alert_id_put"
|
|
244
|
+
end
|
|
245
|
+
# verify the required parameter 'update_email_alert_request' is set
|
|
246
|
+
if @api_client.config.client_side_validation && update_email_alert_request.nil?
|
|
247
|
+
fail ArgumentError, "Missing the required parameter 'update_email_alert_request' when calling EmailAlertsApi.update_email_alert_v1_email_alerts_alert_id_put"
|
|
248
|
+
end
|
|
249
|
+
# resource path
|
|
250
|
+
local_var_path = '/v1/email-alerts/{alert_id}'.sub('{alert_id}', CGI.escape(alert_id.to_s))
|
|
251
|
+
|
|
252
|
+
# query parameters
|
|
253
|
+
query_params = opts[:query_params] || {}
|
|
254
|
+
|
|
255
|
+
# header parameters
|
|
256
|
+
header_params = opts[:header_params] || {}
|
|
257
|
+
# HTTP header 'Accept' (if needed)
|
|
258
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
259
|
+
# HTTP header 'Content-Type'
|
|
260
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
261
|
+
if !content_type.nil?
|
|
262
|
+
header_params['Content-Type'] = content_type
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# form parameters
|
|
266
|
+
form_params = opts[:form_params] || {}
|
|
267
|
+
|
|
268
|
+
# http body (model)
|
|
269
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_email_alert_request)
|
|
270
|
+
|
|
271
|
+
# return_type
|
|
272
|
+
return_type = opts[:debug_return_type] || 'EmailAlertMessageResponse'
|
|
273
|
+
|
|
274
|
+
# auth_names
|
|
275
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
276
|
+
|
|
277
|
+
new_options = opts.merge(
|
|
278
|
+
:operation => :"EmailAlertsApi.update_email_alert_v1_email_alerts_alert_id_put",
|
|
279
|
+
:header_params => header_params,
|
|
280
|
+
:query_params => query_params,
|
|
281
|
+
:form_params => form_params,
|
|
282
|
+
:body => post_body,
|
|
283
|
+
:auth_names => auth_names,
|
|
284
|
+
:return_type => return_type
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
288
|
+
if @api_client.config.debugging
|
|
289
|
+
@api_client.config.logger.debug "API called: EmailAlertsApi#update_email_alert_v1_email_alerts_alert_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
290
|
+
end
|
|
291
|
+
return data, status_code, headers
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
end
|
|
@@ -0,0 +1,132 @@
|
|
|
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 HealthApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Health Check
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [HealthResponse]
|
|
25
|
+
def health_check(opts = {})
|
|
26
|
+
data, _status_code, _headers = health_check_with_http_info(opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Health Check
|
|
31
|
+
# @param [Hash] opts the optional parameters
|
|
32
|
+
# @return [Array<(HealthResponse, Integer, Hash)>] HealthResponse data, response status code and response headers
|
|
33
|
+
def health_check_with_http_info(opts = {})
|
|
34
|
+
if @api_client.config.debugging
|
|
35
|
+
@api_client.config.logger.debug 'Calling API: HealthApi.health_check ...'
|
|
36
|
+
end
|
|
37
|
+
# resource path
|
|
38
|
+
local_var_path = '/v1/health'
|
|
39
|
+
|
|
40
|
+
# query parameters
|
|
41
|
+
query_params = opts[:query_params] || {}
|
|
42
|
+
|
|
43
|
+
# header parameters
|
|
44
|
+
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
47
|
+
|
|
48
|
+
# form parameters
|
|
49
|
+
form_params = opts[:form_params] || {}
|
|
50
|
+
|
|
51
|
+
# http body (model)
|
|
52
|
+
post_body = opts[:debug_body]
|
|
53
|
+
|
|
54
|
+
# return_type
|
|
55
|
+
return_type = opts[:debug_return_type] || 'HealthResponse'
|
|
56
|
+
|
|
57
|
+
# auth_names
|
|
58
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
59
|
+
|
|
60
|
+
new_options = opts.merge(
|
|
61
|
+
:operation => :"HealthApi.health_check",
|
|
62
|
+
:header_params => header_params,
|
|
63
|
+
:query_params => query_params,
|
|
64
|
+
:form_params => form_params,
|
|
65
|
+
:body => post_body,
|
|
66
|
+
:auth_names => auth_names,
|
|
67
|
+
:return_type => return_type
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
71
|
+
if @api_client.config.debugging
|
|
72
|
+
@api_client.config.logger.debug "API called: HealthApi#health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
73
|
+
end
|
|
74
|
+
return data, status_code, headers
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Health Check
|
|
78
|
+
# @param [Hash] opts the optional parameters
|
|
79
|
+
# @return [HealthResponse]
|
|
80
|
+
def health_check_head(opts = {})
|
|
81
|
+
data, _status_code, _headers = health_check_head_with_http_info(opts)
|
|
82
|
+
data
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Health Check
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @return [Array<(HealthResponse, Integer, Hash)>] HealthResponse data, response status code and response headers
|
|
88
|
+
def health_check_head_with_http_info(opts = {})
|
|
89
|
+
if @api_client.config.debugging
|
|
90
|
+
@api_client.config.logger.debug 'Calling API: HealthApi.health_check_head ...'
|
|
91
|
+
end
|
|
92
|
+
# resource path
|
|
93
|
+
local_var_path = '/v1/health'
|
|
94
|
+
|
|
95
|
+
# query parameters
|
|
96
|
+
query_params = opts[:query_params] || {}
|
|
97
|
+
|
|
98
|
+
# header parameters
|
|
99
|
+
header_params = opts[:header_params] || {}
|
|
100
|
+
# HTTP header 'Accept' (if needed)
|
|
101
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
102
|
+
|
|
103
|
+
# form parameters
|
|
104
|
+
form_params = opts[:form_params] || {}
|
|
105
|
+
|
|
106
|
+
# http body (model)
|
|
107
|
+
post_body = opts[:debug_body]
|
|
108
|
+
|
|
109
|
+
# return_type
|
|
110
|
+
return_type = opts[:debug_return_type] || 'HealthResponse'
|
|
111
|
+
|
|
112
|
+
# auth_names
|
|
113
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
114
|
+
|
|
115
|
+
new_options = opts.merge(
|
|
116
|
+
:operation => :"HealthApi.health_check_head",
|
|
117
|
+
:header_params => header_params,
|
|
118
|
+
:query_params => query_params,
|
|
119
|
+
:form_params => form_params,
|
|
120
|
+
:body => post_body,
|
|
121
|
+
:auth_names => auth_names,
|
|
122
|
+
:return_type => return_type
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
data, status_code, headers = @api_client.call_api(:HEAD, local_var_path, new_options)
|
|
126
|
+
if @api_client.config.debugging
|
|
127
|
+
@api_client.config.logger.debug "API called: HealthApi#health_check_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
128
|
+
end
|
|
129
|
+
return data, status_code, headers
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -0,0 +1,100 @@
|
|
|
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 SpeechApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Transcribe audio to text
|
|
23
|
+
# Upload an audio file and receive transcription with speaker diarization, audio events, and dialog. **Supported formats:** .mp3, .mp4, .m4a, .wav, .flac, .ogg, .webm, .aac, .opus **Limits:** - Maximum audio duration: 3 hours - Maximum file size: 1GB - Cost: 1 credit per second of audio (rounded up), minimum 1 credit **Supported languages:** pt, en, es, fr, de, it, ja, ko, nl, pl, ru, tr, zh, vi, id, th, ar, hi, cs, da, el, fi, he, hu, ms, no, ro, sk, sv, ta, uk **Python:** ```python import httpx response = httpx.post( 'https://api.fala.ai/v1/audio/transcriptions', headers={'Authorization': 'Bearer fai_xxx'}, files={'file': open('call.mp3', 'rb')}, data={'model': 'falaai-transcribe-1', 'language': 'pt'} ) print(response.json()) ``` **cURL:** ```bash curl https://api.fala.ai/v1/audio/transcriptions \\ -H 'Authorization: Bearer fai_xxx' \\ -F 'file=@call.mp3' \\ -F 'model=falaai-transcribe-1' \\ -F 'language=pt' ```
|
|
24
|
+
# @param file [File]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :model (default to 'falaai-transcribe-1')
|
|
27
|
+
# @option opts [String] :language (default to 'pt')
|
|
28
|
+
# @option opts [String] :client_reference_id Optional client-supplied ID echoed verbatim in the response. Use to correlate/sync with your system. Accepted charset: [A-Za-z0-9._:-]. Not idempotency.
|
|
29
|
+
# @return [TranscriptionResponse]
|
|
30
|
+
def create_transcription_v1_audio_transcriptions_post(file, opts = {})
|
|
31
|
+
data, _status_code, _headers = create_transcription_v1_audio_transcriptions_post_with_http_info(file, opts)
|
|
32
|
+
data
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Transcribe audio to text
|
|
36
|
+
# Upload an audio file and receive transcription with speaker diarization, audio events, and dialog. **Supported formats:** .mp3, .mp4, .m4a, .wav, .flac, .ogg, .webm, .aac, .opus **Limits:** - Maximum audio duration: 3 hours - Maximum file size: 1GB - Cost: 1 credit per second of audio (rounded up), minimum 1 credit **Supported languages:** pt, en, es, fr, de, it, ja, ko, nl, pl, ru, tr, zh, vi, id, th, ar, hi, cs, da, el, fi, he, hu, ms, no, ro, sk, sv, ta, uk **Python:** ```python import httpx response = httpx.post( 'https://api.fala.ai/v1/audio/transcriptions', headers={'Authorization': 'Bearer fai_xxx'}, files={'file': open('call.mp3', 'rb')}, data={'model': 'falaai-transcribe-1', 'language': 'pt'} ) print(response.json()) ``` **cURL:** ```bash curl https://api.fala.ai/v1/audio/transcriptions \\ -H 'Authorization: Bearer fai_xxx' \\ -F 'file=@call.mp3' \\ -F 'model=falaai-transcribe-1' \\ -F 'language=pt' ```
|
|
37
|
+
# @param file [File]
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @option opts [String] :model (default to 'falaai-transcribe-1')
|
|
40
|
+
# @option opts [String] :language (default to 'pt')
|
|
41
|
+
# @option opts [String] :client_reference_id Optional client-supplied ID echoed verbatim in the response. Use to correlate/sync with your system. Accepted charset: [A-Za-z0-9._:-]. Not idempotency.
|
|
42
|
+
# @return [Array<(TranscriptionResponse, Integer, Hash)>] TranscriptionResponse data, response status code and response headers
|
|
43
|
+
def create_transcription_v1_audio_transcriptions_post_with_http_info(file, opts = {})
|
|
44
|
+
if @api_client.config.debugging
|
|
45
|
+
@api_client.config.logger.debug 'Calling API: SpeechApi.create_transcription_v1_audio_transcriptions_post ...'
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'file' is set
|
|
48
|
+
if @api_client.config.client_side_validation && file.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'file' when calling SpeechApi.create_transcription_v1_audio_transcriptions_post"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/v1/audio/transcriptions'
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = opts[:header_params] || {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
63
|
+
if !content_type.nil?
|
|
64
|
+
header_params['Content-Type'] = content_type
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
form_params['file'] = file
|
|
70
|
+
form_params['model'] = opts[:'model'] if !opts[:'model'].nil?
|
|
71
|
+
form_params['language'] = opts[:'language'] if !opts[:'language'].nil?
|
|
72
|
+
form_params['client_reference_id'] = opts[:'client_reference_id'] if !opts[:'client_reference_id'].nil?
|
|
73
|
+
|
|
74
|
+
# http body (model)
|
|
75
|
+
post_body = opts[:debug_body]
|
|
76
|
+
|
|
77
|
+
# return_type
|
|
78
|
+
return_type = opts[:debug_return_type] || 'TranscriptionResponse'
|
|
79
|
+
|
|
80
|
+
# auth_names
|
|
81
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
82
|
+
|
|
83
|
+
new_options = opts.merge(
|
|
84
|
+
:operation => :"SpeechApi.create_transcription_v1_audio_transcriptions_post",
|
|
85
|
+
:header_params => header_params,
|
|
86
|
+
:query_params => query_params,
|
|
87
|
+
:form_params => form_params,
|
|
88
|
+
:body => post_body,
|
|
89
|
+
:auth_names => auth_names,
|
|
90
|
+
:return_type => return_type
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
94
|
+
if @api_client.config.debugging
|
|
95
|
+
@api_client.config.logger.debug "API called: SpeechApi#create_transcription_v1_audio_transcriptions_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
96
|
+
end
|
|
97
|
+
return data, status_code, headers
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|