content: package com.seasonthon.everflow.app.gemini.config;
  
  import org.springframework.beans.factory.annotation.Qualifier;
  import org.springframework.beans.factory.annotation.Value;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.client.RestClient;
  import org.springframework.web.client.support.RestClientAdapter;
  import org.springframework.web.service.invoker.HttpServiceProxyFactory;
  
  @Configuration
  public class GeminiConfig {
  
      @Bean
      public RestClient geminiRestClient(
              @Value("${gemini.baseurl}") String baseUrl,
              @Value("${googleai.api.key}") String apiKey
      ) {
          return RestClient.builder()
                  .baseUrl(baseUrl)
                  .defaultHeader("x-goog-api-key", apiKey)
                  .defaultHeader("Content-Type", "application/json")
                  .defaultHeader("Accept", "application/json")
                  .build();
      }
  
      @Bean
      public GeminiInterface geminiInterface(@Qualifier("geminiRestClient") RestClient client) {
          HttpServiceProxyFactory factory = HttpServiceProxyFactory
                  .builderFor(RestClientAdapter.create(client))
                  .build();
          return factory.createClient(GeminiInterface.class);
      }
  }