From f8e3043299e98172e7e8aef84a7f209c2a3e7d15 Mon Sep 17 00:00:00 2001 From: zachary62 Date: Fri, 27 Dec 2024 23:34:46 +0000 Subject: [PATCH] node docs fix --- docs/node.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/node.md b/docs/node.md index 265eeac..614cbca 100644 --- a/docs/node.md +++ b/docs/node.md @@ -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). -``` -# Example usage: +```python 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: -``` +```python def process_after_fail(self, shared, prep_res, exc): raise exc ``` @@ -48,7 +47,7 @@ By **default**, it just re-raises `exc`. But you can return a fallback result in ## Minimal Example -``` +```python class SummarizeFile(Node): def prep(self, shared): filename = self.params["filename"]