Skip to content

Commit 5eacb3b

Browse files
committed
Add additional tools
1 parent 3078e1f commit 5eacb3b

File tree

3 files changed

+273
-7
lines changed

3 files changed

+273
-7
lines changed

backend/app/core/graph/skills.py

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,52 @@
1-
from collections.abc import Callable
1+
from typing import Any
22

33
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+
)
616
from pydantic import BaseModel
717

818

919
class SkillInfo(BaseModel):
1020
description: str
11-
tool: Callable
21+
tool: Any
1222

1323

1424
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()
1727
),
1828
"wikipedia": SkillInfo(
1929
description="Searches Wikipedia",
2030
tool=WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()),
2131
),
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+
),
2252
}

0 commit comments

Comments
 (0)