The withStreamUsage() of the OpenAiChatOptions is not supported in AzureOpenAiChatOptions.
When using Azure OpenAI, the 'usage' metadata is always returned as empty in the stream().
I understand that 'usage' is supported in the latest OpenAIServiceVersion, V2024_08_01_PREVIEW. Therefore, the AzureOpenAiChatOptions should also support the withStreamUsage() method to align with this.
Related Issue: https://github.com/Azure/azure-sdk-for-java/issues/40998
Can we implement this feature now that the issue in the Azure SDK has been resolved?
@andresssantos yes, it seems like this should be possible if you want to take a look, that would be appreciated.
@markpollack, opened PR https://github.com/spring-projects/spring-ai/pull/2858.
This is my first PR for Spring projects, please feel free to review and share any feedback or suggestions for improvement. I’m open to making adjustments as needed.
closing issue as it has been resolved