- Split monolithic AI prompt into three distinct AI calls: 1. _ai_extract_potential_products: Extract potential products from ticket content and attachments 2. _ai_match_products_to_database: Match extracted products to database products using registered AI tools 3. _ai_format_final_sale_order: Format matched products into final JSON structure - Added detailed logging at each step for improved debuggability and traceability - Fixed attribute access for OpenWebUI provider model by using provider.default_model_id.technical_name instead of provider.model - Addressed type consistency issues in return statements - Refactored _get_sale_order_values method to orchestrate these three steps sequentially, maintaining existing functionality while improving modularity and debuggability - Modified _ai_extract_potential_products method to use 'product_code' field for product references/codes instead of putting them in the 'name' field - Updated _ai_match_products_to_database to properly handle the new field structure - Fixed KeyError in template formatting by implementing safe template substitution using string.Template with safe_substitute() method to handle missing placeholders gracefully - Updated AI integration to use openwebui_base module directly instead of bridge model approach |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| ai_openwebui_client.py | ||
| ai_openwebui_prompt_template.py | ||
| helpdesk_team.py | ||
| helpdesk_ticket.py | ||
| helpdesk_ticket.py.bak | ||
| res_config_settings.py | ||
| sale_order.py | ||