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

commonMain.com.aallam.openai.client.Chat.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.chat.ChatCompletion
import com.aallam.openai.api.chat.ChatCompletionChunk
import com.aallam.openai.api.chat.ChatCompletionRequest
import kotlinx.coroutines.flow.Flow

/**
 * Given a chat conversation, the model will return a chat completion response.
 */
public interface Chat {

    /**
     * Creates a completion for the chat message.
     */
    public suspend fun chatCompletion(request: ChatCompletionRequest): ChatCompletion

    /**
     * Stream variant of [chatCompletion].
     */
    public fun chatCompletions(request: ChatCompletionRequest): Flow
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy