falaai-api 1.21.47 → 1.21.49
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 +4 -4
- data/README.md +202 -168
- data/docs/AnalysisApi.md +33 -37
- data/docs/AudioEvent.md +5 -5
- data/docs/AudioInputMeta.md +5 -5
- data/docs/CreateEmailAlertRequest.md +3 -3
- data/docs/CreateWebhookRequest.md +4 -4
- data/docs/DiagnosticAudioEvent.md +5 -5
- data/docs/DiagnosticCategoricalAnalysis.md +3 -3
- data/docs/DiagnosticParticipant.md +22 -0
- data/docs/DiagnosticRequest.md +10 -4
- data/docs/DiagnosticResponse.md +4 -4
- data/docs/DiagnosticTextAnalysis.md +1 -1
- data/docs/DiagnosticUsage.md +3 -3
- data/docs/EmailAlertsApi.md +18 -18
- data/docs/HealthApi.md +3 -13
- data/docs/HealthResponse.md +6 -6
- data/docs/Participant.md +2 -2
- data/docs/ParticipantDiagnostic.md +5 -5
- data/docs/{AuditoriaRiscoAnalysisV2.md → RiskAuditAnalysisV2.md} +2 -2
- data/docs/{AuditoriaRiscoAppliedActionV2.md → RiskAuditAppliedActionV2.md} +2 -2
- data/docs/{AuditoriaRiscoAudioEventModelV2.md → RiskAuditAudioEventModelV2.md} +2 -2
- data/docs/{AuditoriaRiscoAuditDecisionsV2.md → RiskAuditAuditDecisionsV2.md} +2 -2
- data/docs/{AuditoriaRiscoConversationScoresV2.md → RiskAuditConversationScoresV2.md} +2 -2
- data/docs/{AuditoriaRiscoDetectionItemV2.md → RiskAuditDetectionItemV2.md} +2 -2
- data/docs/RiskAuditDetectionsV2.md +26 -0
- data/docs/{AuditoriaRiscoIndexerV2.md → RiskAuditIndexerV2.md} +2 -2
- data/docs/{AuditoriaRiscoMetaV2.md → RiskAuditMetaV2.md} +4 -4
- data/docs/RiskAuditParticipantV2.md +28 -0
- data/docs/{AuditoriaRiscoParticipantsV2.md → RiskAuditParticipantsV2.md} +3 -3
- data/docs/{AuditoriaRiscoRequest.md → RiskAuditRequest.md} +12 -12
- data/docs/{AuditoriaRiscoScoresV2.md → RiskAuditScoresV2.md} +3 -3
- data/docs/{AuditoriaRiscoScoringExplanationV2.md → RiskAuditScoringExplanationV2.md} +2 -2
- data/docs/{AuditoriaRiscoSummaryV2.md → RiskAuditSummaryV2.md} +2 -2
- data/docs/{AuditoriaRiscoTimelineV2.md → RiskAuditTimelineV2.md} +2 -2
- data/docs/{AuditoriaRiscoUsageV2.md → RiskAuditUsageV2.md} +2 -2
- data/docs/RiskAuditV2.md +46 -0
- data/docs/RiskAuditV2Response.md +18 -0
- data/docs/{AuditoriaRiscoVerdictV2.md → RiskAuditVerdictV2.md} +3 -3
- data/docs/SpeechApi.md +1 -3
- data/docs/TranscriptionResponse.md +13 -14
- data/docs/TranscriptionUsage.md +3 -3
- data/docs/UpdateWebhookRequest.md +5 -5
- data/docs/UsageApi.md +1 -1
- data/docs/VersionApi.md +2 -7
- data/docs/VersionResponse.md +3 -3
- data/docs/WebhooksApi.md +22 -22
- data/docs/index.html +758 -0
- data/lib/falaai-api/api/analysis_api.rb +38 -42
- data/lib/falaai-api/api/email_alerts_api.rb +10 -10
- data/lib/falaai-api/api/health_api.rb +4 -4
- data/lib/falaai-api/api/speech_api.rb +2 -4
- data/lib/falaai-api/api/usage_api.rb +2 -2
- data/lib/falaai-api/api/version_api.rb +3 -3
- data/lib/falaai-api/api/webhooks_api.rb +18 -18
- data/lib/falaai-api/api_client.rb +2 -2
- data/lib/falaai-api/api_error.rb +2 -2
- data/lib/falaai-api/api_model_base.rb +2 -2
- data/lib/falaai-api/configuration.rb +6 -6
- data/lib/falaai-api/models/audio_event.rb +2 -2
- data/lib/falaai-api/models/audio_input_meta.rb +2 -2
- data/lib/falaai-api/models/create_email_alert_request.rb +2 -2
- data/lib/falaai-api/models/create_webhook_request.rb +2 -2
- data/lib/falaai-api/models/diagnostic_analysis_map.rb +2 -2
- data/lib/falaai-api/models/diagnostic_audio_event.rb +2 -2
- data/lib/falaai-api/models/diagnostic_categorical_analysis.rb +2 -2
- data/lib/falaai-api/models/diagnostic_participant.rb +226 -0
- data/lib/falaai-api/models/diagnostic_request.rb +91 -6
- data/lib/falaai-api/models/diagnostic_response.rb +2 -2
- data/lib/falaai-api/models/diagnostic_text_analysis.rb +2 -2
- data/lib/falaai-api/models/diagnostic_usage.rb +2 -2
- data/lib/falaai-api/models/email_alert_item.rb +2 -2
- data/lib/falaai-api/models/email_alert_list_response.rb +2 -2
- data/lib/falaai-api/models/email_alert_message_response.rb +2 -2
- data/lib/falaai-api/models/email_event.rb +2 -2
- data/lib/falaai-api/models/health_response.rb +2 -2
- data/lib/falaai-api/models/http_validation_error.rb +2 -2
- data/lib/falaai-api/models/location_inner.rb +2 -2
- data/lib/falaai-api/models/message_response.rb +2 -2
- data/lib/falaai-api/models/participant.rb +2 -2
- data/lib/falaai-api/models/participant_diagnostic.rb +2 -2
- data/lib/falaai-api/models/{auditoria_risco_analysis_v2.rb → risk_audit_analysis_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_applied_action_v2.rb → risk_audit_applied_action_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_audio_event_model_v2.rb → risk_audit_audio_event_model_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_audit_decisions_v2.rb → risk_audit_audit_decisions_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_conversation_scores_v2.rb → risk_audit_conversation_scores_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_detection_item_v2.rb → risk_audit_detection_item_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_detections_v2.rb → risk_audit_detections_v2.rb} +8 -8
- data/lib/falaai-api/models/{auditoria_risco_indexer_v2.rb → risk_audit_indexer_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_meta_v2.rb → risk_audit_meta_v2.rb} +7 -7
- data/lib/falaai-api/models/{auditoria_risco_participant_v2.rb → risk_audit_participant_v2.rb} +39 -9
- data/lib/falaai-api/models/{auditoria_risco_participants_v2.rb → risk_audit_participants_v2.rb} +6 -6
- data/lib/falaai-api/models/{auditoria_risco_request.rb → risk_audit_request.rb} +8 -8
- data/lib/falaai-api/models/{auditoria_risco_scores_v2.rb → risk_audit_scores_v2.rb} +6 -6
- data/lib/falaai-api/models/{auditoria_risco_scoring_explanation_v2.rb → risk_audit_scoring_explanation_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_summary_v2.rb → risk_audit_summary_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_timeline_v2.rb → risk_audit_timeline_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_usage_v2.rb → risk_audit_usage_v2.rb} +5 -5
- data/lib/falaai-api/models/{auditoria_risco_v2.rb → risk_audit_v2.rb} +35 -35
- data/lib/falaai-api/models/{auditoria_risco_v2_response.rb → risk_audit_v2_response.rb} +7 -7
- data/lib/falaai-api/models/{auditoria_risco_verdict_v2.rb → risk_audit_verdict_v2.rb} +6 -6
- data/lib/falaai-api/models/transcription_response.rb +2 -2
- data/lib/falaai-api/models/transcription_usage.rb +2 -2
- data/lib/falaai-api/models/update_email_alert_request.rb +2 -2
- data/lib/falaai-api/models/update_webhook_request.rb +2 -2
- data/lib/falaai-api/models/usage_by_key_item.rb +2 -2
- data/lib/falaai-api/models/usage_log_item.rb +2 -2
- data/lib/falaai-api/models/usage_log_response.rb +2 -2
- data/lib/falaai-api/models/validation_error.rb +2 -2
- data/lib/falaai-api/models/version_response.rb +2 -2
- data/lib/falaai-api/models/webhook_event.rb +2 -2
- data/lib/falaai-api/models/webhook_item.rb +2 -2
- data/lib/falaai-api/models/webhook_list_response.rb +2 -2
- data/lib/falaai-api/version.rb +3 -3
- data/lib/falaai-api.rb +23 -22
- metadata +47 -44
- data/docs/AuditoriaRiscoDetectionsV2.md +0 -26
- data/docs/AuditoriaRiscoParticipantV2.md +0 -22
- data/docs/AuditoriaRiscoV2.md +0 -46
- data/docs/AuditoriaRiscoV2Response.md +0 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd424a4222684b15b8858c2545873748ae0186905e13df8b87edb5b9cc7a0176
|
|
4
|
+
data.tar.gz: 36d4614309d8ddeaa0b647fb7a9f141a4ed102fbb7761faafa8b3fb106e3cb54
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4eab457d32570575ae15027dd0e4499330d3aeb7fc6447bc67674c5ace493a6aca993c590155b596efae744bfdb65079f2f631f745bd14e1898e86b61c673926
|
|
7
|
+
data.tar.gz: da26196663d8efa3e9f4fa79d124739c698ca455187fd84e510fc6a0c08a41581d7b691cc07595f711a2f95c24cfc71932da0bd9af1a3a3b077a0b4d97757b30
|
data/README.md
CHANGED
|
@@ -1,205 +1,239 @@
|
|
|
1
|
-
# falaai-api
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
```
|
|
1
|
+
# falaai-api — Ruby SDK for Conversation Intelligence, Speech Analytics & Compliance
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/falaai-api)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://github.com/ActionTecBr/falaai-api-ruby/actions/workflows/ci.yml)
|
|
6
|
+
[](https://actiontecbr.github.io/falaai-api-ruby/)
|
|
38
7
|
|
|
39
|
-
**
|
|
8
|
+
Official **Ruby SDK** for the **FalaAI API** — transcribe audio, analyze conversations and audit compliance (COPC CX, ISO 18295-1). **Use each API independently or combine them into your own pipeline.**
|
|
40
9
|
|
|
41
|
-
Get
|
|
10
|
+
> Analyze calls, contact-center recordings, voice notes, chat and email. Get speaker-separated transcripts, summaries, reasons, actions, sentiment and a **compliance risk score**.
|
|
42
11
|
|
|
43
|
-
|
|
12
|
+
## Use any FalaAI API independently
|
|
44
13
|
|
|
45
|
-
|
|
46
|
-
- Package version: 1.0.0
|
|
47
|
-
- Generator version: 7.25.0
|
|
48
|
-
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
|
14
|
+
FalaAI is a set of **independent REST APIs**. You **do not** need FalaAI Transcription to use FalaAI analysis or compliance auditing. If your application already has a transcript, send that text straight to the analysis APIs.
|
|
49
15
|
|
|
50
|
-
|
|
16
|
+
| If you have... | Use |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Audio but no transcript | `FalaAI::SpeechApi` — Transcription |
|
|
19
|
+
| An existing transcript | `FalaAI::AnalysisApi` — Diagnostic |
|
|
20
|
+
| A transcript needing compliance analysis | `FalaAI::AnalysisApi` — Risk Audit |
|
|
21
|
+
| An existing transcript needing both | Diagnostic + Risk Audit |
|
|
22
|
+
| Your own STT provider (Whisper, Deepgram...) | Skip FalaAI Transcription |
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
Your STT -> FalaAI Diagnostic -> FalaAI Risk Audit
|
|
26
|
+
Telegram voice -> your STT -> FalaAI Risk Audit
|
|
27
|
+
3CX / Asterisk / Genesys transcript -> FalaAI Diagnostic -> FalaAI Risk Audit
|
|
28
|
+
CRM conversation -> FalaAI Risk Audit
|
|
29
|
+
```
|
|
51
30
|
|
|
52
|
-
|
|
31
|
+
## Use the APIs the way you want
|
|
53
32
|
|
|
54
|
-
|
|
33
|
+
Every FalaAI API is **independent and optional** — chain any subset, in any combination.
|
|
55
34
|
|
|
56
|
-
```
|
|
57
|
-
|
|
35
|
+
```mermaid
|
|
36
|
+
flowchart LR
|
|
37
|
+
A["Audio"] -.->|optional| T["Transcribe"]
|
|
38
|
+
T --> X["Text / dialog"]
|
|
39
|
+
S["Your own STT / CRM / chat / existing transcript"] --> X
|
|
40
|
+
X -.->|optional| D["Diagnostic"]
|
|
41
|
+
X -.->|optional| R["Risk Audit"]
|
|
42
|
+
D --> O["Structured intelligence + auditable report"]
|
|
43
|
+
R --> O
|
|
58
44
|
```
|
|
59
45
|
|
|
60
|
-
|
|
46
|
+
> Skip **Transcribe** if you already have text. Call only **Diagnostic**, only **Risk Audit**, or both.
|
|
61
47
|
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
gem install falaai-api
|
|
64
52
|
```
|
|
65
53
|
|
|
66
|
-
|
|
54
|
+
Requires **Ruby 2.7+**.
|
|
67
55
|
|
|
68
|
-
|
|
56
|
+
## Quickstart
|
|
69
57
|
|
|
70
|
-
|
|
58
|
+
### 1. Get an API key
|
|
59
|
+
Create a free account and copy your `fai_` key: <https://falaai.action.tec.br/api/auth> (or the [Dashboard](https://falaai.action.tec.br/api/dashboard)).
|
|
71
60
|
|
|
72
|
-
|
|
61
|
+
### 2. Set environment variables
|
|
73
62
|
|
|
74
|
-
|
|
63
|
+
```bash
|
|
64
|
+
FALAAI_BASE_URL=https://api01-falaai.action.tec.br
|
|
65
|
+
FALAAI_API_KEY=fai_xxxxxxxx
|
|
66
|
+
```
|
|
75
67
|
|
|
76
|
-
|
|
68
|
+
### 3. Transcribe a call (audio -> text)
|
|
77
69
|
|
|
78
|
-
|
|
70
|
+
```ruby
|
|
71
|
+
require 'falaai-api'
|
|
72
|
+
|
|
73
|
+
config = FalaAI::Configuration.new
|
|
74
|
+
config.host = ENV.fetch('FALAAI_BASE_URL', 'https://api01-falaai.action.tec.br')
|
|
75
|
+
config.access_token = ENV['FALAAI_API_KEY']
|
|
76
|
+
client = FalaAI::ApiClient.new(config)
|
|
79
77
|
|
|
80
|
-
|
|
78
|
+
transcription, _status = FalaAI::SpeechApi.new(client).create_transcription_v1_audio_transcriptions_post_with_http_info(
|
|
79
|
+
File.open('call.mp3'),
|
|
80
|
+
{ model: 'falaai-transcribe-1', language: 'pt', client_reference_id: 'call_202609271408' }
|
|
81
|
+
)
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
puts JSON.pretty_generate(transcription)
|
|
84
|
+
```
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
Expected response (abridged):
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"id": "tr-...",
|
|
91
|
+
"object": "transcription",
|
|
92
|
+
"model": "falaai-transcribe-1",
|
|
93
|
+
"language": "por",
|
|
94
|
+
"duration_seconds": 25.0,
|
|
95
|
+
"text": "...",
|
|
96
|
+
"dialog": "Speaker 1: [...] ...",
|
|
97
|
+
"usage": { "audio_seconds": 25.0, "credits_consumed": 25, "processing_ms": 951 }
|
|
98
|
+
}
|
|
86
99
|
```
|
|
87
100
|
|
|
88
|
-
|
|
101
|
+
> Only need analysis? **Skip step 3** and call `FalaAI::AnalysisApi` with your own transcript (use the `text` field for a plain transcript).
|
|
89
102
|
|
|
90
|
-
|
|
103
|
+
### 4. Analyze or audit an existing transcript (no transcription needed)
|
|
91
104
|
|
|
92
105
|
```ruby
|
|
93
|
-
# Load the gem
|
|
94
106
|
require 'falaai-api'
|
|
95
107
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
108
|
+
config = FalaAI::Configuration.new
|
|
109
|
+
config.host = ENV['FALAAI_BASE_URL']
|
|
110
|
+
config.access_token = ENV['FALAAI_API_KEY']
|
|
111
|
+
client = FalaAI::ApiClient.new(config)
|
|
112
|
+
analysis = FalaAI::AnalysisApi.new(client)
|
|
113
|
+
|
|
114
|
+
transcript = 'Good morning, how can I help? I need to cancel my subscription.'
|
|
115
|
+
|
|
116
|
+
# 5 analyses in one call: summary, reason, action, topic, sentiment
|
|
117
|
+
diagnostic, _status = analysis.create_diagnostic_v1_analyze_diagnostic_post_with_http_info(
|
|
118
|
+
FalaAI::DiagnosticRequest.new(text: transcript, language: 'pt-BR', duration_seconds: 81.46)
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
# Compliance risk score + violations + auditable report
|
|
122
|
+
audit, _status = analysis.create_risk_audit_v1_analyze_risk_audit_post_with_http_info(
|
|
123
|
+
FalaAI::RiskAuditRequest.new(text: transcript, language: 'pt-BR', response_language: 'pt-BR', duration_seconds: 81.46)
|
|
124
|
+
)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## What is FalaAI API?
|
|
128
|
+
|
|
129
|
+
FalaAI API is an **AI conversation-intelligence API** for analyzing customer-service, contact-center, sales, messaging and other business conversations. It combines speech-to-text (with speaker diarization and audio-event detection), conversation analysis (summary, contact reason, action taken, topic classification, sentiment) and a **compliance/risk audit** against **COPC CX** and **ISO 18295-1**. Conversation content is processed and discarded (zero-storage).
|
|
130
|
+
|
|
131
|
+
## What can you do with FalaAI?
|
|
132
|
+
|
|
133
|
+
- **Transcribe** audio to text with speaker separation and audio events.
|
|
134
|
+
- **Diagnose** a conversation: summary, reason, action taken, topic and sentiment.
|
|
135
|
+
- **Audit** conversations: compliance risk score, detections/violations and an auditable HTML report.
|
|
136
|
+
- **Track usage**, **manage webhooks** and **email alerts**, and **health/version** checks.
|
|
137
|
+
|
|
138
|
+
## Use cases
|
|
139
|
+
|
|
140
|
+
- **Contact center / Quality** — audit 100% of conversations instead of a sample.
|
|
141
|
+
- **Compliance / Legal** — auditable evidence for audits and disputes.
|
|
142
|
+
- **CX / Operations** — risk score, sentiment and reason per conversation.
|
|
143
|
+
- **BI / Data** — typed JSON ready for your database or analytics stack.
|
|
144
|
+
|
|
145
|
+
## SDK surface (Ruby)
|
|
146
|
+
|
|
147
|
+
| Class | Namespace | Purpose |
|
|
148
|
+
|---|---|---|
|
|
149
|
+
| `Configuration` | `FalaAI` | `host`, `access_token` |
|
|
150
|
+
| `ApiClient` | `FalaAI` | `FalaAI::ApiClient.new(config)` |
|
|
151
|
+
| `HealthApi` | `FalaAI` | `health_check` |
|
|
152
|
+
| `SpeechApi` | `FalaAI` | `create_transcription_v1_audio_transcriptions_post_with_http_info(...)` |
|
|
153
|
+
| `AnalysisApi` | `FalaAI` | `create_diagnostic_v1_analyze_diagnostic_post_with_http_info(...)`, `create_risk_audit_v1_analyze_risk_audit_post_with_http_info(...)` |
|
|
154
|
+
| `UsageApi` / `WebhooksApi` / `EmailAlertsApi` / `VersionApi` | `FalaAI` | management |
|
|
155
|
+
| Models | `FalaAI` | `DiagnosticRequest`, `RiskAuditRequest`, `Participant`, `DiagnosticAudioEvent` |
|
|
156
|
+
| `ApiError` | `FalaAI` | HTTP errors |
|
|
157
|
+
|
|
158
|
+
> Model IDs: `falaai-transcribe-1`, `falaai-diagnostic-1`, `falaai-risk-audit-1`.
|
|
159
|
+
|
|
160
|
+
## Examples
|
|
161
|
+
|
|
162
|
+
Runnable examples in [`examples/`](./examples): `health.rb`, `transcribe.rb`, `diagnose.rb`, `audit.rb`.
|
|
103
163
|
|
|
104
|
-
|
|
105
|
-
|
|
164
|
+
## Authentication
|
|
165
|
+
|
|
166
|
+
Every request requires `Authorization: Bearer fai_<your_key>` — except the public endpoints (`GET/HEAD /v1/health`, `GET /api/version`). Set the key with `Configuration#access_token=` (or `FALAAI_API_KEY`).
|
|
167
|
+
|
|
168
|
+
## Error handling
|
|
169
|
+
|
|
170
|
+
Non-2xx responses raise `FalaAI::ApiError`.
|
|
171
|
+
|
|
172
|
+
```ruby
|
|
173
|
+
require 'falaai-api'
|
|
106
174
|
|
|
107
175
|
begin
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
p result
|
|
176
|
+
health = FalaAI::HealthApi.new(client).health_check
|
|
177
|
+
puts health.status
|
|
111
178
|
rescue FalaAI::ApiError => e
|
|
112
|
-
|
|
179
|
+
warn "FalaAI API error: #{e.message}"
|
|
113
180
|
end
|
|
114
|
-
|
|
115
181
|
```
|
|
116
182
|
|
|
117
|
-
##
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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)
|
|
183
|
+
## Where to integrate (this SDK)
|
|
184
|
+
|
|
185
|
+
FalaAI is language-independent; this package targets **Ruby** backends.
|
|
186
|
+
|
|
187
|
+
| Platform / environment (this SDK's language: **Ruby**) | Integration |
|
|
188
|
+
|---|---|
|
|
189
|
+
| **Ruby on Rails** apps | `falaai-api` (Ruby) |
|
|
190
|
+
| Ruby workers / Sidekiq jobs | `falaai-api` (Ruby) |
|
|
191
|
+
| Ruby data pipelines | `falaai-api` (Ruby) |
|
|
192
|
+
| Other stacks (3CX, Salesforce, Genesys...) | REST / cURL — [API reference](https://api01-falaai.action.tec.br/docs) (or the SDK for that backend's language) |
|
|
193
|
+
|
|
194
|
+
> These are **integration examples**, not certified native integrations. Any platform can integrate through **REST / cURL** — see the [API reference](https://api01-falaai.action.tec.br/docs). Authenticated calls use `Authorization: Bearer fai_<key>`.
|
|
195
|
+
|
|
196
|
+
## Production usage
|
|
197
|
+
|
|
198
|
+
- Store API keys in environment variables or a secret manager — never hard-code.
|
|
199
|
+
- Reuse the `ApiClient` across requests.
|
|
200
|
+
- Handle `FalaAI::ApiError` explicitly.
|
|
201
|
+
|
|
202
|
+
## Compatibility
|
|
203
|
+
|
|
204
|
+
| Requirement | Version |
|
|
205
|
+
|---|---|
|
|
206
|
+
| Ruby | 2.7+ |
|
|
207
|
+
| API | v1.21.49 |
|
|
208
|
+
|
|
209
|
+
## Documentation
|
|
210
|
+
|
|
211
|
+
- **SDK docs (this language):** <https://actiontecbr.github.io/falaai-api-ruby/>
|
|
212
|
+
- **API reference (Swagger UI):** <https://api01-falaai.action.tec.br/docs>
|
|
213
|
+
- **OpenAPI contract:** <https://api01-falaai.action.tec.br/openapi.json>
|
|
214
|
+
- **Sandbox:** <https://falaai.action.tec.br/api#playground>
|
|
215
|
+
- **Quickstart:** <https://falaai.action.tec.br/api/quickstart>
|
|
216
|
+
- **Product page:** <https://falaai.action.tec.br/api>
|
|
217
|
+
|
|
218
|
+
## Versioning
|
|
219
|
+
|
|
220
|
+
Semantic versioning; the SDK version tracks the API version (`1.21.49`). See [CHANGELOG.md](CHANGELOG.md) and [Releases](https://github.com/ActionTecBr/falaai-api-ruby/releases).
|
|
221
|
+
|
|
222
|
+
## Security
|
|
223
|
+
|
|
224
|
+
See [SECURITY.md](SECURITY.md). Never commit real keys — use environment variables.
|
|
225
|
+
|
|
226
|
+
## Contributing
|
|
227
|
+
|
|
228
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
[MIT](LICENSE).
|
|
233
|
+
|
|
234
|
+
## Links
|
|
205
235
|
|
|
236
|
+
- Website: <https://falaai.action.tec.br>
|
|
237
|
+
- API base URL: <https://api01-falaai.action.tec.br>
|
|
238
|
+
- GitHub organization: <https://github.com/ActionTecBr>
|
|
239
|
+
- Other SDKs: Python, Node.js, PHP, Go, Java, .NET.
|
data/docs/AnalysisApi.md
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
# FalaAI::AnalysisApi
|
|
2
2
|
|
|
3
|
-
All URIs are relative to *
|
|
3
|
+
All URIs are relative to *https://api01-falaai.action.tec.br*
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
-
| [**
|
|
8
|
-
| [**
|
|
7
|
+
| [**create_diagnostic_v1_analyze_diagnostic_post**](AnalysisApi.md#create_diagnostic_v1_analyze_diagnostic_post) | **POST** /v1/analyze/diagnostic | Analyze a call transcript — 5 parallel analyses |
|
|
8
|
+
| [**create_risk_audit_v1_analyze_risk_audit_post**](AnalysisApi.md#create_risk_audit_v1_analyze_risk_audit_post) | **POST** /v1/analyze/riskAudit | Compliance Risk Audit — conversation compliance analysis |
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
> <AuditoriaRiscoV2Response> create_auditoria_risco_v1_analyze_auditoria_risco_post(auditoria_risco_request)
|
|
11
|
+
## create_diagnostic_v1_analyze_diagnostic_post
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
> <DiagnosticResponse> create_diagnostic_v1_analyze_diagnostic_post(diagnostic_request)
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
Analyze a call transcript — 5 parallel analyses
|
|
18
16
|
|
|
19
17
|
### Examples
|
|
20
18
|
|
|
@@ -28,32 +26,32 @@ FalaAI.configure do |config|
|
|
|
28
26
|
end
|
|
29
27
|
|
|
30
28
|
api_instance = FalaAI::AnalysisApi.new
|
|
31
|
-
|
|
29
|
+
diagnostic_request = FalaAI::DiagnosticRequest.new({language: 'language_example', duration_seconds: 3.56}) # DiagnosticRequest |
|
|
32
30
|
|
|
33
31
|
begin
|
|
34
|
-
#
|
|
35
|
-
result = api_instance.
|
|
32
|
+
# Analyze a call transcript — 5 parallel analyses
|
|
33
|
+
result = api_instance.create_diagnostic_v1_analyze_diagnostic_post(diagnostic_request)
|
|
36
34
|
p result
|
|
37
35
|
rescue FalaAI::ApiError => e
|
|
38
|
-
puts "Error when calling AnalysisApi->
|
|
36
|
+
puts "Error when calling AnalysisApi->create_diagnostic_v1_analyze_diagnostic_post: #{e}"
|
|
39
37
|
end
|
|
40
38
|
```
|
|
41
39
|
|
|
42
|
-
#### Using the
|
|
40
|
+
#### Using the create_diagnostic_v1_analyze_diagnostic_post_with_http_info variant
|
|
43
41
|
|
|
44
42
|
This returns an Array which contains the response data, status code and headers.
|
|
45
43
|
|
|
46
|
-
> <Array(<
|
|
44
|
+
> <Array(<DiagnosticResponse>, Integer, Hash)> create_diagnostic_v1_analyze_diagnostic_post_with_http_info(diagnostic_request)
|
|
47
45
|
|
|
48
46
|
```ruby
|
|
49
47
|
begin
|
|
50
|
-
#
|
|
51
|
-
data, status_code, headers = api_instance.
|
|
48
|
+
# Analyze a call transcript — 5 parallel analyses
|
|
49
|
+
data, status_code, headers = api_instance.create_diagnostic_v1_analyze_diagnostic_post_with_http_info(diagnostic_request)
|
|
52
50
|
p status_code # => 2xx
|
|
53
51
|
p headers # => { ... }
|
|
54
|
-
p data # => <
|
|
52
|
+
p data # => <DiagnosticResponse>
|
|
55
53
|
rescue FalaAI::ApiError => e
|
|
56
|
-
puts "Error when calling AnalysisApi->
|
|
54
|
+
puts "Error when calling AnalysisApi->create_diagnostic_v1_analyze_diagnostic_post_with_http_info: #{e}"
|
|
57
55
|
end
|
|
58
56
|
```
|
|
59
57
|
|
|
@@ -61,11 +59,11 @@ end
|
|
|
61
59
|
|
|
62
60
|
| Name | Type | Description | Notes |
|
|
63
61
|
| ---- | ---- | ----------- | ----- |
|
|
64
|
-
| **
|
|
62
|
+
| **diagnostic_request** | [**DiagnosticRequest**](DiagnosticRequest.md) | | |
|
|
65
63
|
|
|
66
64
|
### Return type
|
|
67
65
|
|
|
68
|
-
[**
|
|
66
|
+
[**DiagnosticResponse**](DiagnosticResponse.md)
|
|
69
67
|
|
|
70
68
|
### Authorization
|
|
71
69
|
|
|
@@ -77,13 +75,11 @@ end
|
|
|
77
75
|
- **Accept**: application/json
|
|
78
76
|
|
|
79
77
|
|
|
80
|
-
##
|
|
81
|
-
|
|
82
|
-
> <DiagnosticResponse> create_diagnostic_v1_analyze_diagnostic_post(diagnostic_request)
|
|
78
|
+
## create_risk_audit_v1_analyze_risk_audit_post
|
|
83
79
|
|
|
84
|
-
|
|
80
|
+
> <RiskAuditV2Response> create_risk_audit_v1_analyze_risk_audit_post(risk_audit_request)
|
|
85
81
|
|
|
86
|
-
|
|
82
|
+
Compliance Risk Audit — conversation compliance analysis
|
|
87
83
|
|
|
88
84
|
### Examples
|
|
89
85
|
|
|
@@ -97,32 +93,32 @@ FalaAI.configure do |config|
|
|
|
97
93
|
end
|
|
98
94
|
|
|
99
95
|
api_instance = FalaAI::AnalysisApi.new
|
|
100
|
-
|
|
96
|
+
risk_audit_request = FalaAI::RiskAuditRequest.new({duration_seconds: 3.56, language: 'language_example', response_language: 'response_language_example'}) # RiskAuditRequest |
|
|
101
97
|
|
|
102
98
|
begin
|
|
103
|
-
#
|
|
104
|
-
result = api_instance.
|
|
99
|
+
# Compliance Risk Audit — conversation compliance analysis
|
|
100
|
+
result = api_instance.create_risk_audit_v1_analyze_risk_audit_post(risk_audit_request)
|
|
105
101
|
p result
|
|
106
102
|
rescue FalaAI::ApiError => e
|
|
107
|
-
puts "Error when calling AnalysisApi->
|
|
103
|
+
puts "Error when calling AnalysisApi->create_risk_audit_v1_analyze_risk_audit_post: #{e}"
|
|
108
104
|
end
|
|
109
105
|
```
|
|
110
106
|
|
|
111
|
-
#### Using the
|
|
107
|
+
#### Using the create_risk_audit_v1_analyze_risk_audit_post_with_http_info variant
|
|
112
108
|
|
|
113
109
|
This returns an Array which contains the response data, status code and headers.
|
|
114
110
|
|
|
115
|
-
> <Array(<
|
|
111
|
+
> <Array(<RiskAuditV2Response>, Integer, Hash)> create_risk_audit_v1_analyze_risk_audit_post_with_http_info(risk_audit_request)
|
|
116
112
|
|
|
117
113
|
```ruby
|
|
118
114
|
begin
|
|
119
|
-
#
|
|
120
|
-
data, status_code, headers = api_instance.
|
|
115
|
+
# Compliance Risk Audit — conversation compliance analysis
|
|
116
|
+
data, status_code, headers = api_instance.create_risk_audit_v1_analyze_risk_audit_post_with_http_info(risk_audit_request)
|
|
121
117
|
p status_code # => 2xx
|
|
122
118
|
p headers # => { ... }
|
|
123
|
-
p data # => <
|
|
119
|
+
p data # => <RiskAuditV2Response>
|
|
124
120
|
rescue FalaAI::ApiError => e
|
|
125
|
-
puts "Error when calling AnalysisApi->
|
|
121
|
+
puts "Error when calling AnalysisApi->create_risk_audit_v1_analyze_risk_audit_post_with_http_info: #{e}"
|
|
126
122
|
end
|
|
127
123
|
```
|
|
128
124
|
|
|
@@ -130,11 +126,11 @@ end
|
|
|
130
126
|
|
|
131
127
|
| Name | Type | Description | Notes |
|
|
132
128
|
| ---- | ---- | ----------- | ----- |
|
|
133
|
-
| **
|
|
129
|
+
| **risk_audit_request** | [**RiskAuditRequest**](RiskAuditRequest.md) | | |
|
|
134
130
|
|
|
135
131
|
### Return type
|
|
136
132
|
|
|
137
|
-
[**
|
|
133
|
+
[**RiskAuditV2Response**](RiskAuditV2Response.md)
|
|
138
134
|
|
|
139
135
|
### Authorization
|
|
140
136
|
|
data/docs/AudioEvent.md
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
require 'falaai-api'
|
|
17
17
|
|
|
18
18
|
instance = FalaAI::AudioEvent.new(
|
|
19
|
-
event:
|
|
20
|
-
start_s:
|
|
21
|
-
end_s:
|
|
22
|
-
duration_s:
|
|
23
|
-
formatted_timestamp:
|
|
19
|
+
event: null,
|
|
20
|
+
start_s: null,
|
|
21
|
+
end_s: null,
|
|
22
|
+
duration_s: null,
|
|
23
|
+
formatted_timestamp: null
|
|
24
24
|
)
|
|
25
25
|
```
|
|
26
26
|
|
data/docs/AudioInputMeta.md
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
require 'falaai-api'
|
|
17
17
|
|
|
18
18
|
instance = FalaAI::AudioInputMeta.new(
|
|
19
|
-
duration_s:
|
|
20
|
-
original_format:
|
|
21
|
-
codec:
|
|
22
|
-
sample_rate:
|
|
23
|
-
channels:
|
|
19
|
+
duration_s: null,
|
|
20
|
+
original_format: null,
|
|
21
|
+
codec: null,
|
|
22
|
+
sample_rate: null,
|
|
23
|
+
channels: null
|
|
24
24
|
)
|
|
25
25
|
```
|
|
26
26
|
|