Skip to content

Commit

Permalink
Merge pull request #6 from StreetLamb/more-tools
Browse files Browse the repository at this point in the history
Add additional tools
  • Loading branch information
StreetLamb authored Apr 30, 2024
2 parents 3078e1f + 5eacb3b commit 64f4564
Show file tree
Hide file tree
Showing 3 changed files with 273 additions and 7 deletions.
42 changes: 36 additions & 6 deletions backend/app/core/graph/skills.py
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(),
),
}
Loading

0 comments on commit 64f4564

Please sign in to comment.