// File generated from our OpenAPI spec by Stainless.

package com.openai.services.blocking.chat.completions

import com.openai.TestServerExtension
import com.openai.client.okhttp.OpenAIOkHttpClient
import com.openai.models.ChatCompletionMessageListParams
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

@ExtendWith(TestServerExtension::class)
class MessageServiceTest {

    @Test
    fun callList() {
        val client =
            OpenAIOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val messageService = client.chat().completions().messages()
        val chatCompletionMessageList =
            messageService.list(
                ChatCompletionMessageListParams.builder().completionId("completion_id").build()
            )
        println(chatCompletionMessageList)
        chatCompletionMessageList.data().forEach { it.validate() }
    }
}
