Skip to content

Commit

Permalink
Merge pull request #3 from jlowin/run-agent
Browse files Browse the repository at this point in the history
run_ai → run_agent
  • Loading branch information
jlowin authored Apr 6, 2024
2 parents ea3c929 + 6b046db commit c6aa552
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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"):
Expand Down
4 changes: 2 additions & 2 deletions examples/readme_example.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/control_flow/__init__.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/control_flow/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit c6aa552

Please sign in to comment.