Config.get()#

relationalai
#Config.get(name: str, default: Any|None = None, strict:bool = True) -> Any

Get a configuration parameter value.

Parameters#

NameTypeDescription
namestrThe name of the configuration parameter to get.
defaultAnyOptional default value to return if the configuration parameter is not found.
strictboolOptional 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().

See Also#