Skip to content
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

bug: The custom variables passed to register_prompt_context are not substituted in general_instructions #925

Open
4 tasks done
tvsathish opened this issue Jan 10, 2025 · 0 comments
Labels
bug Something isn't working status: needs triage New issues that have not yet been reviewed or categorized.

Comments

@tvsathish
Copy link

Did you check docs and existing issues?

  • I have read all the NeMo-Guardrails docs
  • I have updated the package to the latest version before submitting this issue
  • (optional) I have used the develop branch
  • I have searched the existing issues of NeMo-Guardrails

Python version (python --version)

Python 3.11

Operating system/version

MacOS 14.6.1 (Sonoma)

NeMo-Guardrails version (if you must use a specific version and not the latest

0.11.0

Describe the bug

The context variables set as part of

rails.register_prompt_context(<key>, <value>) are not passed to the general_instructions section for the generic prompt.

In line 902 of [nemo](https://github.com/NVIDIA/NeMo-Guardrails/blob/develop/nemoguardrails/actions/llm/generation.py), I think the set context is not sent to the prompt rendering part.

Kindly treat this as urgent and fix it.

Thanks,
Paddy

Steps To Reproduce

  1. Specify a custom prompt in the general_instructions section of config.yml with a custom variable
  2. Set custom prompt variable using rails.register_prompt_conext(<key>, <value>)
  3. The rendered output prompt doesn not take into account the set

Expected Behavior

The prompt used as part of general_instructions section should honour the custom variables set using rails.register_prompt_conext(<key>, <value>)

Actual Behavior

The prompt used as part of general_instructions section is not receiving the custom variables set using rails.register_prompt_conext(<key>, <value>)

@tvsathish tvsathish added bug Something isn't working status: needs triage New issues that have not yet been reviewed or categorized. labels Jan 10, 2025
@tvsathish tvsathish changed the title bug: bug: The custom variables passed to register_prompt_context are not substituted in general_instructions Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: needs triage New issues that have not yet been reviewed or categorized.
Projects
None yet
Development

No branches or pull requests

1 participant