Skip to content

BUG: Web search tools can hang indefinitely #1713

@dzungvpham

Description

@dzungvpham

Problem
Web search tools may hang indefinitely without a timeout specified

In the implementation of the search-related tools in default_tools.py, the current use of requests.get can lead to an indefinite hang because the timeout parameter is not specified (except for the VisitWebpageTool which has a timeout of 20 seconds). (Reference: https://requests.readthedocs.io/en/latest/user/quickstart/#timeouts)

Suggested fix: Add a timeout parameter to the tools and pass it to the requests.get call so that users can control the timeout when creating the tools.

Checklist

  • I have searched the existing issues and have not found a similar bug report.
  • I have provided a minimal, reproducible example.
  • I have provided the full traceback of the error.
  • I have provided my environment details.
  • I am willing to work on this issue and submit a pull request. (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions