Skip to content

Update help string and doc for "nat run --input_file"#1390

Merged
rapids-bot[bot] merged 2 commits intoNVIDIA:release/1.4from
AnuradhaKaruppiah:ak-update-input-file-docs
Jan 14, 2026
Merged

Update help string and doc for "nat run --input_file"#1390
rapids-bot[bot] merged 2 commits intoNVIDIA:release/1.4from
AnuradhaKaruppiah:ak-update-input-file-docs

Conversation

@AnuradhaKaruppiah
Copy link
Contributor

@AnuradhaKaruppiah AnuradhaKaruppiah commented Jan 12, 2026

Description

  1. Docs update to clarify that "nat run --input_file" accepts single plain text inputs only, distinguishing it from "nat eval" for batch evaluation.
  2. Fixed file handling in console_front_end_plugin.py to read content immediately and pass string instead of file object

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
    • Any contribution which contains commits that are not Signed-Off will not be accepted.
  • When the PR is ready for review, new or existing tests cover these changes.
  • When the PR is ready for review, the documentation is up to date with these changes.

Summary by CodeRabbit

  • Documentation
    • Clarified that --input_file accepts a single plain text input file instead of multiple inputs
    • Updated guidance to use nat eval for batch evaluation of multiple inputs
    • Enhanced documentation with explicit notes on single-input usage and batch evaluation scenarios

✏️ Tip: You can customize this high-level summary in your review settings.

Clarify that nat run --input_file accepts single plain text inputs only,
distinguishing it from nat eval --dataset for batch evaluation.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
@AnuradhaKaruppiah AnuradhaKaruppiah requested a review from a team as a code owner January 12, 2026 18:40
@AnuradhaKaruppiah AnuradhaKaruppiah self-assigned this Jan 12, 2026
@AnuradhaKaruppiah AnuradhaKaruppiah added bug Something isn't working non-breaking Non-breaking change labels Jan 12, 2026
Copy link
Contributor

@mnajafian-nv mnajafian-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Great fix, addresses the confusion and implements the explicit f.read() as discussed.

Note on CLI reference doc:
docs/source/reference/cli.md still shows the old help text, but this will auto-update once the code changes are merged (it reflects the actual CLI --help output).

Minor suggestion (non-blocking):
The help string could be slightly more concise by removing the "Intended for verbose inputs..." line (it's implied).

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Walkthrough

The changes update the --input_file option to accept a single plain text input rather than multiple JSON inputs. Documentation is clarified to reflect this behavior, configuration metadata is updated, and the console plugin implementation is modified to read file contents as a string before passing to the workflow runner.

Changes

Cohort / File(s) Summary
Documentation
docs/source/run-workflows/about-running-workflows.md
Clarified that --input_file accepts a plain text file containing a single input string, not an array. Added note guidance for batch evaluation using nat eval instead.
Configuration
src/nat/front_ends/console/console_front_end_config.py
Updated input_file Field description from "JSON file of inputs" to "plain text file containing a single input" with explicit guidance that batch evaluation should use nat eval.
Implementation
src/nat/front_ends/console/console_front_end_plugin.py
Modified to read file contents into an in-memory string and pass the string to session.run instead of passing the file object directly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: updating documentation and help strings for the '--input_file' option in 'nat run', which is the primary focus across all three modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6491c9a and 278498c.

📒 Files selected for processing (3)
  • docs/source/run-workflows/about-running-workflows.md
  • src/nat/front_ends/console/console_front_end_config.py
  • src/nat/front_ends/console/console_front_end_plugin.py
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{md,mdx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.{md,mdx}: Use 'NVIDIA NeMo Agent toolkit' for full name (first use), 'NeMo Agent toolkit' or 'the toolkit' for subsequent references, and 'Toolkit' (capital T) in titles/headings, 'toolkit' (lowercase t) in body text
Never use deprecated names: 'Agent Intelligence toolkit', 'aiqtoolkit', 'AgentIQ', 'AIQ', or 'aiq' in documentation; update any occurrences unless intentionally referring to deprecated versions or implementing compatibility layers

Files:

  • docs/source/run-workflows/about-running-workflows.md
**/*.{md,mdx,rst}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.{md,mdx,rst}: Documentation must be clear, comprehensive, and free of TODOs, FIXMEs, placeholder text, offensive or outdated terms, and spelling mistakes
Do not use words listed in 'ci/vale/styles/config/vocabularies/nat/reject.txt' in documentation
Words listed in 'ci/vale/styles/config/vocabularies/nat/accept.txt' are acceptable even if they appear to be spelling mistakes

Files:

  • docs/source/run-workflows/about-running-workflows.md
**/*.{py,js,ts,tsx,jsx,sh,yaml,yml,json,toml,md,mdx,rst}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.{py,js,ts,tsx,jsx,sh,yaml,yml,json,toml,md,mdx,rst}: Every file must start with the standard SPDX Apache-2.0 header
Confirm that copyright years are up-to-date whenever a file is changed
All source files must include the SPDX Apache-2.0 header template

Files:

  • docs/source/run-workflows/about-running-workflows.md
  • src/nat/front_ends/console/console_front_end_plugin.py
  • src/nat/front_ends/console/console_front_end_config.py
**/*.{py,md,mdx,rst}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Version numbers are derived automatically by 'setuptools-scm'; never hard-code them in code or docs

Files:

  • docs/source/run-workflows/about-running-workflows.md
  • src/nat/front_ends/console/console_front_end_plugin.py
  • src/nat/front_ends/console/console_front_end_config.py
**/*

⚙️ CodeRabbit configuration file

**/*: # Code Review Instructions

  • Ensure the code follows best practices and coding standards. - For Python code, follow
    PEP 20 and
    PEP 8 for style guidelines.
  • Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values (except for return values of None,
    in that situation no return type hint is needed).
    Example:
    def my_function(param1: int, param2: str) -> bool:
        pass
  • For Python exception handling, ensure proper stack trace preservation:
    • When re-raising exceptions: use bare raise statements to maintain the original stack trace,
      and use logger.error() (not logger.exception()) to avoid duplicate stack trace output.
    • When catching and logging exceptions without re-raising: always use logger.exception()
      to capture the full stack trace information.

Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any

words listed in the ci/vale/styles/config/vocabularies/nat/reject.txt file, words that might appear to be
spelling mistakes but are listed in the ci/vale/styles/config/vocabularies/nat/accept.txt file are OK.

  • Documentation in Markdown files should not contain usage of a possessive 's with inanimate objects
    (ex: "the system's performance" should be "the performance of the system").
  • Documentation in Markdown files should not use NAT as an acronym, always spell out NeMo Agent Toolkit.
    The exception to this rule is when referring to package names or code identifiers that contain "nat", th...

Files:

  • docs/source/run-workflows/about-running-workflows.md
  • src/nat/front_ends/console/console_front_end_plugin.py
  • src/nat/front_ends/console/console_front_end_config.py
docs/source/**/*

⚙️ CodeRabbit configuration file

docs/source/**/*: This directory contains the source code for the documentation. All documentation should be written in Markdown format. Any image files should be placed in the docs/source/_static directory.

Documentation Categories

Ensure documentation is placed in the correct category:

  • get-started/: Introductory documentation for new users
    • get-started/tutorials/: Step-by-step learning guides
  • build-workflows/: Workflow creation, configuration, adding remote MCP tools or A2A agents - run-workflows/: Execution, observability, serving workflows via MCP and A2A protocols - improve-workflows/: Evaluation and optimization guides - components/: Specific component implementations (agents, tools, connectors) - extend/: Custom component development and testing (not core library contributions) - reference/: Python and REST API documentation only - resources/: Project information (licensing, FAQs)
    • resources/contributing/: Development environment and contribution guides

Placement rules:

  1. Component implementations always belong in components/, not build-workflows/ 2. API documentation belongs only in reference/ 3. Using remote MCP tools or A2A agents should be placed in build-workflows/ 4. Serving workflows via MCP/A2A should be placed in run-workflows/

Files:

  • docs/source/run-workflows/about-running-workflows.md
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.py: Follow PEP 20 and PEP 8 for Python style guidelines
Run yapf with PEP 8 base and 'column_limit = 120' for code formatting
Use 'ruff check --fix' for linting with configuration from 'pyproject.toml', fix warnings unless explicitly ignored
Use snake_case for functions and variables, PascalCase for classes, UPPER_CASE for constants
All public APIs require Python 3.11+ type hints on parameters and return values
Prefer 'collections.abc' / 'typing' abstractions (e.g., 'Sequence' over 'list') for type hints
Use 'typing.Annotated' for units or extra metadata when useful
Treat 'pyright' warnings (configured in 'pyproject.toml') as errors during development
Preserve stack traces and prevent duplicate logging when handling exceptions; use bare 'raise' statements when re-raising, and use 'logger.error()' for logging (not 'logger.exception()') to avoid duplicate stack trace output
When catching and logging exceptions without re-raising, always use 'logger.exception()' (equivalent to 'logger.error(exc_info=True)') to capture full stack trace information
Pydantic models using 'SecretStr', 'SerializableSecretStr', or 'OptionalSecretStr' should use 'default=None' for optional fields and 'default_factory=lambda: SerializableSecretStr("")' for non-optional fields to avoid initialization bugs
Provide Google-style docstrings for every public module, class, function and CLI command
The first line of docstrings must be a concise description ending with a period
Surround code entities in docstrings with backticks to avoid Vale false-positives
Validate and sanitise all user input, especially in web or CLI interfaces
Prefer 'httpx' with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use 'async'/'await' for I/O-bound work (HTTP, DB, file reads)
Cache expensive computations with 'functools.lru_cache' or an external cache when appropriate
Leverage NumPy vectorised operations whenever beneficial and feasible

Files:

  • src/nat/front_ends/console/console_front_end_plugin.py
  • src/nat/front_ends/console/console_front_end_config.py
**/*.{py,yaml,yml,json,toml}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Indent with 4 spaces (never tabs) and ensure every file ends with a single newline

Files:

  • src/nat/front_ends/console/console_front_end_plugin.py
  • src/nat/front_ends/console/console_front_end_config.py
src/nat/**/*

⚙️ CodeRabbit configuration file

This directory contains the core functionality of the toolkit. Changes should prioritize backward compatibility.

Files:

  • src/nat/front_ends/console/console_front_end_plugin.py
  • src/nat/front_ends/console/console_front_end_config.py
🔇 Additional comments (5)
src/nat/front_ends/console/console_front_end_plugin.py (1)

92-96: LGTM! File content is now correctly read as a string.

The fix correctly reads the file content into a string variable before passing it to session.run(). The file is properly opened with UTF-8 encoding and closed after reading.

One consideration: there's no explicit error handling for file read failures (e.g., file not found, permission denied, encoding errors). However, since this is within a CLI context and Python's default exceptions are reasonably descriptive, this is acceptable. The pre_run validation ensures the file path is provided, and the Path type in the config would catch basic path issues.

src/nat/front_ends/console/console_front_end_config.py (1)

31-34: LGTM! Field description accurately reflects the updated behavior.

The updated description clearly communicates that:

  1. The file should be plain text (not JSON)
  2. It contains a single input (not multiple)
  3. Users should use nat eval for batch evaluation

This aligns well with the corresponding code change in console_front_end_plugin.py and the documentation update.

docs/source/run-workflows/about-running-workflows.md (3)

59-60: LGTM! Clear clarification of the input file format.

The added line effectively communicates that --input_file expects a plain text file with a single input string.


66-70: LGTM! Helpful context for when to use --input_file.

The updated description provides good guidance on the intended use case—verbose inputs that are better stored in a file than passed on the command line.


72-75: LGTM! Clear guidance in the note block.

The note effectively distinguishes between --input_file (single input) and nat eval (batch evaluation), which addresses the PR objective of reducing user confusion.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AnuradhaKaruppiah
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit e6431ad into NVIDIA:release/1.4 Jan 14, 2026
17 checks passed
@AnuradhaKaruppiah AnuradhaKaruppiah deleted the ak-update-input-file-docs branch January 23, 2026 23:34
Jerryguan777 pushed a commit to Jerryguan777/NeMo-Agent-Toolkit that referenced this pull request Jan 28, 2026
1. Docs update to clarify that "nat run --input_file" accepts single plain text inputs only, distinguishing it from "nat eval" for batch evaluation.
2. Fixed file handling in console_front_end_plugin.py to read content immediately and pass string instead of file object

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/NeMo-Agent-Toolkit/blob/develop/docs/source/resources/contributing/index.md).
- We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
  - Any contribution which contains commits that are not Signed-Off will not be accepted.
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.




## Summary by CodeRabbit

* **Documentation**
  * Clarified that `--input_file` accepts a single plain text input file instead of multiple inputs
  * Updated guidance to use `nat eval` for batch evaluation of multiple inputs
  * Enhanced documentation with explicit notes on single-input usage and batch evaluation scenarios

<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>

Authors:
  - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah)

Approvers:
  - https://github.com/mnajafian-nv

URL: NVIDIA#1390
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants