Package org.springframework.ai.model
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 Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(Object key) Checks if context contains a key.entrySet()
<T> T
Gets an entry from the context.<T> T
getOrDefault
(Object key, T defaultObject) Returns an element or default if not present.default <T> T
getOrDefault
(String key, Supplier<T> defaultObjectSupplier) Returns an element or default if not present.<T> T
getRequired
(Object key) Gets an entry from the context.boolean
isEmpty()
Returnstrue
if this map contains no key-value mappings.keySet()
-
Method Details
-
get
Gets an entry from the context. Returnsnull
when entry is not present.- Type Parameters:
T
- value type- Parameters:
key
- key- Returns:
- entry or
null
if not present
-
getRequired
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
Checks if context contains a key.- Parameters:
key
- key- Returns:
true
when the context contains the entry with the given key
-
getOrDefault
Returns an element or default if not present.- Type Parameters:
T
- value type- Parameters:
key
- keydefaultObject
- default object to return- Returns:
- object or default if not present
-
getOrDefault
Returns an element or default if not present.- Type Parameters:
T
- value type- Parameters:
key
- keydefaultObjectSupplier
- supplier for default object to return- Returns:
- object or default if not present
- Since:
- 1.11.0
-
entrySet
-
keySet
-
isEmpty
boolean isEmpty()Returnstrue
if this map contains no key-value mappings.- Returns:
true
if this map contains no key-value mappings
-