AutoGPT
AutoGPT copied to clipboard
Add support for more filters to search_files()
NEXT ACTION: COMMAND = search_files ARGUMENTS = {'directory': '/', 'query': 'liabilities'} Enter 'y' to authorise command, 'y -N' to run N continuous commands, 'n' to exit program, or enter feedback for ... Input:y -=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-= SYSTEM: Command search_files returned: Error: search_files() got an unexpected keyword argument 'query'
Same error on my end
Same:
NEXT ACTION: COMMAND = search_files ARGUMENTS = {'directory': './', 'query': '*.pdf'}
SYSTEM: Command search_files returned: Error: search_files() got an unexpected keyword argument 'query'
I have seen the error previously, but with 'extension' rather than 'query'
NEXT ACTION: COMMAND = search_files ARGUMENTS = {'directory': './', 'extension': 'pdf'}
Input:Please check your search_file() command. You received an error: search_files() got an unexpected keyword argument 'extension'
This is certainly a bit fishy as 'extension' doesn't appear much at all within the codebase.
I would also note that the seems to be some references to "search_file(" (singular) in these error messages, but sometimes it is plural.
I really don't understand this.. the search_files config seems to clearly state only 1 argument:
@command("search_files", "Search Files", '"directory": "<directory>"')
def search_files(directory: str) -> list[str]:
"""Search for files in a directory
Args:
directory (str): The directory to search in
Returns:
list[str]: A list of files found in the directory
"""
found_files = []
if directory in {"", "/"}:
search_directory = WORKSPACE_PATH
else:
search_directory = path_in_workspace(directory)
for root, _, files in os.walk(search_directory):
for file in files:
if file.startswith("."):
continue
relative_path = os.path.relpath(os.path.join(root, file), WORKSPACE_PATH)
found_files.append(relative_path)
return found_files
Update, AutoGPT can be told to not use the extra argument:
Pardon my typos...

Seems like sometimes it'll work through it. Most often I see it making up names for the files its looking for or adding duplicate destination directories. Sometimes i'll just create the bullshit path it's looking for and it'll find it and end the error loop :) I know i'm an enabler.
looks like a prompting issue. Kinda funky though. Reopen if it keeps happening with different prompts

I am having the same issue consistently, independent of prompt. Using a prompt proven functional by another user still sometimes triggers this problem.
GPT 3.5
@ntindle I am encountering this issue also.
I have the latest code at sha 7a161cc0bd8253759c8e7b15c0a3e3d86f0adbad
I'm incredibly new to AutoGPT, but whatever I can do to help debug this I'm all yours.
Okay seems it's hallucinating other potential parameters for this. If any of y'all code, may as well add them as optional
I got mine to continue by moving the in-work file output out of 'auto_gpt_workspace' into another folder
This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.
This issue was closed automatically because it has been stale for 10 days with no activity.