Implement sender LLM OCR and request remarks

This commit is contained in:
Keannu Christian Bernasol 2025-01-08 13:38:39 +08:00
parent d5477a1e1a
commit 674a7ec592
11 changed files with 174 additions and 62 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 5.1.3 on 2025-01-08 04:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("documents", "0002_alter_document_document_type"),
]
operations = [
migrations.AddField(
model_name="document",
name="memorandum_from",
field=models.CharField(blank=True, max_length=128, null=True),
),
]

View file

@ -0,0 +1,18 @@
# Generated by Django 5.1.3 on 2025-01-08 04:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("documents", "0003_document_memorandum_from"),
]
operations = [
migrations.RenameField(
model_name="document",
old_name="memorandum_from",
new_name="sent_from",
),
]

View file

@ -9,6 +9,9 @@ class Document(models.Model):
document_type = models.CharField(
max_length=128, null=False, blank=False
)
sent_from = models.CharField(
max_length=128, null=True, blank=True
)
number_pages = models.IntegerField(null=False, blank=False)
ocr_metadata = models.TextField(null=True, blank=True)

View file

@ -53,6 +53,7 @@ class DocumentSerializer(serializers.ModelSerializer):
"document_type",
"number_pages",
"ocr_metadata",
"sent_from",
"date_uploaded",
]
read_only_fields = [
@ -61,6 +62,7 @@ class DocumentSerializer(serializers.ModelSerializer):
"document_type",
"number_pages",
"ocr_metadata",
"sent_from",
"date_uploaded",
]
@ -81,6 +83,7 @@ class DocumentFileSerializer(serializers.ModelSerializer):
"number_pages",
"ocr_metadata",
"date_uploaded",
"sent_from",
"file",
]
read_only_fields = [
@ -90,5 +93,6 @@ class DocumentFileSerializer(serializers.ModelSerializer):
"number_pages",
"ocr_metadata",
"date_uploaded",
"sent_from",
"file",
]