"""Async Python SDK for AcruxCore.

Runtime prompt render, gateway chat (with streaming), client-side tool loops,
trace reporting, and feedback — full parity with the TypeScript SDK.

Example::

    import asyncio
    from acruxcore import AcruxCore

    async def main():
        async with AcruxCore(api_key=..., base_url="http://localhost:3001/api/v1") as hub:
            result = await hub.prompts.render("greeting", "production", {"name": "Alice"})
            print(result.messages)

    asyncio.run(main())
"""

from . import tooling as acrux  # noqa: F401 — enables the `@acrux.tool` spelling
from .client import AcruxCore
from .gateway_api import AsyncChatStream, GatewayNamespace
from .errors import (
    API_ERROR,
    MISSING_API_KEY,
    MISSING_BASE_URL,
    MISSING_DISPATCH,
    MISSING_VARIABLES,
    NETWORK_ERROR,
    PROVIDER_ERROR,
    TOOL_SCHEMA_ERROR,
    AcruxCoreError,
    ToolSchemaError,
)
from .eval_types import (
    BuildFromFeedbackResult,
    CandidateDetail,
    DatasetDto,
    DatasetExampleDto,
    DatasetWithExamples,
    ExperimentDto,
    PromoteResult,
    RunCellDetailDto,
    RunDetailDto,
    RunListResponse,
    RunReport,
    StartOptimizeResult,
    StartRunResult,
)
from .evaluations import (
    DatasetsNamespace,
    ExperimentsNamespace,
    OptimizeNamespace,
    RunsNamespace,
)
from .prompts_api import PromptsNamespace
from .response_format import pydantic_response_format
from .tooling import ToolSpec, spec_of, tool
from .types import (
    AliasDetail,
    AnalyticsBucket,
    AnalyticsResult,
    AnalyticsTotals,
    ChatChunk,
    ChatResult,
    ChatUsage,
    DiffResult,
    ExportedPromptDetail,
    ExportedPromptVersion,
    ExportedVersionDetail,
    FacetValuesResult,
    FeedbackBucket,
    FeedbackListResult,
    FeedbackResult,
    FeedbackSummaryResult,
    GatewayCallMeta,
    GetTraceResult,
    ImportPromptResult,
    ImportPromptResultPrompt,
    ImportPromptResultVersion,
    IngestSpan,
    LatencyPercentiles,
    ListTracesResult,
    Message,
    PromptDetail,
    PromptListItem,
    PromptListResult,
    ProviderConfig,
    RenderResult,
    ResolvedTool,
    ResponseFormat,
    RunToolLoopResult,
    SessionDetailResult,
    SessionListResult,
    SessionSummary,
    SessionTraceItem,
    ToolAliasDetail,
    ToolAnalyticsResult,
    ToolCall,
    ToolChoice,
    ToolDefinition,
    ToolDetail,
    ToolExecuteResult,
    ToolListResult,
    ToolRef,
    ToolStat,
    ToolSyncResult,
    ToolVersionDetail,
    ToolVersionListItem,
    ToolVersionListResult,
    TraceFacets,
    TraceFeedbackResult,
    TraceInput,
    TraceResult,
    TraceSettings,
    TraceSpan,
    TraceSummary,
    VersionDetail,
    VersionListItem,
    VersionListResult,
)

__version__ = "0.7.1"

__all__ = [
    "AcruxCore",
    "AsyncChatStream",
    "GatewayNamespace",
    "AcruxCoreError",
    "acrux",
    "tool",
    "ToolSpec",
    "spec_of",
    "pydantic_response_format",
    "ToolSchemaError",
    "TOOL_SCHEMA_ERROR",
    "MISSING_DISPATCH",
    "API_ERROR",
    "MISSING_API_KEY",
    "MISSING_BASE_URL",
    "MISSING_VARIABLES",
    "NETWORK_ERROR",
    "PROVIDER_ERROR",
    "AnalyticsBucket",
    "AnalyticsResult",
    "AnalyticsTotals",
    "ChatChunk",
    "ChatResult",
    "ChatUsage",
    "FacetValuesResult",
    "FeedbackBucket",
    "FeedbackListResult",
    "FeedbackResult",
    "FeedbackSummaryResult",
    "GatewayCallMeta",
    "GetTraceResult",
    "IngestSpan",
    "LatencyPercentiles",
    "ListTracesResult",
    "Message",
    "ProviderConfig",
    "RenderResult",
    "ResolvedTool",
    "ResponseFormat",
    "RunToolLoopResult",
    "SessionDetailResult",
    "SessionListResult",
    "SessionSummary",
    "SessionTraceItem",
    "ToolAliasDetail",
    "ToolAnalyticsResult",
    "ToolCall",
    "ToolChoice",
    "ToolDefinition",
    "ToolDetail",
    "ToolExecuteResult",
    "ToolListResult",
    "ToolRef",
    "ToolStat",
    "ToolSyncResult",
    "ToolVersionDetail",
    "ToolVersionListItem",
    "ToolVersionListResult",
    "TraceFacets",
    "TraceFeedbackResult",
    "TraceInput",
    "TraceResult",
    "TraceSettings",
    "TraceSpan",
    "TraceSummary",
    "BuildFromFeedbackResult",
    "CandidateDetail",
    "DatasetDto",
    "DatasetExampleDto",
    "DatasetWithExamples",
    "ExperimentDto",
    "PromoteResult",
    "RunCellDetailDto",
    "RunDetailDto",
    "RunListResponse",
    "RunReport",
    "StartOptimizeResult",
    "StartRunResult",
    "DatasetsNamespace",
    "ExperimentsNamespace",
    "OptimizeNamespace",
    "RunsNamespace",
    "PromptsNamespace",
    "PromptDetail",
    "PromptListItem",
    "PromptListResult",
    "VersionDetail",
    "VersionListItem",
    "VersionListResult",
    "AliasDetail",
    "DiffResult",
    "ExportedPromptVersion",
    "ExportedPromptDetail",
    "ExportedVersionDetail",
    "ImportPromptResult",
    "ImportPromptResultPrompt",
    "ImportPromptResultVersion",
    "__version__",
]
