"""
{{ name }} Tool - Version {{ version }}

Implement your tool logic here.
"""

from __future__ import annotations

from iq_sdk.tool import BaseTool

from .properties import properties


# ============================================================================
# TOOL IMPLEMENTATION
# ============================================================================

class {{ class_name }}(BaseTool):
    """
    {{ name }} Tool

    Add a description of what this tool does.
    """

    # Property registry - models are generated dynamically
    properties = properties

    async def process(self) -> None:
        """
        Process the tool call.

        Each call gets its own instance - access data via self:
        - self.general: General/config data for this call
        - self.input: Task-specific input data
        - self.output: Pre-filled output (modify directly)
        - self.api_input: External API request data (if defined)
        - self.api_output: External API response data (if defined)
        - self.event_receiver: Event data (if defined)
        - self.metadata: Additional call metadata

        The output is pre-filled with defaults. Just modify
        the values that differ from defaults.
        """
        # ===== IMPLEMENT YOUR LOGIC HERE =====

        # Access general properties (per-call config):
        # queue = self.general.queue
        # priority = self.general.priority

        # Access input properties (task data):
        # data = self.input.data
        # options = self.input.options

        # Example processing:
        # result = await self._do_work(self.input.data)

        # Modify the pre-filled output (only change what's needed):
        # self.output.result = "processed"
        # self.output.status = "completed"
        pass

    # -------------------------------------------------------------------------
    # Optional: Class-level setup/teardown (shared across all calls)
    # -------------------------------------------------------------------------

    # @classmethod
    # async def setup(cls) -> None:
    #     """
    #     Initialize shared resources when tool is registered.
    #
    #     Use for: connection pools, API clients, model loading, cache init
    #     These resources are shared across all calls.
    #     """
    #     # cls._pool = await create_connection_pool()
    #     pass

    # @classmethod
    # async def teardown(cls) -> None:
    #     """
    #     Cleanup shared resources when worker shuts down.
    #     """
    #     # await cls._pool.close()
    #     pass
