Interface BaseLanguageModel

All Known Implementing Classes:
BaseChatModel, BaseLLM, BaseOpenAI, ChatGLM, ChatOpenAI, LLM, Ollama, OpenAI, OpenAIChat

public interface BaseLanguageModel
BaseLanguageModel is an interface for interacting with a language model.
Author:
HamaWhite
  • Method Details

    • generatePrompt

      LLMResult generatePrompt(List<PromptValue> prompts, List<String> stop)
      Take in a list of prompt values and return an LLMResult.
    • predict

      default String predict(String text)
      Predict text from text.
    • predict

      String predict(String text, List<String> stop)
      Predict text from text.
    • predictMessages

      default BaseMessage predictMessages(List<BaseMessage> messages)
      Predict message from messages.
    • predictMessages

      BaseMessage predictMessages(List<BaseMessage> messages, List<String> stop)
      Predict message from messages.
    • asyncGeneratePrompt

      default List<reactor.core.publisher.Flux<AsyncLLMResult>> asyncGeneratePrompt(List<PromptValue> prompts)
      Take in a list of prompt values and return an Flux for every PromptValue.
    • asyncGeneratePrompt

      default List<reactor.core.publisher.Flux<AsyncLLMResult>> asyncGeneratePrompt(List<PromptValue> prompts, List<String> stop)
      Take in a list of prompt values and return an Flux for every PromptValue.
    • asyncPredict

      default reactor.core.publisher.Flux<String> asyncPredict(String text)
      Predict text from text async.
    • asyncPredict

      default reactor.core.publisher.Flux<String> asyncPredict(String text, List<String> stop)
      Predict text from text async.
    • asyncPredictMessages

      default reactor.core.publisher.Flux<BaseMessage> asyncPredictMessages(List<BaseMessage> messages, List<String> stop)
      Predict message from messages async.