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

GoogleSearchAPIWrapper:TimeoutError[WinError 10060] #29038

Open
5 tasks done
SetonLiang opened this issue Jan 6, 2025 · 0 comments
Open
5 tasks done

GoogleSearchAPIWrapper:TimeoutError[WinError 10060] #29038

SetonLiang opened this issue Jan 6, 2025 · 0 comments

Comments

@SetonLiang
Copy link

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

from langchain_core.tools import Tool
from langchain_community.utilities import GoogleSearchAPIWrapper
import os
os.environ["GOOGLE_CSE_ID"] = "" # Your Google CSE ID
os.environ["GOOGLE_API_KEY"] = ""
search = GoogleSearchAPIWrapper()

tool = Tool(
    name="google_search",
    description="Search Google for recent results.",
    func=search.run,
)

result = tool.run("Obama's first name?")
print(result)

Error Message and Stack Trace (if applicable)

No response

Description

I want to call the Google Search API, and successfully run this website:
https://www.googleapis.com/customsearch/v1?key=YOUR_API_KEY&cx=YOUR_CX&q=SEARCH_QUERY

However, when I use the GoogleSearchAPIWrapper with the key and cx_id, it will generate an error: TimeoutError: [WinError 10060]

System Info

pip install google-api-python-client >=2.100.0

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

No branches or pull requests

1 participant