Interface ChatGenerationMetadata

All Superinterfaces:
ResultMetadata

public interface ChatGenerationMetadata extends ResultMetadata
Abstract Data Type (ADT) encapsulating information on the completion choices in the AI response.
Since:
0.7.0
Author:
John Blum
  • Field Details

  • Method Details

    • from

      static ChatGenerationMetadata from(String finishReason, Object contentFilterMetadata)
      Factory method used to construct a new ChatGenerationMetadata from the given finish reason and content filter metadata.
      Parameters:
      finishReason - String contain the reason for the choice completion.
      contentFilterMetadata - underlying AI provider metadata for filtering applied to generation content.
      Returns:
      a new ChatGenerationMetadata from the given finish reason and content filter metadata.
    • getContentFilterMetadata

      @Nullable <T> T getContentFilterMetadata()
      Returns the underlying AI provider metadata for filtering applied to generation content.
      Type Parameters:
      T - Type used to cast the filtered content metadata into the AI provider-specific type.
      Returns:
      the underlying AI provider metadata for filtering applied to generation content.
    • getFinishReason

      String getFinishReason()
      Get the reason this choice completed for the generation.
      Returns:
      the reason this choice completed for the generation.