// File generated from our OpenAPI spec by Stainless.

package com.openai.services.async

import com.openai.TestServerExtension
import com.openai.client.okhttp.OpenAIOkHttpClientAsync
import com.openai.models.embeddings.EmbeddingCreateParams
import com.openai.models.embeddings.EmbeddingModel
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

@ExtendWith(TestServerExtension::class)
internal class EmbeddingServiceAsyncTest {

    @Test
    fun create() {
        val client =
            OpenAIOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .adminApiKey("My Admin API Key")
                .build()
        val embeddingServiceAsync = client.embeddings()

        val createEmbeddingResponseFuture =
            embeddingServiceAsync.create(
                EmbeddingCreateParams.builder()
                    .input("The quick brown fox jumped over the lazy dog")
                    .model(EmbeddingModel.TEXT_EMBEDDING_3_SMALL)
                    .dimensions(1L)
                    .encodingFormat(EmbeddingCreateParams.EncodingFormat.FLOAT)
                    .user("user-1234")
                    .build()
            )

        val createEmbeddingResponse = createEmbeddingResponseFuture.get()
        createEmbeddingResponse.validate()
    }
}
