Class MistralAiStreamingFimModel

java.lang.Object
dev.langchain4j.model.mistralai.MistralAiStreamingFimModel
All Implemented Interfaces:
StreamingLanguageModel

public class MistralAiStreamingFimModel extends Object implements StreamingLanguageModel
Represents a Mistral AI FIM Completion Model with a language completion interface, users can define the starting point of the text/code using a prompt, and the ending point of the text/code using an optional suffix and an optional stop.

The model's response is streamed token by token and should be handled with StreamingResponseHandler.

You can find description of parameters here.

  • Constructor Details

  • Method Details

    • generate

      public void generate(String prompt, String suffix, StreamingResponseHandler<String> handler)
      Generates a completion for the given prompt and suffix.
      Parameters:
      prompt - the prompt to generate a completion for
      suffix - Optional text/code that adds more context for the model. When given a prompt and a suffix the model will fill what is between them.
      handler - the handler to process the completion response
    • generate

      public void generate(String prompt, StreamingResponseHandler<String> handler)
      Generates a completion for the given prompt.
      Specified by:
      generate in interface StreamingLanguageModel
      Parameters:
      prompt - the prompt to generate a completion for
      handler - the handler to process the completion response
    • builder

      public static MistralAiStreamingFimModel.Builder builder()