nemoguardrails.rails.llm.config.RailsConfig#
- class nemoguardrails.rails.llm.config.RailsConfig[source]#
Bases:
BaseModelConfiguration object for the models and the rails.
TODO: add typed config for user_messages, bot_messages, and flows.
-
models:
List[Model]#
-
user_messages:
Dict[str,List[str]]#
-
bot_messages:
Dict[str,List[str]]#
-
flows:
List[Union[Dict,Any]]#
-
instructions:
Optional[List[Instruction]]#
-
docs:
Optional[List[Document]]#
-
actions_server_url:
Optional[str]#
-
sample_conversation:
Optional[str]#
-
prompts:
Optional[List[TaskPrompt]]#
-
prompting_mode:
Optional[str]#
-
config_path:
Optional[str]#
-
import_paths:
Optional[List[str]]#
-
imported_paths:
Optional[Dict[str,str]]#
-
lowest_temperature:
Optional[float]#
-
enable_multi_step_generation:
Optional[bool]#
-
colang_version:
str#
-
custom_data:
Dict#
-
knowledge_base:
KnowledgeBaseConfig#
-
core:
CoreConfig#
-
rails:
Rails#
-
streaming:
bool# Read-only data descriptor used to emit a runtime deprecation warning before accessing a deprecated field.
- msg#
The deprecation message to be emitted.
- wrapped_property#
The property instance if the deprecated field is a computed field, or None.
- field_name#
The name of the field being deprecated.
-
enable_rails_exceptions:
bool#
-
passthrough:
Optional[bool]#
-
event_source_uid:
str#
-
tracing:
TracingConfig#
- classmethod check_model_exists_for_input_rails(values)[source]#
Make sure we have a model for each input rail where one is provided using $model=<model_type>
- classmethod check_model_exists_for_output_rails(values)[source]#
Make sure we have a model for each output rail where one is provided using $model=<model_type>
- classmethod validate_models_api_key_env_var(models)[source]#
Model API Key Env var must be set to make LLM calls
-
raw_llm_call_action:
Optional[str]#
- classmethod from_path(config_path)[source]#
Loads a configuration from a given path.
Supports loading a from a single file, or from a directory.
- Parameters:
config_path (str)
- classmethod from_content(
- colang_content=None,
- yaml_content=None,
- config=None,
Loads a configuration from the provided colang/YAML content/config dict.
- Parameters:
colang_content (str | None)
yaml_content (str | None)
config (dict | None)
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
models: