package com.emoon.common.vector.config;

import io.weaviate.client.Config;
import io.weaviate.client.WeaviateClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author destiny
 * @description:
 * @date 2025/10/13 16:56
 */
@Configuration
public class WeaviateClientConfig {

    @Value("${weaviate.protocol}")
    private String weaviateProtocol;

    @Value("${weaviate.host}")
    private String weaviateHost;

    @Value("${weaviate.port}")
    private String weaviatePort;

    @Bean
    public WeaviateClient weaviateClient() {
        return new WeaviateClient(new Config(weaviateProtocol, String.format("%s:%s", weaviateHost, weaviatePort)));
    }
}
