Utilities
Constants
FORMATS
- class belso.utils.formats.FORMATS[source]
Bases:
object
A class that provides constants for supported schema providers. This allows for more readable code when specifying providers in the convert method.
- ANTHROPIC = 'anthropic'
- BELSO = 'belso'
- GOOGLE = 'google'
- HUGGINGFACE = 'huggingface'
- JSON = 'json'
- LANGCHAIN = 'langchain'
- MISTRAL = 'mistral'
- OLLAMA = 'ollama'
- OPENAI = 'openai'
- XML = 'xml'
- YAML = 'yaml'
Logging
- belso.utils.logging.get_logger(name=None)[source]
Get a logger instance for a specific module within belso.
Args
name (
str
): the name of the module (will be prefixed with ‘belso.’).
Returns
logging.Logger
: the logger instance.
- belso.utils.logging.configure_logger(level=20, log_file=None, log_format=None, propagate=True, handler_config=None)[source]
Configure the belso logger without affecting parent loggers.
Args
level (
int
): the logging level. Defaults tologging.INFO
.log_file (
Optional[str]
): the path to the log file. Defaults toNone
.log_format (
Optional[str]
): the log format. Defaults toNone
.propagate (
bool
): whether to propagate logs to parent loggers. Defaults totrue
.handler_config (
Optional[Dict[str, Any]]
): additional configuration for handlers. Defaults toNone
.