package com.yaoai.ai.providers.config;

public enum ModelCapability {
    TEXT("text"),
    IMAGE("image"),
    VIDEO("video");

    private final String key;

    ModelCapability(String key) {
        this.key = key;
    }

    public String key() {
        return key;
    }

    public static ModelCapability fromKey(String value) {
        if (value == null) {
            throw new IllegalArgumentException("capability is required");
        }
        for (ModelCapability capability : values()) {
            if (capability.key.equalsIgnoreCase(value) || capability.name().equalsIgnoreCase(value)) {
                return capability;
            }
        }
        throw new IllegalArgumentException("unsupported capability: " + value);
    }
}
