mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 20:12:55 +01:00
fix: parse metadata as json, allow metadata typing
This commit is contained in:
parent
f47c05730d
commit
9177a0ad73
4 changed files with 16 additions and 10 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue