Package org.springframework.ai.model
Class AbstractResponseMetadata
java.lang.Object
org.springframework.ai.model.AbstractResponseMetadata
- Direct Known Subclasses:
ChatResponseMetadata
,EmbeddingResponseMetadata
,ModerationResponseMetadata
-
Field Summary
-
Constructor Summary
-
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.<T> T
getRequired
(Object key) Gets an entry from the context.boolean
isEmpty()
keySet()
-
Field Details
-
AI_METADATA_STRING
- See Also:
-
map
-
-
Constructor Details
-
AbstractResponseMetadata
public AbstractResponseMetadata()
-
-
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
-
entrySet
-
keySet
-
isEmpty
public boolean isEmpty()
-