8000 docs: Revise GS example by mikemckiernan · Pull Request #1146 · NVIDIA/NeMo-Guardrails · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docs: Revise GS example #1146

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
merged 2 commits into from
May 28, 2025
Merged

Conversation

mikemckiernan
Copy link
Member

Description

Revise the GS example:

  • Replace errant model_name field with model in config.yml.
  • Remove printing the LLM timing calls.

Related Issue(s)

Checklist

  • I've read the CONTRIBUTING guidelines.
  • I've updated the documentation if applicable.
  • I've added tests if applicable.
  • @mentions of the person or team responsible for reviewing proposed changes.

@mikemckiernan mikemckiernan added the documentation Improvements or additions to documentation label < 8000 a href="#event-17405835693" class="Link--secondary">Apr 25, 2025
@mikemckiernan mikemckiernan added this to the v0.14.0 milestone Apr 25, 2025
@mikemckiernan mikemckiernan self-assigned this Apr 25, 2025
Copy link

Documentation preview

https://nvidia.github.io/NeMo-Guardrails/review/pr-1146

@mikemckiernan mikemckiernan mentioned this pull request Apr 25, 2025
4 tasks
@Pouyanpi Pouyanpi added bug Something isn't working enhancement New feature or request refactoring and removed bug Something isn't working enhancement New feature or request refactoring labels May 1, 2025
@codecov-commenter
Copy link
codecov-commenter commented May 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.43%. Comparing base (36d625e) to head (87eec19).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1146   +/-   ##
========================================
  Coverage    68.43%   68.43%           
========================================
  Files          161      161           
  Lines        15943    15943           
========================================
  Hits         10910    10910           
  Misses        5033     5033           
Flag Coverage Δ
python 68.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator
@Pouyanpi Pouyanpi left a comment

Choose a reason for hiding this comment

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

Thank you @mikemckiernan , I still owe you a bug fix/triage.

langchain-nvidia-ai-endpoints will be supported as an optional dependency of nemoguardrails. (see #1105 )

do you think it is good to change the first to steps into one:

pip install "nemoguardrails[nvidia]"

@mikemckiernan
Copy link
Member Author

Thank you @mikemckiernan , I still owe you a bug fix/triage.

langchain-nvidia-ai-endpoints will be supported as an optional dependency of nemoguardrails. (see #1105 )

do you think it is good to change the first to steps into one:

pip install "nemoguardrails[nvidia]"

I can go either way. The only thing that comes to mind against this update is that other than nemoguardrails[openai], for any other LangChain client, customers need to install the package themselves. Unless someone feels strongly, I guess I prefer the consistency of independent package installation. But not wed to it.

@Pouyanpi
Copy link
Collaborator

@mikemckiernan the explain issue should be resolved in #1194

- Provide link to raw version of prompts.yml in GitHub

Signed-off-by: Mike McKiernan <mmckiernan@nvidia.com>
@mikemckiernan
Copy link
Member Author

@mikemckiernan the explain issue should be resolved in #1194

I was optimistic! I rebased off upstream/develop, but in my hands, I still get the traceback:

Traceback (most recent call last):
  File "/home/local/repos/nemo-guard-tk/examples/configs/gs_content_safety/demo.py", line 76, in <module>
    rails.explain_info.print_llm_calls_summary()
  File "/home/local/repos/nemo-guard-tk/nemoguardrails/logging/explain.py", line 103, in print_llm_calls_summary
    f"{i+1}. Task `{llm_call.task}` took {llm_call.duration:.2f} seconds "
                                         ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported format string passed to NoneType.__format__

In the debugger, I can see that the duration of the second call is None. Looks to me like someone else thought it could be None as well.

Signed-off-by: Mike McKiernan <mmckiernan@nvidia.com>
@Pouyanpi
Copy link
Collaborator

@mikemckiernan the explain issue should be resolved in #1194

I was optimistic! I rebased off upstream/develop, but in my hands, I still get the traceback:

Traceback (most recent call last):
  File "/home/local/repos/nemo-guard-tk/examples/configs/gs_content_safety/demo.py", line 76, in <module>
    rails.explain_info.print_llm_calls_summary()
  File "/home/local/repos/nemo-guard-tk/nemoguardrails/logging/explain.py", line 103, in print_llm_calls_summary
    f"{i+1}. Task `{llm_call.task}` took {llm_call.duration:.2f} seconds "
                                         ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported format string passed to NoneType.__format__

In the debugger, I can see that the duration of the second call is None. Looks to me like someone else thought it could be None as well.

Thanks, the information is useful. I'll try to fix it 👍🏻

@Pouyanpi
Copy link
Collaborator

@mikemckiernan You should be able to create and push branches directly to the cloned repo, no need to use a fork since you have write access. But if you prefer to fork no objection from my side 😃

@Pouyanpi Pouyanpi merged commit 5c5261c into NVIDIA:develop May 28, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0