|
1 |
| -from collections.abc import Callable |
| 1 | +from typing import Any |
2 | 2 |
|
3 | 3 | from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun
|
4 |
| -from langchain_community.utilities import WikipediaAPIWrapper |
5 |
| -from langchain_core.tools import tool |
| 4 | +from langchain_community.tools.google_finance import GoogleFinanceQueryRun |
| 5 | +from langchain_community.tools.google_jobs import GoogleJobsQueryRun |
| 6 | +from langchain_community.tools.google_scholar import GoogleScholarQueryRun |
| 7 | +from langchain_community.tools.google_trends import GoogleTrendsQueryRun |
| 8 | +from langchain_community.tools.yahoo_finance_news import YahooFinanceNewsTool |
| 9 | +from langchain_community.utilities import ( |
| 10 | + GoogleFinanceAPIWrapper, |
| 11 | + GoogleJobsAPIWrapper, |
| 12 | + GoogleScholarAPIWrapper, |
| 13 | + GoogleTrendsAPIWrapper, |
| 14 | + WikipediaAPIWrapper, |
| 15 | +) |
6 | 16 | from pydantic import BaseModel
|
7 | 17 |
|
8 | 18 |
|
9 | 19 | class SkillInfo(BaseModel):
|
10 | 20 | description: str
|
11 |
| - tool: Callable |
| 21 | + tool: Any |
12 | 22 |
|
13 | 23 |
|
14 | 24 | all_skills: dict[str, SkillInfo] = {
|
15 |
| - "search": SkillInfo( |
16 |
| - description="Searches the web using Duck Duck Go", tool=DuckDuckGoSearchRun() |
| 25 | + "duckduckgo-search": SkillInfo( |
| 26 | + description="Searches the web using DuckDuckGo", tool=DuckDuckGoSearchRun() |
17 | 27 | ),
|
18 | 28 | "wikipedia": SkillInfo(
|
19 | 29 | description="Searches Wikipedia",
|
20 | 30 | tool=WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()),
|
21 | 31 | ),
|
| 32 | + "google-finance": SkillInfo( |
| 33 | + description="Get information from Google Finance Page via SerpApi.", |
| 34 | + tool=GoogleFinanceQueryRun(api_wrapper=GoogleFinanceAPIWrapper()), |
| 35 | + ), |
| 36 | + "google-jobs": SkillInfo( |
| 37 | + description="Fetch current job postings from Google Jobs via SerpApi.", |
| 38 | + tool=GoogleJobsQueryRun(api_wrapper=GoogleJobsAPIWrapper()), |
| 39 | + ), |
| 40 | + "google-scholar": SkillInfo( |
| 41 | + description="Fetch papers from Google Scholar via SerpApi.", |
| 42 | + tool=GoogleScholarQueryRun(api_wrapper=GoogleScholarAPIWrapper()), |
| 43 | + ), |
| 44 | + "google-trends": SkillInfo( |
| 45 | + description="Get information from Google Trends Page via SerpApi.", |
| 46 | + tool=GoogleTrendsQueryRun(api_wrapper=GoogleTrendsAPIWrapper()), |
| 47 | + ), |
| 48 | + "yahoo-finance": SkillInfo( |
| 49 | + description="Get information from Yahoo Finance News.", |
| 50 | + tool=YahooFinanceNewsTool(), |
| 51 | + ), |
22 | 52 | }
|
0 commit comments