diff --git a/README.md b/README.md index 5dbef85b..c7b37e08 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ControlFlow is built with [Marvin](https://github.com/prefecthq/marvin) and [Pre ## Example ```python -from control_flow import ai_flow, ai_task, run_ai, instructions +from control_flow import ai_flow, ai_task, run_agent, instructions from pydantic import BaseModel @@ -40,7 +40,7 @@ def demo(): name = get_user_name() # define an AI task inline - interests = run_ai("ask user for three interests", cast=list[str], user_access=True) + interests = run_agent("ask user for three interests", cast=list[str], user_access=True) # set instructions for just the next task with instructions("no more than 8 lines"): diff --git a/examples/readme_example.py b/examples/readme_example.py index a4e7b67f..d88de7d3 100644 --- a/examples/readme_example.py +++ b/examples/readme_example.py @@ -1,4 +1,4 @@ -from control_flow import ai_flow, ai_task, instructions, run_ai +from control_flow import ai_flow, ai_task, instructions, run_agent from pydantic import BaseModel @@ -26,7 +26,7 @@ def demo(): name = get_user_name() # define an AI task inline - interests = run_ai( + interests = run_agent( "ask user for three interests", cast=list[str], user_access=True, diff --git a/src/control_flow/__init__.py b/src/control_flow/__init__.py index b2ccb635..97f9c013 100644 --- a/src/control_flow/__init__.py +++ b/src/control_flow/__init__.py @@ -1,5 +1,5 @@ from .settings import settings -from .agent import ai_task, Agent, run_ai +from .agent import ai_task, Agent, run_agent from .flow import ai_flow from .instructions import instructions diff --git a/src/control_flow/agent.py b/src/control_flow/agent.py index e8c9195e..06351365 100644 --- a/src/control_flow/agent.py +++ b/src/control_flow/agent.py @@ -552,7 +552,7 @@ def wrapper(*args, **kwargs): bound = sig.bind(*args, **kwargs) bound.apply_defaults() - return run_ai.with_options(name=f"Task: {fn.__name__}")( + return run_agent.with_options(name=f"Task: {fn.__name__}")( task=objective, cast=fn.__annotations__.get("return"), context=bound.arguments, @@ -574,7 +574,7 @@ def _name_from_objective(): @prefect_task(task_run_name=_name_from_objective) -def run_ai( +def run_agent( task: str, cast: T = str, context: dict = None,