node docs fix

This commit is contained in:
zachary62 2024-12-27 23:34:46 +00:00
parent b3994478eb
commit f8e3043299
1 changed files with 3 additions and 4 deletions

View File

@ -27,8 +27,7 @@ A **Node** is the smallest building block of Mini LLM Flow. Each Node has three
Nodes in Mini LLM Flow can **retry** execution if `exec()` raises an exception. You control this via a `max_retries` parameter when you create the Node. By default, `max_retries = 1` (meaning no retry). Nodes in Mini LLM Flow can **retry** execution if `exec()` raises an exception. You control this via a `max_retries` parameter when you create the Node. By default, `max_retries = 1` (meaning no retry).
``` ```python
# Example usage:
my_node = SummarizeFile(max_retries=3) my_node = SummarizeFile(max_retries=3)
``` ```
@ -39,7 +38,7 @@ When an exception occurs in `exec()`, the Node automatically retries until:
If you want to **gracefully handle** the error rather than raising it, you can override: If you want to **gracefully handle** the error rather than raising it, you can override:
``` ```python
def process_after_fail(self, shared, prep_res, exc): def process_after_fail(self, shared, prep_res, exc):
raise exc raise exc
``` ```
@ -48,7 +47,7 @@ By **default**, it just re-raises `exc`. But you can return a fallback result in
## Minimal Example ## Minimal Example
``` ```python
class SummarizeFile(Node): class SummarizeFile(Node):
def prep(self, shared): def prep(self, shared):
filename = self.params["filename"] filename = self.params["filename"]