"""Auto-generated by adk-fluent generator. Manual edits will be overwritten."""

from __future__ import annotations
from collections import defaultdict
from typing import Any, Callable, Self
from adk_fluent._base import BuilderBase
from google.adk.agents.agent_config import AgentConfig as _ADK_AgentConfig
from google.adk.agents.base_agent_config import BaseAgentConfig as _ADK_BaseAgentConfig
from google.adk.agents.common_configs import AgentRefConfig as _ADK_AgentRefConfig
from google.adk.agents.common_configs import ArgumentConfig as _ADK_ArgumentConfig
from google.adk.agents.common_configs import CodeConfig as _ADK_CodeConfig
from google.adk.agents.context_cache_config import ContextCacheConfig as _ADK_ContextCacheConfig
from google.adk.agents.llm_agent_config import LlmAgentConfig as _ADK_LlmAgentConfig
from google.adk.agents.loop_agent_config import LoopAgentConfig as _ADK_LoopAgentConfig
from google.adk.agents.parallel_agent_config import ParallelAgentConfig as _ADK_ParallelAgentConfig
from google.adk.agents.run_config import RunConfig as _ADK_RunConfig
from google.adk.agents.run_config import ToolThreadPoolConfig as _ADK_ToolThreadPoolConfig
from google.adk.agents.sequential_agent_config import SequentialAgentConfig as _ADK_SequentialAgentConfig
from google.adk.apps.app import EventsCompactionConfig as _ADK_EventsCompactionConfig
from google.adk.apps.app import ResumabilityConfig as _ADK_ResumabilityConfig
from google.adk.features._feature_registry import FeatureConfig as _ADK_FeatureConfig
from google.adk.flows.llm_flows.audio_cache_manager import AudioCacheConfig as _ADK_AudioCacheConfig
from google.adk.optimization.simple_prompt_optimizer import SimplePromptOptimizerConfig as _ADK_SimplePromptOptimizerConfig
from google.adk.plugins.bigquery_agent_analytics_plugin import BigQueryLoggerConfig as _ADK_BigQueryLoggerConfig
from google.adk.plugins.bigquery_agent_analytics_plugin import RetryConfig as _ADK_RetryConfig
from google.adk.sessions.base_session_service import GetSessionConfig as _ADK_GetSessionConfig
from google.adk.tools._google_credentials import BaseGoogleCredentialsConfig as _ADK_BaseGoogleCredentialsConfig
from google.adk.tools.agent_simulator.agent_simulator_config import AgentSimulatorConfig as _ADK_AgentSimulatorConfig
from google.adk.tools.agent_simulator.agent_simulator_config import InjectionConfig as _ADK_InjectionConfig
from google.adk.tools.agent_simulator.agent_simulator_config import ToolSimulationConfig as _ADK_ToolSimulationConfig
from google.adk.tools.agent_tool import AgentToolConfig as _ADK_AgentToolConfig
from google.adk.tools.bigquery.bigquery_credentials import BigQueryCredentialsConfig as _ADK_BigQueryCredentialsConfig
from google.adk.tools.bigquery.config import BigQueryToolConfig as _ADK_BigQueryToolConfig
from google.adk.tools.bigtable.bigtable_credentials import BigtableCredentialsConfig as _ADK_BigtableCredentialsConfig
from google.adk.tools.data_agent.config import DataAgentToolConfig as _ADK_DataAgentToolConfig
from google.adk.tools.data_agent.credentials import DataAgentCredentialsConfig as _ADK_DataAgentCredentialsConfig
from google.adk.tools.example_tool import ExampleToolConfig as _ADK_ExampleToolConfig
from google.adk.tools.mcp_tool.mcp_toolset import McpToolsetConfig as _ADK_McpToolsetConfig
from google.adk.tools.pubsub.config import PubSubToolConfig as _ADK_PubSubToolConfig
from google.adk.tools.pubsub.pubsub_credentials import PubSubCredentialsConfig as _ADK_PubSubCredentialsConfig
from google.adk.tools.spanner.spanner_credentials import SpannerCredentialsConfig as _ADK_SpannerCredentialsConfig
from google.adk.tools.tool_configs import BaseToolConfig as _ADK_BaseToolConfig
from google.adk.tools.tool_configs import ToolArgsConfig as _ADK_ToolArgsConfig
from google.adk.tools.tool_configs import ToolConfig as _ADK_ToolConfig

# ======================================================================
# Builder: AgentConfig
# ======================================================================

class AgentConfig(BuilderBase):
    """The config for the YAML schema to create an agent."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, root: str) -> None:
        self._config: dict[str, Any] = {"root": root}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_AgentConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_AgentConfig.model_fields:
            available = sorted(
                set(_ADK_AgentConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_AgentConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_AgentConfig:
        """The config for the YAML schema to create an agent. Resolve into a native ADK _ADK_AgentConfig."""
        config = self._prepare_build_config()
        return _ADK_AgentConfig(**config)


# ======================================================================
# Builder: BaseAgentConfig
# ======================================================================

class BaseAgentConfig(BuilderBase):
    """The config for the YAML schema of a BaseAgent."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {'describe': 'description'}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, name: str) -> None:
        self._config: dict[str, Any] = {"name": name}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    def describe(self, value: str) -> Self:
        """Optional. The description of the agent."""
        self._config["description"] = value
        return self

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def agent_class(self, value: Union[Literal[BaseAgent], str]) -> Self:
        """Required. The class of the agent. The value is used to differentiate among different agent classes."""
        self._config["agent_class"] = value
        return self


    def sub_agents(self, value: Union[list[AgentRefConfig], NoneType]) -> Self:
        """Optional. The sub-agents of the agent."""
        self._config["sub_agents"] = value
        return self


    def before_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The before_agent_callbacks of the agent.

Example:

  ```
  before_agent_callbacks:
    - name: my_library.security_callbacks.before_agent_callback
  ```"""
        self._config["before_agent_callbacks"] = value
        return self


    def after_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The after_agent_callbacks of the agent."""
        self._config["after_agent_callbacks"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_BaseAgentConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_BaseAgentConfig.model_fields:
            available = sorted(
                set(_ADK_BaseAgentConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_BaseAgentConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_BaseAgentConfig:
        """The config for the YAML schema of a BaseAgent. Resolve into a native ADK _ADK_BaseAgentConfig."""
        config = self._prepare_build_config()
        return _ADK_BaseAgentConfig(**config)


# ======================================================================
# Builder: AgentRefConfig
# ======================================================================

class AgentRefConfig(BuilderBase):
    """The config for the reference to another agent."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def config_path(self, value: Union[str, NoneType]) -> Self:
        """Set the ``config_path`` field."""
        self._config["config_path"] = value
        return self


    def code(self, value: Union[str, NoneType]) -> Self:
        """Set the ``code`` field."""
        self._config["code"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_AgentRefConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_AgentRefConfig.model_fields:
            available = sorted(
                set(_ADK_AgentRefConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_AgentRefConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_AgentRefConfig:
        """The config for the reference to another agent. Resolve into a native ADK _ADK_AgentRefConfig."""
        config = self._prepare_build_config()
        return _ADK_AgentRefConfig(**config)


# ======================================================================
# Builder: ArgumentConfig
# ======================================================================

class ArgumentConfig(BuilderBase):
    """An argument passed to a function or a class's constructor."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, value: str) -> None:
        self._config: dict[str, Any] = {"value": value}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def name(self, value: Union[str, NoneType]) -> Self:
        """Set the ``name`` field."""
        self._config["name"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_ArgumentConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_ArgumentConfig.model_fields:
            available = sorted(
                set(_ADK_ArgumentConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_ArgumentConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_ArgumentConfig:
        """An argument passed to a function or a class's constructor. Resolve into a native ADK _ADK_ArgumentConfig."""
        config = self._prepare_build_config()
        return _ADK_ArgumentConfig(**config)


# ======================================================================
# Builder: CodeConfig
# ======================================================================

class CodeConfig(BuilderBase):
    """Code reference config for a variable, a function, or a class."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, name: str) -> None:
        self._config: dict[str, Any] = {"name": name}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def args(self, value: Union[list[ArgumentConfig], NoneType]) -> Self:
        """Set the ``args`` field."""
        self._config["args"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_CodeConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_CodeConfig.model_fields:
            available = sorted(
                set(_ADK_CodeConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_CodeConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_CodeConfig:
        """Code reference config for a variable, a function, or a class. Resolve into a native ADK _ADK_CodeConfig."""
        config = self._prepare_build_config()
        return _ADK_CodeConfig(**config)


# ======================================================================
# Builder: ContextCacheConfig
# ======================================================================

class ContextCacheConfig(BuilderBase):
    """Configuration for context caching across all agents in an app."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def cache_intervals(self, value: int) -> Self:
        """Maximum number of invocations to reuse the same cache before refreshing it"""
        self._config["cache_intervals"] = value
        return self


    def ttl_seconds(self, value: int) -> Self:
        """Time-to-live for cache in seconds"""
        self._config["ttl_seconds"] = value
        return self


    def min_tokens(self, value: int) -> Self:
        """Minimum estimated request tokens required to enable caching. This compares against the estimated total tokens of the request (system instruction + tools + contents). Context cache storage may have cost. Set higher to avoid caching small requests where overhead may exceed benefits."""
        self._config["min_tokens"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_ContextCacheConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_ContextCacheConfig.model_fields:
            available = sorted(
                set(_ADK_ContextCacheConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_ContextCacheConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_ContextCacheConfig:
        """Configuration for context caching across all agents in an app. Resolve into a native ADK _ADK_ContextCacheConfig."""
        config = self._prepare_build_config()
        return _ADK_ContextCacheConfig(**config)


# ======================================================================
# Builder: LlmAgentConfig
# ======================================================================

class LlmAgentConfig(BuilderBase):
    """The config for the YAML schema of a LlmAgent."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {'describe': 'description', 'history': 'include_contents', 'instruct': 'instruction', 'outputs': 'output_key', 'static': 'static_instruction'}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, name: str, instruction: str) -> None:
        self._config: dict[str, Any] = {"name": name, "instruction": instruction}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    def describe(self, value: str) -> Self:
        """Optional. The description of the agent."""
        self._config["description"] = value
        return self


    def history(self, value: Literal[default, none]) -> Self:
        """Optional. LlmAgent.include_contents."""
        self._config["include_contents"] = value
        return self


    def instruct(self, value: str) -> Self:
        """Required. LlmAgent.instruction. Dynamic instructions with placeholder support. Behavior: if static_instruction is None, goes to system_instruction; if static_instruction is set, goes to user content after static content."""
        self._config["instruction"] = value
        return self


    def outputs(self, value: Union[str, NoneType]) -> Self:
        """Optional. LlmAgent.output_key."""
        self._config["output_key"] = value
        return self


    def static(self, value: Union[Content, str, File, Part, list[Union[str, File, Part]], NoneType]) -> Self:
        """Optional. LlmAgent.static_instruction. Static content sent literally at position 0 without placeholder processing. When set, changes instruction behavior to go to user content instead of system_instruction. Supports context caching. Accepts types.ContentUnion (str, types.Content, types.Part, PIL.Image.Image, types.File, or list[PartUnion])."""
        self._config["static_instruction"] = value
        return self

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def agent_class(self, value: str) -> Self:
        """The value is used to uniquely identify the LlmAgent class. If it is empty, it is by default an LlmAgent."""
        self._config["agent_class"] = value
        return self


    def sub_agents(self, value: Union[list[AgentRefConfig], NoneType]) -> Self:
        """Optional. The sub-agents of the agent."""
        self._config["sub_agents"] = value
        return self


    def before_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The before_agent_callbacks of the agent.

Example:

  ```
  before_agent_callbacks:
    - name: my_library.security_callbacks.before_agent_callback
  ```"""
        self._config["before_agent_callbacks"] = value
        return self


    def after_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The after_agent_callbacks of the agent."""
        self._config["after_agent_callbacks"] = value
        return self


    def model(self, value: Union[str, NoneType]) -> Self:
        """Optional. LlmAgent.model. Provide a model name string (e.g. "gemini-2.0-flash"). If not set, the model will be inherited from the ancestor or fall back to the system default (gemini-2.5-flash unless overridden via LlmAgent.set_default_model). To construct a model instance from code, use model_code."""
        self._config["model"] = value
        return self


    def model_code(self, value: Union[CodeConfig, NoneType]) -> Self:
        """Optional. A CodeConfig that instantiates a BaseLlm implementation such as LiteLlm with custom arguments (API base, fallbacks, etc.). Cannot be set together with `model`."""
        self._config["model_code"] = value
        return self


    def disallow_transfer_to_parent(self, value: Union[bool, NoneType]) -> Self:
        """Optional. LlmAgent.disallow_transfer_to_parent."""
        self._config["disallow_transfer_to_parent"] = value
        return self


    def disallow_transfer_to_peers(self, value: Union[bool, NoneType]) -> Self:
        """Optional. LlmAgent.disallow_transfer_to_peers."""
        self._config["disallow_transfer_to_peers"] = value
        return self


    def input_schema(self, value: Union[CodeConfig, NoneType]) -> Self:
        """Optional. LlmAgent.input_schema."""
        self._config["input_schema"] = value
        return self


    def output_schema(self, value: Union[CodeConfig, NoneType]) -> Self:
        """Optional. LlmAgent.output_schema."""
        self._config["output_schema"] = value
        return self


    def tools(self, value: Union[list[ToolConfig], NoneType]) -> Self:
        """Optional. LlmAgent.tools.

Examples:

  For ADK built-in tools in `google.adk.tools` package, they can be referenced
  directly with the name:

    ```
    tools:
      - name: google_search
      - name: load_memory
    ```

  For user-defined tools, they can be referenced with fully qualified name:

    ```
    tools:
      - name: my_library.my_tools.my_tool
    ```

  For tools that needs to be created via functions:

    ```
    tools:
      - name: my_library.my_tools.create_tool
        args:
          - name: param1
            value: value1
          - name: param2
            value: value2
    ```

  For more advanced tools, instead of specifying arguments in config, it's
  recommended to define them in Python files and reference them. E.g.,

    ```
    # tools.py
    my_mcp_toolset = McpToolset(
        connection_params=StdioServerParameters(
            command="npx",
            args=["-y", "@notionhq/notion-mcp-server"],
            env={"OPENAPI_MCP_HEADERS": NOTION_HEADERS},
        )
    )
    ```

  Then, reference the toolset in config:

  ```
  tools:
    - name: tools.my_mcp_toolset
  ```"""
        self._config["tools"] = value
        return self


    def before_model_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. LlmAgent.before_model_callbacks.

Example:

  ```
  before_model_callbacks:
    - name: my_library.callbacks.before_model_callback
  ```"""
        self._config["before_model_callbacks"] = value
        return self


    def after_model_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. LlmAgent.after_model_callbacks."""
        self._config["after_model_callbacks"] = value
        return self


    def before_tool_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. LlmAgent.before_tool_callbacks."""
        self._config["before_tool_callbacks"] = value
        return self


    def after_tool_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. LlmAgent.after_tool_callbacks."""
        self._config["after_tool_callbacks"] = value
        return self


    def generate_content_config(self, value: Union[GenerateContentConfig, NoneType]) -> Self:
        """Optional. LlmAgent.generate_content_config."""
        self._config["generate_content_config"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_LlmAgentConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_LlmAgentConfig.model_fields:
            available = sorted(
                set(_ADK_LlmAgentConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_LlmAgentConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_LlmAgentConfig:
        """The config for the YAML schema of a LlmAgent. Resolve into a native ADK _ADK_LlmAgentConfig."""
        config = self._prepare_build_config()
        return _ADK_LlmAgentConfig(**config)


# ======================================================================
# Builder: LoopAgentConfig
# ======================================================================

class LoopAgentConfig(BuilderBase):
    """The config for the YAML schema of a LoopAgent."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {'describe': 'description'}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, name: str) -> None:
        self._config: dict[str, Any] = {"name": name}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    def describe(self, value: str) -> Self:
        """Optional. The description of the agent."""
        self._config["description"] = value
        return self

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def agent_class(self, value: str) -> Self:
        """The value is used to uniquely identify the LoopAgent class."""
        self._config["agent_class"] = value
        return self


    def sub_agents(self, value: Union[list[AgentRefConfig], NoneType]) -> Self:
        """Optional. The sub-agents of the agent."""
        self._config["sub_agents"] = value
        return self


    def before_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The before_agent_callbacks of the agent.

Example:

  ```
  before_agent_callbacks:
    - name: my_library.security_callbacks.before_agent_callback
  ```"""
        self._config["before_agent_callbacks"] = value
        return self


    def after_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The after_agent_callbacks of the agent."""
        self._config["after_agent_callbacks"] = value
        return self


    def max_iterations(self, value: Union[int, NoneType]) -> Self:
        """Optional. LoopAgent.max_iterations."""
        self._config["max_iterations"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_LoopAgentConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_LoopAgentConfig.model_fields:
            available = sorted(
                set(_ADK_LoopAgentConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_LoopAgentConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_LoopAgentConfig:
        """The config for the YAML schema of a LoopAgent. Resolve into a native ADK _ADK_LoopAgentConfig."""
        config = self._prepare_build_config()
        return _ADK_LoopAgentConfig(**config)


# ======================================================================
# Builder: ParallelAgentConfig
# ======================================================================

class ParallelAgentConfig(BuilderBase):
    """The config for the YAML schema of a ParallelAgent."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {'describe': 'description'}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, name: str) -> None:
        self._config: dict[str, Any] = {"name": name}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    def describe(self, value: str) -> Self:
        """Optional. The description of the agent."""
        self._config["description"] = value
        return self

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def agent_class(self, value: str) -> Self:
        """The value is used to uniquely identify the ParallelAgent class."""
        self._config["agent_class"] = value
        return self


    def sub_agents(self, value: Union[list[AgentRefConfig], NoneType]) -> Self:
        """Optional. The sub-agents of the agent."""
        self._config["sub_agents"] = value
        return self


    def before_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The before_agent_callbacks of the agent.

Example:

  ```
  before_agent_callbacks:
    - name: my_library.security_callbacks.before_agent_callback
  ```"""
        self._config["before_agent_callbacks"] = value
        return self


    def after_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The after_agent_callbacks of the agent."""
        self._config["after_agent_callbacks"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_ParallelAgentConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_ParallelAgentConfig.model_fields:
            available = sorted(
                set(_ADK_ParallelAgentConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_ParallelAgentConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_ParallelAgentConfig:
        """The config for the YAML schema of a ParallelAgent. Resolve into a native ADK _ADK_ParallelAgentConfig."""
        config = self._prepare_build_config()
        return _ADK_ParallelAgentConfig(**config)


# ======================================================================
# Builder: RunConfig
# ======================================================================

class RunConfig(BuilderBase):
    """Configs for runtime behavior of agents."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def speech_config(self, value: Union[SpeechConfig, NoneType]) -> Self:
        """Set the ``speech_config`` field."""
        self._config["speech_config"] = value
        return self


    def response_modalities(self, value: Union[list[str], NoneType]) -> Self:
        """Set the ``response_modalities`` field."""
        self._config["response_modalities"] = value
        return self


    def save_input_blobs_as_artifacts(self, value: bool) -> Self:
        """Whether or not to save the input blobs as artifacts. DEPRECATED: Use SaveFilesAsArtifactsPlugin instead for better control and flexibility. See google.adk.plugins.SaveFilesAsArtifactsPlugin."""
        self._config["save_input_blobs_as_artifacts"] = value
        return self


    def support_cfc(self, value: bool) -> Self:
        """Set the ``support_cfc`` field."""
        self._config["support_cfc"] = value
        return self


    def streaming_mode(self, value: StreamingMode) -> Self:
        """Set the ``streaming_mode`` field."""
        self._config["streaming_mode"] = value
        return self


    def output_audio_transcription(self, value: Union[AudioTranscriptionConfig, NoneType]) -> Self:
        """Set the ``output_audio_transcription`` field."""
        self._config["output_audio_transcription"] = value
        return self


    def input_audio_transcription(self, value: Union[AudioTranscriptionConfig, NoneType]) -> Self:
        """Set the ``input_audio_transcription`` field."""
        self._config["input_audio_transcription"] = value
        return self


    def realtime_input_config(self, value: Union[RealtimeInputConfig, NoneType]) -> Self:
        """Set the ``realtime_input_config`` field."""
        self._config["realtime_input_config"] = value
        return self


    def enable_affective_dialog(self, value: Union[bool, NoneType]) -> Self:
        """Set the ``enable_affective_dialog`` field."""
        self._config["enable_affective_dialog"] = value
        return self


    def proactivity(self, value: Union[ProactivityConfig, NoneType]) -> Self:
        """Set the ``proactivity`` field."""
        self._config["proactivity"] = value
        return self


    def session_resumption(self, value: Union[SessionResumptionConfig, NoneType]) -> Self:
        """Set the ``session_resumption`` field."""
        self._config["session_resumption"] = value
        return self


    def context_window_compression(self, value: Union[ContextWindowCompressionConfig, NoneType]) -> Self:
        """Set the ``context_window_compression`` field."""
        self._config["context_window_compression"] = value
        return self


    def save_live_blob(self, value: bool) -> Self:
        """Set the ``save_live_blob`` field."""
        self._config["save_live_blob"] = value
        return self


    def tool_thread_pool_config(self, value: Union[ToolThreadPoolConfig, NoneType]) -> Self:
        """Set the ``tool_thread_pool_config`` field."""
        self._config["tool_thread_pool_config"] = value
        return self


    def save_live_audio(self, value: bool) -> Self:
        """DEPRECATED: Use save_live_blob instead. If set to True, it saves live video and audio data to session and artifact service."""
        self._config["save_live_audio"] = value
        return self


    def max_llm_calls(self, value: int) -> Self:
        """Set the ``max_llm_calls`` field."""
        self._config["max_llm_calls"] = value
        return self


    def custom_metadata(self, value: Union[dict[str, Any], NoneType]) -> Self:
        """Set the ``custom_metadata`` field."""
        self._config["custom_metadata"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_RunConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_RunConfig.model_fields:
            available = sorted(
                set(_ADK_RunConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_RunConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_RunConfig:
        """Configs for runtime behavior of agents. Resolve into a native ADK _ADK_RunConfig."""
        config = self._prepare_build_config()
        return _ADK_RunConfig(**config)


# ======================================================================
# Builder: ToolThreadPoolConfig
# ======================================================================

class ToolThreadPoolConfig(BuilderBase):
    """Configuration for the tool thread pool executor."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def max_workers(self, value: int) -> Self:
        """Maximum number of worker threads in the pool."""
        self._config["max_workers"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_ToolThreadPoolConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_ToolThreadPoolConfig.model_fields:
            available = sorted(
                set(_ADK_ToolThreadPoolConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_ToolThreadPoolConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_ToolThreadPoolConfig:
        """Configuration for the tool thread pool executor. Resolve into a native ADK _ADK_ToolThreadPoolConfig."""
        config = self._prepare_build_config()
        return _ADK_ToolThreadPoolConfig(**config)


# ======================================================================
# Builder: SequentialAgentConfig
# ======================================================================

class SequentialAgentConfig(BuilderBase):
    """The config for the YAML schema of a SequentialAgent."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {'describe': 'description'}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, name: str) -> None:
        self._config: dict[str, Any] = {"name": name}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    def describe(self, value: str) -> Self:
        """Optional. The description of the agent."""
        self._config["description"] = value
        return self

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def agent_class(self, value: str) -> Self:
        """The value is used to uniquely identify the SequentialAgent class."""
        self._config["agent_class"] = value
        return self


    def sub_agents(self, value: Union[list[AgentRefConfig], NoneType]) -> Self:
        """Optional. The sub-agents of the agent."""
        self._config["sub_agents"] = value
        return self


    def before_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The before_agent_callbacks of the agent.

Example:

  ```
  before_agent_callbacks:
    - name: my_library.security_callbacks.before_agent_callback
  ```"""
        self._config["before_agent_callbacks"] = value
        return self


    def after_agent_callbacks(self, value: Union[list[CodeConfig], NoneType]) -> Self:
        """Optional. The after_agent_callbacks of the agent."""
        self._config["after_agent_callbacks"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_SequentialAgentConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_SequentialAgentConfig.model_fields:
            available = sorted(
                set(_ADK_SequentialAgentConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_SequentialAgentConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_SequentialAgentConfig:
        """The config for the YAML schema of a SequentialAgent. Resolve into a native ADK _ADK_SequentialAgentConfig."""
        config = self._prepare_build_config()
        return _ADK_SequentialAgentConfig(**config)


# ======================================================================
# Builder: EventsCompactionConfig
# ======================================================================

class EventsCompactionConfig(BuilderBase):
    """The config of event compaction for an application."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, compaction_interval: str, overlap_size: str) -> None:
        self._config: dict[str, Any] = {"compaction_interval": compaction_interval, "overlap_size": overlap_size}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def summarizer(self, value: Union[BaseEventsSummarizer, NoneType]) -> Self:
        """Set the ``summarizer`` field."""
        self._config["summarizer"] = value
        return self


    def token_threshold(self, value: Union[int, NoneType]) -> Self:
        """Set the ``token_threshold`` field."""
        self._config["token_threshold"] = value
        return self


    def event_retention_size(self, value: Union[int, NoneType]) -> Self:
        """Set the ``event_retention_size`` field."""
        self._config["event_retention_size"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_EventsCompactionConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_EventsCompactionConfig.model_fields:
            available = sorted(
                set(_ADK_EventsCompactionConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_EventsCompactionConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_EventsCompactionConfig:
        """The config of event compaction for an application. Resolve into a native ADK _ADK_EventsCompactionConfig."""
        config = self._prepare_build_config()
        return _ADK_EventsCompactionConfig(**config)


# ======================================================================
# Builder: ResumabilityConfig
# ======================================================================

class ResumabilityConfig(BuilderBase):
    """The config of the resumability for an application."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def is_resumable(self, value: bool) -> Self:
        """Set the ``is_resumable`` field."""
        self._config["is_resumable"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_ResumabilityConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_ResumabilityConfig.model_fields:
            available = sorted(
                set(_ADK_ResumabilityConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_ResumabilityConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_ResumabilityConfig:
        """The config of the resumability for an application. Resolve into a native ADK _ADK_ResumabilityConfig."""
        config = self._prepare_build_config()
        return _ADK_ResumabilityConfig(**config)


# ======================================================================
# Builder: FeatureConfig
# ======================================================================

class FeatureConfig(BuilderBase):
    """Feature configuration."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] = {'default_on', 'stage'}


    def __init__(self, stage: str) -> None:
        self._config: dict[str, Any] = {"stage": stage}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def default_on(self, value: bool) -> Self:
        """Set the ``default_on`` field."""
        self._config["default_on"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_FeatureConfig init params for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS
        _KNOWN_PARAMS = self.__class__._KNOWN_PARAMS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against static _KNOWN_PARAMS set (non-Pydantic class)
        if field_name not in _KNOWN_PARAMS:
            available = sorted(
                _KNOWN_PARAMS
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized parameter on _ADK_FeatureConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_FeatureConfig:
        """Feature configuration. Resolve into a native ADK _ADK_FeatureConfig."""
        config = self._prepare_build_config()
        return _ADK_FeatureConfig(**config)


# ======================================================================
# Builder: AudioCacheConfig
# ======================================================================

class AudioCacheConfig(BuilderBase):
    """Configuration for audio caching behavior."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] = {'auto_flush_threshold', 'max_cache_size_bytes', 'max_cache_duration_seconds'}


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def max_cache_size_bytes(self, value: int) -> Self:
        """Set the ``max_cache_size_bytes`` field."""
        self._config["max_cache_size_bytes"] = value
        return self


    def max_cache_duration_seconds(self, value: float) -> Self:
        """Set the ``max_cache_duration_seconds`` field."""
        self._config["max_cache_duration_seconds"] = value
        return self


    def auto_flush_threshold(self, value: int) -> Self:
        """Set the ``auto_flush_threshold`` field."""
        self._config["auto_flush_threshold"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_AudioCacheConfig init params for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS
        _KNOWN_PARAMS = self.__class__._KNOWN_PARAMS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against static _KNOWN_PARAMS set (non-Pydantic class)
        if field_name not in _KNOWN_PARAMS:
            available = sorted(
                _KNOWN_PARAMS
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized parameter on _ADK_AudioCacheConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_AudioCacheConfig:
        """Configuration for audio caching behavior. Resolve into a native ADK _ADK_AudioCacheConfig."""
        config = self._prepare_build_config()
        return _ADK_AudioCacheConfig(**config)


# ======================================================================
# Builder: SimplePromptOptimizerConfig
# ======================================================================

class SimplePromptOptimizerConfig(BuilderBase):
    """Configuration for the IterativePromptOptimizer."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def optimizer_model(self, value: str) -> Self:
        """The model used to analyze the eval results and optimize the agent."""
        self._config["optimizer_model"] = value
        return self


    def model_configuration(self, value: GenerateContentConfig) -> Self:
        """The configuration for the optimizer model."""
        self._config["model_configuration"] = value
        return self


    def num_iterations(self, value: int) -> Self:
        """The number of optimization rounds to run."""
        self._config["num_iterations"] = value
        return self


    def batch_size(self, value: int) -> Self:
        """The number of training examples to use for scoring each candidate."""
        self._config["batch_size"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_SimplePromptOptimizerConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_SimplePromptOptimizerConfig.model_fields:
            available = sorted(
                set(_ADK_SimplePromptOptimizerConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_SimplePromptOptimizerConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_SimplePromptOptimizerConfig:
        """Configuration for the IterativePromptOptimizer. Resolve into a native ADK _ADK_SimplePromptOptimizerConfig."""
        config = self._prepare_build_config()
        return _ADK_SimplePromptOptimizerConfig(**config)


# ======================================================================
# Builder: BigQueryLoggerConfig
# ======================================================================

class BigQueryLoggerConfig(BuilderBase):
    """Configuration for the BigQueryAgentAnalyticsPlugin."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] = {'enabled', 'max_content_length', 'connection_id', 'table_id', 'retry_config', 'event_denylist', 'batch_size', 'batch_flush_interval', 'log_multi_modal_content', 'shutdown_timeout', 'clustering_fields', 'custom_tags', 'event_allowlist', 'log_session_metadata', 'gcs_bucket_name', 'content_formatter', 'queue_max_size'}


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def enabled(self, value: bool) -> Self:
        """Set the ``enabled`` field."""
        self._config["enabled"] = value
        return self


    def event_allowlist(self, value: list[str] | None) -> Self:
        """Set the ``event_allowlist`` field."""
        self._config["event_allowlist"] = value
        return self


    def event_denylist(self, value: list[str] | None) -> Self:
        """Set the ``event_denylist`` field."""
        self._config["event_denylist"] = value
        return self


    def max_content_length(self, value: int) -> Self:
        """Set the ``max_content_length`` field."""
        self._config["max_content_length"] = value
        return self


    def table_id(self, value: str) -> Self:
        """Set the ``table_id`` field."""
        self._config["table_id"] = value
        return self


    def clustering_fields(self, value: list[str]) -> Self:
        """Set the ``clustering_fields`` field."""
        self._config["clustering_fields"] = value
        return self


    def log_multi_modal_content(self, value: bool) -> Self:
        """Set the ``log_multi_modal_content`` field."""
        self._config["log_multi_modal_content"] = value
        return self


    def retry_config(self, value: RetryConfig) -> Self:
        """Set the ``retry_config`` field."""
        self._config["retry_config"] = value
        return self


    def batch_size(self, value: int) -> Self:
        """Set the ``batch_size`` field."""
        self._config["batch_size"] = value
        return self


    def batch_flush_interval(self, value: float) -> Self:
        """Set the ``batch_flush_interval`` field."""
        self._config["batch_flush_interval"] = value
        return self


    def shutdown_timeout(self, value: float) -> Self:
        """Set the ``shutdown_timeout`` field."""
        self._config["shutdown_timeout"] = value
        return self


    def queue_max_size(self, value: int) -> Self:
        """Set the ``queue_max_size`` field."""
        self._config["queue_max_size"] = value
        return self


    def content_formatter(self, value: Optional[Callable[[Any, str], Any]]) -> Self:
        """Set the ``content_formatter`` field."""
        self._config["content_formatter"] = value
        return self


    def gcs_bucket_name(self, value: Optional[str]) -> Self:
        """Set the ``gcs_bucket_name`` field."""
        self._config["gcs_bucket_name"] = value
        return self


    def connection_id(self, value: Optional[str]) -> Self:
        """Set the ``connection_id`` field."""
        self._config["connection_id"] = value
        return self


    def log_session_metadata(self, value: bool) -> Self:
        """Set the ``log_session_metadata`` field."""
        self._config["log_session_metadata"] = value
        return self


    def custom_tags(self, value: dict[str, Any]) -> Self:
        """Set the ``custom_tags`` field."""
        self._config["custom_tags"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_BigQueryLoggerConfig init params for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS
        _KNOWN_PARAMS = self.__class__._KNOWN_PARAMS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against static _KNOWN_PARAMS set (non-Pydantic class)
        if field_name not in _KNOWN_PARAMS:
            available = sorted(
                _KNOWN_PARAMS
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized parameter on _ADK_BigQueryLoggerConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_BigQueryLoggerConfig:
        """Configuration for the BigQueryAgentAnalyticsPlugin. Resolve into a native ADK _ADK_BigQueryLoggerConfig."""
        config = self._prepare_build_config()
        return _ADK_BigQueryLoggerConfig(**config)


# ======================================================================
# Builder: RetryConfig
# ======================================================================

class RetryConfig(BuilderBase):
    """Configuration for retrying failed BigQuery write operations."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] = {'max_delay', 'max_retries', 'initial_delay', 'multiplier'}


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def max_retries(self, value: int) -> Self:
        """Set the ``max_retries`` field."""
        self._config["max_retries"] = value
        return self


    def initial_delay(self, value: float) -> Self:
        """Set the ``initial_delay`` field."""
        self._config["initial_delay"] = value
        return self


    def multiplier(self, value: float) -> Self:
        """Set the ``multiplier`` field."""
        self._config["multiplier"] = value
        return self


    def max_delay(self, value: float) -> Self:
        """Set the ``max_delay`` field."""
        self._config["max_delay"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_RetryConfig init params for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS
        _KNOWN_PARAMS = self.__class__._KNOWN_PARAMS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against static _KNOWN_PARAMS set (non-Pydantic class)
        if field_name not in _KNOWN_PARAMS:
            available = sorted(
                _KNOWN_PARAMS
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized parameter on _ADK_RetryConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_RetryConfig:
        """Configuration for retrying failed BigQuery write operations. Resolve into a native ADK _ADK_RetryConfig."""
        config = self._prepare_build_config()
        return _ADK_RetryConfig(**config)


# ======================================================================
# Builder: GetSessionConfig
# ======================================================================

class GetSessionConfig(BuilderBase):
    """The configuration of getting a session."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def num_recent_events(self, value: Union[int, NoneType]) -> Self:
        """Set the ``num_recent_events`` field."""
        self._config["num_recent_events"] = value
        return self


    def after_timestamp(self, value: Union[float, NoneType]) -> Self:
        """Set the ``after_timestamp`` field."""
        self._config["after_timestamp"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_GetSessionConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_GetSessionConfig.model_fields:
            available = sorted(
                set(_ADK_GetSessionConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_GetSessionConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_GetSessionConfig:
        """The configuration of getting a session. Resolve into a native ADK _ADK_GetSessionConfig."""
        config = self._prepare_build_config()
        return _ADK_GetSessionConfig(**config)


# ======================================================================
# Builder: BaseGoogleCredentialsConfig
# ======================================================================

class BaseGoogleCredentialsConfig(BuilderBase):
    """Base Google Credentials Configuration for Google API tools (Experimental)."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def credentials(self, value: Union[Credentials, NoneType]) -> Self:
        """Set the ``credentials`` field."""
        self._config["credentials"] = value
        return self


    def external_access_token_key(self, value: Union[str, NoneType]) -> Self:
        """Set the ``external_access_token_key`` field."""
        self._config["external_access_token_key"] = value
        return self


    def client_id(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_id`` field."""
        self._config["client_id"] = value
        return self


    def client_secret(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_secret`` field."""
        self._config["client_secret"] = value
        return self


    def scopes(self, value: Union[list[str], NoneType]) -> Self:
        """Set the ``scopes`` field."""
        self._config["scopes"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_BaseGoogleCredentialsConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_BaseGoogleCredentialsConfig.model_fields:
            available = sorted(
                set(_ADK_BaseGoogleCredentialsConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_BaseGoogleCredentialsConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_BaseGoogleCredentialsConfig:
        """Base Google Credentials Configuration for Google API tools (Experimental). Resolve into a native ADK _ADK_BaseGoogleCredentialsConfig."""
        config = self._prepare_build_config()
        return _ADK_BaseGoogleCredentialsConfig(**config)


# ======================================================================
# Builder: AgentSimulatorConfig
# ======================================================================

class AgentSimulatorConfig(BuilderBase):
    """Configuration for AgentSimulator."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def tool_simulation_configs(self, value: list[ToolSimulationConfig]) -> Self:
        """Set the ``tool_simulation_configs`` field."""
        self._config["tool_simulation_configs"] = value
        return self


    def simulation_model(self, value: str) -> Self:
        """Set the ``simulation_model`` field."""
        self._config["simulation_model"] = value
        return self


    def simulation_model_configuration(self, value: GenerateContentConfig) -> Self:
        """Set the ``simulation_model_configuration`` field."""
        self._config["simulation_model_configuration"] = value
        return self


    def tracing_path(self, value: Union[str, NoneType]) -> Self:
        """Set the ``tracing_path`` field."""
        self._config["tracing_path"] = value
        return self


    def environment_data(self, value: Union[str, NoneType]) -> Self:
        """Set the ``environment_data`` field."""
        self._config["environment_data"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_AgentSimulatorConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_AgentSimulatorConfig.model_fields:
            available = sorted(
                set(_ADK_AgentSimulatorConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_AgentSimulatorConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_AgentSimulatorConfig:
        """Configuration for AgentSimulator. Resolve into a native ADK _ADK_AgentSimulatorConfig."""
        config = self._prepare_build_config()
        return _ADK_AgentSimulatorConfig(**config)


# ======================================================================
# Builder: InjectionConfig
# ======================================================================

class InjectionConfig(BuilderBase):
    """Injection configuration for a tool."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def injection_probability(self, value: float) -> Self:
        """Set the ``injection_probability`` field."""
        self._config["injection_probability"] = value
        return self


    def match_args(self, value: Union[dict[str, Any], NoneType]) -> Self:
        """Set the ``match_args`` field."""
        self._config["match_args"] = value
        return self


    def injected_latency_seconds(self, value: float) -> Self:
        """Set the ``injected_latency_seconds`` field."""
        self._config["injected_latency_seconds"] = value
        return self


    def random_seed(self, value: Union[int, NoneType]) -> Self:
        """Set the ``random_seed`` field."""
        self._config["random_seed"] = value
        return self


    def injected_error(self, value: Union[InjectedError, NoneType]) -> Self:
        """Set the ``injected_error`` field."""
        self._config["injected_error"] = value
        return self


    def injected_response(self, value: Union[dict[str, Any], NoneType]) -> Self:
        """Set the ``injected_response`` field."""
        self._config["injected_response"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_InjectionConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_InjectionConfig.model_fields:
            available = sorted(
                set(_ADK_InjectionConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_InjectionConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_InjectionConfig:
        """Injection configuration for a tool. Resolve into a native ADK _ADK_InjectionConfig."""
        config = self._prepare_build_config()
        return _ADK_InjectionConfig(**config)


# ======================================================================
# Builder: ToolSimulationConfig
# ======================================================================

class ToolSimulationConfig(BuilderBase):
    """Simulation configuration for a single tool."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, tool_name: str) -> None:
        self._config: dict[str, Any] = {"tool_name": tool_name}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def injection_configs(self, value: list[InjectionConfig]) -> Self:
        """Set the ``injection_configs`` field."""
        self._config["injection_configs"] = value
        return self


    def mock_strategy_type(self, value: MockStrategy) -> Self:
        """Set the ``mock_strategy_type`` field."""
        self._config["mock_strategy_type"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_ToolSimulationConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_ToolSimulationConfig.model_fields:
            available = sorted(
                set(_ADK_ToolSimulationConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_ToolSimulationConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_ToolSimulationConfig:
        """Simulation configuration for a single tool. Resolve into a native ADK _ADK_ToolSimulationConfig."""
        config = self._prepare_build_config()
        return _ADK_ToolSimulationConfig(**config)


# ======================================================================
# Builder: AgentToolConfig
# ======================================================================

class AgentToolConfig(BuilderBase):
    """The config for the AgentTool."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, agent: str) -> None:
        self._config: dict[str, Any] = {"agent": agent}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def skip_summarization(self, value: bool) -> Self:
        """Set the ``skip_summarization`` field."""
        self._config["skip_summarization"] = value
        return self


    def include_plugins(self, value: bool) -> Self:
        """Set the ``include_plugins`` field."""
        self._config["include_plugins"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_AgentToolConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_AgentToolConfig.model_fields:
            available = sorted(
                set(_ADK_AgentToolConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_AgentToolConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_AgentToolConfig:
        """The config for the AgentTool. Resolve into a native ADK _ADK_AgentToolConfig."""
        config = self._prepare_build_config()
        return _ADK_AgentToolConfig(**config)


# ======================================================================
# Builder: BigQueryCredentialsConfig
# ======================================================================

class BigQueryCredentialsConfig(BuilderBase):
    """BigQuery Credentials Configuration for Google API tools (Experimental)."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def credentials(self, value: Union[Credentials, NoneType]) -> Self:
        """Set the ``credentials`` field."""
        self._config["credentials"] = value
        return self


    def external_access_token_key(self, value: Union[str, NoneType]) -> Self:
        """Set the ``external_access_token_key`` field."""
        self._config["external_access_token_key"] = value
        return self


    def client_id(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_id`` field."""
        self._config["client_id"] = value
        return self


    def client_secret(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_secret`` field."""
        self._config["client_secret"] = value
        return self


    def scopes(self, value: Union[list[str], NoneType]) -> Self:
        """Set the ``scopes`` field."""
        self._config["scopes"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_BigQueryCredentialsConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_BigQueryCredentialsConfig.model_fields:
            available = sorted(
                set(_ADK_BigQueryCredentialsConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_BigQueryCredentialsConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_BigQueryCredentialsConfig:
        """BigQuery Credentials Configuration for Google API tools (Experimental). Resolve into a native ADK _ADK_BigQueryCredentialsConfig."""
        config = self._prepare_build_config()
        return _ADK_BigQueryCredentialsConfig(**config)


# ======================================================================
# Builder: BigQueryToolConfig
# ======================================================================

class BigQueryToolConfig(BuilderBase):
    """Configuration for BigQuery tools."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def write_mode(self, value: WriteMode) -> Self:
        """Set the ``write_mode`` field."""
        self._config["write_mode"] = value
        return self


    def maximum_bytes_billed(self, value: Union[int, NoneType]) -> Self:
        """Set the ``maximum_bytes_billed`` field."""
        self._config["maximum_bytes_billed"] = value
        return self


    def max_query_result_rows(self, value: int) -> Self:
        """Set the ``max_query_result_rows`` field."""
        self._config["max_query_result_rows"] = value
        return self


    def application_name(self, value: Union[str, NoneType]) -> Self:
        """Set the ``application_name`` field."""
        self._config["application_name"] = value
        return self


    def compute_project_id(self, value: Union[str, NoneType]) -> Self:
        """Set the ``compute_project_id`` field."""
        self._config["compute_project_id"] = value
        return self


    def location(self, value: Union[str, NoneType]) -> Self:
        """Set the ``location`` field."""
        self._config["location"] = value
        return self


    def job_labels(self, value: Union[dict[str, str], NoneType]) -> Self:
        """Set the ``job_labels`` field."""
        self._config["job_labels"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_BigQueryToolConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_BigQueryToolConfig.model_fields:
            available = sorted(
                set(_ADK_BigQueryToolConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_BigQueryToolConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_BigQueryToolConfig:
        """Configuration for BigQuery tools. Resolve into a native ADK _ADK_BigQueryToolConfig."""
        config = self._prepare_build_config()
        return _ADK_BigQueryToolConfig(**config)


# ======================================================================
# Builder: BigtableCredentialsConfig
# ======================================================================

class BigtableCredentialsConfig(BuilderBase):
    """Bigtable Credentials Configuration for Google API tools (Experimental)."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def credentials(self, value: Union[Credentials, NoneType]) -> Self:
        """Set the ``credentials`` field."""
        self._config["credentials"] = value
        return self


    def external_access_token_key(self, value: Union[str, NoneType]) -> Self:
        """Set the ``external_access_token_key`` field."""
        self._config["external_access_token_key"] = value
        return self


    def client_id(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_id`` field."""
        self._config["client_id"] = value
        return self


    def client_secret(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_secret`` field."""
        self._config["client_secret"] = value
        return self


    def scopes(self, value: Union[list[str], NoneType]) -> Self:
        """Set the ``scopes`` field."""
        self._config["scopes"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_BigtableCredentialsConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_BigtableCredentialsConfig.model_fields:
            available = sorted(
                set(_ADK_BigtableCredentialsConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_BigtableCredentialsConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_BigtableCredentialsConfig:
        """Bigtable Credentials Configuration for Google API tools (Experimental). Resolve into a native ADK _ADK_BigtableCredentialsConfig."""
        config = self._prepare_build_config()
        return _ADK_BigtableCredentialsConfig(**config)


# ======================================================================
# Builder: DataAgentToolConfig
# ======================================================================

class DataAgentToolConfig(BuilderBase):
    """Configuration for Data Agent tools."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def max_query_result_rows(self, value: int) -> Self:
        """Set the ``max_query_result_rows`` field."""
        self._config["max_query_result_rows"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_DataAgentToolConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_DataAgentToolConfig.model_fields:
            available = sorted(
                set(_ADK_DataAgentToolConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_DataAgentToolConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_DataAgentToolConfig:
        """Configuration for Data Agent tools. Resolve into a native ADK _ADK_DataAgentToolConfig."""
        config = self._prepare_build_config()
        return _ADK_DataAgentToolConfig(**config)


# ======================================================================
# Builder: DataAgentCredentialsConfig
# ======================================================================

class DataAgentCredentialsConfig(BuilderBase):
    """Data Agent Credentials Configuration for Google API tools."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def credentials(self, value: Union[Credentials, NoneType]) -> Self:
        """Set the ``credentials`` field."""
        self._config["credentials"] = value
        return self


    def external_access_token_key(self, value: Union[str, NoneType]) -> Self:
        """Set the ``external_access_token_key`` field."""
        self._config["external_access_token_key"] = value
        return self


    def client_id(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_id`` field."""
        self._config["client_id"] = value
        return self


    def client_secret(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_secret`` field."""
        self._config["client_secret"] = value
        return self


    def scopes(self, value: Union[list[str], NoneType]) -> Self:
        """Set the ``scopes`` field."""
        self._config["scopes"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_DataAgentCredentialsConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_DataAgentCredentialsConfig.model_fields:
            available = sorted(
                set(_ADK_DataAgentCredentialsConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_DataAgentCredentialsConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_DataAgentCredentialsConfig:
        """Data Agent Credentials Configuration for Google API tools. Resolve into a native ADK _ADK_DataAgentCredentialsConfig."""
        config = self._prepare_build_config()
        return _ADK_DataAgentCredentialsConfig(**config)


# ======================================================================
# Builder: ExampleToolConfig
# ======================================================================

class ExampleToolConfig(BuilderBase):
    """Fluent builder for ExampleToolConfig."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, examples: str) -> None:
        self._config: dict[str, Any] = {"examples": examples}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_ExampleToolConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_ExampleToolConfig.model_fields:
            available = sorted(
                set(_ADK_ExampleToolConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_ExampleToolConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_ExampleToolConfig:
        """Fluent builder for ExampleToolConfig. Resolve into a native ADK _ADK_ExampleToolConfig."""
        config = self._prepare_build_config()
        return _ADK_ExampleToolConfig(**config)


# ======================================================================
# Builder: McpToolsetConfig
# ======================================================================

class McpToolsetConfig(BuilderBase):
    """The config for McpToolset."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def stdio_server_params(self, value: Union[StdioServerParameters, NoneType]) -> Self:
        """Set the ``stdio_server_params`` field."""
        self._config["stdio_server_params"] = value
        return self


    def stdio_connection_params(self, value: Union[StdioConnectionParams, NoneType]) -> Self:
        """Set the ``stdio_connection_params`` field."""
        self._config["stdio_connection_params"] = value
        return self


    def sse_connection_params(self, value: Union[SseConnectionParams, NoneType]) -> Self:
        """Set the ``sse_connection_params`` field."""
        self._config["sse_connection_params"] = value
        return self


    def streamable_http_connection_params(self, value: Union[StreamableHTTPConnectionParams, NoneType]) -> Self:
        """Set the ``streamable_http_connection_params`` field."""
        self._config["streamable_http_connection_params"] = value
        return self


    def tool_filter(self, value: Union[list[str], NoneType]) -> Self:
        """Set the ``tool_filter`` field."""
        self._config["tool_filter"] = value
        return self


    def tool_name_prefix(self, value: Union[str, NoneType]) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self._config["tool_name_prefix"] = value
        return self


    def auth_scheme(self, value: Union[APIKey, HTTPBase, OAuth2, OpenIdConnect, HTTPBearer, OpenIdConnectWithConfig, NoneType]) -> Self:
        """Set the ``auth_scheme`` field."""
        self._config["auth_scheme"] = value
        return self


    def auth_credential(self, value: Union[AuthCredential, NoneType]) -> Self:
        """Set the ``auth_credential`` field."""
        self._config["auth_credential"] = value
        return self


    def use_mcp_resources(self, value: bool) -> Self:
        """Set the ``use_mcp_resources`` field."""
        self._config["use_mcp_resources"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_McpToolsetConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_McpToolsetConfig.model_fields:
            available = sorted(
                set(_ADK_McpToolsetConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_McpToolsetConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_McpToolsetConfig:
        """The config for McpToolset. Resolve into a native ADK _ADK_McpToolsetConfig."""
        config = self._prepare_build_config()
        return _ADK_McpToolsetConfig(**config)


# ======================================================================
# Builder: PubSubToolConfig
# ======================================================================

class PubSubToolConfig(BuilderBase):
    """Configuration for Pub/Sub tools."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def project_id(self, value: str | None) -> Self:
        """Set the ``project_id`` field."""
        self._config["project_id"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_PubSubToolConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_PubSubToolConfig.model_fields:
            available = sorted(
                set(_ADK_PubSubToolConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_PubSubToolConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_PubSubToolConfig:
        """Configuration for Pub/Sub tools. Resolve into a native ADK _ADK_PubSubToolConfig."""
        config = self._prepare_build_config()
        return _ADK_PubSubToolConfig(**config)


# ======================================================================
# Builder: PubSubCredentialsConfig
# ======================================================================

class PubSubCredentialsConfig(BuilderBase):
    """Pub/Sub Credentials Configuration for Google API tools (Experimental)."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def credentials(self, value: Union[Credentials, NoneType]) -> Self:
        """Set the ``credentials`` field."""
        self._config["credentials"] = value
        return self


    def external_access_token_key(self, value: Union[str, NoneType]) -> Self:
        """Set the ``external_access_token_key`` field."""
        self._config["external_access_token_key"] = value
        return self


    def client_id(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_id`` field."""
        self._config["client_id"] = value
        return self


    def client_secret(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_secret`` field."""
        self._config["client_secret"] = value
        return self


    def scopes(self, value: Union[list[str], NoneType]) -> Self:
        """Set the ``scopes`` field."""
        self._config["scopes"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_PubSubCredentialsConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_PubSubCredentialsConfig.model_fields:
            available = sorted(
                set(_ADK_PubSubCredentialsConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_PubSubCredentialsConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_PubSubCredentialsConfig:
        """Pub/Sub Credentials Configuration for Google API tools (Experimental). Resolve into a native ADK _ADK_PubSubCredentialsConfig."""
        config = self._prepare_build_config()
        return _ADK_PubSubCredentialsConfig(**config)


# ======================================================================
# Builder: SpannerCredentialsConfig
# ======================================================================

class SpannerCredentialsConfig(BuilderBase):
    """Spanner Credentials Configuration for Google API tools (Experimental)."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def credentials(self, value: Union[Credentials, NoneType]) -> Self:
        """Set the ``credentials`` field."""
        self._config["credentials"] = value
        return self


    def external_access_token_key(self, value: Union[str, NoneType]) -> Self:
        """Set the ``external_access_token_key`` field."""
        self._config["external_access_token_key"] = value
        return self


    def client_id(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_id`` field."""
        self._config["client_id"] = value
        return self


    def client_secret(self, value: Union[str, NoneType]) -> Self:
        """Set the ``client_secret`` field."""
        self._config["client_secret"] = value
        return self


    def scopes(self, value: Union[list[str], NoneType]) -> Self:
        """Set the ``scopes`` field."""
        self._config["scopes"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_SpannerCredentialsConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_SpannerCredentialsConfig.model_fields:
            available = sorted(
                set(_ADK_SpannerCredentialsConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_SpannerCredentialsConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_SpannerCredentialsConfig:
        """Spanner Credentials Configuration for Google API tools (Experimental). Resolve into a native ADK _ADK_SpannerCredentialsConfig."""
        config = self._prepare_build_config()
        return _ADK_SpannerCredentialsConfig(**config)


# ======================================================================
# Builder: BaseToolConfig
# ======================================================================

class BaseToolConfig(BuilderBase):
    """The base class for all tool configs."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_BaseToolConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_BaseToolConfig.model_fields:
            available = sorted(
                set(_ADK_BaseToolConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_BaseToolConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_BaseToolConfig:
        """The base class for all tool configs. Resolve into a native ADK _ADK_BaseToolConfig."""
        config = self._prepare_build_config()
        return _ADK_BaseToolConfig(**config)


# ======================================================================
# Builder: ToolArgsConfig
# ======================================================================

class ToolArgsConfig(BuilderBase):
    """Config to host free key-value pairs for the args in ToolConfig."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, ) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_ToolArgsConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_ToolArgsConfig.model_fields:
            available = sorted(
                set(_ADK_ToolArgsConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_ToolArgsConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_ToolArgsConfig:
        """Config to host free key-value pairs for the args in ToolConfig. Resolve into a native ADK _ADK_ToolArgsConfig."""
        config = self._prepare_build_config()
        return _ADK_ToolArgsConfig(**config)


# ======================================================================
# Builder: ToolConfig
# ======================================================================

class ToolConfig(BuilderBase):
    """The configuration for a tool."""

    # --- Class-level alias / field maps ---
    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()


    def __init__(self, name: str) -> None:
        self._config: dict[str, Any] = {"name": name}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)

    # --- Ergonomic aliases ---

    # --- Additive callback methods ---

    # --- Explicit field methods ---

    def args(self, value: Union[ToolArgsConfig, NoneType]) -> Self:
        """The args for the tool."""
        self._config["args"] = value
        return self

    # --- Extra methods ---

    # --- Dynamic field forwarding (safety net) ---

    def __getattr__(self, name: str):
        """Forward unknown methods to _ADK_ToolConfig.model_fields for zero-maintenance compatibility."""
        if name.startswith("_"):
            raise AttributeError(name)

        # Resolve through alias map (class-level constants)
        _ALIASES = self.__class__._ALIASES
        _CALLBACK_ALIASES = self.__class__._CALLBACK_ALIASES
        _ADDITIVE_FIELDS = self.__class__._ADDITIVE_FIELDS

        field_name = _ALIASES.get(name, name)

        # Check if it's a callback alias
        if name in _CALLBACK_ALIASES:
            cb_field = _CALLBACK_ALIASES[name]
            def _cb_setter(fn: Callable) -> Self:
                self._callbacks[cb_field].append(fn)
                return self
            return _cb_setter

        # Validate against actual Pydantic schema
        if field_name not in _ADK_ToolConfig.model_fields:
            available = sorted(
                set(_ADK_ToolConfig.model_fields.keys())
                | set(_ALIASES.keys())
                | set(_CALLBACK_ALIASES.keys())
            )
            raise AttributeError(
                f"'{name}' is not a recognized field on _ADK_ToolConfig. "
                f"Available: {', '.join(available)}"
            )

        # Return a setter that stores value and returns self for chaining
        def _setter(value: Any) -> Self:
            if field_name in _ADDITIVE_FIELDS:
                self._callbacks[field_name].append(value)
            else:
                self._config[field_name] = value
            return self

        return _setter

    # --- Terminal methods ---

    def build(self) -> _ADK_ToolConfig:
        """The configuration for a tool. Resolve into a native ADK _ADK_ToolConfig."""
        config = self._prepare_build_config()
        return _ADK_ToolConfig(**config)
