AI Voice Bot: Claude — post-call structured extraction

Odoo 19 · Community · Part of AI Voice Bot

AI Voice Bot: Claude

The AI-extraction adapter for AI Voice Bot. Turns a finished call's transcript into the structured, schema-guaranteed result the review workflow consumes — using Anthropic's official anthropic Python SDK, not a hand-rolled REST call.

This page describes the adapter's own contribution. For the campaign/call/review workflow it plugs into, see the AI Voice Bot product page.

What it does

The base module defines a pluggable AIProvider interface. This module registers the concrete implementation under the code claude. Its extract_result(conversation) calls client.messages.create() with output_config={'format': {'type': 'json_schema', 'schema': ...}} — the response is guaranteed to match the shared extraction contract (conversation status, business status, primary contact name/job title/phone/email, phone/email verified, opt-out, follow-up, confidence), not merely likely to.

Never trusts the model unconditionally

A structured-output schema guarantees shape, not correctness. Every response is checked for stop_reason == 'refusal' before its content is trusted, and the confidence figure Claude reports is clamped to [0, 1] rather than passed through raw — the base module's own review-routing logic is the actual authority on whether a result needs a human, and it never receives an unbounded number from here.

Post-call only, deliberately

start_session/process_message — the live, turn-by-turn conversation — raise NotImplementedError pointing at the external AI Voice Service, which owns real-time audio per the base module's own architecture. An Odoo worker blocking on a live phone call is exactly the failure mode this suite is built to avoid, so this adapter never attempts it.

Configuration

SettingPurpose
API KeyYour Anthropic API key. Stored via ir.config_parameter, never in code.
ModelDefaults to claude-opus-5; overridable per deployment.

Dependencies

do_ai_voice_bot, plus the anthropic Python package (not bundled with Odoo — pip install anthropic).