nemoguardrails.cli.providers

View as Markdown

Module Contents

Functions

NameDescription
_get_provider_completionsGet list of providers based on type.
_list_providersList all available providers.
find_providersList and select LLM providers interactively.
select_providerLet user select a specific provider based on the type.
select_provider_typeLet user select between text completion and chat completion providers.
select_provider_with_typeLet user select both provider type and specific provider.

Data

ProviderType

log

API

nemoguardrails.cli.providers._get_provider_completions(
provider_type: typing.Optional[nemoguardrails.cli.providers.ProviderType] = None
) -> typing.List[str]

Get list of providers based on type.

nemoguardrails.cli.providers._list_providers() -> None

List all available providers.

nemoguardrails.cli.providers.find_providers(
list_only: bool = typer.Option(False, '--list...
)

List and select LLM providers interactively.

This command provides an interactive interface to explore and select LLM providers. It supports both text completion and chat completion providers.

When run without options:

  • Type to search for provider type (text/chat completion)
  • Type to search for specific provider
  • Use arrows to navigate and Tab to complete

When run with —list:

  • Simply lists all available providers
  • No selection is made
nemoguardrails.cli.providers.select_provider(
provider_type: typing.Optional[nemoguardrails.cli.providers.ProviderType] = None
) -> typing.Optional[str]

Let user select a specific provider based on the type.

nemoguardrails.cli.providers.select_provider_type() -> typing.Optional[nemoguardrails.cli.providers.ProviderType]

Let user select between text completion and chat completion providers.

nemoguardrails.cli.providers.select_provider_with_type() -> typing.Optional[typing.Tuple[str, str]]

Let user select both provider type and specific provider.

nemoguardrails.cli.providers.ProviderType = Literal['text completion', 'chat completion']
nemoguardrails.cli.providers.log = logging.getLogger(__name__)