Skip to content

Set Search Engine does not work on SearchGraph #955

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

Open
AlanY1an opened this issue Mar 18, 2025 · 1 comment
Open

Set Search Engine does not work on SearchGraph #955

AlanY1an opened this issue Mar 18, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@AlanY1an
Copy link

Describe the bug
I set search_engine as duckduckgo. But it still uses Google Search engine and it seems that Google search cannot be scraped.

`
graph_config = {
"llm_model": "ollama/llama3",
"llm": {
"model": "ollama/llama3",
"format": "json",
"temperature": 0,
"base_url": "http://localhost:11434",
},
"verbose": True,
"headless": False,
"search_engine": "duckduckgo",
"max_results": 5,
}

prompt = {
"description": "Finding description about company {company}.",
"history": "Finding history about company {company}.",
"events": "Finding recent events about company{company}.",
}

def retrieve_basic_info_by_search(company_name: str) -> Dict[str, str]:
smart_scraper_graph = SearchGraph(
prompt=prompt["description"].format(company=company_name),
config=graph_config,
)
result = smart_scraper_graph.run()
return json.dumps(result, indent=2)

if name == "main":
company = "LinkedIn"
company_info = retrieve_basic_info_by_search(company)
print(f"\nSummary for {company}:")
print(company_info)
`

--- Executing MergeAnswers Node ---

Summary for LinkedIn:
{
"company_description": [
{
"source": "Website 1",
"description": "LinkedIn is a social networking platform designed for professionals and job seekers."
},
{
"source": "Website 2",
"description": "LinkedIn is a business and employment-oriented online service that operates through websites and mobile apps."
}
],
"sources": [
"http://www.google.com/search?hl=en&q={"description+about+LinkedIn"+:+"company+LinkedIn"}"
]
}

Copy link

dosubot bot commented Mar 18, 2025

Hey there, @AlanY1an! I'm here to help you out with any bugs or questions you have while waiting for a human maintainer. Let's tackle this together!

To ensure that the SearchGraph uses DuckDuckGo instead of Google, make sure you have the necessary dependencies installed. Specifically, you need the DuckDuckGoSearchResults from the langchain_community.tools module and the duckduckgo-search library version >=7.2.1 [1][2].

Additionally, verify that your configuration is correctly set up to use DuckDuckGo by including "search_engine": "duckduckgo" in your graph_config, which you have already done. If the issue persists, check if there are any error messages or logs that might indicate why the setting is being ignored. The verbose setting in your configuration should help provide more detailed logs during execution [3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot dosubot bot added the bug Something isn't working label Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant