Update imports to use langchain_core.documents
This commit is contained in:
parent
7efa79af69
commit
c0c64c99c9
15 changed files with 36 additions and 31 deletions
|
|
@ -1,8 +1,8 @@
|
|||
from langflow import CustomComponent
|
||||
|
||||
from langchain.llms.base import BaseLLM
|
||||
from langchain.prompts import PromptTemplate
|
||||
from langchain.schema import Document
|
||||
from langchain_core.documents import Document
|
||||
|
||||
from langflow import CustomComponent
|
||||
|
||||
|
||||
class PromptRunner(CustomComponent):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from langchain.schema import Document
|
||||
|
||||
from langchain_core.documents import Document
|
||||
from langflow import CustomComponent
|
||||
from langflow.utils.constants import LOADERS_INFO
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
from typing import List
|
||||
|
||||
from langchain import document_loaders
|
||||
from langchain.schema import Document
|
||||
from langchain_core.documents import Document
|
||||
|
||||
from langflow import CustomComponent
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from typing import Optional
|
||||
|
||||
from langchain.schema import Document
|
||||
from langchain.text_splitter import Language
|
||||
from langchain_core.documents import Document
|
||||
|
||||
from langflow import CustomComponent
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
from typing import Optional
|
||||
|
||||
from langchain_core.documents import Document
|
||||
|
||||
from langflow import CustomComponent
|
||||
from langchain.schema import Document
|
||||
from langflow.utils.util import build_loader_repr_from_documents
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
from langflow import CustomComponent
|
||||
from langchain.schema import Document
|
||||
from langflow.services.database.models.base import orjson_dumps
|
||||
import requests
|
||||
from typing import Optional
|
||||
|
||||
import requests
|
||||
from langchain_core.documents import Document
|
||||
from langflow import CustomComponent
|
||||
from langflow.services.database.models.base import orjson_dumps
|
||||
|
||||
|
||||
class GetRequest(CustomComponent):
|
||||
display_name: str = "GET Request"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
# - **Document:** The Document containing the JSON object.
|
||||
|
||||
from langchain.schema import Document
|
||||
from langchain_core.documents import Document
|
||||
from langflow import CustomComponent
|
||||
from langflow.services.database.models.base import orjson_dumps
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
from langflow import CustomComponent
|
||||
from langchain.schema import Document
|
||||
from langflow.services.database.models.base import orjson_dumps
|
||||
import requests
|
||||
from typing import Optional
|
||||
|
||||
import requests
|
||||
from langchain_core.documents import Document
|
||||
from langflow import CustomComponent
|
||||
from langflow.services.database.models.base import orjson_dumps
|
||||
|
||||
|
||||
class PostRequest(CustomComponent):
|
||||
display_name: str = "POST Request"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
from typing import List, Optional
|
||||
|
||||
import requests
|
||||
from langchain_core.documents import Document
|
||||
from langflow import CustomComponent
|
||||
from langchain.schema import Document
|
||||
from langflow.services.database.models.base import orjson_dumps
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
from typing import Optional, Union
|
||||
from langflow import CustomComponent
|
||||
from typing import List, Optional
|
||||
|
||||
from langchain.embeddings.base import Embeddings
|
||||
from langchain.schema import BaseRetriever
|
||||
from langchain.schema import Document
|
||||
from langchain_community.vectorstores import VectorStore
|
||||
from langchain_community.vectorstores.pgvector import PGVector
|
||||
from langchain_core.documents import Document
|
||||
from langchain_core.retrievers import BaseRetriever
|
||||
|
||||
from langflow import CustomComponent
|
||||
|
||||
|
||||
class PGVectorComponent(CustomComponent):
|
||||
"""
|
||||
A custom component for implementing a Vector Store using PostgreSQL.
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ from langchain.agents.agent_toolkits.base import BaseToolkit
|
|||
from langchain.agents.tools import BaseTool
|
||||
from langchain.chains.base import Chain
|
||||
from langchain.document_loaders.base import BaseLoader
|
||||
from langchain.schema import Document
|
||||
from langchain_community.vectorstores import VectorStore
|
||||
from langchain_core.documents import Document
|
||||
from loguru import logger
|
||||
from pydantic import ValidationError
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import os
|
|||
from typing import Any, Callable, Dict, Type
|
||||
|
||||
import orjson
|
||||
from langchain.schema import Document
|
||||
from langchain_community.vectorstores import (
|
||||
FAISS,
|
||||
Chroma,
|
||||
|
|
@ -13,6 +12,7 @@ from langchain_community.vectorstores import (
|
|||
SupabaseVectorStore,
|
||||
Weaviate,
|
||||
)
|
||||
from langchain_core.documents import Document
|
||||
|
||||
|
||||
def docs_in_params(params: dict) -> bool:
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import re
|
||||
import inspect
|
||||
import importlib
|
||||
import inspect
|
||||
import re
|
||||
from functools import wraps
|
||||
from typing import List, Optional, Dict, Any, Union
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from docstring_parser import parse
|
||||
from langchain_core.documents import Document
|
||||
|
||||
from langflow.template.frontend_node.constants import FORCE_SHOW_FIELDS
|
||||
from langflow.utils import constants
|
||||
from langchain.schema import Document
|
||||
|
||||
|
||||
def remove_ansi_escape_codes(text):
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ export const custom = `from langflow import CustomComponent
|
|||
from langchain.llms.base import BaseLLM
|
||||
from langchain.chains import LLMChain
|
||||
from langchain.prompts import PromptTemplate
|
||||
from langchain.schema import Document
|
||||
from langchain_core.documents import Document
|
||||
from langflow.field_typing import NestedDict
|
||||
|
||||
import requests
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ from langflow.interface.custom.custom_component import CustomComponent
|
|||
from langchain.llms.base import BaseLLM
|
||||
from langchain.chains import LLMChain
|
||||
from langchain.prompts import PromptTemplate
|
||||
from langchain.schema import Document
|
||||
from langchain_core.documents import Document
|
||||
|
||||
import requests
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ def test_custom_component_get_function_entrypoint_return_type():
|
|||
Test the get_function_entrypoint_return_type
|
||||
property of the CustomComponent class.
|
||||
"""
|
||||
from langchain.schema import Document
|
||||
from langchain_core.documents import Document
|
||||
|
||||
custom_component = CustomComponent(code=code_default, function_entrypoint_name="build")
|
||||
return_type = custom_component.get_function_entrypoint_return_type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue