Interface LanguageModel

All Known Implementing Classes:
AzureOpenAiLanguageModel, DisabledLanguageModel, HuggingFaceLanguageModel, JlamaLanguageModel, LocalAiLanguageModel, OllamaLanguageModel, OpenAiLanguageModel, VertexAiLanguageModel, WorkersAiLanguageModel

public interface LanguageModel
Represents a language model that has a simple text interface (as opposed to a chat interface). It is recommended to use the ChatLanguageModel instead, as it offers more features.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Response<String>
    generate(Prompt prompt)
    Generate a response to the given prompt.
    generate(String prompt)
    Generate a response to the given prompt.
  • Method Details

    • generate

      Response<String> generate(String prompt)
      Generate a response to the given prompt.
      Parameters:
      prompt - the prompt.
      Returns:
      the response.
    • generate

      default Response<String> generate(Prompt prompt)
      Generate a response to the given prompt.
      Parameters:
      prompt - the prompt.
      Returns:
      the response.