You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
The methods implemented by OpenAiUsage throw NullPointerException whenever one of the usage type is not reported by OpenAI. For example, that's the case with the "generation tokens" for Embedding models.
Environment
Spring AI: 1.0.0-SNAPSHOT
Steps to reproduce
Use the OpenAiEmbeddingModel to make a call to OpenAI
On the EmbeddingResponse, get the Usage and call the getGenerationTokens() method.
You'll get a NullPointerException.
Expected behavior
No NullPointerException when the usage tokens are not reported by the model provider.