Other Configuration Classes¶
Additional configuration classes.
LoggingConfig¶
from mamba_agents.config import LoggingConfig
config = LoggingConfig(
level="INFO",
format="json",
redact_sensitive=True,
)
| Option | Type | Default | Description |
|---|---|---|---|
level |
str | "INFO" |
Log level |
format |
str | "text" |
Output format |
redact_sensitive |
bool | True | Redact secrets |
ErrorRecoveryConfig¶
from mamba_agents.config import ErrorRecoveryConfig
config = ErrorRecoveryConfig(
retry_level=2,
max_retries=3,
base_wait=1.0,
)
| Option | Type | Default | Description |
|---|---|---|---|
retry_level |
int | 2 | Aggressiveness (1-3) |
max_retries |
int | 3 | Max attempts |
base_wait |
float | 1.0 | Initial backoff |
API Reference¶
LoggingConfig
¶
Bases: BaseModel
Configuration for logging behavior.
Supports structured JSON logging, request/response body logging, and automatic redaction of sensitive data.
| ATTRIBUTE | DESCRIPTION |
|---|---|
level |
Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL).
TYPE:
|
structured |
Enable JSON format logging.
TYPE:
|
include_request_body |
Log request bodies (opt-in for privacy).
TYPE:
|
include_response_body |
Log response bodies (opt-in for privacy).
TYPE:
|
body_size_limit |
Maximum bytes to log for bodies.
TYPE:
|
include_correlation_id |
Include correlation IDs in logs.
TYPE:
|
redact_authorization |
Redact Authorization headers.
TYPE:
|
redact_api_keys |
Redact API keys in query params.
TYPE:
|
sensitive_patterns |
Custom regex patterns to redact.
TYPE:
|
ErrorRecoveryConfig
¶
Bases: BaseModel
Configuration for error recovery and retry behavior.
Error recovery aggressiveness is configurable on a scale of 1-3: - Level 1 (Conservative): Minimal retries, fail fast - Level 2 (Balanced): Default behavior - Level 3 (Aggressive): Maximum retry attempts
| ATTRIBUTE | DESCRIPTION |
|---|---|
retry_level |
Aggressiveness level (1-3).
TYPE:
|
tool_max_retries |
Override for tool retry count.
TYPE:
|
model_max_retries |
Override for model retry count.
TYPE:
|
initial_backoff_seconds |
Initial wait before retry.
TYPE:
|
max_backoff_seconds |
Maximum wait between retries.
TYPE:
|
circuit_breaker_threshold |
Failures before circuit opens.
TYPE:
|
circuit_breaker_timeout |
Seconds before retry after circuit opens.
TYPE:
|
retryable_tool_errors |
Tool error types that trigger retry.
TYPE:
|
retryable_model_errors |
Model error types that trigger retry.
TYPE:
|
validate_retry_level
classmethod
¶
Validate retry level is in range 1-3.
get_tool_retries
¶
Get tool retry count based on configuration.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Number of retries for tool calls. |
Source code in src/mamba_agents/config/retry.py
get_model_retries
¶
Get model retry count based on configuration.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Number of retries for model calls. |
Source code in src/mamba_agents/config/retry.py
get_backoff_multiplier
¶
Get exponential backoff multiplier based on retry level.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Backoff multiplier for exponential backoff. |