From 95f286de7fab72e9e4b2d29c4f7fffec8414ce52 Mon Sep 17 00:00:00 2001 From: kylexqian Date: Wed, 11 Mar 2026 17:25:29 -0700 Subject: [PATCH] fix(cli): display plain-string chat content in non-streaming mode The print_llm_chat_result function silently dropped text responses because the elif branch only matched list-type content. Plain string content (normal LLM replies) never matched any branch and was never printed. Co-Authored-By: Claude Sonnet 4.6 --- src/opengradient/cli.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/opengradient/cli.py b/src/opengradient/cli.py index cfca61b..8dbd93b 100644 --- a/src/opengradient/cli.py +++ b/src/opengradient/cli.py @@ -643,13 +643,15 @@ def print_llm_chat_result(model_cid, tx_hash, finish_reason, chat_output, is_van fn = tool_call.get("function", {}) click.echo(f" Function: {fn.get('name', '')}") click.echo(f" Arguments: {fn.get('arguments', '')}") - elif key == "content" and isinstance(value, list): - # Normalize list-of-blocks content (e.g. Gemini 3 thought signatures) - if key == "content" and isinstance(value, list): + elif key == "content": + if isinstance(value, list): + # Normalize list-of-blocks content (e.g. Gemini 3 thought signatures) text = " ".join(block.get("text", "") for block in value if isinstance(block, dict) and block.get("type") == "text").strip() - click.echo(f"{key}: {text}") + click.echo(text) else: - click.echo(f"{key}: {value}") + click.echo(value) + else: + click.echo(f"{key}: {value}") click.echo()