Skip to content

Support executor_kwargs in LocalPythonExecutor for initialization customization #1314

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

Merged

Conversation

albertvillanova
Copy link
Member

Support passing executor_kwargs to LocalPythonExecutor, aligning its behavior with RemotePythonExecutor, which already accepts it.

This PR simplifies configuration and improves consistency across executor types.

With this change, we can now use

agent = CodeAgent(tools=[], model=model, executor_kwargs={"additional_functions": {"open": open}})

as functionally equivalent to

agent = CodeAgent(tools=[], model=model)
agent.python_executor.additional_functions = {"open": open}

@albertvillanova albertvillanova merged commit 27bd549 into huggingface:main May 15, 2025
3 checks passed
@albertvillanova albertvillanova deleted the local-executor-kwargs branch May 15, 2025 12:31
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

Successfully merging this pull request may close these issues.

2 participants