Class ChatResponseMetadata

java.lang.Object
org.springframework.ai.model.AbstractResponseMetadata
org.springframework.ai.chat.metadata.ChatResponseMetadata
All Implemented Interfaces:
ResponseMetadata

public class ChatResponseMetadata extends AbstractResponseMetadata implements ResponseMetadata
Models common AI provider metadata returned in an AI response.
Since:
1.0.0
Author:
John Blum, Thomas Vitale, Mark Pollack, Alexandros Pappas
  • Constructor Details

    • ChatResponseMetadata

      public ChatResponseMetadata()
  • Method Details

    • builder

      public static ChatResponseMetadata.Builder builder()
    • getId

      public String getId()
      A unique identifier for the chat completion operation.
      Returns:
      unique operation identifier.
    • getModel

      public String getModel()
      The model that handled the request.
      Returns:
      the model that handled the request.
    • getRateLimit

      public RateLimit getRateLimit()
      Returns AI provider specific metadata on rate limits.
      Returns:
      AI provider specific metadata on rate limits.
      See Also:
    • getUsage

      public Usage getUsage()
      Returns AI provider specific metadata on API usage.
      Returns:
      AI provider specific metadata on API usage.
      See Also:
    • getPromptMetadata

      public PromptMetadata getPromptMetadata()
      Returns the prompt metadata gathered by the AI during request processing.
      Returns:
      the prompt metadata.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object