Skip to content

Commit

Permalink
langchain[patch]: load ReadFileTool (langchain-ai#14301)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Dr. Simon Kroll <krolls@fida.de>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Eugene Yurtsev <eugene@langchain.dev>
Co-authored-by: Bagatur <baskaryan@gmail.com>
  • Loading branch information
5 people authored Mar 30, 2024
1 parent 0884e5d commit c4da8d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libs/langchain/langchain/agents/load_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from typing import Any, Dict, List, Optional, Callable, Tuple
from mypy_extensions import Arg, KwArg

from langchain_community.tools.file_management import ReadFileTool
from langchain_core.tools import Tool
from langchain_core.language_models import BaseLanguageModel
from langchain_core.callbacks import BaseCallbackManager
Expand Down Expand Up @@ -413,6 +414,10 @@ def _get_google_cloud_texttospeech(**kwargs: Any) -> BaseTool:
return GoogleCloudTextToSpeechTool(**kwargs)


def _get_file_management_tool(**kwargs: Any) -> BaseTool:
return ReadFileTool(**kwargs)


def _get_reddit_search(**kwargs: Any) -> BaseTool:
return RedditSearchRun(api_wrapper=RedditSearchAPIWrapper(**kwargs))

Expand Down Expand Up @@ -501,6 +506,7 @@ def _get_reddit_search(**kwargs: Any) -> BaseTool:
),
"eleven_labs_text2speech": (_get_eleven_labs_text2speech, ["eleven_api_key"]),
"google_cloud_texttospeech": (_get_google_cloud_texttospeech, []),
"read_file": (_get_file_management_tool, []),
"reddit_search": (
_get_reddit_search,
["reddit_client_id", "reddit_client_secret", "reddit_user_agent"],
Expand Down

0 comments on commit c4da8d0

Please sign in to comment.