package com.seer.teach.openapi.config;

import com.seer.teach.common.config.LlmConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.web.reactive.function.client.ExchangeStrategies;
import org.springframework.web.reactive.function.client.WebClient;

/**
 *
 * <p>
 *
 * </p >
 *
 * @author Captain
 * @since 2025-09-27 19:30
 */
@Configuration
@DependsOn("llmConfig")
public class WebClientConfig {

    @Bean
    public WebClient webClient(WebClient.Builder builder) {
        ExchangeStrategies strategies = ExchangeStrategies.builder()
                .codecs(configurer ->
                        configurer.defaultCodecs().maxInMemorySize(16 * 1024 * 1024))
                .build();
        return builder
                .exchangeStrategies(strategies)
                .baseUrl(LlmConfig.IP)
                .build();
    }
}
