You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if you could add this import so the plot outputted can be saved as an image for example. This could turn the code Agent into a data visualisation Agent.
The text was updated successfully, but these errors were encountered:
You can add which libraries can be imported in CodeAgent by passing the libraries to additional_authorized_imports
Example:
from smolagents import CodeAgent, HfApiModel
agent = CodeAgent(
tools=[],
model=HfApiModel(),
additional_authorized_imports=["matplotlib"], # or any other you want
)
agent_output = agent.run(
"how to plot a graph in python"
)
just make sure to first install matplotlib i-e pip install matplotlib
It would be nice if you could add this import so the plot outputted can be saved as an image for example. This could turn the code Agent into a data visualisation Agent.
The text was updated successfully, but these errors were encountered: