diff --git a/README.md b/README.md index 1c931e8..a29b706 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ steps = [step_one, step_two] ## Function `start` ```python -start(steps, stepped=False) +start(steps, stepped=False, step_interval=0.0) ``` ### Description @@ -75,7 +75,9 @@ Starts the main loop in a separate thread. This loop will run the steps given, i - `steps` : a list of functions that should be executed in the loop. Each function should accept a single argument and return a single value which will be passed as an argument to the next function. The first function will receive `None` as an argument. -- `stepped` (optional): a boolean value that determines whether the loop should run in stepped mode or not. Defaults to `False`. +- `paused` (optional): a boolean value that determines whether the loop should run in paused step mode or not. Defaults to `False`. + +- `step_interval` (optional): a float value that determines the time interval between steps in seconds. Defaults to `0.0`. ### Returns @@ -173,7 +175,7 @@ None ## Function `loop` ```python -loop(steps, stepped=False, loop_data=None) +loop(steps, paused=False, loop_data=None, step_interval=0.0) ``` ### Description @@ -184,10 +186,12 @@ Runs the step array in a loop until stopped. - `steps`: a list of functions that should be executed in the loop. Each function should accept a single argument and return a single value which will be passed as an argument to the next function. The first function will receive `None` as an argument. -- `stepped` (optional): a boolean value that determines whether the loop should run in stepped mode or not. Defaults to `False`. +- `paused` (optional): a boolean value that determines whether the loop should run in paused / stepped mode or not. Defaults to `False`. - `loop_data` (optional): a dictionary containing `stop_event` and `step_event` instances. If not provided, new events will be created. +- `step_interval` (optional): a float value that determines the time interval between steps in seconds. Defaults to `0.0`. + ### Returns None diff --git a/agentloop/loop.py b/agentloop/loop.py index 0caebcb..f4960bd 100644 --- a/agentloop/loop.py +++ b/agentloop/loop.py @@ -6,9 +6,14 @@ def start(steps, paused=False, step_interval=0.0): Function to start the main loop Args: + steps: array of functions to be run in the loop + paused: boolean - whether the loop should run automatically. If paused can be stepped one-step-at-a-time. Defaults to False. + step_interval: float - time in seconds to wait between steps. Defaults to 0.0 (no wait) + + Returns: loop_data: a dictionary of loop data """ diff --git a/setup.py b/setup.py index 4282d43..7eed5f7 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name="agentloop", - version="0.2.1", + version="0.2.2", description="A simple, lightweight loop for your agent.", long_description=readme, # added this line long_description_content_type="text/markdown", # and this line