Config.get()#
relationalai
#Config.get(name: str, default: Any|None = None, strict:bool = True) -> Any
Get a configuration parameter value.
Parameters#
Name | Type | Description |
---|---|---|
name | str | The name of the configuration parameter to get. |
default | Any | Optional default value to return if the configuration parameter is not found. |
strict | bool | Optional flag to raise an error if the configuration parameter is not found and no default value is provided. (Default: True ) |
Returns#
The value of the configuration parameter.
Example#
Use .get()
to get the value of a configuration parameter:
#import relationalai as rai
# Get the current configuration.
cfg = rai.Config()
# Get the configured engine name.
print(cfg.get("engine"))
# 'my_engine'
See Valid Profile Keys for a list of configuration parameters that can be retrieved using .get()
.