crewAI: DuckDuckGo Search not working anymore? Not supported?

I updated to the latest crewai release 0.19.0 and DuckDuckGo Search does not working anymore. Is this not supported anymore? Here is the error:

`Action: duckduckgo_search Action Input: {“q”: “AIi news latest not older than 1 day”}

I encountered an error while trying to use the tool. This was the error: DuckDuckGoSearchRun._run() got an unexpected keyword argument ‘q’. Tool duckduckgo_search accepts there inputs: A wrapper around DuckDuckGo Search. Useful for when you need to answer questions about current events. Input should be a search query. `

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Hello guys, I was facing absolutely the same problem but after the solution suggested by João seems it finally worked

Libraries version:
crewai 0.19.0
crewai-tools 0.0.15
duckduckgo_search 5.0

The changed part: image

Output: image

It seems to be something around how the duckduckgo tool specificaly was constructed, if you wrap it as a crewAI tool it shoudl work:

from crewai_tools import tool

@tool('DuckDuckGoSearch')
def search(search_query: str):
    """Search the web for information on a given topic"""
    return DuckDuckGoSearchRun().run(search_query)

agent = Agent(
#...
    tools=[search],
#...
)

– João Moura @joaomdmoura http://twitter.com/joaomdmoura

Em ter., 5 de mar. de 2024 às 13:18, marioz78 @.***> escreveu:

Hi, I have the same issue with error msg --> action duck_search doesn’t exist

— Reply to this email directly, view it on GitHub https://github.com/joaomdmoura/crewAI/issues/316#issuecomment-1979142855, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFC3N5Q27IV25FAZSUKKCDYWXV3TAVCNFSM6AAAAABEGYI526VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZZGE2DEOBVGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Hi, I have the same issue with error msg --> action duck_search doesn’t exist

It seems to be something around how the duckduckgo tool specificaly was constructed, if you wrap it as a crewAI tool it shoudl work: python from crewai_tools import tool @tool('DuckDuckGoSearch') def search(search_query: str): """Search the web for information on a given topic""" return DuckDuckGoSearchRun().run(search_query) agent = Agent( #... tools=[search], #... ) … – João Moura @joaomdmoura http://twitter.com/joaomdmoura Em ter., 5 de mar. de 2024 às 13:18, marioz78 @.> escreveu: Hi, I have the same issue with error msg --> action duck_search doesn’t exist — Reply to this email directly, view it on GitHub <#316 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFC3N5Q27IV25FAZSUKKCDYWXV3TAVCNFSM6AAAAABEGYI526VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZZGE2DEOBVGU . You are receiving this because you are subscribed to this thread.Message ID: @.>

wrapping it as suggested got the same errore --> Action ‘DuckDuckGoSearch(‘latest advancements in AI 2024’)’ don’t exist, these are the only available Actions: DuckDuckGoSearch: DuckDuckGoSearch(search_query: ‘string’) - Search the web for information on a given topic

Just a suggestion. I isolated/debug the issue by creating a test.py with only the minimum code. First to use the tool by itself, nothing else, and see if it works. And so on…

And I figure out that I could not use the old way:

search_tool = searchduck(source_material)

but invoking the searchduck(source_material) directly inside the Agent declaration. Not sure if this is your case but it worked for me.

@tool("Needfindertool")        
def Need_tool(Company_name: str):
            """The input to this tool should be the name of the client company they are searching for ,
            This tool is useful for finding the core needs of given company
            """
            loader = CSVLoader(file_path="client.csv")
            texts = loader.load()          
            new_db=FAISS.from_documents(texts, embeddings)
            db=new_db.as_retriever(search_type="mmr",search_kwargs={"k": 1})
            documents=db.get_relevant_documents(Company_name)
            llm= ChatOpenAI(model='gpt-3.5-turbo')
            prompt = PromptTemplate(template="""What are the needs of the following company ,and while answering answer based on core needs of company such what industrial problem are they facing  \n,
                          answer the content related to asked :
                                                 {context}
    
                          Question: {question}""",input_variables=["question","context"])           
            output_parser = StrOutputParser()
            chain = prompt | llm | output_parser
            result=chain.invoke({'question':Company_name,'context':documents})
            return result

Is there something wrong with these tool

I am getting this output Screenshot 2024-03-07 183637