ai.platon.pulsar.external.ChatModel.kt Maven / Gradle / Ivy
package ai.platon.pulsar.external
import ai.platon.pulsar.dom.FeaturedDocument
import org.jsoup.nodes.Element
interface ChatModel {
/**
* Generates a response from the model based on a sequence of messages.
* Typically, the sequence contains messages in the following order:
* System (optional) - User - AI - User - AI - User ...
*
* @return The response generated by the model.
*/
fun call(prompt: String): ModelResponse
/**
* Generates a response from the model based on a sequence of messages.
* Typically, the sequence contains messages in the following order:
* System (optional) - User - AI - User - AI - User ...
*
* @param userMessage The user message.
* @param systemMessage The system message.
* @return The response generated by the model.
*/
fun call(userMessage: String, systemMessage: String): ModelResponse
/**
* Generates a response from the model based on a sequence of messages.
* Typically, the sequence contains messages in the following order:
* System (optional) - User - AI - User - AI - User ...
*
* @param document An array of messages.
* @return The response generated by the model.
*/
fun call(document: FeaturedDocument, prompt: String): ModelResponse
/**
* Generates a response from the model based on a sequence of messages.
* Typically, the sequence contains messages in the following order:
* System (optional) - User - AI - User - AI - User ...
*
* @param ele The Element to ask.
* @return The response generated by the model.
*/
fun call(ele: Element, prompt: String): ModelResponse
}