gunn.config package¶
Submodules¶
gunn.config.config module¶
Core configuration management for gunn.
This module provides the main configuration classes and loading functionality with environment variable support and feature flags.
- class gunn.config.config.FeatureFlags(latency_simulation=True, backpressure_management=True, staleness_detection=True, cancellation_tokens=True, telemetry=True, metrics_export=True, structured_logging=True, pii_redaction=True, memory_management=True, log_compaction=True, view_caching=True, authentication=False, authorization=False, rate_limiting=True, distributed_mode=False, gpu_acceleration=False)[ソース]¶
ベースクラス:
object
Feature flags for enabling/disabling functionality.
These can be controlled via the GUNN_FEATURES environment variable as a comma-separated list (e.g., "latency,backpressure,telemetry").
- パラメータ:
latency_simulation (bool)
backpressure_management (bool)
staleness_detection (bool)
cancellation_tokens (bool)
telemetry (bool)
metrics_export (bool)
structured_logging (bool)
pii_redaction (bool)
memory_management (bool)
log_compaction (bool)
view_caching (bool)
authentication (bool)
authorization (bool)
rate_limiting (bool)
distributed_mode (bool)
gpu_acceleration (bool)
- class gunn.config.config.LoggingConfig(**data)[ソース]¶
ベースクラス:
BaseModel
Logging configuration.
- パラメータ:
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gunn.config.config.MetricsConfig(**data)[ソース]¶
ベースクラス:
BaseModel
Metrics configuration.
- パラメータ:
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gunn.config.config.SecurityConfig(**data)[ソース]¶
ベースクラス:
BaseModel
Security configuration.
- パラメータ:
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gunn.config.config.DatabaseConfig(**data)[ソース]¶
ベースクラス:
BaseModel
Database configuration.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gunn.config.config.Config(**data)[ソース]¶
ベースクラス:
BaseModel
Main configuration class for gunn.
This class combines all configuration sections and provides validation and environment variable loading.
- パラメータ:
orchestrator (OrchestratorConfig)
features (FeatureFlags)
logging (LoggingConfig)
metrics (MetricsConfig)
security (SecurityConfig)
database (DatabaseConfig)
environment (Literal['development', 'staging', 'production'])
debug (bool)
-
orchestrator:
OrchestratorConfig
¶
-
features:
FeatureFlags
¶
-
logging:
LoggingConfig
¶
-
metrics:
MetricsConfig
¶
-
security:
SecurityConfig
¶
-
database:
DatabaseConfig
¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- gunn.config.config.load_config_from_file(config_path)[ソース]¶
Load configuration from YAML file.
- Args:
config_path: Path to configuration file
- Returns:
Loaded configuration
- Raises:
ConfigError: If configuration is invalid or file cannot be read
- gunn.config.config.load_config_from_env()[ソース]¶
Load configuration from environment variables.
Environment variables are mapped as follows: - GUNN_ENVIRONMENT: Environment name (development/staging/production) - GUNN_DEBUG: Enable debug mode (true/false) - GUNN_FEATURES: Comma-separated list of enabled features - GUNN_LOG_LEVEL: Logging level - GUNN_LOG_FORMAT: Logging format (json/text) - GUNN_METRICS_PORT: Metrics server port - GUNN_DATABASE_URL: Database connection URL - GUNN_MAX_AGENTS: Maximum number of agents - GUNN_STALENESS_THRESHOLD: Staleness detection threshold - GUNN_BACKPRESSURE_POLICY: Backpressure policy (defer/shed/drop)
- 戻り値の型:
- Returns:
Configuration loaded from environment variables
- gunn.config.config.load_config(config_path=None)[ソース]¶
Load configuration from file and environment variables.
Configuration is loaded in the following order (later sources override earlier): 1. Default values 2. Configuration file (if provided) 3. Environment variables
- Args:
config_path: Optional path to configuration file
- Returns:
Merged configuration
gunn.config.deployment module¶
Deployment configuration and health checks.
This module provides deployment-specific configuration and health check functionality for production deployments.
- class gunn.config.deployment.HealthCheckConfig(**data)[ソース]¶
ベースクラス:
BaseModel
Configuration for health checks.
- パラメータ:
enabled (bool)
endpoint (str)
readiness_endpoint (str)
liveness_endpoint (str)
timeout_seconds (float)
check_interval_seconds (float)
check_database (bool)
check_event_log (bool)
check_orchestrator (bool)
check_memory_usage (bool)
max_memory_usage_percent (float)
max_response_time_ms (float)
max_queue_depth (int)
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gunn.config.deployment.HealthStatus(healthy, ready, checks, timestamp, response_time_ms)[ソース]¶
ベースクラス:
object
Health check status.
- パラメータ:
- class gunn.config.deployment.DeploymentConfig(**data)[ソース]¶
ベースクラス:
BaseModel
Deployment-specific configuration.
- パラメータ:
-
health:
HealthCheckConfig
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gunn.config.deployment.HealthChecker(config)[ソース]¶
ベースクラス:
object
Health check implementation.
- パラメータ:
config (HealthCheckConfig)
- async check_health()[ソース]¶
Perform comprehensive health check.
- 戻り値の型:
- Returns:
Health status with detailed check results
gunn.config.environment module¶
Environment detection and configuration.
This module provides utilities for detecting the current environment and loading environment-specific configurations.
- class gunn.config.environment.Environment(*values)[ソース]¶
ベースクラス:
Enum
Supported deployment environments.
- DEVELOPMENT = 'development'¶
- STAGING = 'staging'¶
- PRODUCTION = 'production'¶
- TESTING = 'testing'¶
- gunn.config.environment.get_environment()[ソース]¶
Detect current environment from various sources.
Environment is detected in the following order: 1. GUNN_ENVIRONMENT environment variable 2. NODE_ENV environment variable (for compatibility) 3. Presence of specific files (.env.production, etc.) 4. Default to development
- 戻り値の型:
- Returns:
Detected environment
- gunn.config.environment.get_config_file_path(environment=None)[ソース]¶
Get the configuration file path for the given environment.
- 戻り値の型:
Path
|None
- パラメータ:
environment (Environment | None)
- Args:
environment: Environment to get config for (defaults to current)
- Returns:
Path to configuration file, or None if not found
Module contents¶
Configuration management for gunn.
This module provides configuration loading, validation, and feature flag management for the multi-agent simulation core.
- class gunn.config.Config(**data)[ソース]¶
ベースクラス:
BaseModel
Main configuration class for gunn.
This class combines all configuration sections and provides validation and environment variable loading.
- パラメータ:
orchestrator (OrchestratorConfig)
features (FeatureFlags)
logging (LoggingConfig)
metrics (MetricsConfig)
security (SecurityConfig)
database (DatabaseConfig)
environment (Literal['development', 'staging', 'production'])
debug (bool)
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
orchestrator:
OrchestratorConfig
¶
-
features:
FeatureFlags
¶
-
logging:
LoggingConfig
¶
-
metrics:
MetricsConfig
¶
-
security:
SecurityConfig
¶
-
database:
DatabaseConfig
¶
- class gunn.config.DeploymentConfig(**data)[ソース]¶
ベースクラス:
BaseModel
Deployment-specific configuration.
- パラメータ:
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
health:
HealthCheckConfig
¶
- class gunn.config.Environment(*values)[ソース]¶
ベースクラス:
Enum
Supported deployment environments.
- DEVELOPMENT = 'development'¶
- STAGING = 'staging'¶
- PRODUCTION = 'production'¶
- TESTING = 'testing'¶
- class gunn.config.FeatureFlags(latency_simulation=True, backpressure_management=True, staleness_detection=True, cancellation_tokens=True, telemetry=True, metrics_export=True, structured_logging=True, pii_redaction=True, memory_management=True, log_compaction=True, view_caching=True, authentication=False, authorization=False, rate_limiting=True, distributed_mode=False, gpu_acceleration=False)[ソース]¶
ベースクラス:
object
Feature flags for enabling/disabling functionality.
These can be controlled via the GUNN_FEATURES environment variable as a comma-separated list (e.g., "latency,backpressure,telemetry").
- パラメータ:
latency_simulation (bool)
backpressure_management (bool)
staleness_detection (bool)
cancellation_tokens (bool)
telemetry (bool)
metrics_export (bool)
structured_logging (bool)
pii_redaction (bool)
memory_management (bool)
log_compaction (bool)
view_caching (bool)
authentication (bool)
authorization (bool)
rate_limiting (bool)
distributed_mode (bool)
gpu_acceleration (bool)
- class gunn.config.HealthCheckConfig(**data)[ソース]¶
ベースクラス:
BaseModel
Configuration for health checks.
- パラメータ:
enabled (bool)
endpoint (str)
readiness_endpoint (str)
liveness_endpoint (str)
timeout_seconds (float)
check_interval_seconds (float)
check_database (bool)
check_event_log (bool)
check_orchestrator (bool)
check_memory_usage (bool)
max_memory_usage_percent (float)
max_response_time_ms (float)
max_queue_depth (int)
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- gunn.config.get_environment()[ソース]¶
Detect current environment from various sources.
Environment is detected in the following order: 1. GUNN_ENVIRONMENT environment variable 2. NODE_ENV environment variable (for compatibility) 3. Presence of specific files (.env.production, etc.) 4. Default to development
- 戻り値の型:
- Returns:
Detected environment
- gunn.config.load_config(config_path=None)[ソース]¶
Load configuration from file and environment variables.
Configuration is loaded in the following order (later sources override earlier): 1. Default values 2. Configuration file (if provided) 3. Environment variables
- Args:
config_path: Optional path to configuration file
- Returns:
Merged configuration
- gunn.config.load_config_from_env()[ソース]¶
Load configuration from environment variables.
Environment variables are mapped as follows: - GUNN_ENVIRONMENT: Environment name (development/staging/production) - GUNN_DEBUG: Enable debug mode (true/false) - GUNN_FEATURES: Comma-separated list of enabled features - GUNN_LOG_LEVEL: Logging level - GUNN_LOG_FORMAT: Logging format (json/text) - GUNN_METRICS_PORT: Metrics server port - GUNN_DATABASE_URL: Database connection URL - GUNN_MAX_AGENTS: Maximum number of agents - GUNN_STALENESS_THRESHOLD: Staleness detection threshold - GUNN_BACKPRESSURE_POLICY: Backpressure policy (defer/shed/drop)
- 戻り値の型:
- Returns:
Configuration loaded from environment variables