haive.core.utils.file_utils¶
📄 File Reader Utilities
This module provides utility functions for reading .md, .yaml, or .yml files into memory. It supports content integration for system messages and configuration loading.
Features: - Read Markdown files as plain strings - Read YAML files into Python dictionaries - Auto-detect file type based on extension - Read multiple files at once and return a dictionary - Designed for use in LLM prompt templates and configuration systems
Author: Your Name
Functions¶
|
Reads a Markdown or YAML file and returns its content. |
|
Reads multiple Markdown or YAML files and returns a dictionary of filename to content. |
|
Reads a YAML (.yml or .yaml) file and returns the parsed Python object. |
Module Contents¶
- haive.core.utils.file_utils.read_file_content(file_path)[source]¶
Reads a Markdown or YAML file and returns its content.
Automatically detects the file type based on extension.
- Parameters:
file_path (Union[str, Path]) – Path to the file to read (.md, .yml, or .yaml).
- Returns:
- String content for .md files, parsed Python object for .yaml files,
or None if the file cannot be read.
- Return type:
Any