-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from StreetLamb/more-tools
Add additional tools
- Loading branch information
Showing
3 changed files
with
273 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,52 @@ | ||
from collections.abc import Callable | ||
from typing import Any | ||
|
||
from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun | ||
from langchain_community.utilities import WikipediaAPIWrapper | ||
from langchain_core.tools import tool | ||
from langchain_community.tools.google_finance import GoogleFinanceQueryRun | ||
from langchain_community.tools.google_jobs import GoogleJobsQueryRun | ||
from langchain_community.tools.google_scholar import GoogleScholarQueryRun | ||
from langchain_community.tools.google_trends import GoogleTrendsQueryRun | ||
from langchain_community.tools.yahoo_finance_news import YahooFinanceNewsTool | ||
from langchain_community.utilities import ( | ||
GoogleFinanceAPIWrapper, | ||
GoogleJobsAPIWrapper, | ||
GoogleScholarAPIWrapper, | ||
GoogleTrendsAPIWrapper, | ||
WikipediaAPIWrapper, | ||
) | ||
from pydantic import BaseModel | ||
|
||
|
||
class SkillInfo(BaseModel): | ||
description: str | ||
tool: Callable | ||
tool: Any | ||
|
||
|
||
all_skills: dict[str, SkillInfo] = { | ||
"search": SkillInfo( | ||
description="Searches the web using Duck Duck Go", tool=DuckDuckGoSearchRun() | ||
"duckduckgo-search": SkillInfo( | ||
description="Searches the web using DuckDuckGo", tool=DuckDuckGoSearchRun() | ||
), | ||
"wikipedia": SkillInfo( | ||
description="Searches Wikipedia", | ||
tool=WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()), | ||
), | ||
"google-finance": SkillInfo( | ||
description="Get information from Google Finance Page via SerpApi.", | ||
tool=GoogleFinanceQueryRun(api_wrapper=GoogleFinanceAPIWrapper()), | ||
), | ||
"google-jobs": SkillInfo( | ||
description="Fetch current job postings from Google Jobs via SerpApi.", | ||
tool=GoogleJobsQueryRun(api_wrapper=GoogleJobsAPIWrapper()), | ||
), | ||
"google-scholar": SkillInfo( | ||
description="Fetch papers from Google Scholar via SerpApi.", | ||
tool=GoogleScholarQueryRun(api_wrapper=GoogleScholarAPIWrapper()), | ||
), | ||
"google-trends": SkillInfo( | ||
description="Get information from Google Trends Page via SerpApi.", | ||
tool=GoogleTrendsQueryRun(api_wrapper=GoogleTrendsAPIWrapper()), | ||
), | ||
"yahoo-finance": SkillInfo( | ||
description="Get information from Yahoo Finance News.", | ||
tool=YahooFinanceNewsTool(), | ||
), | ||
} |
Oops, something went wrong.