diff --git a/service/src/test/java/com/launchableinc/openai/service/ChatCompletionTest.java b/service/src/test/java/com/launchableinc/openai/service/ChatCompletionTest.java index 76295293..6e4c72e5 100644 --- a/service/src/test/java/com/launchableinc/openai/service/ChatCompletionTest.java +++ b/service/src/test/java/com/launchableinc/openai/service/ChatCompletionTest.java @@ -101,6 +101,27 @@ void createChatCompletion_with_json_mode() { assertTrue(isValidJson(choices.getMessage().getContent())); } + @Test + void createChatCompletion_with_gpt4o() { + final List messages = new ArrayList<>(); + final ChatMessage systemMessage = new ChatMessage(ChatMessageRole.SYSTEM.value(), + "You are a cat and will speak as such."); + messages.add(systemMessage); + + ChatCompletionRequest chatCompletionRequest = ChatCompletionRequest + .builder() + .model("gpt-4o") + .messages(messages) + .n(5) + .maxTokens(50) + .logitBias(new HashMap<>()) + .build(); + + List choices = service.createChatCompletion(chatCompletionRequest) + .getChoices(); + assertEquals(5, choices.size()); + } + private boolean isValidJson(String jsonString) { ObjectMapper objectMapper = new ObjectMapper(); try {