falaai-api 1.21.54 → 1.21.67
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 +11 -5
- data/docs/AnalysisApi.md +4 -0
- data/docs/DiagnosticUsage.md +1 -1
- data/docs/ResponseExtractConversationsV1WhatsappExtractconversationsPost.md +42 -0
- data/docs/RiskAuditAppliedActionV2.md +0 -4
- data/docs/RiskAuditAuditDecisionsV2.md +1 -3
- data/docs/RiskAuditConversationScoresV2.md +0 -2
- data/docs/RiskAuditDetectionItemV2.md +5 -75
- data/docs/RiskAuditSummaryV2.md +0 -4
- data/docs/RiskAuditUsageV2.md +1 -1
- data/docs/RiskAuditVerdictV2.md +1 -7
- data/docs/SpeechApi.md +2 -0
- data/docs/TranscriptionUsage.md +1 -1
- data/docs/WhatsappApi.md +16 -10
- data/docs/WhatsappConversation.md +1 -1
- data/docs/WhatsappMeta.md +3 -1
- data/docs/WhatsappPreviewItem.md +32 -0
- data/docs/WhatsappPreviewItemBreakdown.md +26 -0
- data/docs/WhatsappPreviewItemCredits.md +20 -0
- data/docs/WhatsappPreviewItemMedia.md +30 -0
- data/docs/WhatsappPreviewParams.md +32 -0
- data/docs/WhatsappPreviewResponse.md +32 -0
- data/docs/WhatsappPreviewWindow.md +22 -0
- data/docs/WhatsappUsage.md +11 -5
- data/docs/index.html +35 -7
- data/lib/falaai-api/api/analysis_api.rb +5 -1
- data/lib/falaai-api/api/email_alerts_api.rb +1 -1
- data/lib/falaai-api/api/health_api.rb +1 -1
- data/lib/falaai-api/api/speech_api.rb +3 -1
- data/lib/falaai-api/api/usage_api.rb +1 -1
- data/lib/falaai-api/api/version_api.rb +1 -1
- data/lib/falaai-api/api/webhooks_api.rb +1 -1
- data/lib/falaai-api/api/whatsapp_api.rb +21 -21
- data/lib/falaai-api/api_client.rb +1 -1
- data/lib/falaai-api/api_error.rb +1 -1
- data/lib/falaai-api/api_model_base.rb +1 -1
- data/lib/falaai-api/configuration.rb +1 -1
- data/lib/falaai-api/models/audio_event.rb +1 -1
- data/lib/falaai-api/models/audio_input_meta.rb +1 -1
- data/lib/falaai-api/models/create_email_alert_request.rb +1 -1
- data/lib/falaai-api/models/create_webhook_request.rb +1 -1
- data/lib/falaai-api/models/diagnostic_analysis_map.rb +1 -1
- data/lib/falaai-api/models/diagnostic_audio_event.rb +1 -1
- data/lib/falaai-api/models/diagnostic_categorical_analysis.rb +1 -1
- data/lib/falaai-api/models/diagnostic_participant.rb +1 -1
- data/lib/falaai-api/models/diagnostic_request.rb +1 -1
- data/lib/falaai-api/models/diagnostic_response.rb +1 -1
- data/lib/falaai-api/models/diagnostic_text_analysis.rb +1 -1
- data/lib/falaai-api/models/diagnostic_usage.rb +3 -3
- data/lib/falaai-api/models/email_alert_item.rb +1 -1
- data/lib/falaai-api/models/email_alert_list_response.rb +1 -1
- data/lib/falaai-api/models/email_alert_message_response.rb +1 -1
- data/lib/falaai-api/models/email_event.rb +1 -1
- data/lib/falaai-api/models/health_response.rb +1 -1
- data/lib/falaai-api/models/http_validation_error.rb +1 -1
- data/lib/falaai-api/models/location_inner.rb +1 -1
- data/lib/falaai-api/models/message_response.rb +1 -1
- data/lib/falaai-api/models/participant.rb +1 -1
- data/lib/falaai-api/models/participant_diagnostic.rb +1 -1
- data/lib/falaai-api/models/response_extract_conversations_v1_whatsapp_extractconversations_post.rb +103 -0
- data/lib/falaai-api/models/risk_audit_analysis_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_applied_action_v2.rb +2 -26
- data/lib/falaai-api/models/risk_audit_audio_event_model_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_audit_decisions_v2.rb +5 -17
- data/lib/falaai-api/models/risk_audit_conversation_scores_v2.rb +2 -12
- data/lib/falaai-api/models/risk_audit_detection_item_v2.rb +19 -393
- data/lib/falaai-api/models/risk_audit_detections_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_indexer_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_meta_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_participant_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_participants_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_request.rb +1 -1
- data/lib/falaai-api/models/risk_audit_scores_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_scoring_explanation_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_summary_v2.rb +2 -24
- data/lib/falaai-api/models/risk_audit_timeline_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_usage_v2.rb +2 -2
- data/lib/falaai-api/models/risk_audit_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_v2_response.rb +1 -1
- data/lib/falaai-api/models/risk_audit_verdict_v2.rb +5 -36
- data/lib/falaai-api/models/transcription_response.rb +1 -1
- data/lib/falaai-api/models/transcription_usage.rb +2 -2
- data/lib/falaai-api/models/update_email_alert_request.rb +1 -1
- data/lib/falaai-api/models/update_webhook_request.rb +1 -1
- data/lib/falaai-api/models/usage_by_key_item.rb +1 -1
- data/lib/falaai-api/models/usage_log_item.rb +1 -1
- data/lib/falaai-api/models/usage_log_response.rb +1 -1
- data/lib/falaai-api/models/validation_error.rb +1 -1
- data/lib/falaai-api/models/version_response.rb +1 -1
- data/lib/falaai-api/models/webhook_event.rb +1 -1
- data/lib/falaai-api/models/webhook_item.rb +1 -1
- data/lib/falaai-api/models/webhook_list_response.rb +1 -1
- data/lib/falaai-api/models/whatsapp_conversation.rb +2 -2
- data/lib/falaai-api/models/whatsapp_conversations_response.rb +30 -6
- data/lib/falaai-api/models/whatsapp_meta.rb +32 -5
- data/lib/falaai-api/models/whatsapp_preview_item.rb +354 -0
- data/lib/falaai-api/models/whatsapp_preview_item_breakdown.rb +273 -0
- data/lib/falaai-api/models/whatsapp_preview_item_credits.rb +192 -0
- data/lib/falaai-api/models/whatsapp_preview_item_media.rb +329 -0
- data/lib/falaai-api/models/whatsapp_preview_params.rb +354 -0
- data/lib/falaai-api/models/whatsapp_preview_response.rb +384 -0
- data/lib/falaai-api/models/whatsapp_preview_window.rb +219 -0
- data/lib/falaai-api/models/whatsapp_speaker.rb +1 -1
- data/lib/falaai-api/models/whatsapp_usage.rb +90 -9
- data/lib/falaai-api/version.rb +15 -15
- data/lib/falaai-api.rb +9 -1
- metadata +18 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -20,6 +20,7 @@ module FalaAI
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Analyze a call transcript — 5 parallel analyses
|
|
23
|
+
# Analyzes a call transcript and returns six structured blocks: dialogue summary, contact reason, identified action, theme label, predominant sentiment and identified participants with roles, names, confidence and evidence; use it for a fast, generic diagnosis of what happened in a call, and use /v1/analyze/riskAudit instead when the goal is compliance violation auditing. Provide at least one of dialog (primary source: diarized transcript in the format 'Speaker 1: [00:00:00.540 - 00:00:01.139] text', speaker labels accepted in any case as Speaker, Interlocutor, Hablante, Locutor or Orador plus number) or text (plain transcript fallback), each up to 300,000 characters; when dialog is used duration_seconds is required by the schema and, when provided, must be >= the last turn end time. Required: language; optional: model (always 'falaai-diagnostic-1'), audio_events, response_language (language of the results, defaulting to language), participants (up to 10 with interlocutor and optional name and role agent/client/bot, ground truth when the role is informed and otherwise inferred), call_direction (inferred when omitted), client_reference_id (echoed verbatim, charset [A-Za-z0-9 _/:.-], max 60). Returns id, object 'analysis', response_language, analysis with the six blocks, usage (characters, credits_consumed, processing_ms) and html_report (base64 gzip) only when dialog is provided; with text-only input the participant roles are forced to confidence 'low'. Credits are charged per character of the transcript (0.03/char, counted without speaker labels, timestamps and inline expression tokens, minimum 500 characters, plus 50 characters per audio event) and the amount charged is returned in usage.credits_consumed. Stateless: neither the transcript nor the analysis is persisted (only billing and usage metadata is logged), protecting personal data under LGPD.
|
|
23
24
|
# @param diagnostic_request [DiagnosticRequest]
|
|
24
25
|
# @param [Hash] opts the optional parameters
|
|
25
26
|
# @return [DiagnosticResponse]
|
|
@@ -29,6 +30,7 @@ module FalaAI
|
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# Analyze a call transcript — 5 parallel analyses
|
|
33
|
+
# Analyzes a call transcript and returns six structured blocks: dialogue summary, contact reason, identified action, theme label, predominant sentiment and identified participants with roles, names, confidence and evidence; use it for a fast, generic diagnosis of what happened in a call, and use /v1/analyze/riskAudit instead when the goal is compliance violation auditing. Provide at least one of dialog (primary source: diarized transcript in the format 'Speaker 1: [00:00:00.540 - 00:00:01.139] text', speaker labels accepted in any case as Speaker, Interlocutor, Hablante, Locutor or Orador plus number) or text (plain transcript fallback), each up to 300,000 characters; when dialog is used duration_seconds is required by the schema and, when provided, must be >= the last turn end time. Required: language; optional: model (always 'falaai-diagnostic-1'), audio_events, response_language (language of the results, defaulting to language), participants (up to 10 with interlocutor and optional name and role agent/client/bot, ground truth when the role is informed and otherwise inferred), call_direction (inferred when omitted), client_reference_id (echoed verbatim, charset [A-Za-z0-9 _/:.-], max 60). Returns id, object 'analysis', response_language, analysis with the six blocks, usage (characters, credits_consumed, processing_ms) and html_report (base64 gzip) only when dialog is provided; with text-only input the participant roles are forced to confidence 'low'. Credits are charged per character of the transcript (0.03/char, counted without speaker labels, timestamps and inline expression tokens, minimum 500 characters, plus 50 characters per audio event) and the amount charged is returned in usage.credits_consumed. Stateless: neither the transcript nor the analysis is persisted (only billing and usage metadata is logged), protecting personal data under LGPD.
|
|
32
34
|
# @param diagnostic_request [DiagnosticRequest]
|
|
33
35
|
# @param [Hash] opts the optional parameters
|
|
34
36
|
# @return [Array<(DiagnosticResponse, Integer, Hash)>] DiagnosticResponse data, response status code and response headers
|
|
@@ -86,6 +88,7 @@ module FalaAI
|
|
|
86
88
|
end
|
|
87
89
|
|
|
88
90
|
# Compliance Risk Audit — conversation compliance analysis
|
|
91
|
+
# Runs a compliance risk audit on a diarized call transcript, detecting violations and positives, applying the ISO 31000 risk matrix, classifying the conversation into a level and returning the verdict with the applied actions and the NIST/OWASP risk framework enquadramento; use it for compliance and quality audits of company-agent-to-client calls, not for generic conversation summarization. Required fields: dialog (diarized transcript in the format 'Speaker 1: [00:00:00.540 - 00:00:01.139] text', speaker labels accepted in any case as Speaker, Interlocutor, Hablante, Locutor or Orador plus number; plain text is not accepted; max 300,000 characters), duration_seconds (total audio duration in seconds, must be >= the last turn end time) and language plus response_language (only pt-BR, en-US or es-ES). Optional: model (always 'falaai-risk-audit-1'), audio_events (up to 500, each requiring event and start_s), participants (up to 10 with interlocutor and role agent/client/bot, ground truth when provided, else inferred), call_direction (inbound/outbound, inferred when omitted), response_format (only 'v2'), client_reference_id (echoed verbatim, charset [A-Za-z0-9 _/:.-], max 60). Returns response (V2) with meta+usage, participants, verdict with level and applied actions, scores, detections (violations, positives, client alerts), analysis frameworks, timeline, categories_summary, executive summary, scoring explanation and an HTML report (gzip+base64). Credits are charged per character of the spoken transcript (0.09/char, counted without speaker labels and inline expression tokens, minimum 1,000 characters, plus 50 characters per audio event) and a minimum-cost guard may raise the final amount, so response.meta.usage.credits_consumed is the amount actually charged. Stateless: neither the transcript nor the analysis is persisted (only billing and usage metadata is logged), protecting personal data under LGPD.
|
|
89
92
|
# @param risk_audit_request [RiskAuditRequest]
|
|
90
93
|
# @param [Hash] opts the optional parameters
|
|
91
94
|
# @return [RiskAuditV2Response]
|
|
@@ -95,6 +98,7 @@ module FalaAI
|
|
|
95
98
|
end
|
|
96
99
|
|
|
97
100
|
# Compliance Risk Audit — conversation compliance analysis
|
|
101
|
+
# Runs a compliance risk audit on a diarized call transcript, detecting violations and positives, applying the ISO 31000 risk matrix, classifying the conversation into a level and returning the verdict with the applied actions and the NIST/OWASP risk framework enquadramento; use it for compliance and quality audits of company-agent-to-client calls, not for generic conversation summarization. Required fields: dialog (diarized transcript in the format 'Speaker 1: [00:00:00.540 - 00:00:01.139] text', speaker labels accepted in any case as Speaker, Interlocutor, Hablante, Locutor or Orador plus number; plain text is not accepted; max 300,000 characters), duration_seconds (total audio duration in seconds, must be >= the last turn end time) and language plus response_language (only pt-BR, en-US or es-ES). Optional: model (always 'falaai-risk-audit-1'), audio_events (up to 500, each requiring event and start_s), participants (up to 10 with interlocutor and role agent/client/bot, ground truth when provided, else inferred), call_direction (inbound/outbound, inferred when omitted), response_format (only 'v2'), client_reference_id (echoed verbatim, charset [A-Za-z0-9 _/:.-], max 60). Returns response (V2) with meta+usage, participants, verdict with level and applied actions, scores, detections (violations, positives, client alerts), analysis frameworks, timeline, categories_summary, executive summary, scoring explanation and an HTML report (gzip+base64). Credits are charged per character of the spoken transcript (0.09/char, counted without speaker labels and inline expression tokens, minimum 1,000 characters, plus 50 characters per audio event) and a minimum-cost guard may raise the final amount, so response.meta.usage.credits_consumed is the amount actually charged. Stateless: neither the transcript nor the analysis is persisted (only billing and usage metadata is logged), protecting personal data under LGPD.
|
|
98
102
|
# @param risk_audit_request [RiskAuditRequest]
|
|
99
103
|
# @param [Hash] opts the optional parameters
|
|
100
104
|
# @return [Array<(RiskAuditV2Response, Integer, Hash)>] RiskAuditV2Response data, response status code and response headers
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -20,6 +20,7 @@ module FalaAI
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Transcribe audio to text
|
|
23
|
+
# Transcribes one uploaded audio file into text with speaker diarization and timestamped audio events (laughs, sighs, pauses), returning the full transcript, a turn-by-turn dialog with speaker labels and start/end timestamps, the detected events and the word count. Use it when a recording must become text for analysis, review or storage of the transcript. The required file field takes a single audio upload limited to 1GB and 3 hours, with accepted MIME types audio/mpeg, audio/mp3, audio/mp4, audio/m4a, audio/wav, audio/wave, audio/x-wav, audio/flac, audio/x-flac, audio/ogg, audio/opus, video/ogg, audio/webm, video/webm, audio/aac and audio/x-aac. model is optional and defaults to falaai-transcribe-1, the only supported value; language is an optional two-letter code (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) that forces the audio language and is auto-detected when omitted; client_reference_id is optional, charset A-Za-z0-9 space _/:.- up to 60 chars, echoed verbatim (not idempotency). Billing is 1 credit per second of processed audio with a minimum of 10 credits per request, rounded to 2 decimals; usage reports credits_consumed and processing_ms. Stateless: the audio is processed in memory and never persisted (LGPD). Returns id (tr-), language, language_confidence, duration_seconds, text, dialog, audio_events, event_types, word_count and input metadata (duration, format, codec, sample rate, channels).
|
|
23
24
|
# @param file [File]
|
|
24
25
|
# @param [Hash] opts the optional parameters
|
|
25
26
|
# @option opts [String] :model (default to 'falaai-transcribe-1')
|
|
@@ -32,6 +33,7 @@ module FalaAI
|
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
# Transcribe audio to text
|
|
36
|
+
# Transcribes one uploaded audio file into text with speaker diarization and timestamped audio events (laughs, sighs, pauses), returning the full transcript, a turn-by-turn dialog with speaker labels and start/end timestamps, the detected events and the word count. Use it when a recording must become text for analysis, review or storage of the transcript. The required file field takes a single audio upload limited to 1GB and 3 hours, with accepted MIME types audio/mpeg, audio/mp3, audio/mp4, audio/m4a, audio/wav, audio/wave, audio/x-wav, audio/flac, audio/x-flac, audio/ogg, audio/opus, video/ogg, audio/webm, video/webm, audio/aac and audio/x-aac. model is optional and defaults to falaai-transcribe-1, the only supported value; language is an optional two-letter code (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) that forces the audio language and is auto-detected when omitted; client_reference_id is optional, charset A-Za-z0-9 space _/:.- up to 60 chars, echoed verbatim (not idempotency). Billing is 1 credit per second of processed audio with a minimum of 10 credits per request, rounded to 2 decimals; usage reports credits_consumed and processing_ms. Stateless: the audio is processed in memory and never persisted (LGPD). Returns id (tr-), language, language_confidence, duration_seconds, text, dialog, audio_events, event_types, word_count and input metadata (duration, format, codec, sample rate, channels).
|
|
35
37
|
# @param file [File]
|
|
36
38
|
# @param [Hash] opts the optional parameters
|
|
37
39
|
# @option opts [String] :model (default to 'falaai-transcribe-1')
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -20,37 +20,43 @@ module FalaAI
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Extract and segment WhatsApp conversations from an export
|
|
23
|
+
# Extracts and segments the conversations of a WhatsApp export (.zip or .txt containing chat.txt in UTF-8 with at least one turn) and, unless it is a preview, resolves each selected conversation with AI by transcribing voice/audio/video notes and describing visual expressions, returning the segmented conversations with speakers, dialogs, counts and usage. Use dry_run=true for a PREVIEW: it validates the file, segments the conversations, counts media and ESTIMATES the credits WITHOUT calling the AI and WITHOUT charging (credits_charged=0), returning object whatsapp_preview with credits_total, the params actually used, the windows, per-conversation items and warnings. The window is given either as a single start/end pair or as windows, a JSON string holding a non-empty list of sub-objects each with start and end; windows must not be combined with start/end, and a windows selection is the deduplicated chronological union of the overlaps, which bypasses the noise filter and keeps conversations that are monologues or below min_messages, while for a single window sending only one of start/end is rejected and empty/all-zeros values select the real period of the export, both being allowed to be omitted in dry_run while outside dry_run both absent is rejected. timezone and date_format are required, where date_format must be day_first, month_first or year_first. gap_minutes is optional (default 720) and splits conversations on idle gaps, min_messages is optional (default 2) and is the minimum messages kept per conversation outside the explicit windows selection, voice_note is optional (default true) and turns voice/audio/video media into text, expression is optional (default true) and describes visual expressions (figurinha, GIF, emoji), and client_reference_id is optional, echoed verbatim, charset A-Za-z0-9 space _/:.- up to 60 chars. Billing outside the preview is 0.15 credit per conversation plus 0.15 per figurinha, 0.18 per GIF and 0.1 per emoji (only with expression=true) plus 0.19 per second of voice/audio/video (only with voice_note=true), rounded to 2 decimals with no rounding up, and the preview credits_total is the same exact sum with 2 decimals; files are limited to 1GB and the endpoint is stateless (export and media processed in memory, temporary files removed, nothing persisted), returning object conversations with id (wc-), usage and the conversations (conversation_id, first_at, last_at, duration_seconds, speakers, dialog, message_count, characters) plus meta.
|
|
23
24
|
# @param file [File]
|
|
24
|
-
# @param start [String]
|
|
25
|
-
# @param _end [String]
|
|
26
25
|
# @param timezone [String]
|
|
27
26
|
# @param date_format [String]
|
|
28
27
|
# @param [Hash] opts the optional parameters
|
|
28
|
+
# @option opts [String] :start Inicio da janela. Obrigatorio fora do dry_run; no dry_run ausente = primeiro turno do export.
|
|
29
|
+
# @option opts [String] :_end Fim da janela. Obrigatorio fora do dry_run; no dry_run ausente = ultimo turno do export.
|
|
30
|
+
# @option opts [String] :windows Selecao explicita por varias janelas: JSON [{\\\"start\\\":\\\"...\\\",\\\"end\\\":\\\"...\\\"}]. Nao combinar com 'start'/'end'.
|
|
29
31
|
# @option opts [Float] :gap_minutes (default to 720)
|
|
30
32
|
# @option opts [Integer] :min_messages (default to 2)
|
|
31
33
|
# @option opts [Boolean] :voice_note Transcrever mensagens de voz/video gravadas na hora? (default to true)
|
|
32
34
|
# @option opts [Boolean] :expression Descrever expressoes visuais (figurinha/GIF/imagem)? (default to true)
|
|
35
|
+
# @option opts [Boolean] :dry_run So analisa o arquivo: valida, segmenta e ESTIMA os creditos SEM chamar a IA e SEM debitar (credits_charged=0). (default to false)
|
|
33
36
|
# @option opts [String] :client_reference_id
|
|
34
|
-
# @return [
|
|
35
|
-
def extract_conversations_v1_whatsapp_extract_conversations_post(file,
|
|
36
|
-
data, _status_code, _headers = extract_conversations_v1_whatsapp_extract_conversations_post_with_http_info(file,
|
|
37
|
+
# @return [ResponseExtractConversationsV1WhatsappExtractconversationsPost]
|
|
38
|
+
def extract_conversations_v1_whatsapp_extract_conversations_post(file, timezone, date_format, opts = {})
|
|
39
|
+
data, _status_code, _headers = extract_conversations_v1_whatsapp_extract_conversations_post_with_http_info(file, timezone, date_format, opts)
|
|
37
40
|
data
|
|
38
41
|
end
|
|
39
42
|
|
|
40
43
|
# Extract and segment WhatsApp conversations from an export
|
|
44
|
+
# Extracts and segments the conversations of a WhatsApp export (.zip or .txt containing chat.txt in UTF-8 with at least one turn) and, unless it is a preview, resolves each selected conversation with AI by transcribing voice/audio/video notes and describing visual expressions, returning the segmented conversations with speakers, dialogs, counts and usage. Use dry_run=true for a PREVIEW: it validates the file, segments the conversations, counts media and ESTIMATES the credits WITHOUT calling the AI and WITHOUT charging (credits_charged=0), returning object whatsapp_preview with credits_total, the params actually used, the windows, per-conversation items and warnings. The window is given either as a single start/end pair or as windows, a JSON string holding a non-empty list of sub-objects each with start and end; windows must not be combined with start/end, and a windows selection is the deduplicated chronological union of the overlaps, which bypasses the noise filter and keeps conversations that are monologues or below min_messages, while for a single window sending only one of start/end is rejected and empty/all-zeros values select the real period of the export, both being allowed to be omitted in dry_run while outside dry_run both absent is rejected. timezone and date_format are required, where date_format must be day_first, month_first or year_first. gap_minutes is optional (default 720) and splits conversations on idle gaps, min_messages is optional (default 2) and is the minimum messages kept per conversation outside the explicit windows selection, voice_note is optional (default true) and turns voice/audio/video media into text, expression is optional (default true) and describes visual expressions (figurinha, GIF, emoji), and client_reference_id is optional, echoed verbatim, charset A-Za-z0-9 space _/:.- up to 60 chars. Billing outside the preview is 0.15 credit per conversation plus 0.15 per figurinha, 0.18 per GIF and 0.1 per emoji (only with expression=true) plus 0.19 per second of voice/audio/video (only with voice_note=true), rounded to 2 decimals with no rounding up, and the preview credits_total is the same exact sum with 2 decimals; files are limited to 1GB and the endpoint is stateless (export and media processed in memory, temporary files removed, nothing persisted), returning object conversations with id (wc-), usage and the conversations (conversation_id, first_at, last_at, duration_seconds, speakers, dialog, message_count, characters) plus meta.
|
|
41
45
|
# @param file [File]
|
|
42
|
-
# @param start [String]
|
|
43
|
-
# @param _end [String]
|
|
44
46
|
# @param timezone [String]
|
|
45
47
|
# @param date_format [String]
|
|
46
48
|
# @param [Hash] opts the optional parameters
|
|
49
|
+
# @option opts [String] :start Inicio da janela. Obrigatorio fora do dry_run; no dry_run ausente = primeiro turno do export.
|
|
50
|
+
# @option opts [String] :_end Fim da janela. Obrigatorio fora do dry_run; no dry_run ausente = ultimo turno do export.
|
|
51
|
+
# @option opts [String] :windows Selecao explicita por varias janelas: JSON [{\\\"start\\\":\\\"...\\\",\\\"end\\\":\\\"...\\\"}]. Nao combinar com 'start'/'end'.
|
|
47
52
|
# @option opts [Float] :gap_minutes (default to 720)
|
|
48
53
|
# @option opts [Integer] :min_messages (default to 2)
|
|
49
54
|
# @option opts [Boolean] :voice_note Transcrever mensagens de voz/video gravadas na hora? (default to true)
|
|
50
55
|
# @option opts [Boolean] :expression Descrever expressoes visuais (figurinha/GIF/imagem)? (default to true)
|
|
56
|
+
# @option opts [Boolean] :dry_run So analisa o arquivo: valida, segmenta e ESTIMA os creditos SEM chamar a IA e SEM debitar (credits_charged=0). (default to false)
|
|
51
57
|
# @option opts [String] :client_reference_id
|
|
52
|
-
# @return [Array<(
|
|
53
|
-
def extract_conversations_v1_whatsapp_extract_conversations_post_with_http_info(file,
|
|
58
|
+
# @return [Array<(ResponseExtractConversationsV1WhatsappExtractconversationsPost, Integer, Hash)>] ResponseExtractConversationsV1WhatsappExtractconversationsPost data, response status code and response headers
|
|
59
|
+
def extract_conversations_v1_whatsapp_extract_conversations_post_with_http_info(file, timezone, date_format, opts = {})
|
|
54
60
|
if @api_client.config.debugging
|
|
55
61
|
@api_client.config.logger.debug 'Calling API: WhatsappApi.extract_conversations_v1_whatsapp_extract_conversations_post ...'
|
|
56
62
|
end
|
|
@@ -58,14 +64,6 @@ module FalaAI
|
|
|
58
64
|
if @api_client.config.client_side_validation && file.nil?
|
|
59
65
|
fail ArgumentError, "Missing the required parameter 'file' when calling WhatsappApi.extract_conversations_v1_whatsapp_extract_conversations_post"
|
|
60
66
|
end
|
|
61
|
-
# verify the required parameter 'start' is set
|
|
62
|
-
if @api_client.config.client_side_validation && start.nil?
|
|
63
|
-
fail ArgumentError, "Missing the required parameter 'start' when calling WhatsappApi.extract_conversations_v1_whatsapp_extract_conversations_post"
|
|
64
|
-
end
|
|
65
|
-
# verify the required parameter '_end' is set
|
|
66
|
-
if @api_client.config.client_side_validation && _end.nil?
|
|
67
|
-
fail ArgumentError, "Missing the required parameter '_end' when calling WhatsappApi.extract_conversations_v1_whatsapp_extract_conversations_post"
|
|
68
|
-
end
|
|
69
67
|
# verify the required parameter 'timezone' is set
|
|
70
68
|
if @api_client.config.client_side_validation && timezone.nil?
|
|
71
69
|
fail ArgumentError, "Missing the required parameter 'timezone' when calling WhatsappApi.extract_conversations_v1_whatsapp_extract_conversations_post"
|
|
@@ -93,21 +91,23 @@ module FalaAI
|
|
|
93
91
|
# form parameters
|
|
94
92
|
form_params = opts[:form_params] || {}
|
|
95
93
|
form_params['file'] = file
|
|
96
|
-
form_params['start'] = start
|
|
97
|
-
form_params['end'] = _end
|
|
98
94
|
form_params['timezone'] = timezone
|
|
99
95
|
form_params['date_format'] = date_format
|
|
96
|
+
form_params['start'] = opts[:'start'] if !opts[:'start'].nil?
|
|
97
|
+
form_params['end'] = opts[:'_end'] if !opts[:'_end'].nil?
|
|
98
|
+
form_params['windows'] = opts[:'windows'] if !opts[:'windows'].nil?
|
|
100
99
|
form_params['gap_minutes'] = opts[:'gap_minutes'] if !opts[:'gap_minutes'].nil?
|
|
101
100
|
form_params['min_messages'] = opts[:'min_messages'] if !opts[:'min_messages'].nil?
|
|
102
101
|
form_params['voice_note'] = opts[:'voice_note'] if !opts[:'voice_note'].nil?
|
|
103
102
|
form_params['expression'] = opts[:'expression'] if !opts[:'expression'].nil?
|
|
103
|
+
form_params['dry_run'] = opts[:'dry_run'] if !opts[:'dry_run'].nil?
|
|
104
104
|
form_params['client_reference_id'] = opts[:'client_reference_id'] if !opts[:'client_reference_id'].nil?
|
|
105
105
|
|
|
106
106
|
# http body (model)
|
|
107
107
|
post_body = opts[:debug_body]
|
|
108
108
|
|
|
109
109
|
# return_type
|
|
110
|
-
return_type = opts[:debug_return_type] || '
|
|
110
|
+
return_type = opts[:debug_return_type] || 'ResponseExtractConversationsV1WhatsappExtractconversationsPost'
|
|
111
111
|
|
|
112
112
|
# auth_names
|
|
113
113
|
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
data/lib/falaai-api/api_error.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -18,7 +18,7 @@ module FalaAI
|
|
|
18
18
|
# Total characters analyzed
|
|
19
19
|
attr_accessor :characters
|
|
20
20
|
|
|
21
|
-
# Credits consumed: max(
|
|
21
|
+
# Credits consumed: per character, round(max(characters, 500) * 0.03, 2)
|
|
22
22
|
attr_accessor :credits_consumed
|
|
23
23
|
|
|
24
24
|
# Total processing time in milliseconds
|
|
@@ -47,7 +47,7 @@ module FalaAI
|
|
|
47
47
|
def self.openapi_types
|
|
48
48
|
{
|
|
49
49
|
:'characters' => :'Integer',
|
|
50
|
-
:'credits_consumed' => :'
|
|
50
|
+
:'credits_consumed' => :'Float',
|
|
51
51
|
:'processing_ms' => :'Integer'
|
|
52
52
|
}
|
|
53
53
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.21.
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
data/lib/falaai-api/models/response_extract_conversations_v1_whatsapp_extractconversations_post.rb
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FalaAI API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.21.67
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FalaAI
|
|
17
|
+
module ResponseExtractConversationsV1WhatsappExtractconversationsPost
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
20
|
+
def openapi_any_of
|
|
21
|
+
[
|
|
22
|
+
:'WhatsappConversationsResponse',
|
|
23
|
+
:'WhatsappPreviewResponse'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
+
# - TODO: logging when debugging is set.
|
|
37
|
+
openapi_any_of.each do |klass|
|
|
38
|
+
begin
|
|
39
|
+
next if klass == :AnyType # "nullable: true"
|
|
40
|
+
return find_and_cast_into_type(klass, data)
|
|
41
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
51
|
+
|
|
52
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
53
|
+
def find_and_cast_into_type(klass, data)
|
|
54
|
+
return if data.nil?
|
|
55
|
+
|
|
56
|
+
case klass.to_s
|
|
57
|
+
when 'Boolean'
|
|
58
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
59
|
+
when 'Float'
|
|
60
|
+
return data if data.instance_of?(Float)
|
|
61
|
+
when 'Integer'
|
|
62
|
+
return data if data.instance_of?(Integer)
|
|
63
|
+
when 'Time'
|
|
64
|
+
return Time.parse(data)
|
|
65
|
+
when 'Date'
|
|
66
|
+
return Date.iso8601(data)
|
|
67
|
+
when 'String'
|
|
68
|
+
return data if data.instance_of?(String)
|
|
69
|
+
when 'Object' # "type: object"
|
|
70
|
+
return data if data.instance_of?(Hash)
|
|
71
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
72
|
+
if data.instance_of?(Array)
|
|
73
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
74
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
75
|
+
end
|
|
76
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
77
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
78
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
79
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
80
|
+
end
|
|
81
|
+
else # model
|
|
82
|
+
const = FalaAI.const_get(klass)
|
|
83
|
+
if const
|
|
84
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
85
|
+
model = const.build(data)
|
|
86
|
+
return model if model
|
|
87
|
+
else
|
|
88
|
+
# raise if data contains keys that are not known to the model
|
|
89
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
90
|
+
model = const.build_from_hash(data)
|
|
91
|
+
return model if model
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
raise # if no match by now, raise
|
|
97
|
+
rescue
|
|
98
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|