pocketflow/cookbook/pocketflow-streamlit-hitl/README.md

1.4 KiB

PocketFlow Streamlit Human-in-the-Loop (HITL) Application

Minimal Human-in-the-Loop (HITL) web application using PocketFlow and Streamlit. Submit text, review processed output, and approve/reject.

Features

  • Streamlit UI: Simple, interactive interface for submitting tasks and providing feedback, built entirely in Python.
  • PocketFlow Workflow: Manages distinct processing stages (initial processing, finalization) using synchronous PocketFlow Flows.
  • Session State Management: Utilizes Streamlit's st.session_state to manage the current stage of the workflow and to act as the shared data store for PocketFlow.
  • Iterative Feedback Loop: Allows users to reject processed output and resubmit, facilitating refinement.

How to Run

  1. Install Dependencies:

    pip install -r requirements.txt
    
  2. Run the Streamlit Application:

    streamlit run app.py
    
  3. Access the Web UI: Open the URL provided by Streamlit (usually http://localhost:8501).

Files