Class OpenAiChatResponseMetadata
java.lang.Object
org.springframework.ai.openai.metadata.OpenAiChatResponseMetadata
- All Implemented Interfaces:
ChatResponseMetadata
,ResponseMetadata
ChatResponseMetadata
implementation for OpenAI.- Since:
- 0.7.0
- Author:
- John Blum
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.ai.chat.metadata.ChatResponseMetadata
NULL
-
Constructor Summary
ModifierConstructorDescriptionprotected
OpenAiChatResponseMetadata
(String id, OpenAiUsage usage) protected
OpenAiChatResponseMetadata
(String id, OpenAiUsage usage, OpenAiRateLimit rateLimit) -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenAiChatResponseMetadata
from
(OpenAiApi.ChatCompletion result) getId()
Returns AI provider specific metadata on rate limits.getUsage()
Returns AI provider specific metadata on API usage.toString()
withRateLimit
(RateLimit rateLimit) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.ai.chat.metadata.ChatResponseMetadata
getPromptMetadata
-
Field Details
-
AI_METADATA_STRING
- See Also:
-
-
Constructor Details
-
OpenAiChatResponseMetadata
-
OpenAiChatResponseMetadata
protected OpenAiChatResponseMetadata(String id, OpenAiUsage usage, @Nullable OpenAiRateLimit rateLimit)
-
-
Method Details
-
from
-
getId
-
getRateLimit
Description copied from interface:ChatResponseMetadata
Returns AI provider specific metadata on rate limits.- Specified by:
getRateLimit
in interfaceChatResponseMetadata
- Returns:
- AI provider specific metadata on rate limits.
- See Also:
-
getUsage
Description copied from interface:ChatResponseMetadata
Returns AI provider specific metadata on API usage.- Specified by:
getUsage
in interfaceChatResponseMetadata
- Returns:
- AI provider specific metadata on API usage.
- See Also:
-
withRateLimit
-
toString
-