Interface ResponseMetadata

All Known Implementing Classes:
AudioTranscriptionResponseMetadata, AzureOpenAiAudioTranscriptionResponseMetadata, AzureOpenAiImageResponseMetadata, ChatResponseMetadata, EmbeddingResponseMetadata, ImageResponseMetadata, ModerationResponseMetadata, MutableResponseMetadata, OpenAiAudioSpeechResponseMetadata, OpenAiAudioTranscriptionResponseMetadata

public interface ResponseMetadata
Interface representing metadata associated with an AI model's response.
Since:
1.0.0
Author:
Mark Pollack
  • Method Details

    • get

      @Nullable <T> T get(String key)
      Gets an entry from the context. Returns null when entry is not present.
      Type Parameters:
      T - value type
      Parameters:
      key - key
      Returns:
      entry or null if not present
    • getRequired

      @NonNull <T> T getRequired(Object key)
      Gets an entry from the context. Throws exception when entry is not present.
      Type Parameters:
      T - value type
      Parameters:
      key - key
      Returns:
      entry
      Throws:
      IllegalArgumentException - if not present
    • containsKey

      boolean containsKey(Object key)
      Checks if context contains a key.
      Parameters:
      key - key
      Returns:
      true when the context contains the entry with the given key
    • getOrDefault

      <T> T getOrDefault(Object key, T defaultObject)
      Returns an element or default if not present.
      Type Parameters:
      T - value type
      Parameters:
      key - key
      defaultObject - default object to return
      Returns:
      object or default if not present
    • getOrDefault

      default <T> T getOrDefault(String key, Supplier<T> defaultObjectSupplier)
      Returns an element or default if not present.
      Type Parameters:
      T - value type
      Parameters:
      key - key
      defaultObjectSupplier - supplier for default object to return
      Returns:
      object or default if not present
      Since:
      1.11.0
    • entrySet

      Set<Map.Entry<String,Object>> entrySet()
    • keySet

      Set<String> keySet()
    • isEmpty

      boolean isEmpty()
      Returns true if this map contains no key-value mappings.
      Returns:
      true if this map contains no key-value mappings