"""Shared utility functions for the actor subsystem."""

from __future__ import annotations

#: Sentinel model value for tool actors that have no real model.
TOOL_ACTOR_SENTINEL: str = "__tool_actor__"


def infer_provider_from_model(model: str) -> str:
    """Infer a provider identifier from a model string.

    If the model contains ``/`` the prefix is used as provider
    (e.g. ``openai/gpt-4`` → ``openai``).  Otherwise ``"custom"``
    is returned as a fallback.
    """
    if "/" in model:
        prefix = model.split("/", 1)[0]
        return prefix if prefix else "custom"
    return "custom"
