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 TypeMethodDescriptionbooleancontainsKey(Object key) Checks if context contains a key.entrySet()<T> TGets an entry from the context.<T> TgetOrDefault(Object key, T defaultObject) Returns an element or default if not present.default <T> TgetOrDefault(String key, Supplier<T> defaultObjectSupplier) Returns an element or default if not present.<T> TgetRequired(Object key) Gets an entry from the context.booleanisEmpty()Returnstrueif this map contains no key-value mappings.keySet()
-
Method Details
-
get
Gets an entry from the context. Returnsnullwhen entry is not present.- Type Parameters:
T- value type- Parameters:
key- key- Returns:
- entry or
nullif 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:
truewhen 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()Returnstrueif this map contains no key-value mappings.- Returns:
trueif this map contains no key-value mappings
-