fix: force JSON output for Ollama intent classification; fix attachment detection
- ollama_backend: add format='json' for 'master' and receipt_parser callers so llama3.1:8b returns valid JSON instead of plain English - ab_ai_mail: add debug logging to trace attachment_ids from Discuss; handle file-only messages and clarification look-back flow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,20 @@ class DiscussChannel(models.Model):
|
||||
return result
|
||||
|
||||
text = _strip_html(body)
|
||||
|
||||
# Odoo 18 Discuss uploads attachments before posting the message and
|
||||
# passes their IDs in kwargs as attachment_ids (list of ints or ORM
|
||||
# commands). result.attachment_ids resolves those after super() runs.
|
||||
# Log both so we can see exactly what arrives.
|
||||
_logger.info(
|
||||
'AB AI mail hook: body=%r kwargs_keys=%s '
|
||||
'attachment_ids_kwarg=%r result.attachment_ids=%s',
|
||||
(body or '')[:80],
|
||||
list(kwargs.keys()),
|
||||
kwargs.get('attachment_ids'),
|
||||
result.attachment_ids.ids,
|
||||
)
|
||||
|
||||
attachments = result.attachment_ids
|
||||
|
||||
# Nothing to work with
|
||||
|
||||
Reference in New Issue
Block a user