import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.openai.OpenAiChatModel;

import static java.time.Duration.ofSeconds;

public class _01_ModelParameters {

    public static void main(String[] args) {

        // OpenAI parameters are explained here: https://platform.openai.com/docs/api-reference/chat/create

        ChatLanguageModel model = OpenAiChatModel.builder()
                .apiKey(ApiKeys.OPENAI_API_KEY)
                .modelName("gpt-3.5-turbo")
                .temperature(0.3)
                .timeout(ofSeconds(60))
                .logRequests(true)
                .logResponses(true)
                .build();

        String prompt = "Explain in three lines how to make a beautiful painting";

        String response = model.generate(prompt);

        System.out.println(response);
    }
}

dev.langchain4j.model.openai.OpenAiChatModel.builder
[((377, 664), 'dev.langchain4j.model.openai.OpenAiChatModel.builder'), ((377, 639), 'dev.langchain4j.model.openai.OpenAiChatModel.builder'), ((377, 603), 'dev.langchain4j.model.openai.OpenAiChatModel.builder'), ((377, 568), 'dev.langchain4j.model.openai.OpenAiChatModel.builder'), ((377, 528), 'dev.langchain4j.model.openai.OpenAiChatModel.builder'), ((377, 494), 'dev.langchain4j.model.openai.OpenAiChatModel.builder'), ((377, 450), 'dev.langchain4j.model.openai.OpenAiChatModel.builder')]