<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="res_config_settings_view_form_encoach_ai" model="ir.ui.view">
        <field name="name">res.config.settings.view.form.encoach.ai</field>
        <field name="model">res.config.settings</field>
        <field name="priority">90</field>
        <field name="inherit_id" ref="base.res_config_settings_view_form"/>
        <field name="arch" type="xml">
            <xpath expr="//form" position="inside">
                <app string="EnCoach AI Services" name="encoach_ai">
                    <block title="General">
                        <setting string="Enable AI Services" help="Master switch for all AI features">
                            <field name="ai_enabled"/>
                        </setting>
                        <setting string="Max Generation Retries" help="Maximum retry attempts for AI content generation">
                            <field name="ai_max_retries"/>
                        </setting>
                    </block>
                    <block title="OpenAI (GPT &amp; Whisper)">
                        <setting string="API Key" help="Your OpenAI API key (sk-...)">
                            <field name="ai_openai_api_key" password="True"/>
                        </setting>
                        <setting string="Primary Model" help="Used for grading, content generation, coaching">
                            <field name="ai_openai_model"/>
                        </setting>
                        <setting string="Fast Model" help="Used for tagging, classification, tips">
                            <field name="ai_openai_fast_model"/>
                        </setting>
                    </block>
                    <block title="Text-to-Speech">
                        <setting string="TTS Provider" help="Choose between AWS Polly and ElevenLabs">
                            <field name="ai_tts_provider"/>
                        </setting>
                        <setting string="AWS Access Key ID">
                            <field name="ai_aws_access_key" password="True"/>
                        </setting>
                        <setting string="AWS Secret Access Key">
                            <field name="ai_aws_secret_key" password="True"/>
                        </setting>
                        <setting string="AWS Region">
                            <field name="ai_aws_region"/>
                        </setting>
                        <setting string="ElevenLabs API Key">
                            <field name="ai_elevenlabs_api_key" password="True"/>
                        </setting>
                        <setting string="ElevenLabs Model">
                            <field name="ai_elevenlabs_model"/>
                        </setting>
                    </block>
                    <block title="Content Detection">
                        <setting string="GPTZero API Key" help="For AI-generated content detection">
                            <field name="ai_gptzero_api_key" password="True"/>
                        </setting>
                    </block>
                    <block title="Avatar Videos">
                        <setting string="ELAI Token" help="For generating avatar videos">
                            <field name="ai_elai_token" password="True"/>
                        </setting>
                    </block>
                </app>
            </xpath>
        </field>
    </record>
</odoo>
