crewAI
crewAI copied to clipboard
SerperDevTool._run() missing 1 required positional argument: 'search_query'.
A.I says: I encountered an error while trying to use the tool. This was the error: SerperDevTool._run() missing 1 required positional argument: 'search_query'. Tool Search the internet accepts these inputs: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
I am just running from the example, copy and paste. `` import os from crewai import Agent, Task, Crew, Process from crewai_tools import SerperDevTool
#os.environ["OPENAI_API_KEY"] = "YOUR_API_KEY" os.environ["SERPER_API_KEY"] = "I have filled this in with a valid key" # serper.dev API key
os.environ["OPENAI_API_BASE"] ='http://localhost:11434/v1' os.environ["OPENAI_MODEL_NAME"] ='mistral' # Adjust based on available model os.environ["OPENAI_API_KEY"] ='null' #switching between null and ollama makes no difference, the error as mentioned remains.
search_tool = SerperDevTool() ``
The rest is exactly copy and paste from the front page example.
Could be a model limitation but will give it a try as well! Em 5 de abr. de 2024, 19:32 -0300, Bracer Jack @.***> escreveu:
A.I says: I encountered an error while trying to use the tool. This was the error: SerperDevTool._run() missing 1 required positional argument: 'search_query'. Tool Search the internet accepts these inputs: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content. I am just running from the example, copy and paste. import os from crewai import Agent, Task, Crew, Process from crewai_tools import SerperDevTool #os.environ["OPENAI_API_KEY"] = "YOUR_API_KEY" os.environ["SERPER_API_KEY"] = "I have filled this in with a valid key" # serper.dev API key You can choose to use a local model through Ollama for example. See https://docs.crewai.com/how-to/LLM-Connections/ for more information. os.environ["OPENAI_API_BASE"] ='http://localhost:11434/v1' os.environ["OPENAI_MODEL_NAME"] ='mistral' # Adjust based on available model os.environ["OPENAI_API_KEY"] ='null' #switching between null and ollama makes no difference, the error as mentioned remains. search_tool = SerperDevTool() The rest is exactly copy and paste from the front page example. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Could be a model limitation
Ok let me try again now: import os from crewai import Agent, Task, Crew, Process from crewai_tools import SerperDevTool
#os.environ["OPENAI_API_KEY"] = "YOUR_API_KEY" os.environ["SERPER_API_KEY"] = "valid API Key enetered" # serper.dev API key
os.environ["OPENAI_API_BASE"] ='http://localhost:11434/v1' os.environ["OPENAI_MODEL_NAME"] ='llava' #I swtitched from 'mistral' to llava. os.environ["OPENAI_API_KEY"] ='null' bla bla bla
Result: Action 'search_query' don't exist, these are the only available Actions: Search the internet: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
Switching from 'mistral' to 'llava' makes no difference, the search still fails. the serper API key is valid. It should also be noted that I install via: pip install "crewai[tools]" so the tools exist.
I'll also try the same models locally just in case to make sure we make it better for them, but just in case, gpt4 works like a cham I guess?
-- João Moura @joaomdmoura http://twitter.com/joaomdmoura
Em sex., 5 de abr. de 2024 às 19:38, Bracer Jack @.***> escreveu:
Could be a model limitation
Ok let me try again now: import os from crewai import Agent, Task, Crew, Process from crewai_tools import SerperDevTool
#os.environ["OPENAI_API_KEY"] = "YOUR_API_KEY" os.environ["SERPER_API_KEY"] = "a0b7dc06666b68bac203ea16276b9e58c21e19dd"
serper.dev API key
You can choose to use a local model through Ollama for example. See https://docs.crewai.com/how-to/LLM-Connections/ for more information.
os.environ["OPENAI_API_BASE"] ='http://localhost:11434/v1' os.environ["OPENAI_MODEL_NAME"] ='llava' #I swtitch from 'mistral' to llava. os.environ["OPENAI_API_KEY"] ='null' bla bla bla
Result: Action 'search_query' don't exist, these are the only available Actions: Search the internet: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
— Reply to this email directly, view it on GitHub https://github.com/joaomdmoura/crewAI/issues/430#issuecomment-2040720430, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFC3N4UM3DU37IDAJB4M5LY34RWJAVCNFSM6AAAAABFZ34LFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBQG4ZDANBTGA . You are receiving this because you commented.Message ID: @.***>
No idea, I only use local models. CrewA.I. worked before, but I deleted the archived venv isolated folder to update because it has been a long time and that venv backup was old, should have kept the backup! ha ha ha Good luck solving this :D
More reports: Action 'search_query('AI advancements 2023')' don't exist, these are the only available Actions: Search the internet: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
Switched from Ollama to LM Studio to see if anything changes, nope same issue, it should also be noted that yet another different model was used, this issue seems to be model independent: Action '[Search the internet] 'artificial intelligence trends 2024' - A tool that can be used to semantic search a query from a txt's content.' don't exist, these are the only available Actions: Search the internet: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
I have updated crewA.I. to the latest v0.28.1 7 April 2024 and it is still giving this error: "I encountered an error while trying to use the tool. This was the error: SerperDevTool._run() missing 1 required positional argument: 'search_query'. Tool Search the internet accepts these inputs: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content."
I've ran into the same issue but weirdly enough it only appears to fail sporadically; i first saw the error 5m ago and I ended up re-running just for the sake of it but it appears to be working now.
Edit: it actually just failed in the middle of my task. It made two successfully Serper search requests, failed twice and then worked again:
_I encountered an error while trying to use the tool. This was the error: SerperDevTool.run() missing 1 required positional argument: 'search_query'. Tool Search the internet accepts these inputs: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
I mean I'm doing some digging but it seems to be a model limitation (smaller models sometime struggle more than bigger ones), the good thing is that crewAI will try to skew the model to try again with the right format, but I'll still do some more digging on this
@joaomdmoura thanks for the quick reply. I've edited my comment above btw, it now appears to fail sporadically instead of permanently.
For the record, I'm using Mistral 7B on a MacBook Air M1 (16GB RAM). I'm aware it is a bit heavy, as there is some delay when chatting with the LLM locally. I will give it a shot on a smaller LLM later today hopefully.
Yup, smaller model will probably fail even more often
Oh, i see. Well, I'll try a larger one then 😅
Looks like the solution might be to have a list of "compatible models" along with the minimum quantization needed.
I have the same issue here, SerperDevTool is not working, returning forementioned error message. Also here, I just copied and pasted the trip planner example, which worked well with gpt4. Now I am using Ollama on Windows and tried the following models: llama2:7b (as far as I can see, the agent doesnt even try to use SerperDevTool, stops after max iterations) llama2:13b (the agent tries to search, but SerperDevTool does not work) llama2:70b (freezes, I can actually run models that large on my machine, but for this example, it doesn't work) openhermes (SerperDevTool works sporadically, but then WebsiteSearchTool fails) mistral:7b (works, SerperDevTool fails its very first attempt but then "adjusts" and runs well)
hope this helps
Do I still have to configure all model files to introduce "Result" as stop word?
I just ran it on dolphin-2.8-mistral-7b-v02, a recent model and it failed, but seeing from the comments that the failure/success rate is also "random", I cannot longer say it definitely doesn't work.
The issue here is...it is not that the search is returning nothing...it is not that too little or too much information came from the search, the situation seem to be that the connection itself is not even established, you have:
1: "A tool that can be used to semantic search a query from a txt's content.' don't exist" 2: SerperDevTool._run() missing 1 required positional argument: 'search_query'. 3: Action 'search_query' don't exist, these are the only available~
The first one stats the tool didn't exist even though pip install "crewai[tools]" is used. The second is a code error itself where 1 argument is missing, this seems to indicate code issue, not A.I. issue? The third one, the function call doesn't exist...code issue again? Nothing to do with the A.I. ?
Any idea what is the version where this work? Or we have a case where even if we go back in versions it wouldn't help because the tools that are installed via pip install "crewai[tools]" wasn't archived so the old version of crew_ai would still be using the newer damaged tools?
I am speculating here, I have no idea.
I'm also getting this error, but using the JSONSearchTool
. I have not tried this with other tools, but I've tried using both local LLMs and gpt-4-0125-preview
.
Full CrewAI error text is:
Action: Search a JSON's content
Action Input: {"query": "datadog"}
I encountered an error while trying to use the tool. This was the error: JSONSearchTool._run() missing 1 required positional argument: 'search_query'.
Tool Search a JSON's content accepts these inputs: A tool that can be used to semantic search a query the data/knowledge_base.json JSON's content.
Environment:
python==3.11.8
crewai==0.28.6
crewai-tools==0.1.6
Hi guys,
I have the same issue here using codellama
local model with ollama
.
Action Input: {'string': 'current trends and breakthroughs in AI research'}
I encountered an error while trying to use the tool. This was the error: SerperDevTool._run() missing 1 required positional argument: 'search_query'.
Tool Search the internet accepts these inputs: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
I'm trying to run the example on Readme file on the creawAI github
.
Updated to the latest v0.28.5 as of 11 April 2024, same issue: I encountered an error while trying to use the tool. This was the error: SerperDevTool._run() missing 1 required positional argument: 'search_query'. Tool Search the internet accepts these inputs: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
Do I still have to configure all model files to introduce "Result" as stop word?
@0xC0FFEE71 last time I check this was not necessary anymore
@BracerJack @thiagosrib @ThinksFast
Updated to the latest v0.28.5 as of 11 April 2024, same issue: I encountered an error while trying to use the tool. This was the error: SerperDevTool._run() missing 1 required positional argument: 'search_query'. Tool Search the internet accepts these inputs: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
This one could be a bug we shipped a couple thins in the tools that I think impacted, this will get the team looking into it first thing in the morning
Thank you for taking the time to reply, it is nice to know our issues are heard.
Traceback (most recent call last):
File "c:/Users/AVITA/Desktop/Learn Django/aiagent/newsletter.py", line 3, in
from crewai_tools import SerperDevTool
ModuleNotFoundError: No module named 'crewai_tools'
Going to throw my hat into the ring and say it's affected me too - serving via LM Studio v0.2.19 beta, tested with Zephyr Beta 7B and Mistral Instruct 7B, failed both times. It doesn't even work with Command-R locally.
I seem to have solved the problem. When you define the task that involves serper search tool, in the task description add this particular line: 'Set the input parameter as : search_query'. By default it sets the parameter as 'query' which is not allowed by serper, so.... try this
Could you post a snippet example for reference?
research_agent = Agent( role='Researcher', goal='Find and summarize the latest AI news', backstory="""You're a researcher at a large company. You're responsible for analyzing data and providing insights to the business.""", verbose=True, llm=llm, tools=[search_tool] )
task = Task( description='Find and summarize the latest AI news. Set the input parameter as : search_query', expected_output='A bullet list summary of the top 5 most important AI news', agent=research_agent )
Adding Set the input parameter as : search_query'
didn't really help in my case, even when using your agent and task:
[DEBUG]: == Working Agent: Researcher
[INFO]: == Starting Task: Find and summarize the latest AI news. Set the input parameter as : search_query
> Entering new CrewAgentExecutor chain...
Action: Search the internet(search_query="latest AI news")
Action Input: {'search_query': 'latest AI news'}
Action 'Search the internet(search_query="latest AI news")' don't exist, these are the only available Actions: Search the internet: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
I seem to have solved the problem. When you define the task that involves serper search tool, in the task description add this particular line: 'Set the input parameter as : search_query'. By default it sets the parameter as 'query' which is not allowed by serper, so.... try this
It worked apparently
research_agent = Agent( role='Researcher', goal='Find and summarize the latest AI news', backstory="""You're a researcher at a large company. You're responsible for analyzing data and providing insights to the business.""", verbose=True, llm=llm, tools=[search_tool] )
task = Task( description='Find and summarize the latest AI news. Set the input parameter as : search_query', expected_output='A bullet list summary of the top 5 most important AI news', agent=research_agent )
Your solution worked for me, thanks much!
16 April 2024: Adding "Set the input parameter as : search_query." doesn't work.
Now you get: Action 'search_query' don't exist, these are the only available Actions: Search the internet: Search the internet(search_query: 'string') - A tool that can be used to semantic search a query from a txt's content.
Quick question where are you setting the tool? On the agent or on the task?
I placed it in task following ananthpn's example :-)