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

eu.ciechanowiec.sling.rocket.llm.ChatCompletion Maven / Gradle / Ivy

There is a newer version: 13.26.0
Show newest version
package eu.ciechanowiec.sling.rocket.llm;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import java.util.List;

/**
 * Generates the next {@link ChatMessage} in a conversation based on the previous ones.
 */
@FunctionalInterface
@JsonDeserialize(as = ChatMessageDefault.class)
@SuppressWarnings({"unused", "InterfaceNeverImplemented"})
public interface ChatCompletion {

    /**
     * Generates the next {@link ChatMessage} in a conversation based on the previous ones.
     * @param chatMessages list of consecutive {@link ChatMessage}-s from a single conversation
     *                     that should be used to generate the next one
     * @return next {@link ChatMessage} in the conversation;
     *         the returned {@link ChatMessage} is generated by an underlying large language model (LLM, AI)
     */
    ChatMessage complete(List chatMessages);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy