Class MessageChunk

java.lang.Object
nl.dannyj.mistral.models.completion.message.MessageChunk

public class MessageChunk extends Object
A chunk of a message in a conversation. Returned when using streaming chat completions.
  • Constructor Details

    • MessageChunk

      public MessageChunk(String id, String object, long created, String model, List<DeltaChoice> choices, Usage usage)
      Creates a new MessageChunk instance.
      Parameters:
      id - The ID of the message chunk.
      object - Always chat.completion.chunk
      created - The time the message chunk was created.
      model - The model used to generate the completions.
      choices - The generated delta completions.
      usage - The tokens used to generate the completion.
    • MessageChunk

      public MessageChunk()
  • Method Details

    • getId

      public String getId()
      The ID of the message chunk.
      Returns:
      the id of the message chunk
    • getObject

      public String getObject()
      Always chat.completion.chunk
      Returns:
      the object type of the message chunk
    • getCreated

      public long getCreated()
      The time the message chunk was created.
      Returns:
      the time the message chunk was created in seconds since the epoch
    • getModel

      public String getModel()
      The model used to generate the completions.
      Returns:
      the id of the model used to generate the completions
    • getChoices

      public List<DeltaChoice> getChoices()
      The generated delta completions.
      Returns:
      the generated delta completions
    • getUsage

      public Usage getUsage()
      The tokens used to generate the completion.
      Returns:
      the tokens used to generate the completion