Sync midstream to upstream#16
Merged
m-misiura merged 18 commits intoNov 28, 2025
Merged
Conversation
…-NeMo#1490) * Add full path to server uvicorn.run() call * Remove unused files * Add Procfile with the commands to run Guardrails, content safety mock, and APP LLM mock * Add simple script to validate Guardrails and mocks are running correctly * Restructure configs into mocks and Guardrails configs * Add tests against validate_mocks.py * Convert f-string logging statements to %s format * Add tests for validate_mocks.py * Remove script-testing unit-tests * Add pyproject.toml 'benchmark' extra to install honcho and requests * Add workers CLI argument to pass to uvicorn app invocation * Use httpx rather than requests to call and validate mocks * Revert "Add pyproject.toml 'benchmark' extra to install honcho and requests" This reverts commit 20f3726. * Removed commented line in Procfile * Add README explaining core-banchmarking * Small README tweaks
…-ai-endpoints v0.3.19 (NVIDIA-NeMo#1503) This reverts commit aafd733.
…VIDIA-NeMo#1504) * feat(llm): Add async streaming support to ChatNVIDIA provider Enables stream_async() to work with ChatNVIDIA/NIM models by implementing async streaming decorator and _agenerate method. Prior to this fix, stream_async() would fail with NIM engine configurations. * fix: ensure stream_async background task completes before exit (NVIDIA-NeMo#1508) Wrap the returned iterator to await the background generation task in a finally block, preventing "Task was destroyed but it is pending" warning. Add overloaded type signatures to provide accurate return types based on the include_generation_metadata parameter.
* refactor(langchain): migrate imports to canonical langchain-core paths Migrate all imports from deprecated proxy paths to canonical langchain-core paths to ensure compatibility with LangChain 1.x. Changes include: - Use `from langchain_core.language_models import BaseLLM, BaseChatModel` - Remove proxy imports from `langchain.chat_models.base` - Standardize submodule imports to top-level langchain_core.language_models This ensures forward compatibility with LangChain 1.x where proxy imports from the main langchain package will be removed. * refactor(langchain)!: remove deprecated Chain support from action dispatcher Remove support for registering LangChain Chain objects as actions in favor of the modern Runnable interface. Chain support is deprecated in LangChain 1.x and users should migrate to using Runnable objects instead. - Remove Chain handling logic from action_dispatcher.py - Remove Chain-based tests from test_runnable_rails.py - Add deprecation warning in python-api.md documentation * refactor(langchain)!: remove SummarizeDocument built-in action Remove the built-in SummarizeDocument action which relied on deprecated LangChain Chain features. Users who need document summarization should implement custom actions using LangChain Runnable chains. - Delete nemoguardrails/actions/summarize_document.py - Remove related import from llm/filters.py * feat(langchain): add LangChain 1.x compatibility with fallback patterns Add try/except fallback patterns in examples to support both LangChain 0.x and 1.x. When using LangChain 1.x, legacy Chain features are imported from langchain-classic package with helpful error messages. This allows examples to work seamlessly across LangChain versions without requiring code changes from users. - Add fallback imports for RetrievalQA, embeddings, text splitters, vectorstores - Provide clear error messages directing users to install langchain-classic * refactor(langchain): update runtime imports to langchain-core Update Colang runtime imports to use canonical langchain-core paths for callbacks and runnables. Part of the broader migration to langchain-core for LangChain 1.x compatibility. * docs(langchain): rewrite custom LLM provider guide with BaseChatModel support Complete rewrite of the custom LLM provider documentation with: - Separate comprehensive guides for BaseLLM (text completion) and BaseChatModel (chat) - Correct method signatures (_call vs _generate) - Proper async implementations - Clear registration instructions (register_llm_provider vs register_chat_provider) - Working code examples with correct langchain-core imports - Important notes on choosing the right base class This addresses the gap where users were not properly guided on implementing custom chat models and were being directed to the wrong interface. * feat(langchain): extend dependency constraints to support LangChain 1.x Extend LangChain dependency constraints to support both 0.x and 1.x versions: - langchain: >=0.2.14,<0.4.0 → >=0.2.14,<2.0.0 - langchain-core: >=0.2.14,<0.4.0 → >=0.2.14,<2.0.0 - langchain-community: >=0.2.5,<0.4.0 → >=0.2.5,<2.0.0
NVIDIA-NeMo#1509) * fix(cli): Fix TypeError in v2.x chat due to incorrect State/dict conversion Fixes incorrect type assumptions in PR NVIDIA-NeMo#1380 that caused TypeError when using v2.x chat CLI. The bug incorrectly assumed process_events_async returns dict and tried to convert State objects with State(**output_state). Changes: - Fix type annotations in LLMRails.process_events_async to return Union[dict, State] - Remove incorrect asdict() conversion and State(**) reconstruction in chat.py - Add integration tests to prevent regression
* chore(pre-commit): switch to ruff for linting and formatting Replace isort and black with ruff and ruff-format in pre-commit config. Update hooks to use ruff for both linting and formatting, specifying versions v0.9.6 and v0.11.2. Remove isort and black hooks, and keep other hooks unchanged. * feat(imports): add utilities for optional dependencies Introduced a new `imports.py` module providing utilities to handle optional dependencies. This includes functions for importing optional modules with customizable error handling, checking for their presence, and version validation. Also added a mapping for commonly used optional dependencies and a helper to retrieve them with predefined settings.
* ci: add lint workflow and unify coverage reporting - Introduced `.github/workflows/lint.yml` for running pre-commit hooks on PRs and pushes to main/develop branches. - Updated `_test.yml` to support coverage reporting and uploading to Codecov, controlled via `with-coverage` input. - Enhanced `pr-tests.yml` to run tests with coverage for Python 3.11. - Added `pr-tests-skip.yml` to skip tests for non-code PRs. - Removed obsolete `test-coverage-report.yml` workflow.
* docs: clean up documentation language and references Co-authored-by: Chris Parisien <64271260+cparisien@users.noreply.github.com> Signed-off-by: Pouyan <13303554+Pouyanpi@users.noreply.github.com> --------- Signed-off-by: Pouyan <13303554+Pouyanpi@users.noreply.github.com> Co-authored-by: Chris Parisien <64271260+cparisien@users.noreply.github.com>
Signed-off-by: Mike McKiernan <mmckiernan@nvidia.com>
48a7021
into
trustyai-explainability:develop
4 of 22 checks passed
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
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.
No description provided.