All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonTest.com.aallam.openai.client.TestEdits.kt Maven / Gradle / Ivy

There is a newer version: 4.0.0-beta01
Show newest version
package com.aallam.openai.client

import com.aallam.openai.api.edits.EditsRequest
import com.aallam.openai.api.model.ModelId
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertTrue

class TestEdits : TestOpenAI() {

    @Test
    fun edits() = runTest {
        val response = openAI.edit(
            request = EditsRequest(
                model = ModelId("text-davinci-edit-001"),
                input = "What day of the wek is it?",
                instruction = "Fix the spelling mistakes"
            )
        )
        assertTrue { response.created != 0L }
        assertTrue { response.choices.isNotEmpty() }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy