Skip to content

Feature Request: text_only output support #14

Description

@ritwik-g

The current cli output for whisperer extraction contains the result and the metadata as well.

Retrieve API supports a text_only output which simply shows the text result as it is (If it is layout preserved the output will also be layout preserved. This mode can be useful when we only need the result_text.

Activity

  1. miraj2729 commented on Sep 17, 2026

    @miraj2729

    Hi @ritwik-g, I'd like to work on adding the --text-only flag support for whisperer extraction. Could you please assign this issue to me?

  2. ritwik-g commented on Sep 17, 2026

    @ritwik-g
    Author

    Hi @ritwik-g, I'd like to work on adding the --text-only flag support for whisperer extraction. Could you please assign this issue to me?

    Hi @miraj2729 please feel free to raise a PR and share here. We can assign it to you once the initial PR is opened

  3. miraj2729 commented on Sep 17, 2026

    @miraj2729

    Thanks @ritwik-g! I'm currently setting up the environment and writing the code for this. I'll submit the PR shortly. Please hold this issue for me!

  4. miraj2729 commented on Sep 18, 2026

    @miraj2729

    Hi, I have addressed all the feedback and fixed the checks. The PR is ready for review when you get a chance. Thanks!

  5. ritwik-g commented on Sep 18, 2026

    @ritwik-g
    Author

    #16

    This is the PR right? @chandrasekharan-zipstack

  6. chandrasekharan-zipstack commented on Sep 18, 2026

    @chandrasekharan-zipstack
    Contributor

    This is already covered on main by the generic -o raw output format, which prints the extraction's result_text alone, unwrapped, with layout preserved:

    unstract whisper extract invoice.pdf -o raw > invoice.txt
    unstract whisper retrieve <whisper_hash> -o raw

    -o raw works across product commands (each declares which field it prints; unstract --discover full lists them), so there is no whisperer-specific flag to add.

    How close is it to the API's text_only? Functionally identical for the caller: result_text is the layout-preserved text, and that is all that reaches stdout. The only difference is on the wire: with text_only=true the server skips sending the metadata bytes, whereas the CLI receives the full JSON and drops everything but the text locally. For a single retrieve that is negligible.

    Why not pass text_only straight through to the API? The CLI calls the API via the llmwhisperer-client SDK (currently pinned at 2.9.0), and whisper_retrieve() there does not expose a text_only argument yet. A true passthrough would need that added to the client and released first, then the CLI pin bumped. Given the local -o raw already gives the same output, that is not worth chasing on its own; if the client gains the argument for other reasons, wiring it in becomes a one-liner.

    If the gap here was discoverability rather than capability, a README example or a line in the whisper retrieve help text is the change to make.


    Correction (2026-09-18): the two examples above put -o raw after the subcommand, which fails today with No such option '-o' (the bug in #12 / #15). Until #19 merges, global flags go before the subcommand:

    unstract -o raw whisper extract invoice.pdf > invoice.txt
    unstract -o raw whisper retrieve <whisper_hash>

    PR #19 makes both placements work and closes this issue.

  7. ritwik-g commented on Sep 18, 2026

    @ritwik-g
    Author

    This is already covered on main by the generic -o raw output format, which prints the extraction's result_text alone, unwrapped, with layout preserved:

    unstract whisper extract invoice.pdf -o raw > invoice.txt
    unstract whisper retrieve <whisper_hash> -o raw
    -o raw works across product commands (each declares which field it prints; unstract --discover full lists them), so there is no whisperer-specific flag to add.

    How close is it to the API's text_only? Functionally identical for the caller: result_text is the layout-preserved text, and that is all that reaches stdout. The only difference is on the wire: with text_only=true the server skips sending the metadata bytes, whereas the CLI receives the full JSON and drops everything but the text locally. For a single retrieve that is negligible.

    Why not pass text_only straight through to the API? The CLI calls the API via the llmwhisperer-client SDK (currently pinned at 2.9.0), and whisper_retrieve() there does not expose a text_only argument yet. A true passthrough would need that added to the client and released first, then the CLI pin bumped. Given the local -o raw already gives the same output, that is not worth chasing on its own; if the client gains the argument for other reasons, wiring it in becomes a one-liner.

    If the gap here was discoverability rather than capability, a README example or a line in the whisper retrieve help text is the change to make.

    Okay @chandrasekharan-zipstack in that case this ticket is invalid. Lets close this. Lets close the PR also. But anyway please note there are some bugs that might make this usage itself bit difficult.

    #12

    @miraj2729 thank you for the effort. But apologies since this might not be an actual requirement anymore. Please feel free to raise contributions in the future.

  8. miraj2729 commented on Sep 18, 2026

    @miraj2729
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions