Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Controller:
def __init__(self):
self.file_manipulator = FileManipulator()

def fill_form(self, user_input: str, fields: list, pdf_form_path: str):
def fill_form(self, user_input: str, fields: dict, pdf_form_path: str):
return self.file_manipulator.fill_form(user_input, fields, pdf_form_path)

def create_template(self, pdf_path: str):
Expand Down
4 changes: 2 additions & 2 deletions src/file_manipulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self):

def create_template(self, pdf_path: str):
"""
By using commonforms, we create an editable .pdf template and we store it.
Create an editable PDF template using commonforms and write it to disk.
"""
# Lazy import
from commonforms import prepare_form
Expand All @@ -23,7 +23,7 @@ def create_template(self, pdf_path: str):
prepare_form(pdf_path, template_path)
return template_path

def fill_form(self, user_input: str, fields: list, pdf_form_path: str):
def fill_form(self, user_input: str, fields: dict, pdf_form_path: str):
"""
It receives the raw data, runs the PDF filling logic,
and returns the path to the newly created file.
Expand Down
4 changes: 2 additions & 2 deletions src/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self, transcript_text=None, target_fields=None, json=None):
if json is None:
json = {}
self._transcript_text = transcript_text # str
self._target_fields = target_fields # List, contains the template field.
self._target_fields = target_fields # dict, maps field names to their values
self._json = json # dictionary

def type_check_all(self):
Expand All @@ -18,7 +18,7 @@ def type_check_all(self):
f"ERROR in LLM() attributes ->\
Transcript must be text. Input:\n\ttranscript_text: {self._transcript_text}"
)
elif type(self._target_fields) is not list:
elif type(self._target_fields) is not dict:
raise TypeError(
f"ERROR in LLM() attributes ->\
Target fields must be a list. Input:\n\ttarget_fields: {self._target_fields}"
Expand Down