package org.agoncal.fascicle.langchain4j.accessing.mistralai;

import dev.langchain4j.model.mistralai.MistralAiChatModel;

// tag::adocSkip[]

/**
 * @author Antonio Goncalves
 * http://www.antoniogoncalves.org
 * --
 */
// end::adocSkip[]
public class MusicianService {

  public static void main(String[] args) {
    MusicianService musicianService = new MusicianService();

    musicianService.useMistralAiChatModel();
  }

  private static final String AZURE_OPENAI_KEY = System.getenv("AZURE_OPENAI_KEY");
  private static final String AZURE_OPENAI_ENDPOINT = System.getenv("AZURE_OPENAI_ENDPOINT");
  private static final String AZURE_OPENAI_DEPLOYMENT_NAME = System.getenv("AZURE_OPENAI_DEPLOYMENT_NAME");

  private static final String PROMPT = "When was the first Beatles album released?";

  // ###############################
  // ### AZURE OPENAI CHAT MODEL ###
  // ###############################
  public void useMistralAiChatModel() {
    System.out.println("### useMistralAiChatModel");

    // tag::adocSnippet[]
    MistralAiChatModel model = MistralAiChatModel.builder()
      .apiKey(AZURE_OPENAI_KEY)
      .temperature(0.3)
      .build();
    // end::adocSnippet[]

    String completion = model.generate("When was the first Rolling Stones album released?");

    System.out.println(completion);
  }
}

[((1062, 1161), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder'), ((1062, 1146), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder'), ((1062, 1122), 'dev.langchain4j.model.mistralai.MistralAiChatModel.builder')]