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

Add external search tool documentation for PraisonAI agents #406

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

MervinPraison
Copy link
Owner

  • Updated mint.json to include new external tools section
  • Expanded langchain_tools.mdx with more comprehensive examples and explanations
  • Added documentation pages for BraveSearch, Google Trends, and SerpAPI tools
  • Included installation, setup, and usage examples for external search tools
  • Organized new documentation under the "External Tools" group

- Updated `mint.json` to include new external tools section
- Expanded `langchain_tools.mdx` with more comprehensive examples and explanations
- Added documentation pages for BraveSearch, Google Trends, and SerpAPI tools
- Included installation, setup, and usage examples for external search tools
- Organized new documentation under the "External Tools" group
@MervinPraison MervinPraison merged commit bc33c05 into main Mar 10, 2025
3 of 6 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @MervinPraison, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request adds documentation for external search tools (BraveSearch, Google Trends, and SerpAPI) for use with PraisonAI agents. It includes installation instructions, setup guides, and usage examples. The documentation is organized under a new "External Tools" group in the mint.json configuration file. The langchain_tools.mdx file is expanded with more comprehensive examples and explanations.

Highlights

  • Documentation: Adds documentation pages for BraveSearch, Google Trends, and SerpAPI tools.
  • Configuration: Updates mint.json to include a new "External Tools" section for the documentation.
  • Examples: Expands langchain_tools.mdx with more comprehensive examples and explanations for using LangChain tools with PraisonAI agents.
  • Installation and Setup: Includes installation, setup, and usage examples for the new external search tools.

Changelog

Click here to see the changelog
  • docs/mint.json
    • Added a new 'External Tools' group to the documentation navigation, including links to the SerpAPI, BraveSearch, and Google Trends documentation pages. Lines 209-216
  • docs/tools/external/brave-search.mdx
    • Created a new documentation page for the BraveSearch tool, including an overview, installation instructions, environment variable setup, and a usage example with PraisonAI agents. Lines 1-38
  • docs/tools/external/google-trends.mdx
    • Created a new documentation page for the Google Trends tool, including an overview, installation instructions, environment variable setup, and a usage example with PraisonAI agents. Lines 1-34
  • docs/tools/external/serp-api.mdx
    • Created a new documentation page for the SerpAPI tool, including an overview, installation instructions, environment variable setup, and a usage example with PraisonAI agents. Lines 1-26
  • docs/tools/langchain_tools.mdx
    • Expanded the documentation to include a quick start guide with both code and no-code examples, API key setup, and example usage with Wikipedia and YouTube tools. Lines 13-115
    • Added sections explaining LangChain integration, features, and usage examples with and without wrappers. Lines 124-202
    • Removed redundant 'With More Detailed Instructions' section. Lines 219-378
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Trivia time!

Which search engine was co-founded by Brendan Eich, the creator of JavaScript?

Click here for the answer
Brave Search was co-founded by Brendan Eich, the creator of JavaScript.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces documentation for external search tools, enhancing the PraisonAI agents' capabilities. The addition of BraveSearch, Google Trends, and SerpAPI documentation is a valuable contribution. The structure and content are generally well-organized, providing clear installation, setup, and usage examples. However, there are a few areas that could be improved for clarity and consistency.

Summary of Findings

  • Inconsistent API Key Variable Names: The documentation uses different environment variable names for API keys across different tools (e.g., BRAVE_SEARCH_API vs. SERPAPI_API_KEY). Consistent naming would improve user experience.
  • Missing Google Trends API Key Setup: The Google Trends documentation lacks instructions on how to obtain a SerpAPI key, which is required for the GoogleTrendsAPIWrapper. This needs to be clarified.
  • Incomplete Code Example for Google Trends: The Google Trends example code is missing the environment variable setup within the Python code, which is crucial for the tool to function correctly.

Merge Readiness

The pull request is a valuable addition to the documentation, but there are a few issues that need to be addressed before merging. Specifically, the inconsistencies in API key variable names and the missing Google Trends API key setup should be resolved. I am unable to approve this pull request, and users should have others review and approve this code before merging. At a minimum, the high severity issues should be addressed before merging.

Comment on lines +16 to +17
export SERPAPI_API_KEY=your_api_key_here
```

Choose a reason for hiding this comment

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

high

It would be helpful to include a note here indicating that the SERPAPI_API_KEY is required to use the Google Trends tool, and a link to where users can obtain this key.

export SERPAPI_API_KEY=your_api_key_here # Required for Google Trends API

Comment on lines 23 to 26
research_agent = Agent(
instructions="Research trending topics related to AI",
tools=[google_trends_tool]
tools=[GoogleTrendsAPIWrapper]
)

Choose a reason for hiding this comment

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

high

The tools parameter in the Agent constructor expects an instance of the tool, not the class itself. You should instantiate GoogleTrendsAPIWrapper before passing it to the agent. Also, the example is missing the API key setup within the Python code, which is crucial for the tool to function correctly. Consider adding os.environ["SERPAPI_API_KEY"] = "your_serpapi_key_here" before the agent definition.

from langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper
from praisonaiagents import Agent, PraisonAIAgents
import os

os.environ["SERPAPI_API_KEY"] = "your_serpapi_key_here" # Set your SerpAPI API Key

research_agent = Agent(
    instructions="Research trending topics related to AI",
    tools=[GoogleTrendsAPIWrapper()]
)

Comment on lines +12 to +13
pip install langchain-community google-search-results
```

Choose a reason for hiding this comment

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

medium

Consider adding a comment explaining why google-search-results is needed here, as it might not be immediately obvious to the user.

pip install langchain-community google-search-results # Required for parsing search results

Comment on lines +13 to +14
export SERPAPI_API_KEY=your_api_key_here
export OPENAI_API_KEY=your_api_key_here

Choose a reason for hiding this comment

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

medium

For consistency, consider using the same environment variable naming convention as in the BraveSearch documentation (e.g., SERPAPI_API instead of SERPAPI_API_KEY).

export SERPAPI_API=your_api_key_here
export OPENAI_API_KEY=your_api_key_here

Copy link

netlify bot commented Mar 10, 2025

Deploy Preview for praisonai ready!

Name Link
🔨 Latest commit 401c068
🔍 Latest deploy log https://app.netlify.com/sites/praisonai/deploys/67ce7e96c6573c00086ca7a8
😎 Deploy Preview https://deploy-preview-406--praisonai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant