From b3994478eb726cb73a056b8b78e2de99291146af Mon Sep 17 00:00:00 2001 From: zachary62 Date: Fri, 27 Dec 2024 23:31:40 +0000 Subject: [PATCH] docs fix --- README.md | 4 ++-- docs/index.md | 15 +++++++++------ docs/node.md | 9 +++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9245672..54e2369 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) -A 100-line minimalist LLM framework for agents, task decomposition, RAG, etc. +A [100-line](minillmflow/__init__.py) minimalist LLM framework for agents, task decomposition, RAG, etc. - Install via ```pip install minillmflow```, or just copy the [source](minillmflow/__init__.py) (only 100 lines) @@ -27,7 +27,7 @@ Hence, I built this framework that lets LLMs focus on what matters. It turns out
- +
## Example diff --git a/docs/index.md b/docs/index.md index 8bf1275..0a65aa4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,23 +1,26 @@ --- layout: default title: "Home" +nav_order: 1 --- # Mini LLM Flow A 100-line minimalist LLM framework for agents, task decomposition, RAG, etc. -![Alt text](/docs/assets/minillmflow.jpg) +
+ +
## Core Abstraction We model the LLM workflow as a **Nested Flow**: - -- Each **Node** handles a simple LLM task (e.g., text summarization, structure extraction, or question answering). -- Nodes are chained together to form a **Flow** for more complex tasks. One Node can be chained to multiple Nodes based on **Actions**, e.g., for agentic steps. +- Each **Node** handles a simple LLM task. +- Nodes are chained together to form a **Flow** for more complex tasks. +- One Node can be chained to multiple Nodes based on **Actions**. - A Flow can be treated as a Node for **Nested Flows**. -- Both Nodes and Flows can be **Batched** for data-intensive tasks (e.g., processing one file at a time in a directory of files). -- Nodes and Flows can be **Async**, e.g., for user feedback before proceeding. +- Both Nodes and Flows can be **Batched** for data-intensive tasks. +- Nodes and Flows can be **Async**. - [Node](./node.md) - [Flow](./flow.md) diff --git a/docs/node.md b/docs/node.md index 7552496..265eeac 100644 --- a/docs/node.md +++ b/docs/node.md @@ -1,6 +1,7 @@ --- layout: default title: "Node" +nav_order: 2 --- # Node @@ -38,16 +39,16 @@ 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: -`` +``` def process_after_fail(self, shared, prep_res, exc): raise exc -`` +``` By **default**, it just re-raises `exc`. But you can return a fallback result instead. That fallback result becomes the `exec_res` passed to `post()`. ## Minimal Example -`` +``` class SummarizeFile(Node): def prep(self, shared): filename = self.params["filename"] @@ -68,5 +69,5 @@ class SummarizeFile(Node): filename = self.params["filename"] shared["summary"][filename] = exec_res # Return "default" by not returning anything -`` +```