eu.ciechanowiec.sling.rocket.llm.ChatCompletion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sling.rocket.commons Show documentation
Show all versions of sling.rocket.commons Show documentation
Common utilities used by Sling Rocket
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