Skip to content

model_capabilities

Class info

🛈 DocStrings

Model capability utilities.

supports_vision async

supports_vision(model_name: str | None) -> bool

Check if a model supports vision capabilities.

Parameters:

Name Type Description Default
model_name str | None

Name of the model to check

required

Returns:

Type Description
bool

True if the model supports vision, False otherwise

Source code in src/llmling_agent/utils/model_capabilities.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
async def supports_vision(model_name: str | None) -> bool:
    """Check if a model supports vision capabilities.

    Args:
        model_name: Name of the model to check

    Returns:
        True if the model supports vision, False otherwise
    """
    if not model_name:
        return False

    try:
        import tokonomics

        caps = await tokonomics.get_model_capabilities(model_name)
        return bool(caps and caps.supports_vision)
    except ImportError:
        # If tokonomics is not available, return False
        return False