Merge branch 'update_lc' of personal:logspace-ai/langflow into update_lc
This commit is contained in:
commit
84c85727a8
10 changed files with 51 additions and 45 deletions
|
|
@ -10,7 +10,7 @@ class AZLyricsLoaderComponent(CustomComponent):
|
|||
|
||||
def build_config(self):
|
||||
return {
|
||||
"metadata": {"display_name": "Metadata", "type": "dict", "default": {}, "show": True},
|
||||
"metadata": {"display_name": "Metadata", "field_type": "dict", "value": {}, "show": True},
|
||||
"web_path": {"display_name": "Web Page", "type": "str", "required": True, "show": True},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,10 +17,11 @@ class AirbyteJSONLoaderComponent(CustomComponent):
|
|||
"type": "file",
|
||||
"fileTypes": ["json"],
|
||||
"required": True,
|
||||
"field_type": "file",
|
||||
},
|
||||
"metadata": {
|
||||
"display_name": "Metadata",
|
||||
"type": "dict",
|
||||
"field_type": "dict",
|
||||
"required": False,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,13 @@ class BSHTMLLoaderComponent(CustomComponent):
|
|||
"type": "file",
|
||||
"suffixes": [".html"],
|
||||
"file_types": ["html"],
|
||||
"field_type": "file",
|
||||
},
|
||||
"metadata": {
|
||||
"display_name": "Metadata",
|
||||
"required": False,
|
||||
"show": True,
|
||||
"type": "dict",
|
||||
"field_type": "dict",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
from langchain import CustomComponent
|
||||
from langflow import CustomComponent
|
||||
from typing import Optional, Dict, List
|
||||
from langchain.loaders import CSVLoader
|
||||
from langchain.documents import Document
|
||||
from langchain_community.document_loaders.csv_loader import CSVLoader
|
||||
from langchain.docstore.document import Document
|
||||
|
||||
class CSVLoaderComponent(CustomComponent):
|
||||
display_name = "CSVLoader"
|
||||
|
|
@ -15,6 +15,7 @@ class CSVLoaderComponent(CustomComponent):
|
|||
"required": True,
|
||||
"suffixes": [".csv"],
|
||||
"file_types": ["csv"],
|
||||
"field_type": "file",
|
||||
},
|
||||
"metadata": {
|
||||
"display_name": "Metadata",
|
||||
|
|
@ -25,6 +26,6 @@ class CSVLoaderComponent(CustomComponent):
|
|||
def build(
|
||||
self,
|
||||
file_path: str,
|
||||
metadata: Optional[Dict[str, str]] = None,
|
||||
metadata: dict
|
||||
) -> List[Document]:
|
||||
return CSVLoader(file_path=file_path, metadata=metadata).load()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from langflow import CustomComponent
|
||||
from langchain.documents import Document
|
||||
from langchain.docstore.document import Document
|
||||
from typing import Optional, Dict
|
||||
from langflow.field_typing import TemplateField
|
||||
|
||||
|
|
@ -11,13 +11,13 @@ class CoNLLULoaderComponent(CustomComponent):
|
|||
|
||||
def build_config(self):
|
||||
return {
|
||||
"file_path": TemplateField(
|
||||
display_name="File Path",
|
||||
required=True,
|
||||
type="file",
|
||||
file_types=["conllu"],
|
||||
suffixes=[".conllu"],
|
||||
),
|
||||
"file_path": {
|
||||
"display_name": "File Path",
|
||||
"required": True,
|
||||
"suffixes": [".conllu"],
|
||||
"file_types": ["conllu"],
|
||||
"field_type": "file",
|
||||
},
|
||||
"metadata": TemplateField(
|
||||
display_name="Metadata",
|
||||
required=False,
|
||||
|
|
@ -25,7 +25,7 @@ class CoNLLULoaderComponent(CustomComponent):
|
|||
),
|
||||
}
|
||||
|
||||
def build(self, file_path: str, metadata: Optional[Dict[str, str]] = None) -> Document:
|
||||
def build(self, file_path: str, metadata: dict) -> Document:
|
||||
# Here, you would use the actual class that loads CoNLL-U files.
|
||||
# As I don't have the specific class, I'm returning an instance of Document.
|
||||
# In a real scenario, you should replace the below Document with the actual loader class.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
from langflow import CustomComponent
|
||||
from langchain.document_loaders import Document
|
||||
from langchain.docstore.document import Document
|
||||
from typing import Optional, Dict
|
||||
|
||||
class CollegeConfidentialLoaderComponent(CustomComponent):
|
||||
|
|
@ -10,14 +10,14 @@ class CollegeConfidentialLoaderComponent(CustomComponent):
|
|||
|
||||
def build_config(self):
|
||||
return {
|
||||
"metadata": {"display_name": "Metadata", "default": {}},
|
||||
"metadata": {"display_name": "Metadata", "values": {}},
|
||||
"web_path": {"display_name": "Web Page", "required": True},
|
||||
}
|
||||
|
||||
def build(
|
||||
self,
|
||||
web_path: str,
|
||||
metadata: Optional[Dict] = None,
|
||||
metadata: Optional[dict] = {}
|
||||
) -> Document:
|
||||
# Assuming there is a loader class `CollegeConfidentialLoader` that takes `metadata` and `web_path` as arguments
|
||||
# Replace `CollegeConfidentialLoader` with the actual class name if different
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
from langflow import CustomComponent
|
||||
from langchain.data_connections import Document
|
||||
from langchain.docstore.document import Document
|
||||
from typing import Optional, Dict, Any
|
||||
|
||||
class DirectoryLoaderComponent(CustomComponent):
|
||||
|
|
@ -9,14 +9,14 @@ class DirectoryLoaderComponent(CustomComponent):
|
|||
|
||||
def build_config(self) -> Dict[str, Any]:
|
||||
return {
|
||||
"glob": {"display_name": "Glob Pattern", "default": "**/*.txt"},
|
||||
"load_hidden": {"display_name": "Load Hidden Files", "default": False, "advanced": True},
|
||||
"max_concurrency": {"display_name": "Max Concurrency", "default": 10, "advanced": True},
|
||||
"metadata": {"display_name": "Metadata", "default": {}},
|
||||
"glob": {"display_name": "Glob Pattern", "value": "**/*.txt"},
|
||||
"load_hidden": {"display_name": "Load Hidden Files", "value": False, "advanced": True},
|
||||
"max_concurrency": {"display_name": "Max Concurrency", "value": 10, "advanced": True},
|
||||
"metadata": {"display_name": "Metadata", "value": {}},
|
||||
"path": {"display_name": "Local Directory"},
|
||||
"recursive": {"display_name": "Recursive", "default": True, "advanced": True},
|
||||
"silent_errors": {"display_name": "Silent Errors", "default": False, "advanced": True},
|
||||
"use_multithreading": {"display_name": "Use Multithreading", "default": True, "advanced": True},
|
||||
"recursive": {"display_name": "Recursive", "value": True, "advanced": True},
|
||||
"silent_errors": {"display_name": "Silent Errors", "value": False, "advanced": True},
|
||||
"use_multithreading": {"display_name": "Use Multithreading", "value": True, "advanced": True},
|
||||
}
|
||||
|
||||
def build(
|
||||
|
|
@ -25,7 +25,7 @@ class DirectoryLoaderComponent(CustomComponent):
|
|||
path: str,
|
||||
load_hidden: Optional[bool] = False,
|
||||
max_concurrency: Optional[int] = 10,
|
||||
metadata: Optional[Dict[str, Any]] = None,
|
||||
metadata: Optional[dict] = {},
|
||||
recursive: Optional[bool] = True,
|
||||
silent_errors: Optional[bool] = False,
|
||||
use_multithreading: Optional[bool] = True,
|
||||
|
|
|
|||
|
|
@ -17,12 +17,13 @@ class EverNoteLoaderComponent(CustomComponent):
|
|||
"show": True,
|
||||
"type": "file",
|
||||
"file_types": ["xml"],
|
||||
"field_type": "file",
|
||||
},
|
||||
"metadata": {
|
||||
"display_name": "Metadata",
|
||||
"required": False,
|
||||
"show": True,
|
||||
"type": "dict",
|
||||
"field_type": "dict",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
from langflow import CustomComponent
|
||||
from langchain.documents import Document
|
||||
from langchain.docstore.document import Document
|
||||
from typing import Optional, Dict
|
||||
|
||||
class FacebookChatLoaderComponent(CustomComponent):
|
||||
|
|
@ -15,10 +15,12 @@ class FacebookChatLoaderComponent(CustomComponent):
|
|||
"required": True,
|
||||
"suffixes": [".json"],
|
||||
"file_types": ["json"],
|
||||
"field_type": "file",
|
||||
},
|
||||
"metadata": {
|
||||
"display_name": "Metadata",
|
||||
"required": False,
|
||||
"field_type": "dict",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -27,4 +29,4 @@ class FacebookChatLoaderComponent(CustomComponent):
|
|||
# and returns a Document object. Replace 'FacebookChatLoader' with the actual class name.
|
||||
# As per the JSON, the output type is 'Document', which is part of langchain.documents.
|
||||
# Therefore, the 'FacebookChatLoader' should be imported or defined elsewhere in the codebase.
|
||||
return FacebookChatLoader(file_path=file_path, metadata=metadata)
|
||||
return FacebookChatLoader(file_path=file_path, metadata=metadata)
|
||||
|
|
@ -9,25 +9,25 @@ class VertexAIEmbeddingsComponent(CustomComponent):
|
|||
|
||||
def build_config(self):
|
||||
return {
|
||||
"client": {"display_name": "Client", "advanced": True},
|
||||
"credentials": {"display_name": "Credentials", "default": '', "file_types": ['json']},
|
||||
"location": {"display_name": "Location", "default": 'us-central1', "advanced": True},
|
||||
"max_output_tokens": {"display_name": "Max Output Tokens", "default": 128},
|
||||
"max_retries": {"display_name": "Max Retries", "default": 6, "advanced": True},
|
||||
"model_name": {"display_name": "Model Name", "default": 'textembedding-gecko'},
|
||||
"n": {"display_name": "N", "default": 1, "advanced": True},
|
||||
"credentials": {"display_name": "Credentials", "value": '', "file_types": ['json'],"field_type": "file"},
|
||||
"instance": {"display_name": "instance", "advanced": True, "field_type": "dict"},
|
||||
"location": {"display_name": "Location", "value": 'us-central1', "advanced": True},
|
||||
"max_output_tokens": {"display_name": "Max Output Tokens", "value": 128},
|
||||
"max_retries": {"display_name": "Max Retries", "value": 6, "advanced": True},
|
||||
"model_name": {"display_name": "Model Name", "value": 'textembedding-gecko'},
|
||||
"n": {"display_name": "N", "value": 1, "advanced": True},
|
||||
"project": {"display_name": "Project", "advanced": True},
|
||||
"request_parallelism": {"display_name": "Request Parallelism", "default": 5, "advanced": True},
|
||||
"request_parallelism": {"display_name": "Request Parallelism", "value": 5, "advanced": True},
|
||||
"stop": {"display_name": "Stop", "advanced": True},
|
||||
"streaming": {"display_name": "Streaming", "default": False, "advanced": True},
|
||||
"temperature": {"display_name": "Temperature", "default": 0.0},
|
||||
"top_k": {"display_name": "Top K", "default": 40, "advanced": True},
|
||||
"top_p": {"display_name": "Top P", "default": 0.95, "advanced": True},
|
||||
"streaming": {"display_name": "Streaming", "value": False, "advanced": True},
|
||||
"temperature": {"display_name": "Temperature", "value": 0.0},
|
||||
"top_k": {"display_name": "Top K", "value": 40, "advanced": True},
|
||||
"top_p": {"display_name": "Top P", "value": 0.95, "advanced": True},
|
||||
}
|
||||
|
||||
def build(
|
||||
self,
|
||||
client: Optional[str] = None,
|
||||
instance: Optional[str] = None,
|
||||
credentials: Optional[str] = None,
|
||||
location: str = 'us-central1',
|
||||
max_output_tokens: int = 128,
|
||||
|
|
@ -43,7 +43,7 @@ class VertexAIEmbeddingsComponent(CustomComponent):
|
|||
top_p: float = 0.95,
|
||||
) -> VertexAIEmbeddings:
|
||||
return VertexAIEmbeddings(
|
||||
client=client,
|
||||
instance=instance,
|
||||
credentials=credentials,
|
||||
location=location,
|
||||
max_output_tokens=max_output_tokens,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue