danoan.llm_assistant.common.config module
LLM-assistant configuration API.
- danoan.llm_assistant.common.config.get_absolute_configuration_path(path: Path)[source]
Get absolute path of a configuration parameter.
Paths in the configuration file are given relative to the location of the configuration file. This function resolves to its absolute path.
- Parameters:
path (Path)
- danoan.llm_assistant.common.config.get_configuration() LLMAssistantConfiguration [source]
Return configuration object.
- Return type:
- danoan.llm_assistant.common.config.get_configuration_filepath() Path [source]
Return path to llm-assistant configuration file.
- Return type:
Path
- danoan.llm_assistant.common.config.get_configuration_folder() Path [source]
Return directory where configuration file is stored.
First checks if a configuration file exists in the file hierarchy. If that is the case, return the directory where the configuration file is located.
If the procedure above does not find a configuration file, return the value stored in the environment variable LLM_ASSISTANT_ENV_VARIABLE.
If the environment variable is not defined, raise an error.
- Raises:
EnvironmentVariableNotDefinedError – If the LLM_ASSISTANT_ENV_VARIABLE is not defined and a configuration file is not found in the file hierarchy
- Return type:
Path
- danoan.llm_assistant.common.config.get_environment_variable_value() Path [source]
- Return type:
Path
- danoan.llm_assistant.common.config.get_prompt_configuration(prompt_name: str) PromptConfiguration [source]
Get prompt configuration object.
It searches the prompt configuration file within the directory specified by runner.prompt_collection_folder setting.
- Raises:
FileNotFoundError – if prompt configuration file is not found.
- Parameters:
prompt_name (str)
- Return type: