Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(community): Added Google Trends Integration #7248

Merged
merged 8 commits into from
Dec 14, 2024

Conversation

A-Jatana
Copy link
Contributor

@A-Jatana A-Jatana commented Nov 23, 2024

Description:
This PR introduces the Google Trends Tool from SerpAPI, allowing users to use the integrate a tool for Google Trends API with Langchain to retrieve and analyze search interest data. The tool supports viewing trends for specific search queries and exploring related queries to gain deeper insights.

New Files

  • libs/langchain-community/src/tools/google_trends.ts
    Implements the core functionality for the Google Trends Tool, including methods to handle normal queries and related queries.

  • examples/src/tools/google_trends.ts
    Provides an example of how to use the Google Trends Tool in a LangChain integration.

  • libs/langchain-community/src/tools/tests/google_trends.int.test.ts
    Includes integration tests to validate the functionality of the Google Trends Tool for normal and related queries.

  • docs/core_docs/docs/integrations/tools/google_trends.mdx
    Adds documentation with setup instructions and usage examples for the Google Trends Tool.

Updated Files

  • docs/api_refs/blacklisted-entrypoints.json
    Ensures the Google Trends Tool is correctly integrated and avoids exposure of unintended entry points in the API documentation.

  • libs/langchain-community/.gitignore
    Updates to ignore any temporary or generated files related to the Google Trends integration.

  • libs/langchain-community/langchain.config.js
    Configures the LangChain community package to include the Google Trends Tool for proper build and test pipeline integration.

  • libs/langchain-community/package.json
    Adds google-trends-api as a dependency and updates metadata to reflect the new tool.

Fixes # 7070

Sample Output

Query: Coffee

Date From: Nov 19 – 25,, 2023

Date To: Nov 17 – 23, 2024

Min Value: 84

Max Value: 100

Average Value: 91.75471698113208

Percent Change: 3.23%

Trend values: 93, 91, 98, 89, 92, 100, 93, 93, 89, 86, 86, 90, 90, 93, 92, 91, 87, 90, 91, 93, 84, 88, 90, 94, 91, 86, 89, 90, 88, 90, 94, 91, 85, 92, 95, 92, 90, 91, 100, 96, 96, 100, 93, 96, 91, 99, 93, 93, 89, 91, 89, 94, 96

Rising Related Queries: shop coffee tables on sale, coffee loophole recipe, costa coffee hot chocolate death, the coffee table movie, tomoro coffee, javy coffee, ninja coffee machine, dreams coffee, zus coffee, zus coffee near me, blank street coffee, 7 brew coffee, before the coffee gets cold series, ryze, ryze coffee, black sheep coffee, zus coffee menu, the coffee table, mushroom coffee

Top Related Queries: the coffee, coffee shop, coffee near me, coffee table, best coffee, coffee machine, coffee maker, black coffee, coffee cup, coffee shops, coffee house, coffee bean, starbucks coffee, starbucks, iced coffee, coffee beans, espresso, espresso coffee, cold coffee, coffee mug, white coffee, coffee bar, caffeine in coffee, coffe, coffee cups

Copy link

vercel bot commented Nov 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Dec 4, 2024 2:27am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Dec 4, 2024 2:27am

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Nov 23, 2024
@zhaoroger
Copy link
Contributor

Hi @jacoblee93, could you take a look at our PR? Thank you for your time!

@A-Jatana A-Jatana changed the title Added Google Trends Integration feat(community): Added Google Trends Integration Nov 30, 2024
@zhaoroger
Copy link
Contributor

Hi @jacoblee93 thanks for reviewing our PR. I have renamed GoogleTrendsAPI to SERPGoogleTrendsTool everywhere and changed to .invoke as suggested, as well as fixing some lint warnings I missed before.

…w interfaces for lint warnings, and minor documentation updates
Copy link
Collaborator

@jacoblee93 jacoblee93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Dec 13, 2024
@jacoblee93 jacoblee93 merged commit f8175ef into langchain-ai:main Dec 14, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features lgtm PRs that are ready to be merged as-is size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants