Skip to content

Commit ccbde38

Browse files
docs(readme): document modular structure, graceful exit, async LLM
1 parent 946f8cc commit ccbde38

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,32 @@
6565

6666
---
6767

68+
## Code Structure
69+
70+
- `main.py` — Main event loop and orchestration
71+
- `cli_input.py` — Terminal input handling (CTRL+C, CTRL+Q, backspace, etc.)
72+
- `signals.py` — Signal handling (SIGINT for interruption)
73+
- `constants.py` — User-facing strings and help messages
74+
- `exceptions.py` — Custom exceptions for clean exit and error handling
75+
76+
All components are designed for modularity, minimalism, and functional programming style.
77+
78+
---
79+
80+
## Graceful Exit and Signal Handling
81+
82+
- **CTRL+C**: Interrupts the current operation and returns to the prompt (does not exit).
83+
- **CTRL+Q** or typing `exit`/`quit` at the prompt: Exits the application cleanly, with no traceback or error.
84+
- Only SIGINT (CTRL+C) is handled as a signal for async safety; quit is handled at the prompt for robust, async-safe shutdown.
85+
86+
---
87+
88+
## Async-Aware LLM Support
89+
90+
Agent Loop automatically supports both synchronous and asynchronous LLM functions, ensuring optimal performance and compatibility. The main event loop will call your LLM function in the most efficient way, whether it is sync or async.
91+
92+
---
93+
6894
## Features
6995

7096
- Conversational AI agent powered by Anthropic Claude or OpenAI GPT

0 commit comments

Comments
 (0)