Files
ai-tax-agent/libs/config/settings.py
harkon fdba81809f
Some checks failed
CI/CD Pipeline / Generate SBOM (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Code Quality & Linting (push) Has been cancelled
CI/CD Pipeline / Policy Validation (push) Has been cancelled
CI/CD Pipeline / Test Suite (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-coverage) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-extract) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-firm-connectors) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-forms) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-hmrc) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-ingestion) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-kg) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-normalize-map) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-ocr) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-rag-indexer) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-rag-retriever) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-reason) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-rpa) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (ui-review) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-coverage) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-extract) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-kg) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-rag-retriever) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (ui-review) (push) Has been cancelled
CI/CD Pipeline / Notifications (push) Has been cancelled
completed local setup with compose
2025-11-26 13:17:17 +00:00

114 lines
4.1 KiB
Python

"""Base settings class for all services."""
from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict
class BaseAppSettings(BaseSettings):
"""Base settings class for all services"""
model_config = SettingsConfigDict(
env_file=".env", env_file_encoding="utf-8", case_sensitive=False, extra="ignore"
)
# Service identification
service_name: str = Field(default="default-service", description="Service name")
service_version: str = Field(default="1.0.0", description="Service version")
# Network and security
host: str = Field(default="0.0.0.0", description="Service host")
port: int = Field(default=8000, description="Service port")
internal_cidrs: list[str] = Field(
default=["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"],
description="Internal network CIDRs",
)
# Development settings
dev_mode: bool = Field(
default=False,
description="Enable development mode (disables auth)",
validation_alias="DEV_MODE",
)
disable_auth: bool = Field(
default=False,
description="Disable authentication middleware",
validation_alias="DISABLE_AUTH",
)
# Vault configuration
vault_addr: str = Field(
default="http://vault:8200", description="Vault server address"
)
vault_role_id: str | None = Field(default=None, description="Vault AppRole role ID")
vault_secret_id: str | None = Field(
default=None, description="Vault AppRole secret ID"
)
vault_token: str | None = Field(default=None, description="Vault token (dev only)")
vault_mount_point: str = Field(
default="transit", description="Vault transit mount point"
)
# Database URLs
postgres_url: str = Field(
default="postgresql://user:pass@postgres:5432/taxagent",
description="PostgreSQL connection URL",
)
neo4j_uri: str = Field(
default="bolt://neo4j:7687", description="Neo4j connection URI"
)
neo4j_user: str = Field(default="neo4j", description="Neo4j username")
neo4j_password: str = Field(default="password", description="Neo4j password")
redis_url: str = Field(
default="redis://redis:6379", description="Redis connection URL"
)
# Object storage
minio_endpoint: str = Field(default="minio:9000", description="MinIO endpoint")
minio_access_key: str = Field(default="minioadmin", description="MinIO access key")
minio_secret_key: str = Field(default="minioadmin", description="MinIO secret key")
minio_secure: bool = Field(default=False, description="Use HTTPS for MinIO")
# Vector database
qdrant_url: str = Field(
default="http://qdrant:6333", description="Qdrant server URL"
)
qdrant_api_key: str | None = Field(default=None, description="Qdrant API key")
# Event bus configuration
event_bus_type: str = Field(
default="nats", description="Event bus type: nats, kafka, sqs, or memory"
)
# NATS configuration
nats_servers: str = Field(
default="nats://localhost:4222",
description="NATS server URLs (comma-separated)",
)
nats_stream_name: str = Field(
default="TAX_AGENT_EVENTS", description="NATS JetStream stream name"
)
nats_consumer_group: str = Field(
default="tax-agent", description="NATS consumer group name"
)
# Kafka configuration (legacy)
kafka_bootstrap_servers: str = Field(
default="localhost:9092", description="Kafka bootstrap servers"
)
# AWS configuration
aws_region: str = Field(default="us-east-1", description="AWS region for SQS/SNS")
# Observability
otel_service_name: str | None = Field(
default=None, description="OpenTelemetry service name"
)
otel_exporter_endpoint: str | None = Field(
default=None, description="OTEL exporter endpoint"
)
log_level: str = Field(default="INFO", description="Log level")
# Performance
max_workers: int = Field(default=4, description="Maximum worker threads")
request_timeout: int = Field(default=30, description="Request timeout in seconds")