Skip to content

Conversation

@Pouyanpi
Copy link
Collaborator

Description

Removes the deprecated nemoguardrails.llm.params module that was scheduled for removal in v0.19.0. The llm_params context manager has been replaced by passing parameters directly to llm_call() using
the llm_params argument.

Modified Files

  • nemoguardrails/llm/params.py (deleted - 131 lines removed)
  • tests/test_llm_params.py (deleted - 321 lines removed)

References

@Pouyanpi Pouyanpi added this to the v0.19.0 milestone Oct 27, 2025
@Pouyanpi Pouyanpi self-assigned this Oct 27, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR removes the deprecated nemoguardrails.llm.params module and its associated tests as part of a planned deprecation cycle. The module provided a context manager pattern (llm_params()) for temporarily adjusting LLM parameters, which was deprecated in v0.17.0 and scheduled for removal in v0.19.0. The functionality has been replaced by passing parameters directly to llm_call() using the llm_params argument. This cleanup simplifies the API surface by removing 131 lines of production code and 321 lines of test code. The change aligns with the project's architectural shift toward leveraging LangChain's universal .bind() method for parameter binding across all model packages, reducing complexity in the NeMo Guardrails LLM integration layer.

Important Files Changed

Filename Score Overview
nemoguardrails/llm/params.py 5/5 Removed deprecated module containing LLMParams context manager class and helper functions (131 lines)
tests/test_llm_params.py 5/5 Deleted comprehensive test suite for the removed params module (321 lines)

Confidence score: 5/5

  • This PR is safe to merge with minimal risk
  • The removal follows a documented deprecation schedule (deprecated v0.17.0, removal planned for v0.19.0), and the functionality has been replaced by a simpler direct parameter-passing approach that has been available for multiple versions
  • No files require special attention; this is straightforward cleanup of deprecated code with no remaining references

Sequence Diagram

sequenceDiagram
    participant Developer
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Pouyanpi Pouyanpi force-pushed the chore/remove-deprecated-llm-params branch from 3717caa to 9d1a3ab Compare November 7, 2025 12:23
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Removes the deprecated nemoguardrails.llm.params module containing the llm_params context manager and associated test file. This was scheduled for removal in v0.19.0.

Key Changes:

  • Deleted nemoguardrails/llm/params.py (132 lines) - contained LLMParams context manager class
  • Deleted tests/test_llm_params.py (321 lines) - contained unit tests for the deprecated functionality
  • No remaining references to the deprecated module found in the codebase
  • The replacement pattern (passing llm_params as argument to llm_call()) was implemented in v0.17.0 via #1387

Migration Path:
Users should now pass parameters directly: await llm_call(llm, prompt, llm_params={"temperature": 0.7})

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Clean removal of deprecated code that was scheduled for deletion. No remaining references found in codebase, replacement functionality already implemented and tested in v0.17.0, and comprehensive E2E tests exist for the new pattern.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
nemoguardrails/llm/params.py 5/5 Deleted deprecated llm_params context manager module (132 lines removed)
tests/test_llm_params.py 5/5 Deleted deprecated tests for llm_params context manager (321 lines removed)

Sequence Diagram

sequenceDiagram
    participant User as User Code
    participant Old as llm_params (DEPRECATED)
    participant New as llm_call()
    participant LLM as Language Model
    
    Note over User,LLM: Before v0.19.0 (Old Pattern - REMOVED)
    User->>Old: with llm_params(llm, temperature=0.7)
    Old->>LLM: Temporarily set temperature=0.7
    User->>LLM: await llm_call(llm, prompt)
    LLM-->>User: response
    Old->>LLM: Restore original temperature
    
    Note over User,LLM: After v0.17.0 (New Pattern - CURRENT)
    User->>New: await llm_call(llm, prompt, llm_params={"temperature": 0.7})
    New->>LLM: llm.bind(temperature=0.7)
    LLM-->>New: bound_llm
    New->>LLM: bound_llm.ainvoke(prompt)
    LLM-->>New: response
    New-->>User: response
    Note over User,New: Original LLM unchanged - no side effects
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants