OS-Copilot Config

class oscopilot.utils.config.Config[source]

Bases: object

A singleton class for storing and accessing configuration parameters.

This class ensures that only one instance is created and provides methods for initializing and accessing parameters.

classmethod get_parameter(key)[source]

Retrieves a parameter value by key.

Parameters:

key (str) – The key of the parameter to retrieve.

Returns:

The value of the parameter if found, otherwise None.

Return type:

Any

classmethod initialize(args)[source]

Initializes the Config instance with command-line arguments.

Parameters:

args (argparse.Namespace) – The parsed command-line arguments.

oscopilot.utils.config.self_learning_print_logging(args)[source]

Prints self-learning task information and logs it.

Parameters:

args (argparse.Namespace) – The parsed command-line arguments.

oscopilot.utils.config.setup_config()[source]

Sets up configuration parameters based on command-line arguments.

Returns:

The parsed command-line arguments.

Return type:

argparse.Namespace

oscopilot.utils.config.setup_pre_run(args)[source]

Sets up pre-run tasks and logging.

Parameters:

args (argparse.Namespace) – The parsed command-line arguments.

Returns:

A string containing information about the task.

Return type:

str