-
Notifications
You must be signed in to change notification settings - Fork 396
Add support for environment variable interpolation in config files #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rapids-bot
merged 18 commits into
NVIDIA:develop
from
mpenn:mpenn_env-var-interpolation
Apr 30, 2025
Merged
Add support for environment variable interpolation in config files #157
rapids-bot
merged 18 commits into
NVIDIA:develop
from
mpenn:mpenn_env-var-interpolation
Apr 30, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75b1762 to
72bdc81
Compare
mdemoret-nv
requested changes
Apr 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good functionality, but I fear we are missing edge cases
…g files and unit tests. Signed-off-by: mpenn <mpenn@nvidia.com>
Signed-off-by: mpenn <mpenn@nvidia.com>
Signed-off-by: mpenn <mpenn@nvidia.com>
Signed-off-by: mpenn <mpenn@nvidia.com>
Signed-off-by: mpenn <mpenn@nvidia.com>
## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.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. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) URL: NVIDIA#154 Signed-off-by: mpenn <mpenn@nvidia.com>
## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.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. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) URL: NVIDIA#155 Signed-off-by: mpenn <mpenn@nvidia.com>
- Downgrades Python requirement from `3.12` to `3.11` across all packages - Adds compatibility layer for `typing.override` decorator `type_utils.py` - Replaces all `@typing.override` instances with the compatible version ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.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. Authors: - Yuchen Zhang (https://github.com/yczhang-nv) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: NVIDIA#148 Signed-off-by: mpenn <mpenn@nvidia.com>
Signed-off-by: mpenn <mpenn@nvidia.com>
Signed-off-by: mpenn <mpenn@nvidia.com>
Signed-off-by: mpenn <mpenn@nvidia.com>
26a43e3 to
02f20c2
Compare
Signed-off-by: Matthew Penn <mpenn@nvidia.com>
mdemoret-nv
approved these changes
Apr 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
…ols.py and test_yaml_tools.py to streamline codebase. Signed-off-by: Matthew Penn <mpenn@nvidia.com>
|
/merge |
yczhang-nv
pushed a commit
to yczhang-nv/NeMo-Agent-Toolkit
that referenced
this pull request
May 8, 2025
…VIDIA#157) Closes: NVIDIA#156 This PR adds support for environment variable interpolation in YAML configuration files using the format `${VAR:-default_value}`. This allows developers to: 1. Reference environment variables in configuration 2. Provide default values if the environment variable is not set 3. Use empty strings as default values if needed To illustrate this concept, an example from the `llms` section of the configuration file is provided below. ```yaml llms: nim_llm: _type: nim base_url: ${NIM_BASE_URL:-"http://default.com"} # Optional with default value api_key: ${NIM_API_KEY} # Will use empty string if `NIM_API_KEY` not set model_name: ${MODEL_NAME:-} # Will use empty string if `MODEL_NAME` not set temperature: 0.0 ``` The environment variable interpolation process follow the rules enumerated below. - `${VAR}` - Uses the value of environment variable `VAR`, or empty string if not set - `${VAR:-default}` - Uses the value of environment variable `VAR`, or `default` if not set - `${VAR:-}` - Uses the value of environment variable `VAR`, or empty string if not set ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.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. Authors: - Matthew Penn (https://github.com/mpenn) - David Gardner (https://github.com/dagardner-nv) - Yuchen Zhang (https://github.com/yczhang-nv) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: NVIDIA#157 Signed-off-by: Yuchen Zhang <134643420+yczhang-nv@users.noreply.github.com>
ericevans-nv
pushed a commit
to ericevans-nv/agent-iq
that referenced
this pull request
Jun 3, 2025
…VIDIA#157) Closes: NVIDIA#156 This PR adds support for environment variable interpolation in YAML configuration files using the format `${VAR:-default_value}`. This allows developers to: 1. Reference environment variables in configuration 2. Provide default values if the environment variable is not set 3. Use empty strings as default values if needed To illustrate this concept, an example from the `llms` section of the configuration file is provided below. ```yaml llms: nim_llm: _type: nim base_url: ${NIM_BASE_URL:-"http://default.com"} # Optional with default value api_key: ${NIM_API_KEY} # Will use empty string if `NIM_API_KEY` not set model_name: ${MODEL_NAME:-} # Will use empty string if `MODEL_NAME` not set temperature: 0.0 ``` The environment variable interpolation process follow the rules enumerated below. - `${VAR}` - Uses the value of environment variable `VAR`, or empty string if not set - `${VAR:-default}` - Uses the value of environment variable `VAR`, or `default` if not set - `${VAR:-}` - Uses the value of environment variable `VAR`, or empty string if not set ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.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. Authors: - Matthew Penn (https://github.com/mpenn) - David Gardner (https://github.com/dagardner-nv) - Yuchen Zhang (https://github.com/yczhang-nv) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: NVIDIA#157 Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
ericevans-nv
pushed a commit
to ericevans-nv/agent-iq
that referenced
this pull request
Jun 3, 2025
…VIDIA#157) Closes: NVIDIA#156 This PR adds support for environment variable interpolation in YAML configuration files using the format `${VAR:-default_value}`. This allows developers to: 1. Reference environment variables in configuration 2. Provide default values if the environment variable is not set 3. Use empty strings as default values if needed To illustrate this concept, an example from the `llms` section of the configuration file is provided below. ```yaml llms: nim_llm: _type: nim base_url: ${NIM_BASE_URL:-"http://default.com"} # Optional with default value api_key: ${NIM_API_KEY} # Will use empty string if `NIM_API_KEY` not set model_name: ${MODEL_NAME:-} # Will use empty string if `MODEL_NAME` not set temperature: 0.0 ``` The environment variable interpolation process follow the rules enumerated below. - `${VAR}` - Uses the value of environment variable `VAR`, or empty string if not set - `${VAR:-default}` - Uses the value of environment variable `VAR`, or `default` if not set - `${VAR:-}` - Uses the value of environment variable `VAR`, or empty string if not set ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.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. Authors: - Matthew Penn (https://github.com/mpenn) - David Gardner (https://github.com/dagardner-nv) - Yuchen Zhang (https://github.com/yczhang-nv) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: NVIDIA#157 Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
AnuradhaKaruppiah
pushed a commit
to AnuradhaKaruppiah/oss-agentiq
that referenced
this pull request
Aug 4, 2025
…VIDIA#157) Closes: NVIDIA#156 This PR adds support for environment variable interpolation in YAML configuration files using the format `${VAR:-default_value}`. This allows developers to: 1. Reference environment variables in configuration 2. Provide default values if the environment variable is not set 3. Use empty strings as default values if needed To illustrate this concept, an example from the `llms` section of the configuration file is provided below. ```yaml llms: nim_llm: _type: nim base_url: ${NIM_BASE_URL:-"http://default.com"} # Optional with default value api_key: ${NIM_API_KEY} # Will use empty string if `NIM_API_KEY` not set model_name: ${MODEL_NAME:-} # Will use empty string if `MODEL_NAME` not set temperature: 0.0 ``` The environment variable interpolation process follow the rules enumerated below. - `${VAR}` - Uses the value of environment variable `VAR`, or empty string if not set - `${VAR:-default}` - Uses the value of environment variable `VAR`, or `default` if not set - `${VAR:-}` - Uses the value of environment variable `VAR`, or empty string if not set ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.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. Authors: - Matthew Penn (https://github.com/mpenn) - David Gardner (https://github.com/dagardner-nv) - Yuchen Zhang (https://github.com/yczhang-nv) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: NVIDIA#157
scheckerNV
pushed a commit
to scheckerNV/aiq-factory-reset
that referenced
this pull request
Aug 22, 2025
…VIDIA#157) Closes: NVIDIA#156 This PR adds support for environment variable interpolation in YAML configuration files using the format `${VAR:-default_value}`. This allows developers to: 1. Reference environment variables in configuration 2. Provide default values if the environment variable is not set 3. Use empty strings as default values if needed To illustrate this concept, an example from the `llms` section of the configuration file is provided below. ```yaml llms: nim_llm: _type: nim base_url: ${NIM_BASE_URL:-"http://default.com"} # Optional with default value api_key: ${NIM_API_KEY} # Will use empty string if `NIM_API_KEY` not set model_name: ${MODEL_NAME:-} # Will use empty string if `MODEL_NAME` not set temperature: 0.0 ``` The environment variable interpolation process follow the rules enumerated below. - `${VAR}` - Uses the value of environment variable `VAR`, or empty string if not set - `${VAR:-default}` - Uses the value of environment variable `VAR`, or `default` if not set - `${VAR:-}` - Uses the value of environment variable `VAR`, or empty string if not set ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.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. Authors: - Matthew Penn (https://github.com/mpenn) - David Gardner (https://github.com/dagardner-nv) - Yuchen Zhang (https://github.com/yczhang-nv) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: NVIDIA#157
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes: #156
This PR adds support for environment variable interpolation in YAML configuration files using the format
${VAR:-default_value}. This allows developers to:To illustrate this concept, an example from the
llmssection of the configuration file is provided below.The environment variable interpolation process follow the rules enumerated below.
${VAR}- Uses the value of environment variableVAR, or empty string if not set${VAR:-default}- Uses the value of environment variableVAR, ordefaultif not set${VAR:-}- Uses the value of environment variableVAR, or empty string if not setBy Submitting this PR I confirm: