File tree Expand file tree Collapse file tree 6 files changed +38
-1
lines changed
Expand file tree Collapse file tree 6 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ This example demonstrates how to create a simple custom flow using the new Quant
88examples/flow/01_custom_flow/
99├── flows/
1010│ └── greeting_flow/
11+ │ ├── __init__.py # Module exports
1112│ ├── prompts.yaml # Prompt templates
1213│ └── flow.py # Flow implementation
1314├── config.yaml # Flow configuration
@@ -38,6 +39,18 @@ examples/flow/01_custom_flow/
3839- Separated from code for easy editing
3940- Loaded dynamically
4041
42+ ## Easy Import Structure
43+
44+ With the new ` __init__.py ` files, you can now import flows cleanly:
45+
46+ ``` python
47+ # Import from flow directory
48+ from flows.greeting_flow import GreetingFlow, GreetingFlowConfig
49+
50+ # Use in major pipelines
51+ flow = GreetingFlow(config)
52+ ```
53+
4154## Running the Demo
4255
4356``` bash
Original file line number Diff line number Diff line change 1+ """Greeting flow module."""
2+
3+ from .flow import GreetingFlow , GreetingFlowConfig
4+
5+ __all__ = ["GreetingFlow" , "GreetingFlowConfig" ]
Original file line number Diff line number Diff line change 44from pathlib import Path
55
66# Import the custom flow
7- from flows .greeting_flow . flow import GreetingFlow
7+ from flows .greeting_flow import GreetingFlow
88from quantmind .config .settings import load_config
99
1010
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ This example demonstrates the built-in SummaryFlow with custom chunking strategy
88examples/flow/02_summary_flow/
99├── flows/
1010│ └── summary_flow/
11+ │ ├── __init__.py # Module exports
1112│ ├── prompts.yaml # Prompt templates
1213│ └── flow.py # Mock LLM implementation (for testing)
1314├── config.yaml # Flow configuration
@@ -37,6 +38,18 @@ examples/flow/02_summary_flow/
3738- Smart provider inference (OpenAI models use ` OPENAI_API_KEY ` )
3839- Secure configuration without hardcoded keys
3940
41+ ## Easy Import Structure
42+
43+ With the new ` __init__.py ` file, you can import the demo flow cleanly:
44+
45+ ``` python
46+ # Import from flow directory
47+ from flows.summary_flow import DemoSummaryFlow
48+
49+ # Use in pipelines
50+ flow = DemoSummaryFlow(config)
51+ ```
52+
4053## Running the Demo
4154
4255``` bash
Original file line number Diff line number Diff line change 1+ """Summary flow module."""
2+
3+ from .flow import DemoSummaryFlow
4+
5+ __all__ = ["DemoSummaryFlow" ]
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ Both examples showcase the core principles of the new flow architecture:
35353 . ** Direct Access** : No unnecessary wrapper methods, just direct access to resources
36364 . ** Template Separation** : Prompts in YAML files for easy editing and maintenance
37375 . ** Type Safety** : Pydantic-based configuration instead of complex schemas
38+ 6 . ** Easy Imports** : Each flow directory has ` __init__.py ` for clean imports (e.g., ` from flows.greeting_flow import GreetingFlow ` )
3839
3940## Quick Start
4041
You can’t perform that action at this time.
0 commit comments