Repository navigation
[ADD] ai_document_extraction - #96
volkantasci wants to merge 7 commits into
Conversation
|
Updated the documentation (commit |
|
Hi @etobella and @angelmoya 👋 Just a friendly ping — when you have a moment, could you take a look at this PR whenever convenient? All CI checks are green (pre-commit, Odoo/OCB tests, codecov, runboat). Happy to adjust anything based on your feedback. Thanks so much for your time and all the maintenance work! |
|
Interesting, however, why don't you use https://github.com/OCA/ai/tree/18.0/ai_connection ? This way we can reuse code and so on. |
3f64a21 to
0c759e6
Compare
|
Hi @etobella, thanks for the suggestion! Following up on your feedback: We ported
All 85 tests pass across |
|
Quick update on the final UX since my previous comment (relevant for review):
All green: 78 local tests, CI (pre-commit, Odoo/OCB, codecov, runboat). |
|
Hi @etobella 👋 gentle follow-up — whenever you have a moment. Where things stand: per your suggestion, This module is the foundation of a broader AI-integration effort we're preparing: several more OCA modules will consume the same connection layer, with new features arriving as separate PRs and branches. Your review direction here would be especially valuable — the sooner the design is aligned, the easier those follow-ups will be to review. Happy to adjust anything. Thanks for your time! |
|
Hi @etobella 👋 Per your suggestion, ai_connection/ai_tool are now in #100 and this PR has been refactored to use connection._run(...) (provider config on ai.connection, settings moved to Technical > AI). All 85 tests green. #100 is the blocker for a clean rebase here - once it is merged I will rebase this one to remove the duplicated commits. Happy to adjust anything else in the meantime. Thanks! |
Currently translated at 100.0% (14 of 14 strings) Translation: ai-18.0/ai-18.0-ai_connection Translate-URL: https://translation.odoo-community.org/projects/ai-18-0/ai-18-0-ai_connection/it/
512d23f to
985f034
Compare
|
Conflict resolved. Rebased onto the current
The branch now contains only Note on CI: the test jobs currently fail only because |
| from pdf2image import convert_from_path | ||
|
|
||
| images = convert_from_path( | ||
| file_path, dpi=200, first_page=1, last_page=1 |
There was a problem hiding this comment.
This works fine for single page invoices. Tested locally with great results. But what about multi page invoices? As of now, we only get the details from the first page
| class AccountMove(models.Model): | ||
| _inherit = "account.move" | ||
|
|
||
| invoice_date = fields.Date( |
There was a problem hiding this comment.
Why this field? We already have the field in odoo, isn't it?
| ) | ||
| temperature = fields.Float(default=0.0) | ||
|
|
||
| def _get_client_openai_compatible(self, tools): |
| return result | ||
|
|
||
| def action_extract_with_ai(self): | ||
| self.ensure_one() |
There was a problem hiding this comment.
I would recommend a completly different approach. You define a connection on journal or company (Up to you). And then, here you add the extracion process by using the file. You could reuse some toolings for getting the images or something like that. For me that would be much more clean.
4e03b75 to
83b3bd1
Compare
601cd36 to
767a3ea
Compare
767a3ea to
30cccad
Compare
Add the
ai_document_extractionmodule: local OCR (PaddleOCR) + LLM (Ollama) invoice data extraction into draftaccount.moverecords.Features
[HEADER]/[BODY]/[FOOTER]from bounding boxes)qwen3:4bvia Ollama) with a strict JSON schema, logo/header guard and hallucination controls (no math, null for unknown)queue_job(non-blocking UI)res.config.settings(API base URL, model, OCR language, match threshold)Notes
paddleocr,rapidfuzz, etc.) are declared in the manifest / reporequirements.txt;cv2is imported lazily and documented inreadme/INSTALL.mdsincecv2is not a valid PyPI distribution name for CI.queue_job(OCA/queue, 19.0).