Skip to content

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