Update CollegeConfidentialLoader.py

This commit is contained in:
carlosrcoelho 2024-01-09 19:40:27 -03:00
commit 920f092ea1

View file

@ -1,6 +1,6 @@
from langflow import CustomComponent from langflow import CustomComponent
from langchain.document_loaders import Document from langchain.docstore.document import Document
from typing import Optional, Dict from typing import Optional, Dict
class CollegeConfidentialLoaderComponent(CustomComponent): class CollegeConfidentialLoaderComponent(CustomComponent):
@ -10,14 +10,14 @@ class CollegeConfidentialLoaderComponent(CustomComponent):
def build_config(self): def build_config(self):
return { return {
"metadata": {"display_name": "Metadata", "default": {}}, "metadata": {"display_name": "Metadata", "values": {}},
"web_path": {"display_name": "Web Page", "required": True}, "web_path": {"display_name": "Web Page", "required": True},
} }
def build( def build(
self, self,
web_path: str, web_path: str,
metadata: Optional[Dict] = None, metadata: Optional[dict] = {}
) -> Document: ) -> Document:
# Assuming there is a loader class `CollegeConfidentialLoader` that takes `metadata` and `web_path` as arguments # Assuming there is a loader class `CollegeConfidentialLoader` that takes `metadata` and `web_path` as arguments
# Replace `CollegeConfidentialLoader` with the actual class name if different # Replace `CollegeConfidentialLoader` with the actual class name if different