"""netanel-core: Self-learning LLM call library.

Public API exports — 12 classes for end users.
Internal types (Context, EvalResult, ToolCallRecord, etc.) are accessible
via their modules for advanced users.
"""

import os
import warnings

# BUG-068: LangSmith rate-limit errors flood stderr when the free-tier quota is
# exceeded.  Disable tracing by default so users who haven't configured LangSmith
# are not affected.  Users who want tracing can set these env vars before importing
# netanel_core and the setdefault calls will leave their values untouched.
os.environ.setdefault("LANGCHAIN_TRACING_V2", "false")
os.environ.setdefault("LANGSMITH_TRACING", "false")

# BUG-005: suppress Pydantic serialization UserWarnings emitted by LangChain's
# with_structured_output(). These occur because the `parsed` field is typed as
# None in the schema but contains EvalResponse/LearningExtraction at runtime.
# This is a LangChain internal issue — safe to suppress at library level.
warnings.filterwarnings(
    "ignore",
    message=r"Expected `none`",
    category=UserWarning,
)

__version__ = "0.1.0"

from .config import NathanConfig
from .deep_agent import DeepAgent, SpawnResult
from .hooks import HookManager
from .learning_llm import CallResult, LearningLLM
from .memory_store import Memory, MemoryStore
from .prompt_evolver import EvolutionResult, PromptEvolver
from .tool_selector import ScoredTool, ToolSelector

__all__ = [
    "CallResult",
    "DeepAgent",
    "EvolutionResult",
    "HookManager",
    "LearningLLM",
    "Memory",
    "MemoryStore",
    "NathanConfig",
    "PromptEvolver",
    "ScoredTool",
    "SpawnResult",
    "ToolSelector",
]
