Normalise CLI --no-streaming in CLI

This commit is contained in:
Cyber MacGeddon 2025-11-26 17:26:05 +00:00
parent 985c725c50
commit 3857f7ef6e
3 changed files with 11 additions and 10 deletions

View file

@ -203,7 +203,7 @@ async def handle(self, message, session, websocket):
2. Update GraphRag.query() and DocumentRag.query() methods 2. Update GraphRag.query() and DocumentRag.query() methods
3. Update Processors to handle streaming 3. Update Processors to handle streaming
4. Update Gateway dispatch handlers 4. Update Gateway dispatch handlers
5. Add CLI flags to `tg-invoke-graph-rag` and `tg-invoke-document-rag` 5. Add `--no-streaming` flags to `tg-invoke-graph-rag` and `tg-invoke-document-rag` (streaming enabled by default, following agent CLI pattern)
**Callback pattern**: **Callback pattern**:
Follow the same async callback pattern established in Agent streaming: Follow the same async callback pattern established in Agent streaming:
@ -255,9 +255,10 @@ No new security considerations beyond existing RAG services:
- Test CLI streaming output - Test CLI streaming output
**Manual testing**: **Manual testing**:
- `tg-invoke-graph-rag --streaming -q "What is machine learning?"` - `tg-invoke-graph-rag -q "What is machine learning?"` (streaming by default)
- `tg-invoke-document-rag --streaming -q "Summarize the documents about AI"` - `tg-invoke-document-rag -q "Summarize the documents about AI"` (streaming by default)
- Verify incremental output appears - `tg-invoke-graph-rag --no-streaming -q "..."` (test non-streaming mode)
- Verify incremental output appears in streaming mode
## Migration Plan ## Migration Plan

View file

@ -132,16 +132,16 @@ def main():
) )
parser.add_argument( parser.add_argument(
'--streaming', '--no-streaming',
action='store_true', action='store_true',
help='Enable streaming mode (token-by-token output)' help='Disable streaming (use non-streaming mode)'
) )
args = parser.parse_args() args = parser.parse_args()
try: try:
if args.streaming: if not args.no_streaming:
asyncio.run( asyncio.run(
question_streaming( question_streaming(
url=args.url, url=args.url,

View file

@ -164,16 +164,16 @@ def main():
) )
parser.add_argument( parser.add_argument(
'--streaming', '--no-streaming',
action='store_true', action='store_true',
help='Enable streaming mode (token-by-token output)' help='Disable streaming (use non-streaming mode)'
) )
args = parser.parse_args() args = parser.parse_args()
try: try:
if args.streaming: if not args.no_streaming:
asyncio.run( asyncio.run(
question_streaming( question_streaming(
url=args.url, url=args.url,