|
|
|
@ -8,6 +8,7 @@ from typing import Optional
|
|
|
|
|
import pandas as pd
|
|
|
|
|
from langchain.agents import tool
|
|
|
|
|
from langchain.agents.agent_toolkits.pandas.base import create_pandas_dataframe_agent
|
|
|
|
|
from langchain.chains.qa_with_sources.loading import load_qa_with_sources_chain
|
|
|
|
|
from langchain.docstore.document import Document
|
|
|
|
|
|
|
|
|
|
ROOT_DIR = "./data/"
|
|
|
|
@ -15,11 +16,14 @@ ROOT_DIR = "./data/"
|
|
|
|
|
from langchain.chains.qa_with_sources.loading import BaseCombineDocumentsChain
|
|
|
|
|
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
|
|
|
from langchain.tools import BaseTool
|
|
|
|
|
from langchain.tools.file_management.read import ReadFileTool
|
|
|
|
|
from langchain.tools.file_management.write import WriteFileTool
|
|
|
|
|
from pydantic import Field
|
|
|
|
|
|
|
|
|
|
from swarms.utils.logger import logger
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@contextmanager
|
|
|
|
|
def pushd(new_dir):
|
|
|
|
|
"""Context manager for changing the current working directory."""
|
|
|
|
|