Class ChatResponseMetadata
java.lang.Object
org.springframework.ai.model.AbstractResponseMetadata
org.springframework.ai.chat.metadata.ChatResponseMetadata
- All Implemented Interfaces:
ResponseMetadata
Models common AI provider metadata returned in an AI response.
- Since:
- 1.0.0
- Author:
- John Blum, Thomas Vitale, Mark Pollack, Alexandros Pappas
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.springframework.ai.model.AbstractResponseMetadata
AI_METADATA_STRING, map -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ChatResponseMetadata.Builderbuilder()booleangetId()A unique identifier for the chat completion operation.getModel()The model that handled the request.Returns the prompt metadata gathered by the AI during request processing.Returns AI provider specific metadata on rate limits.getUsage()Returns AI provider specific metadata on API usage.inthashCode()toString()Methods inherited from class org.springframework.ai.model.AbstractResponseMetadata
containsKey, entrySet, get, getOrDefault, getRequired, isEmpty, keySetMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.ai.model.ResponseMetadata
containsKey, entrySet, get, getOrDefault, getOrDefault, getRequired, isEmpty, keySet
-
Constructor Details
-
ChatResponseMetadata
public ChatResponseMetadata()
-
-
Method Details
-
builder
-
getId
A unique identifier for the chat completion operation.- Returns:
- unique operation identifier.
-
getModel
The model that handled the request.- Returns:
- the model that handled the request.
-
getRateLimit
Returns AI provider specific metadata on rate limits.- Returns:
- AI provider specific metadata on rate limits.
- See Also:
-
getUsage
Returns AI provider specific metadata on API usage.- Returns:
- AI provider specific metadata on API usage.
- See Also:
-
getPromptMetadata
Returns the prompt metadata gathered by the AI during request processing.- Returns:
- the prompt metadata.
-
equals
-
hashCode
public int hashCode() -
toString
-