fix: parse metadata as json, allow metadata typing

This commit is contained in:
Nathan Lenas 2024-07-29 09:26:40 +02:00
parent f47c05730d
commit 9177a0ad73
4 changed files with 16 additions and 10 deletions

View file

@ -1,5 +1,6 @@
import logging
from pathlib import Path
from typing import Any
from llama_index.core.readers import StringIterableReader
from llama_index.core.readers.base import BaseReader
@ -69,7 +70,7 @@ class IngestionHelper:
@staticmethod
def transform_file_into_documents(
file_name: str, file_data: Path, file_metadata: dict[str, str] | None = None
file_name: str, file_data: Path, file_metadata: dict[str, Any] | None = None
) -> list[Document]:
documents = IngestionHelper._load_file_to_documents(file_name, file_data)
for document in documents: