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
The example for the more complex agent fails to run because the controlflow.tools.web module and controlflow.tools.code module are not imported correctly.
This is easy to miss because if you run two imports anywhere in your python environment then the example code will work.
The __init__.py file of the controlflow.tools module has the content:
So when you evaluate the expression cf.tools.web.get_url it results in the error AttributeError: module 'controlflow.tools' has no attribute 'web'.
Equally if you evaluate the expression cf.tools.code.python it results in the error AttributeError: module 'controlflow.tools' has no attribute 'code'.
This should be fixed by adding the following imports to the example:
importcontrolflowascfagent=cf.Agent(
name="Data Analyst",
description="An AI agent specialized in data analysis",
instructions=(
"Perform data analysis tasks efficiently and accurately. ""Browse the web for data and use Python to analyze it."
),
tools=[cf.tools.web.get_url, cf.tools.code.python],
model="openai/gpt-4o",
interactive=True,
)
Description
The example for the more complex agent fails to run because the
controlflow.tools.web
module andcontrolflow.tools.code
module are not imported correctly.This is easy to miss because if you run two imports anywhere in your python environment then the example code will work.
The
__init__.py
file of thecontrolflow.tools
module has the content:There is no
web
orcode
here so the content ofcf.tools
is justoutput:
So when you evaluate the expression
cf.tools.web.get_url
it results in the errorAttributeError: module 'controlflow.tools' has no attribute 'web'
.Equally if you evaluate the expression
cf.tools.code.python
it results in the errorAttributeError: module 'controlflow.tools' has no attribute 'code'
.This should be fixed by adding the following imports to the example:
Example Code
Version Information
Additional Context
No response
The text was updated successfully, but these errors were encountered: