bemade-addons/openwebui_connector/views/res_config_settings_views.xml

69 lines
4.1 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.openai.connector</field>
<field name="model">res.config.settings</field>
<field name="priority">20</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<app data-string="AI Services" string="AI Services" name="openwebui_connector" logo="/base/static/description/settings.png">
<!-- API Configuration Block -->
<block title="AI API Configuration" name="openai_settings_container">
<setting id="openai_api_settings">
<span class="o_form_label">API Configuration</span>
<div class="text-muted">
Configure your AI API credentials (OpenAI, OpenWebUI, Claude)
</div>
<div class="content-group mt16">
<div class="row mt16">
<label for="openai_api_key" class="col-lg-3 o_light_label">API Key</label>
<field name="openai_api_key" password="True"/>
</div>
<div class="row mt16">
<label for="openai_base_url" class="col-lg-3 o_light_label">API Base URL</label>
<field name="openai_base_url" placeholder="https://ai.bemade.org/api"/>
</div>
<div class="row mt16">
<label for="openai_model" class="col-lg-3 o_light_label">AI Model</label>
<field name="openai_model" placeholder="anthropic.claude-3-7-sonnet-latest"/>
</div>
</div>
</setting>
</block>
<!-- Helpdesk AI Settings Block -->
<block title="Helpdesk AI Settings" name="helpdesk_ai_settings_container">
<setting id="ai_sales_order_toggle">
<field name="helpdesk_use_ai_sale_orders"/>
<label for="helpdesk_use_ai_sale_orders"/>
<div class="text-muted">
Enable AI-powered sales order generation from helpdesk tickets
</div>
</setting>
<setting id="ai_prompt_template" invisible="not helpdesk_use_ai_sale_orders">
<div class="o_setting_right_pane">
<label for="ai_prompt_template_relation"/>
<div class="text-muted">
Default template for the prompt sent to the AI
</div>
<div class="mt8 d-flex align-items-center">
<!-- Select the template directly -->
<field name="ai_prompt_template_relation"/>
<button name="action_open_prompt_templates" type="object" class="btn btn-link ps-2">
<i class="fa fa-external-link" title="Manage Templates"/> Manage Templates
</button>
</div>
<div class="mt-2 text-muted">
<small>The template content is stored in the system and can be accessed programmatically.</small>
</div>
</div>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>