package tech.easyflow.ai.config;

import com.easyagents.store.milvus.MilvusVectorStoreConfig;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "rag.milvus")
public class AiMilvusConfig extends MilvusVectorStoreConfig {

    public MilvusVectorStoreConfig copyForCollection(String collectionName) {
        MilvusVectorStoreConfig config = new MilvusVectorStoreConfig();
        config.setUri(getUri());
        config.setToken(getToken());
        config.setDatabaseName(getDatabaseName());
        config.setUsername(getUsername());
        config.setPassword(getPassword());
        config.setAutoCreateCollection(isAutoCreateCollection());
        config.setDefaultCollectionName(collectionName);
        return config;
    }
}
