Skip to content

Commit

Permalink
v0.2.2 - add docs
Browse files Browse the repository at this point in the history
lalalune committed Aug 3, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 97d330a commit e3ddf8a
Showing 3 changed files with 14 additions and 5 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions agentloop/loop.py
Original file line number Diff line number Diff line change
@@ -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
"""
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e3ddf8a

Please sign in to comment.