dataflow.config.settingsΒΆ
Application settings configuration for the Haive framework.
This module defines Pydantic models for application settings, providing a type-safe and validated configuration system. Settings are automatically loaded from environment variables with sensible defaults.
The settings hierarchy includes: - AppSettings: Top-level application settings - APISettings: API-specific settings - AgentSettings: Agent-specific settings
Settings can be accessed using the get_settings() function, which returns a singleton instance of the AppSettings class.
Typical usage example:
from haive.dataflow.config.settings import get_settings
settings = get_settings()
# Access settings properties api_prefix = settings.api.prefix is_production = settings.is_production agent_timeout = settings.agent.default_timeout
# Use in application logic if settings.is_development:
print(fβRunning in development mode with debug={settings.api.debug}β)
ClassesΒΆ
API-specific settings for the Haive framework. |
|
Agent-specific settings for the Haive framework. |
|
Application-wide settings for the Haive framework. |
FunctionsΒΆ
Get application settings. |
Module ContentsΒΆ
- class dataflow.config.settings.APISettings(/, **data)ΒΆ
Bases:
pydantic.BaseModel
API-specific settings for the Haive framework.
This model defines settings specific to the API server, including debug mode, CORS configuration, rate limits, and other HTTP-related settings. Values are loaded from environment variables with sensible defaults.
- Parameters:
data (Any)
- debugΒΆ
Whether the API is running in debug mode
- titleΒΆ
The title of the API for OpenAPI documentation
- prefixΒΆ
URL prefix for all API endpoints
- cors_originsΒΆ
List of allowed origins for CORS
- rate_limitΒΆ
Maximum requests per minute per client
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- class dataflow.config.settings.AgentSettings(/, **data)ΒΆ
Bases:
pydantic.BaseModel
Agent-specific settings for the Haive framework.
This model defines settings specific to agent execution, including timeouts, streaming configuration, and usage costs. Values are loaded from environment variables with sensible defaults.
- Parameters:
data (Any)
- default_timeoutΒΆ
Default timeout in seconds for agent execution
- streaming_enabledΒΆ
Whether streaming responses are enabled
- credit_cost_per_1k_tokensΒΆ
Cost in credits per 1000 tokens processed
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- class dataflow.config.settings.AppSettings(/, **data)ΒΆ
Bases:
pydantic.BaseModel
Application-wide settings for the Haive framework.
This is the top-level settings model that includes all other setting categories as nested models. It provides properties for determining the current environment and accessing environment-specific settings.
- Parameters:
data (Any)
- environmentΒΆ
The current environment (development, staging, production)
- apiΒΆ
API-specific settings
- agentΒΆ
Agent-specific settings
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- dataflow.config.settings.get_settings()ΒΆ
Get application settings.
- Return type: