public AiModelFactory getFactory(final AiModelProviderEnum modelType) {
        return factories.stream()
                .filter(f -> f.supports(modelType))
                .findFirst()
                .orElseThrow(() -> new IllegalArgumentException("Unsupported AI model: " + modelType));
    }
Get ai model factory .

@param modelType modelType
@return aiModelFactory
shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-common/src/main/java/org/apache/shenyu/plugin/ai/common/spring/ai/registry/AiModelFactoryRegistry.java