falaai-api 1.21.47 → 1.21.48

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +339 -205
  3. data/docs/AnalysisApi.md +2 -2
  4. data/docs/AuditoriaRiscoParticipantV2.md +7 -1
  5. data/docs/SpeechApi.md +1 -1
  6. data/lib/falaai-api/api/analysis_api.rb +6 -6
  7. data/lib/falaai-api/api/email_alerts_api.rb +2 -2
  8. data/lib/falaai-api/api/health_api.rb +2 -2
  9. data/lib/falaai-api/api/speech_api.rb +4 -4
  10. data/lib/falaai-api/api/usage_api.rb +2 -2
  11. data/lib/falaai-api/api/version_api.rb +2 -2
  12. data/lib/falaai-api/api/webhooks_api.rb +2 -2
  13. data/lib/falaai-api/api_client.rb +2 -2
  14. data/lib/falaai-api/api_error.rb +2 -2
  15. data/lib/falaai-api/api_model_base.rb +2 -2
  16. data/lib/falaai-api/configuration.rb +2 -2
  17. data/lib/falaai-api/models/audio_event.rb +2 -2
  18. data/lib/falaai-api/models/audio_input_meta.rb +2 -2
  19. data/lib/falaai-api/models/auditoria_risco_analysis_v2.rb +2 -2
  20. data/lib/falaai-api/models/auditoria_risco_applied_action_v2.rb +2 -2
  21. data/lib/falaai-api/models/auditoria_risco_audio_event_model_v2.rb +2 -2
  22. data/lib/falaai-api/models/auditoria_risco_audit_decisions_v2.rb +2 -2
  23. data/lib/falaai-api/models/auditoria_risco_conversation_scores_v2.rb +2 -2
  24. data/lib/falaai-api/models/auditoria_risco_detection_item_v2.rb +2 -2
  25. data/lib/falaai-api/models/auditoria_risco_detections_v2.rb +2 -2
  26. data/lib/falaai-api/models/auditoria_risco_indexer_v2.rb +2 -2
  27. data/lib/falaai-api/models/auditoria_risco_meta_v2.rb +2 -2
  28. data/lib/falaai-api/models/auditoria_risco_participant_v2.rb +36 -6
  29. data/lib/falaai-api/models/auditoria_risco_participants_v2.rb +2 -2
  30. data/lib/falaai-api/models/auditoria_risco_request.rb +2 -2
  31. data/lib/falaai-api/models/auditoria_risco_scores_v2.rb +2 -2
  32. data/lib/falaai-api/models/auditoria_risco_scoring_explanation_v2.rb +2 -2
  33. data/lib/falaai-api/models/auditoria_risco_summary_v2.rb +2 -2
  34. data/lib/falaai-api/models/auditoria_risco_timeline_v2.rb +2 -2
  35. data/lib/falaai-api/models/auditoria_risco_usage_v2.rb +2 -2
  36. data/lib/falaai-api/models/auditoria_risco_v2.rb +2 -2
  37. data/lib/falaai-api/models/auditoria_risco_v2_response.rb +2 -2
  38. data/lib/falaai-api/models/auditoria_risco_verdict_v2.rb +2 -2
  39. data/lib/falaai-api/models/create_email_alert_request.rb +2 -2
  40. data/lib/falaai-api/models/create_webhook_request.rb +2 -2
  41. data/lib/falaai-api/models/diagnostic_analysis_map.rb +2 -2
  42. data/lib/falaai-api/models/diagnostic_audio_event.rb +2 -2
  43. data/lib/falaai-api/models/diagnostic_categorical_analysis.rb +2 -2
  44. data/lib/falaai-api/models/diagnostic_request.rb +2 -2
  45. data/lib/falaai-api/models/diagnostic_response.rb +2 -2
  46. data/lib/falaai-api/models/diagnostic_text_analysis.rb +2 -2
  47. data/lib/falaai-api/models/diagnostic_usage.rb +2 -2
  48. data/lib/falaai-api/models/email_alert_item.rb +2 -2
  49. data/lib/falaai-api/models/email_alert_list_response.rb +2 -2
  50. data/lib/falaai-api/models/email_alert_message_response.rb +2 -2
  51. data/lib/falaai-api/models/email_event.rb +2 -2
  52. data/lib/falaai-api/models/health_response.rb +2 -2
  53. data/lib/falaai-api/models/http_validation_error.rb +2 -2
  54. data/lib/falaai-api/models/location_inner.rb +2 -2
  55. data/lib/falaai-api/models/message_response.rb +2 -2
  56. data/lib/falaai-api/models/participant.rb +2 -2
  57. data/lib/falaai-api/models/participant_diagnostic.rb +2 -2
  58. data/lib/falaai-api/models/transcription_response.rb +2 -2
  59. data/lib/falaai-api/models/transcription_usage.rb +2 -2
  60. data/lib/falaai-api/models/update_email_alert_request.rb +2 -2
  61. data/lib/falaai-api/models/update_webhook_request.rb +2 -2
  62. data/lib/falaai-api/models/usage_by_key_item.rb +2 -2
  63. data/lib/falaai-api/models/usage_log_item.rb +2 -2
  64. data/lib/falaai-api/models/usage_log_response.rb +2 -2
  65. data/lib/falaai-api/models/validation_error.rb +2 -2
  66. data/lib/falaai-api/models/version_response.rb +2 -2
  67. data/lib/falaai-api/models/webhook_event.rb +2 -2
  68. data/lib/falaai-api/models/webhook_item.rb +2 -2
  69. data/lib/falaai-api/models/webhook_list_response.rb +2 -2
  70. data/lib/falaai-api/version.rb +3 -3
  71. data/lib/falaai-api.rb +2 -2
  72. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3381038826725700d977c7fa6fa28f2f6ee14c5432bb3bfb490573763752f17f
4
- data.tar.gz: 39803b031fa1bd7d247fd98e7dfd22c3ebe60b69081c9b23150ad98e99b68a67
3
+ metadata.gz: ce5138e63a53b8aa63fc294b5da58caae86fc8d871c5b047522e0a06742eebc4
4
+ data.tar.gz: 8c384866a62861e5f6f4cad85c26c6e853d2f64b4123a7e8cb60b8becbe6167f
5
5
  SHA512:
6
- metadata.gz: 677fbbf0ba09380ef989b37a05cc9a9ba049377d750f36ee9187fcb98bdc4a1004e4622c6596aff24d06d9f7af59ea376a2f2b76ed4fdeccc5934c22d5bf5e38
7
- data.tar.gz: a10e570c6bce24ceae199beb013566355677787c6d0b293f8c63419c74030287ccba5182365044dc792a0aa01b06aaf09712155cb8a9641660febc57e76a8df8
6
+ metadata.gz: 4d3ca8cd91d02b7ddb9f2c5744aca963c44f3335af5d2755b4ffe9ac68bd965e56d0873ccfee3f4098c7b86839f785bba7e8316538019203fbd1bb001d1f2d73
7
+ data.tar.gz: cd3bf3c1b9cb76c12afa102b0cd08cd1c4ff1b3782edde784270aef24ce706e97376268fa5316e922e249f9adc1c13b5c1e5e2748cc9d0959e6e65aacef94464
data/README.md CHANGED
@@ -1,205 +1,339 @@
1
- # falaai-api
2
-
3
- FalaAI - the Ruby gem for the FalaAI API
4
-
5
- Transcribe, diagnose and score calls with 3 simple endpoints.
6
-
7
- **Endpoints:**
8
- - `POST /v1/audio/transcriptions` — Audio to text
9
- - `POST /v1/analyze/diagnostic` — Conversation analysis
10
- - `POST /v1/analyze/auditoriaRisco` — Compliance audit
11
-
12
- **Complete flow (Python):**
13
- ```python
14
- import httpx
15
-
16
- API = 'https://api.fala.ai'
17
- KEY = 'fai_xxx'
18
- HD = {'Authorization': f'Bearer {KEY}'}
19
-
20
- # 1. Transcribe
21
- files = {'file': open('call.mp3', 'rb')}
22
- resp = httpx.post(f'{API}/v1/audio/transcriptions', headers=HD, files=files, data={'model': 'falaai-transcribe-1', 'language': 'pt'})
23
- tr = resp.json()
24
- print(f'Text: {tr[\"text\"][:100]}...')
25
-
26
- # 2. Diagnose
27
- resp = httpx.post(f'{API}/v1/analyze/diagnostic', headers=HD, json={'dialog': tr['dialog'], 'language': 'pt-BR', 'duration_seconds': tr['duration_seconds']})
28
- diag = resp.json()
29
- print(f'Sentiment: {diag[\"analysis\"][\"sentiment\"][\"list_choice\"]}')
30
- print(f'Summary: {diag[\"analysis\"][\"dialogue_summary\"][\"explanation\"][:100]}...')
31
-
32
- # 3. Audit
33
- resp = httpx.post(f'{API}/v1/analyze/auditoriaRisco', headers=HD, json={'dialogo': tr['dialog'], 'duration_seconds': tr['duration_seconds']})
34
- audit = resp.json()
35
- print(f'Score: {audit[\"audit_score\"]} | Verdict: {audit[\"verdict\"]}')
36
- print(f'Detections: {audit[\"total_detections\"]} | Violations: {len(audit[\"violations\"])} | Positives: {len(audit[\"positives\"])}')
37
- ```
38
-
39
- **Authentication:** All endpoints require an API Key in the `Authorization` header: `Bearer fai_xxx`
40
-
41
- Get your API Key at [falaai.action.tec.br/api](https://falaai.action.tec.br/api)
42
-
43
- This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
44
-
45
- - API version: 1.21.47
46
- - Package version: 1.0.0
47
- - Generator version: 7.25.0
48
- - Build package: org.openapitools.codegen.languages.RubyClientCodegen
49
-
50
- ## Installation
51
-
52
- ### Build a gem
53
-
54
- To build the Ruby code into a gem:
55
-
56
- ```shell
57
- gem build falaai-api.gemspec
58
- ```
59
-
60
- Then either install the gem locally:
61
-
62
- ```shell
63
- gem install ./falaai-api-1.0.0.gem
64
- ```
65
-
66
- (for development, run `gem install --dev ./falaai-api-1.0.0.gem` to install the development dependencies)
67
-
68
- or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
69
-
70
- Finally add this to the Gemfile:
71
-
72
- gem 'falaai-api', '~> 1.0.0'
73
-
74
- ### Install from Git
75
-
76
- If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
77
-
78
- gem 'falaai-api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
79
-
80
- ### Include the Ruby code directly
81
-
82
- Include the Ruby code directly using `-I` as follows:
83
-
84
- ```shell
85
- ruby -Ilib script.rb
86
- ```
87
-
88
- ## Getting Started
89
-
90
- Please follow the [installation](#installation) procedure and then run the following code:
91
-
92
- ```ruby
93
- # Load the gem
94
- require 'falaai-api'
95
-
96
- # Setup authorization
97
- FalaAI.configure do |config|
98
- # Configure Bearer authorization (fai_xxx): ApiKeyAuth
99
- config.access_token = 'YOUR_BEARER_TOKEN'
100
- # Configure a proc to get access tokens in lieu of the static access_token configuration
101
- config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' }
102
- end
103
-
104
- api_instance = FalaAI::AnalysisApi.new
105
- auditoria_risco_request = FalaAI::AuditoriaRiscoRequest.new({duration_seconds: 3.56, language: 'pt-BR', response_language: 'en-US'}) # AuditoriaRiscoRequest |
106
-
107
- begin
108
- #Compliance Risk Audit — conversation compliance analysis
109
- result = api_instance.create_auditoria_risco_v1_analyze_auditoria_risco_post(auditoria_risco_request)
110
- p result
111
- rescue FalaAI::ApiError => e
112
- puts "Exception when calling AnalysisApi->create_auditoria_risco_v1_analyze_auditoria_risco_post: #{e}"
113
- end
114
-
115
- ```
116
-
117
- ## Documentation for API Endpoints
118
-
119
- All URIs are relative to *http://localhost*
120
-
121
- Class | Method | HTTP request | Description
122
- ------------ | ------------- | ------------- | -------------
123
- *FalaAI::AnalysisApi* | [**create_auditoria_risco_v1_analyze_auditoria_risco_post**](docs/AnalysisApi.md#create_auditoria_risco_v1_analyze_auditoria_risco_post) | **POST** /v1/analyze/auditoriaRisco | Compliance Risk Audit — conversation compliance analysis
124
- *FalaAI::AnalysisApi* | [**create_diagnostic_v1_analyze_diagnostic_post**](docs/AnalysisApi.md#create_diagnostic_v1_analyze_diagnostic_post) | **POST** /v1/analyze/diagnostic | Analyze a call transcript — 5 parallel analyses
125
- *FalaAI::EmailAlertsApi* | [**create_email_alert_v1_email_alerts_post**](docs/EmailAlertsApi.md#create_email_alert_v1_email_alerts_post) | **POST** /v1/email-alerts | Criar email de alerta
126
- *FalaAI::EmailAlertsApi* | [**delete_email_alert_v1_email_alerts_alert_id_delete**](docs/EmailAlertsApi.md#delete_email_alert_v1_email_alerts_alert_id_delete) | **DELETE** /v1/email-alerts/{alert_id} | Remover email de alerta
127
- *FalaAI::EmailAlertsApi* | [**list_email_alerts_v1_email_alerts_get**](docs/EmailAlertsApi.md#list_email_alerts_v1_email_alerts_get) | **GET** /v1/email-alerts | Listar emails de alerta
128
- *FalaAI::EmailAlertsApi* | [**update_email_alert_v1_email_alerts_alert_id_put**](docs/EmailAlertsApi.md#update_email_alert_v1_email_alerts_alert_id_put) | **PUT** /v1/email-alerts/{alert_id} | Atualizar email de alerta
129
- *FalaAI::HealthApi* | [**health_check**](docs/HealthApi.md#health_check) | **GET** /v1/health | Health Check
130
- *FalaAI::HealthApi* | [**health_check_head**](docs/HealthApi.md#health_check_head) | **HEAD** /v1/health | Health Check
131
- *FalaAI::SpeechApi* | [**create_transcription_v1_audio_transcriptions_post**](docs/SpeechApi.md#create_transcription_v1_audio_transcriptions_post) | **POST** /v1/audio/transcriptions | Transcribe audio to text
132
- *FalaAI::UsageApi* | [**get_usage_by_key_v1_usage_by_key_get**](docs/UsageApi.md#get_usage_by_key_v1_usage_by_key_get) | **GET** /v1/usage/by-key | Get Usage By Key
133
- *FalaAI::UsageApi* | [**get_usage_log_v1_usage_log_get**](docs/UsageApi.md#get_usage_log_v1_usage_log_get) | **GET** /v1/usage/log | Get Usage Log
134
- *FalaAI::VersionApi* | [**get_version_api_version_get**](docs/VersionApi.md#get_version_api_version_get) | **GET** /api/version | Get Version
135
- *FalaAI::WebhooksApi* | [**create_webhook_v1_webhooks_post**](docs/WebhooksApi.md#create_webhook_v1_webhooks_post) | **POST** /v1/webhooks | Criar webhook de alertas
136
- *FalaAI::WebhooksApi* | [**delete_webhook_v1_webhooks_webhook_id_delete**](docs/WebhooksApi.md#delete_webhook_v1_webhooks_webhook_id_delete) | **DELETE** /v1/webhooks/{webhook_id} | Remover webhook
137
- *FalaAI::WebhooksApi* | [**list_webhooks_v1_webhooks_get**](docs/WebhooksApi.md#list_webhooks_v1_webhooks_get) | **GET** /v1/webhooks | Listar webhooks de alertas
138
- *FalaAI::WebhooksApi* | [**update_webhook_v1_webhooks_webhook_id_put**](docs/WebhooksApi.md#update_webhook_v1_webhooks_webhook_id_put) | **PUT** /v1/webhooks/{webhook_id} | Atualizar webhook
139
-
140
-
141
- ## Documentation for Models
142
-
143
- - [FalaAI::AudioEvent](docs/AudioEvent.md)
144
- - [FalaAI::AudioInputMeta](docs/AudioInputMeta.md)
145
- - [FalaAI::AuditoriaRiscoAnalysisV2](docs/AuditoriaRiscoAnalysisV2.md)
146
- - [FalaAI::AuditoriaRiscoAppliedActionV2](docs/AuditoriaRiscoAppliedActionV2.md)
147
- - [FalaAI::AuditoriaRiscoAudioEventModelV2](docs/AuditoriaRiscoAudioEventModelV2.md)
148
- - [FalaAI::AuditoriaRiscoAuditDecisionsV2](docs/AuditoriaRiscoAuditDecisionsV2.md)
149
- - [FalaAI::AuditoriaRiscoConversationScoresV2](docs/AuditoriaRiscoConversationScoresV2.md)
150
- - [FalaAI::AuditoriaRiscoDetectionItemV2](docs/AuditoriaRiscoDetectionItemV2.md)
151
- - [FalaAI::AuditoriaRiscoDetectionsV2](docs/AuditoriaRiscoDetectionsV2.md)
152
- - [FalaAI::AuditoriaRiscoIndexerV2](docs/AuditoriaRiscoIndexerV2.md)
153
- - [FalaAI::AuditoriaRiscoMetaV2](docs/AuditoriaRiscoMetaV2.md)
154
- - [FalaAI::AuditoriaRiscoParticipantV2](docs/AuditoriaRiscoParticipantV2.md)
155
- - [FalaAI::AuditoriaRiscoParticipantsV2](docs/AuditoriaRiscoParticipantsV2.md)
156
- - [FalaAI::AuditoriaRiscoRequest](docs/AuditoriaRiscoRequest.md)
157
- - [FalaAI::AuditoriaRiscoScoresV2](docs/AuditoriaRiscoScoresV2.md)
158
- - [FalaAI::AuditoriaRiscoScoringExplanationV2](docs/AuditoriaRiscoScoringExplanationV2.md)
159
- - [FalaAI::AuditoriaRiscoSummaryV2](docs/AuditoriaRiscoSummaryV2.md)
160
- - [FalaAI::AuditoriaRiscoTimelineV2](docs/AuditoriaRiscoTimelineV2.md)
161
- - [FalaAI::AuditoriaRiscoUsageV2](docs/AuditoriaRiscoUsageV2.md)
162
- - [FalaAI::AuditoriaRiscoV2](docs/AuditoriaRiscoV2.md)
163
- - [FalaAI::AuditoriaRiscoV2Response](docs/AuditoriaRiscoV2Response.md)
164
- - [FalaAI::AuditoriaRiscoVerdictV2](docs/AuditoriaRiscoVerdictV2.md)
165
- - [FalaAI::CreateEmailAlertRequest](docs/CreateEmailAlertRequest.md)
166
- - [FalaAI::CreateWebhookRequest](docs/CreateWebhookRequest.md)
167
- - [FalaAI::DiagnosticAnalysisMap](docs/DiagnosticAnalysisMap.md)
168
- - [FalaAI::DiagnosticAudioEvent](docs/DiagnosticAudioEvent.md)
169
- - [FalaAI::DiagnosticCategoricalAnalysis](docs/DiagnosticCategoricalAnalysis.md)
170
- - [FalaAI::DiagnosticRequest](docs/DiagnosticRequest.md)
171
- - [FalaAI::DiagnosticResponse](docs/DiagnosticResponse.md)
172
- - [FalaAI::DiagnosticTextAnalysis](docs/DiagnosticTextAnalysis.md)
173
- - [FalaAI::DiagnosticUsage](docs/DiagnosticUsage.md)
174
- - [FalaAI::EmailAlertItem](docs/EmailAlertItem.md)
175
- - [FalaAI::EmailAlertListResponse](docs/EmailAlertListResponse.md)
176
- - [FalaAI::EmailAlertMessageResponse](docs/EmailAlertMessageResponse.md)
177
- - [FalaAI::EmailEvent](docs/EmailEvent.md)
178
- - [FalaAI::HTTPValidationError](docs/HTTPValidationError.md)
179
- - [FalaAI::HealthResponse](docs/HealthResponse.md)
180
- - [FalaAI::LocationInner](docs/LocationInner.md)
181
- - [FalaAI::MessageResponse](docs/MessageResponse.md)
182
- - [FalaAI::Participant](docs/Participant.md)
183
- - [FalaAI::ParticipantDiagnostic](docs/ParticipantDiagnostic.md)
184
- - [FalaAI::TranscriptionResponse](docs/TranscriptionResponse.md)
185
- - [FalaAI::TranscriptionUsage](docs/TranscriptionUsage.md)
186
- - [FalaAI::UpdateEmailAlertRequest](docs/UpdateEmailAlertRequest.md)
187
- - [FalaAI::UpdateWebhookRequest](docs/UpdateWebhookRequest.md)
188
- - [FalaAI::UsageByKeyItem](docs/UsageByKeyItem.md)
189
- - [FalaAI::UsageLogItem](docs/UsageLogItem.md)
190
- - [FalaAI::UsageLogResponse](docs/UsageLogResponse.md)
191
- - [FalaAI::ValidationError](docs/ValidationError.md)
192
- - [FalaAI::VersionResponse](docs/VersionResponse.md)
193
- - [FalaAI::WebhookEvent](docs/WebhookEvent.md)
194
- - [FalaAI::WebhookItem](docs/WebhookItem.md)
195
- - [FalaAI::WebhookListResponse](docs/WebhookListResponse.md)
196
-
197
-
198
- ## Documentation for Authorization
199
-
200
-
201
- Authentication schemes defined for the API:
202
- ### ApiKeyAuth
203
-
204
- - **Type**: Bearer authentication (fai_xxx)
205
-
1
+ # FalaAI API Ruby SDK - Speech-to-Text, Call Analytics & Compliance Audit
2
+
3
+ [![version](https://img.shields.io/gem/v/falaai-api)](https://rubygems.org/gems/falaai-api)
4
+ [![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/ActionTecBr/falaai-api-ruby/blob/main/LICENSE)
5
+ [![build](https://github.com/ActionTecBr/falaai-api-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/ActionTecBr/falaai-api-ruby/actions/workflows/ci.yml)
6
+
7
+ Official Ruby SDK for the **FalaAI API** - call transcription, conversation intelligence and compliance auditing (**COPC CX**, **ISO 18295-1**).
8
+
9
+ ## What is FalaAI API?
10
+
11
+ FalaAI API turns conversations into auditable business intelligence, in three steps:
12
+
13
+ 1. **Transcribe** - audio (calls, voice notes, meetings) to text, with speaker separation.
14
+ 2. **Diagnose** - summary, reason, recommended action, topic and sentiment per conversation.
15
+ 3. **Audit compliance** - risk score and violations against **COPC CX** and **ISO 18295-1**.
16
+
17
+ It works with **phone calls and call recordings** (PABX IP, Asterisk, FreePBX, contact center),
18
+ **messaging** (WhatsApp, Telegram, web chat, SMS) and email - anything that can be turned into
19
+ text. Three core endpoints (plus health, usage, webhooks and email alerts), one API key, no setup.
20
+
21
+ ## Who it's for
22
+
23
+ | Role | What they get |
24
+ | --- | --- |
25
+ | **Contact Center / Quality** | Audit 100% of conversations instead of a sample |
26
+ | **Compliance / Legal** | Forensic, auditable evidence for audits and disputes |
27
+ | **CX / Operations** | Risk score, sentiment and reason for every conversation |
28
+ | **Developers** | One typed SDK, three core endpoints, one API key |
29
+ | **Data / BI** | Clean, typed JSON ready for your database or BI tool |
30
+
31
+ ## Install
32
+
33
+ ```bash
34
+ gem install falaai-api
35
+ ```
36
+
37
+ ## Quick start
38
+
39
+ ```ruby
40
+ require "falaai-api"
41
+
42
+ config = FalaAI::Configuration.new
43
+ config.scheme = "https"
44
+ config.host = "api01-falaai.action.tec.br"
45
+ config.access_token = "fai_xxxxxx"
46
+
47
+ client = FalaAI::ApiClient.new(config)
48
+ speech = FalaAI::SpeechApi.new(client)
49
+
50
+ response, status = speech.create_transcription_v1_audio_transcriptions_post_with_http_info(
51
+ File.open("call.mp3"),
52
+ model: "falaai-transcribe-1", language: "pt"
53
+ )
54
+
55
+ puts response.text
56
+ ```
57
+
58
+ ## Request and response examples
59
+
60
+ Real requests and responses, captured against the live API.
61
+
62
+ ### Health
63
+
64
+ **Request**
65
+
66
+ ```bash
67
+ curl https://api01-falaai.action.tec.br/v1/health \
68
+ -H "Authorization: Bearer fai_xxxxxx"
69
+ ```
70
+
71
+ **Response**
72
+
73
+ ```json
74
+ {
75
+ "status": "ok",
76
+ "version": "api_v1.21.47",
77
+ "uptime_seconds": 92855,
78
+ "database": true,
79
+ "phase": "production",
80
+ "launch_date": "2026-08-01"
81
+ }
82
+ ```
83
+
84
+ ### Transcribe
85
+
86
+ **Response** (the request is in [Quick start](#quick-start))
87
+
88
+ ```json
89
+ {
90
+ "id": "tr-a38a97d0-452e-4519-b6bb-3c63694bf7ae",
91
+ "object": "transcription",
92
+ "model": "falaai-transcribe-1",
93
+ "filename": "analise_25s.mp3",
94
+ "processed_at": "2026-09-23T17:42:54.242449+00:00",
95
+ "usage": {
96
+ "audio_seconds": 25.0,
97
+ "credits_consumed": 25,
98
+ "processing_ms": 951
99
+ },
100
+ "language": "por",
101
+ "duration_seconds": 25.0,
102
+ "text": "Novatechno tudo, bom dia. Bom dia, Mateus. Tudo bem? Bem e você? Tudo bem. Não tem nada no sistema. Eu queria ver se de ...",
103
+ "dialog": "Speaker 1: [00:00:01.639 - 00:00:02.560] Novatechno tudo, bom dia.\nSpeaker 2: [00:00:02.980 - 00:00:03.980] Bom dia, Mateus. Tudo bem?\nSpeaker 1: [00:00:04.700 - 00:00:05.179] Bem e você?\nSpeaker 2: [ ...",
104
+ "audio_events": [
105
+ {
106
+ "event": "[tosse]",
107
+ "start_s": 22.06,
108
+ "end_s": 22.44,
109
+ "duration_s": 0.38,
110
+ "formatted_timestamp": "00:00:22.059"
111
+ }
112
+ ],
113
+ "event_types": [
114
+ "[tosse]"
115
+ ],
116
+ "word_count": 129,
117
+ "input": {
118
+ "duration_s": 25.2,
119
+ "original_format": "mp3",
120
+ "codec": "mp3",
121
+ "sample_rate": 8000,
122
+ "channels": 1
123
+ },
124
+ "language_confidence": 1.0,
125
+ "client_reference_id": "readme-example"
126
+ }
127
+ ```
128
+
129
+ ### Diagnose
130
+
131
+ **Request**
132
+
133
+ ```bash
134
+ curl https://api01-falaai.action.tec.br/v1/analyze/diagnostic \
135
+ -H "Authorization: Bearer fai_xxxxxx" \
136
+ -H "Content-Type: application/json" \
137
+ -d '{"dialog": "<transcription dialog>", "language": "pt-BR", "duration_seconds": 25.0}'
138
+ ```
139
+
140
+ **Response**
141
+
142
+ ```json
143
+ {
144
+ "id": "di-15c79d7c-7245-4af4-9a4e-ead237c1a6ed",
145
+ "response_language": "pt-BR",
146
+ "object": "analysis",
147
+ "analysis": {
148
+ "dialogue_summary": {
149
+ "explanation": "O cliente (Speaker 2) contatou a Novatechno (Speaker 1) para obter informações sobre um produto (código 4675005) que saiu de linha. O cliente já realizou uma pe ..."
150
+ },
151
+ "contact_reason": {
152
+ "explanation": "O cliente busca informação sobre qual produto substituiu o código 4675005, que saiu de linha."
153
+ },
154
+ "identified_action": {
155
+ "list_choice": "Sem Ação",
156
+ "justification": "O cliente buscou informações sobre um produto que saiu de linha, mas a conversa terminou sem uma ação definida ou resolução.",
157
+ "evidence_phrases": [
158
+ "Novatechno tudo, bom dia.",
159
+ "Bom dia, Mateus. Tudo bem?",
160
+ "Tudo bem. Não tem nada no sistema. Eu queria ver se de repente você tem alguma informação.",
161
+ "Quatro meia sete cinco zero zero cinco saiu de linha. Ééé, eu procurei no Google ver se o que entrou no lugar. Aí ele fala"
162
+ ]
163
+ },
164
+ "identified_label": {
165
+ "list_choice": "Pedido de Informação",
166
+ "justification": "O cliente busca informações sobre um produto que saiu de linha, perguntando o que o substituiu, indicando uma necessidade de dados.",
167
+ "evidence_phrases": [
168
+ "Não tem nada no sistema. Eu queria ver se de repente você tem alguma informação.",
169
+ "É, o produto, posso te falar o código?",
170
+ ... (truncated)
171
+ ```
172
+
173
+ ### Audit compliance
174
+
175
+ **Request**
176
+
177
+ ```bash
178
+ curl https://api01-falaai.action.tec.br/v1/analyze/auditoriaRisco \
179
+ -H "Authorization: Bearer fai_xxxxxx" \
180
+ -H "Content-Type: application/json" \
181
+ -d '{"dialog": "<transcription dialog>", "language": "pt-BR", "duration_seconds": 25.0, "response_format": "v2"}'
182
+ ```
183
+
184
+ **Response**
185
+
186
+ ```json
187
+ {
188
+ "response": {
189
+ "meta": {
190
+ "id": "ar-3439fd5f-1932-4ebe-bfb5-944ec1046e60",
191
+ "usage": {
192
+ "characters": 378,
193
+ "credits_consumed": 90,
194
+ "processing_ms": 6534
195
+ },
196
+ "object": "auditoria_risco",
197
+ "call_duration_s": 25.0,
198
+ "analyzed_at": "2026-09-23T17:43:02.092299",
199
+ "client_reference_id": "readme-example"
200
+ },
201
+ "participants": {
202
+ "identified": [
203
+ {
204
+ "confidence": "high",
205
+ "source": "input",
206
+ "evidence": "fornecido pelo input",
207
+ "interlocutor": "Speaker 1",
208
+ "name": "Mateus",
209
+ "role": "agent"
210
+ },
211
+ {
212
+ "confidence": "high",
213
+ "source": "input",
214
+ "evidence": "fornecido pelo input",
215
+ "interlocutor": "Speaker 2",
216
+ "name": "Cliente",
217
+ "role": "client"
218
+ }
219
+ ],
220
+ "call_direction": "inbound",
221
+ "role_inference_reliable": true,
222
+ "identification_status": "input",
223
+ "unidentified_items_count": 0
224
+ },
225
+ "verdict": {
226
+ "label": "Limpa",
227
+ "level_code": "LIMPA",
228
+ "color": "#4fff4d",
229
+ "icon": "mdi:check-circle",
230
+ "risk_matrix": {
231
+ "severity": "NOTE",
232
+ "likelihood_avg": 0.0,
233
+ "impact_avg": 0.0,
234
+ "likelihood_level": "LOW",
235
+ "impact_level": "LOW"
236
+ },
237
+ "applied_actions": [
238
+ {
239
+ "action_type": "nenhuma_acao",
240
+ "label": "Nenhuma Acao",
241
+ "description": "Nenhuma acao necessaria. A chamada nao apresentou deteccoes que exijam intervencao. Continuar monitoramento de rotina.",
242
+ "priority": "BAIXO",
243
+ "color": "#6B7280",
244
+ "icon": "mdi:check-circle-outline",
245
+ "condition": "sempre",
246
+ "reason": "condição=sempre"
247
+ }
248
+ ],
249
+ ... (truncated)
250
+ ```
251
+
252
+ ### The forensic HTML report
253
+
254
+ The audit response carries **`response.html_report`** - the complete **forensic report as HTML**, encoded as a **base64 gzip** string (~19 KB). Decode it and open in a browser (or convert to PDF) to get the auditable evidence: timeline, audio events (MAC/MVAD/MOD), violations against **COPC CX** and **ISO 18295-1**, and the executive verdict.
255
+
256
+ ```python
257
+ import base64, gzip, json, httpx
258
+
259
+ res = httpx.post(
260
+ "https://api01-falaai.action.tec.br/v1/analyze/auditoriaRisco",
261
+ headers={"Authorization": "Bearer fai_xxxxxx"},
262
+ json={"dialog": dialog, "language": "pt-BR", "duration_seconds": 25.0, "response_format": "v2"},
263
+ timeout=900,
264
+ ).json()
265
+
266
+ html = gzip.decompress(base64.b64decode(res["response"]["html_report"])).decode("utf-8")
267
+ open("report.html", "w", encoding="utf-8").write(html)
268
+ ```
269
+
270
+ ## Use cases
271
+
272
+ - Call and voice-note **transcription** with speaker separation
273
+ - **Contact center quality assurance (QA)** automation
274
+ - **Compliance auditing** against **COPC CX** and **ISO 18295-1**
275
+ - **Risk detection** - churn risk, legal threats, escalation
276
+ - **WhatsApp, Telegram and chat** conversation analysis
277
+ - **CRM and help desk** enrichment
278
+ - **Call analytics** and **speech-to-text** at scale - every call transcribed and scored
279
+ - **Conversation intelligence** - summary, reason, action, topic and **sentiment analysis** per conversation
280
+ - **Speaker diarization** (speaker separation) on stereo or mono audio
281
+ - **Quality monitoring** and **agent performance** - audit 100% instead of a sample
282
+ - Built from a single **OpenAPI** contract, so all SDKs stay in sync
283
+ - **LGPD**-aware handling of customer conversations
284
+
285
+ ## Where it fits
286
+
287
+ Plugs into **omnichannel service platforms**, **help desks**, **chatbots** and **unified messaging** - anywhere a conversation becomes text.
288
+
289
+ Common Ruby stacks in contact center, CRM and help desk - if you build on any of these, the SDK drops in:
290
+
291
+ Chatwoot - Zendesk Support - Discourse - Fat Free CRM
292
+
293
+ > Product names are trademarks of their respective owners, listed as common stacks in this ecosystem. No partnership is implied.
294
+
295
+ ## Endpoints
296
+
297
+ | Method | Path | Description |
298
+ | --- | --- | --- |
299
+ | `POST` | `/v1/audio/transcriptions` | Audio to text, with speaker separation |
300
+ | `POST` | `/v1/analyze/diagnostic` | Conversation analysis - summary, reason, action, topic, sentiment |
301
+ | `POST` | `/v1/analyze/auditoriaRisco` | Compliance audit - risk score and violations |
302
+ | `GET` | `/v1/health` | Service health check (public) |
303
+
304
+ All endpoints require `Authorization: Bearer fai_xxxxxx`.
305
+ Full reference: <https://api01-falaai.action.tec.br/docs>
306
+ Other operations: usage logs, webhooks and email alerts - see the full reference.
307
+
308
+ ## Links
309
+
310
+ - **Product:** <https://falaai.action.tec.br/api>
311
+ - **API reference:** <https://api01-falaai.action.tec.br/docs>
312
+ - **Get an API key:** <https://falaai.action.tec.br/api/auth>
313
+ - **Package (RubyGems):** <https://rubygems.org/gems/falaai-api>
314
+ - **Source:** <https://github.com/ActionTecBr/falaai-api-ruby>
315
+
316
+ ## Other official SDKs
317
+
318
+ | Language | Install | Package |
319
+ | --- | --- | --- |
320
+ | **Python** | `pip install falaai-api` | [PyPI](https://pypi.org/project/falaai-api/) |
321
+ | **Node.js / TypeScript** | `npm install falaai-api` | [npm](https://www.npmjs.com/package/falaai-api) |
322
+ | **PHP** | `composer require actiontecbr/falaai-api` | [Packagist](https://packagist.org/packages/actiontecbr/falaai-api) |
323
+ | **Go** | `go get github.com/actiontecbr/falaai-api` | [pkg.go.dev](https://pkg.go.dev/github.com/actiontecbr/falaai-api) |
324
+ | **Ruby** | `gem install falaai-api` | [RubyGems](https://rubygems.org/gems/falaai-api) |
325
+ | **Java** | `io.github.actiontecbr:falaai-api` | [Maven Central](https://central.sonatype.com/artifact/io.github.actiontecbr/falaai-api) |
326
+ | **.NET / C#** | `dotnet add package FalaAI.Api` | [NuGet](https://www.nuget.org/packages/FalaAI.Api) |
327
+
328
+ ## Requirements, support and more
329
+
330
+ - **Requirements:** an API key (`fai_...`) and a runtime able to upload audio files.
331
+ - **Documentation:** <https://api01-falaai.action.tec.br/docs>
332
+ - **Support:** open an issue in this repository.
333
+ - **Security:** responsible disclosure policy in [SECURITY.md](SECURITY.md).
334
+ - **Contributing:** see [CONTRIBUTING.md](CONTRIBUTING.md) · [Code of Conduct](CODE_OF_CONDUCT.md).
335
+ - **Changelog:** see [CHANGELOG.md](CHANGELOG.md).
336
+
337
+ ## License
338
+
339
+ MIT (c) 2026 Action Tec Br - see [LICENSE](LICENSE).
data/docs/AnalysisApi.md CHANGED
@@ -14,7 +14,7 @@ All URIs are relative to *http://localhost*
14
14
 
15
15
  Compliance Risk Audit — conversation compliance analysis
16
16
 
17
- 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\" }' ```
17
+ 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://api01-falaai.action.tec.br/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://api01-falaai.action.tec.br/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\" }' ```
18
18
 
19
19
  ### Examples
20
20
 
@@ -83,7 +83,7 @@ end
83
83
 
84
84
  Analyze a call transcript — 5 parallel analyses
85
85
 
86
- 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 }' ```
86
+ 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://api01-falaai.action.tec.br/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://api01-falaai.action.tec.br/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 }' ```
87
87
 
88
88
  ### Examples
89
89
 
@@ -7,6 +7,9 @@
7
7
  | **interlocutor** | **String** | Speaker label | [optional] |
8
8
  | **name** | **String** | Participant name | [optional] |
9
9
  | **role** | **String** | Role (agent/client/bot/unknown) | [optional] |
10
+ | **confidence** | **String** | Role inference confidence (high/medium/low) | [optional] |
11
+ | **source** | **String** | Role source (input/inferred) | [optional] |
12
+ | **evidence** | **String** | Role inference evidence | [optional] |
10
13
 
11
14
  ## Example
12
15
 
@@ -16,7 +19,10 @@ require 'falaai-api'
16
19
  instance = FalaAI::AuditoriaRiscoParticipantV2.new(
17
20
  interlocutor: null,
18
21
  name: null,
19
- role: null
22
+ role: null,
23
+ confidence: null,
24
+ source: null,
25
+ evidence: null
20
26
  )
21
27
  ```
22
28
 
data/docs/SpeechApi.md CHANGED
@@ -13,7 +13,7 @@ All URIs are relative to *http://localhost*
13
13
 
14
14
  Transcribe audio to text
15
15
 
16
- 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' ```
16
+ 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://api01-falaai.action.tec.br/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://api01-falaai.action.tec.br/v1/audio/transcriptions \\ -H 'Authorization: Bearer fai_xxx' \\ -F 'file=@call.mp3' \\ -F 'model=falaai-transcribe-1' \\ -F 'language=pt' ```
17
17
 
18
18
  ### Examples
19
19