Config Manager

Configuration manager for Arshai.

This module handles loading, validating, and accessing configuration settings.

Classes

class arshai.config.config_manager.ConfigManager(config_path=None)[source]

Bases: object

Configuration manager for Arshai.

This class handles loading configuration from different sources (files and defaults) and provides access to configuration values.

It focuses on structural configuration (which providers to use, what strategies to follow), while sensitive data and connection details should be read from environment variables directly in component implementations.

__init__(config_path=None)[source]

Initialize the configuration manager.

Parameters:

config_path (Optional[str]) – Optional path to a configuration file

load_from_file(config_path)[source]

Load configuration from a file.

Parameters:

config_path (str) – Path to the configuration file (JSON or YAML)

Return type:

None

get(path, default=None)[source]

Get a configuration value by path.

Parameters:
  • path (str) – Dot-separated path to the configuration value (e.g., “llm.provider”)

  • default (Any) – Default value to return if the path is not found

Return type:

Any

Returns:

The configuration value at the specified path, or the default value

get_all()[source]

Get the entire configuration dictionary.

Return type:

Dict[str, Any]

Returns:

The entire configuration dictionary

set(path, value)[source]

Set a configuration value by path.

Parameters:
  • path (str) – Dot-separated path to the configuration value (e.g., “llm.provider”)

  • value (Any) – Value to set

Return type:

None