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 .py files for all existing .mdx tools, Add .mdx, .py for the new AgentQL tool #428

Merged
merged 4 commits into from
Mar 26, 2025

Conversation

asiffarhankhan
Copy link
Contributor

No description provided.

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 @asiffarhankhan, 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 new example files demonstrating the usage of various Langchain tools with PraisonAI agents. It includes a new documentation file for the AgentQL tool and a corresponding Python example. Additionally, it introduces example Python files for Azure Code Interpreter, Bearly Code Interpreter, DuckDuckGo Search, Exa Search, Google Search, Google Serper Search, Jina Code Interpreter, Jina Search, SearchApi Search, Serp Search, Tavily Search, Wikipedia Search, and You Search. The PR aims to provide users with practical examples of how to integrate these tools into their PraisonAI agent workflows.

Highlights

  • New Tool: AgentQL: Adds documentation and an example for using the AgentQL tool for structured data extraction from webpages.
  • Langchain Tool Examples: Introduces example Python files showcasing the integration of various Langchain tools (e.g., search engines, code interpreters) with PraisonAI agents.
  • Agent Integration: Demonstrates how to create agents with specific instructions and tools, and how to initialize and run them using PraisonAIAgents.

Changelog

Click here to see the changelog
  • docs/tools/external/agentql-toolkit.mdx
    • Created a new documentation file for the AgentQL tool, providing an overview, installation instructions, and example code for extracting structured data from webpages using PraisonAI agents.
  • examples/tools/langchain/agentql-toolkit.py
    • Added a new example Python file demonstrating how to use the AgentQL tool with PraisonAI agents to extract data from a specified URL based on a given query.
  • examples/tools/langchain/azure-code-interpreter.py
    • Created a new example Python file demonstrating the use of the Azure Code Interpreter tool with PraisonAI agents for executing Python code.
  • examples/tools/langchain/bearly-code-interpreter.py
    • Added a new example Python file showcasing the integration of the Bearly Code Interpreter tool with PraisonAI agents for executing Python code.
  • examples/tools/langchain/duckduckgo-search.py
    • Created a new example Python file demonstrating the use of the DuckDuckGo search tool with PraisonAI agents for searching and reading research papers.
  • examples/tools/langchain/exa-search.py
    • Added a new example Python file showcasing the integration of the Exa search tool with PraisonAI agents for finding job listings.
  • examples/tools/langchain/google-search.py
    • Created a new example Python file demonstrating the use of the Google Search tool with PraisonAI agents for searching information.
  • examples/tools/langchain/google-serper-search.py
    • Added a new example Python file showcasing the integration of the Google Serper Search tool with PraisonAI agents for suggesting websites.
  • examples/tools/langchain/jina-code-interpreter.py
    • Created a new example Python file demonstrating the use of the Jina Code Interpreter tool with PraisonAI agents for executing Python code.
  • examples/tools/langchain/jina-search.py
    • Added a new example Python file showcasing the integration of the Jina Search tool with PraisonAI agents for finding websites.
  • examples/tools/langchain/searchapi-search.py
    • Created a new example Python file demonstrating the use of the SearchApi Search tool with PraisonAI agents for searching information.
  • examples/tools/langchain/serp-search.py
    • Added a new example Python file showcasing the integration of the Serp Search tool with PraisonAI agents for searching information.
  • examples/tools/langchain/tavily-search.py
    • Created a new example Python file demonstrating the use of the Tavily Search tool with PraisonAI agents for searching information.
  • examples/tools/langchain/wikipedia-search.py
    • Added a new example Python file showcasing the integration of the Wikipedia Search tool with PraisonAI agents for gathering information.
  • examples/tools/langchain/you-search.py
    • Created a new example Python file demonstrating the use of the You Search tool with PraisonAI agents for gathering information.
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.


AIs are learning, agents in the night,
Searching, coding, with all their might.
From web data's gleam to code's command,
Tools in hand, across the land.

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 adds documentation and examples for using the AgentQL tool with PraisonAI agents, and includes several new example Python files demonstrating various Langchain tools. The addition of the AgentQL documentation and example is a valuable contribution. The new example files showcase the integration of PraisonAI agents with various Langchain tools, which enhances the usability and understanding of the framework. However, there are a few areas that could be improved to ensure clarity and maintainability.

Summary of Findings

  • Environment Variable Setting in Documentation: The documentation includes setting the AgentQL API key directly in the code, which is not a secure practice. It should emphasize setting the API key as an environment variable.
  • Inconsistent Tool Usage: Some examples define a function to invoke a tool, while others directly use the tool. Consistency in tool usage would improve readability and maintainability.
  • Missing Error Handling: The examples lack error handling for API calls and tool invocations, which could lead to unexpected behavior in production.

Merge Readiness

The pull request introduces valuable documentation and examples. However, addressing the security concern regarding API key handling and improving consistency in tool usage would significantly enhance the quality of the code. I recommend addressing these issues before merging. I am unable to approve this pull request, and users should have others review and approve this code before merging.

Comment on lines +16 to +17
os.environ["AGENTQL_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

Setting the API key directly in the code is not recommended for security reasons. It's better to load it from environment variables. Consider updating this to reflect that best practice.

os.environ["AGENTQL_API_KEY"] = os.getenv('AGENTQL_API_KEY')

Comment on lines +10 to +16
def extract_web_data_tool(url, query):
agentql_tool = ExtractWebDataTool().invoke(
{
"url": url,
"prompt": query,
},)
return agentql_tool

Choose a reason for hiding this comment

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

medium

Consider adding error handling to the invoke call. This will help prevent unexpected crashes if the API call fails.

def extract_web_data_tool(url, query):
    try:
        agentql_tool = ExtractWebDataTool().invoke(
            {
                "url": url,
                "prompt": query,
            },)
        return agentql_tool
    except Exception as e:
        print(f"Error invoking ExtractWebDataTool: {e}")
        return None # Or raise the exception, depending on desired behavior

@MervinPraison MervinPraison merged commit cbc6939 into MervinPraison:main Mar 26, 2025
1 of 2 checks passed
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.

2 participants