package fr.anthonyquere.talkwithme.core.ai.langchain.models;

import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.mistralai.MistralAiChatModel;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MistralAIConfiguration {
  @Value("${mistral-ia.api-key}")
  private String mistralApiKey;

  @Bean
  public ChatLanguageModel buildMistralModel() {
    return MistralAiChatModel.builder()
      .apiKey(mistralApiKey)
      .maxTokens(100)
      .modelName("mistral-tiny")
      .temperature(1.0d)
      .logRequests(true)
      .logResponses(true)
      .maxRetries(1)
      .build();
  }
}

dev.langchain4j.model.mistralai.MistralAiChatModel.builder
[((535, 759), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder'), ((535, 744), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder'), ((535, 723), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder'), ((535, 697), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder'), ((535, 672), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder'), ((535, 647), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder'), ((535, 614), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder'), ((535, 592), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder')]