bemade-addons/openwebui_base/models/openwebui_model.py
mathis c5904a51d7 [REF] Replace openwebui_connector with centralized openwebui_base module
This commit represents a significant architectural improvement:

- Completely replaced openwebui_connector with a more robust openwebui_base module
- Centralized OpenWebUI API integration for better maintainability
- Redesigned helpdesk_sale_order_ai to use the new openwebui_base module
- Added support for multiple OpenWebUI providers and models
- Improved error handling and response parsing
- Added proper template management with openwebui_prompt_template
- Fixed KeyError issues with safe template substitution
- Streamlined API client initialization and usage
2025-07-28 13:27:29 -04:00

29 lines
724 B
Python

from odoo import models, fields, api
class OpenWebUIModel(models.Model):
_name = "openwebui.model"
_description = "OpenWebUI Model"
technical_name = fields.Char(
required=True,
help="Technical name of the model on the OpenWebUI server.",
readonly=True,
)
name = fields.Char(
required=True,
help="User-friendly name of the model.",
readonly=True,
)
provider_id = fields.Many2one(
"openwebui.provider",
required=True,
)
_sql_constraints = [
(
"technical_name_provider_unique",
"unique(technical_name, provider_id)",
"Technical name must be unique per provider",
)
]