nemoguardrails.integrations.langchain.helpers

View as Markdown

Module Contents

Functions

NameDescription
get_llm_instance_wrapperWraps an LLM instance in a class that can be registered with LLMRails.

API

nemoguardrails.integrations.langchain.helpers.get_llm_instance_wrapper(
llm_instance: langchain_core.language_models.LLM,
llm_type: str
) -> typing.Type[langchain_core.language_models.LLM]

Wraps an LLM instance in a class that can be registered with LLMRails.

This is useful to create specific types of LLMs using a generic LLM provider from HuggingFace, e.g., HuggingFacePipelineCompatible or HuggingFaceEndpoint.