Skip to content

Commit

Permalink
fix cannot upload file (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
leehuwuj authored Sep 12, 2024
1 parent 38a8be8 commit c011455
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions templates/components/services/python/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from io import BytesIO
from pathlib import Path
from typing import Any, List, Tuple
from typing import List, Optional, Tuple

from app.engine.index import IndexConfig, get_index
from llama_index.core import VectorStoreIndex
Expand Down Expand Up @@ -72,7 +72,12 @@ def store_and_parse_file(file_name, file_data, extension) -> List[Document]:
return documents

@staticmethod
def process_file(file_name: str, base64_content: str, params: Any) -> List[str]:
def process_file(
file_name: str, base64_content: str, params: Optional[dict] = None
) -> List[str]:
if params is None:
params = {}

file_data, extension = PrivateFileService.preprocess_base64_file(base64_content)

# Add the nodes to the index and persist it
Expand Down

0 comments on commit c011455

Please sign in to comment.