|
|
@ -98,6 +98,11 @@ def load_files( |
|
|
|
description="Optional batch size for the collection.", |
|
|
|
examples=[256], |
|
|
|
), |
|
|
|
force_rebuild: bool = Body( |
|
|
|
False, |
|
|
|
description="Whether to force rebuild the collection if it already exists.", |
|
|
|
examples=[False], |
|
|
|
), |
|
|
|
): |
|
|
|
""" |
|
|
|
Load files into the vector database. |
|
|
@ -107,6 +112,7 @@ def load_files( |
|
|
|
collection_name (str, optional): Name for the collection. Defaults to None. |
|
|
|
collection_description (str, optional): Description for the collection. Defaults to None. |
|
|
|
batch_size (int, optional): Batch size for processing. Defaults to None. |
|
|
|
force_rebuild (bool, optional): Whether to force rebuild the collection. Defaults to False. |
|
|
|
|
|
|
|
Returns: |
|
|
|
dict: A dictionary containing a success message. |
|
|
@ -120,6 +126,7 @@ def load_files( |
|
|
|
collection_name=collection_name, |
|
|
|
collection_description=collection_description, |
|
|
|
batch_size=batch_size if batch_size is not None else 8, |
|
|
|
force_rebuild=force_rebuild, |
|
|
|
) |
|
|
|
return {"message": "Files loaded successfully."} |
|
|
|
except Exception as e: |
|
|
@ -148,6 +155,11 @@ def load_website( |
|
|
|
description="Optional batch size for the collection.", |
|
|
|
examples=[256], |
|
|
|
), |
|
|
|
force_rebuild: bool = Body( |
|
|
|
False, |
|
|
|
description="Whether to force rebuild the collection if it already exists.", |
|
|
|
examples=[False], |
|
|
|
), |
|
|
|
): |
|
|
|
""" |
|
|
|
Load website content into the vector database. |
|
|
@ -157,6 +169,7 @@ def load_website( |
|
|
|
collection_name (str, optional): Name for the collection. Defaults to None. |
|
|
|
collection_description (str, optional): Description for the collection. Defaults to None. |
|
|
|
batch_size (int, optional): Batch size for processing. Defaults to None. |
|
|
|
force_rebuild (bool, optional): Whether to force rebuild the collection. Defaults to False. |
|
|
|
|
|
|
|
Returns: |
|
|
|
dict: A dictionary containing a success message. |
|
|
@ -170,6 +183,7 @@ def load_website( |
|
|
|
collection_name=collection_name, |
|
|
|
collection_description=collection_description, |
|
|
|
batch_size=batch_size if batch_size is not None else 8, |
|
|
|
force_rebuild=force_rebuild, |
|
|
|
) |
|
|
|
return {"message": "Website loaded successfully."} |
|
|
|
except Exception as e: |
|
|
|